This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Question on attribute save-restore in reg elements (target descriptions).
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Anmol P. Paralkar" <b07584 at freescale dot com>
- Cc: gdb at sourceware dot org
- Date: Sun, 11 May 2008 17:29:00 -0400
- Subject: Re: Question on attribute save-restore in reg elements (target descriptions).
- References: <Pine.LNX.4.64.0805091631040.22847@ld0159-tx32>
On Fri, May 09, 2008 at 04:41:58PM -0500, Anmol P. Paralkar wrote:
> Hello,
>
> Per Appendix F, Sec. F.2.5 Registers, of the GDB User Manual:
>
> save-restore
>
> Whether the register should be preserved across inferior function
> calls; this must be either yes or no. The default is yes, which
> is appropriate for most registers except for some system control
> registers; this is not related to the target's ABI.
>
> In our target description file, we have a lot of special purpose
> registers about which nothing might be assumed either way, so in
> addition to 'yes' and 'no', can we have an "unspecified" value to
> this attribute, (say, denoted by '?')? In what way does GDB use this
> information?
GDB uses this information to make a decision, so clearly it can not be
unspecified - GDB would have to do something unspecified...
When the user types "print foo()" GDB will save and restore those
registers which are marked with save-restore="yes". Generally this
is what you want for GPRs but not what you want for global system
state like coprocessor control registers.
--
Daniel Jacobowitz
CodeSourcery