This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Add support for target switches in simulator
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 17 May 2002 09:58:03 +0100
- Subject: Re: Add support for target switches in simulator
- References: <200205161624.RAA15198@cam-mail2.cambridge.arm.com>
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.