Best way to check whether the "sim" is running standalone or by GDB

William Tambe tambewilliam@gmail.com
Fri Aug 30 15:24:00 GMT 2019


On Fri, Aug 30, 2019 at 4:54 AM Nick Clifton <nickc@redhat.com> wrote:
>
> Hi William,
>
> >> What is the best way to check whether the "sim" is running standalone
> >> or by GDB ?
>
> Possibly not the best way, but one way is to use a global variable to
> indicate the presence of the standalone driver.  eg:
>
>   int running_standalone = 0;
>
>   ...
>     if (! running_standalone)
>       sim_engine_halt (sim_stopped, SIM_SIGTRAP);
>
> Then in your standalone code, initialise the variable to non-zero.

What constitute the standalone code ?

in fact, to port the simulator, I only had to implement the following:
sim_engine_run ()
sim_open ()
sim_create_inferior ()

All the above functions are both used when the sim is running
"standalone" or by "GDB".

Is there another function I can define that will only be used when the
sim is running "standalone" ?

>
> Cheers
>   Nick
>
>
>
>



More information about the Gdb mailing list