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

William Tambe <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAF8i9mOR--quVcm9ByGLDgX-TFzPU_vvXhgHGGMe-C_r1fi8Dw@mail.gmail.com>
On Fri, Aug 30, 2019 at 4:54 AM Nick Clifton <[email protected]> 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
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.