Enabling the buildin simulator for ARM in gdb-binutils in crosstools-ng

I was asked to enable the test suite in the project using the simulator that comes along with it. I figured out that cross tools-ng is customized by a configuration file which controls almost anything that crosstools-ng does. To enable (build/install) the simulator component in the gdb we need to set the parameter

CT_GDB_CROSS_SIM=y

which will invoke gdb-Binutils configure script with the option "--enable-sim". By default, this is disabled by crosstools-ng. Once you enabled it , the simulator is built and installed.

If you want to use it to run tests with the dejagnu framework, then you have to pass the "--targetboard=arm-sim" option when invoking runtest. If runtest is invoked by "make check" then enter "make check RUNTESTFLAGS="--targetboard=arm-sim". This should work. The "arm-sim" is a default configuration shipped as part of dejagnu and you can find it in /usr/share/dejagnu/baseboards. This file by default finds the Cygnus simulator (the one that comes with gdb) and configures and uses it to run tests.

soundararajan