Re: Best way to check whether the "sim" is running standalone or by GDB
Michael Morrell <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
William, > What is the best way to check whether the "sim" is running standalone or by GDB ? In sim_open, the first parameter is "SIM_OPEN_KIND kind". When sim_open is called in standalone (i.e., from nrun.c), this parameter is SIM_OPEN_STANDALONE) and when called from GDB, it is SIM_OPEN_DEBUG. This can be saved and checked later. A typical call in sim_open is: SIM_DESC sd = sim_state_alloc(kind, callback); which saves kind in the sd structure. You can use STATE_OPEN_KIND(sd) to examine it in any function that receives an "sd". Hope this helps. Michael