This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add support for target switches in simulator


Hi Guys,

Answers to comments on my patch submission:

> >  I would like permission to apply the following patch.  It adds
> >  the ability for simulator backends to parse their own command
> >  line switches, thus creating target specific simulator options.

> Frank Ch. Eigler writes:
> 
> How does this proposed facility compare to that provided by
> sim/common/sim-options*?

It is a similar kind of thing accept that it has two advantages:

  * It works for simulators that do not use sim-common.[ch]  (such as
    the ARM simualtor).

  * It isolates all of the target specific code in the target specific
    subdirectories, and just has a very small intrusion into the
    generic code.  (Unlike say the SIM_H8300 option).



> >  I have not worked out how this feature would be accessed from
> >  GDB.  My guess is that the switches could be added to the
> >  arguments passed via sim_open(), but how would a GDB user tell
> >  GDB to add these switches ?

> Richard Earnshaw <rearnsha@arm.com> writes:

> Hmm, I thought there was already a way to tell the simulator what
> amount of memory to use.

So did I, but looking through the GDB sources I do not see a place
where it is used.

> Couldn't a similar method be employed.

That method is specific to setting the memory size - it uses a
simulator/debugger interface call specifically set up for the
purpose.  I looked for the function - sim_size() - and found it being
used by the run program but not by GDB.  I am puzzled.

Anyway the point here is that setting the memory size appears to be a
specific API function and I want a generic method to set any kind of
target specific option.


> From: Michael Snyder <msnyder@redhat.com>

>From memory, don't you do something like:

	(gdb) target sim xxx=yyy

Yup that works - thanks Michael.

I have now updated my ARM SIM patch so that it will work using this
interface.  So if the common sim part can be approved then we will
have a complete method for controlling SWI emulation in the ARM
simulator.

Cheers
        Nick

PS.  I will post the arm sim parts of the patch to this list shortly.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]