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

Nick Clifton
Fri Aug 30 16:02:00 GMT 2019

Hi William,

> 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" ?

Presumably you are using a like the other simulators.
In there you define SIM_RUN_OBJS to contain the object files that
are only part of the standalone simulator.  So you could use a 
function in one of those object files.  main() would be the obvious
choice, if you are using your own.  Or else something called from
the main() defined in common/nrun.c.


More information about the Gdb mailing list