This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH][SH] invalid registers


On Wed, Nov 16, 2005 at 04:20:47PM +0000, Andrew STUBBS wrote:
> Hi,
> 
> The attached patch teaches GDB which registers are invalid in previous 
> frames when the CFI does not say otherwise.
> 
> It does this using the SH4 ABI. This is backwards compatible with the 
> sh1-sh3 and variants. I have not attempted to deal with the DSP 
> registers as I don't know the ABI. They will be treated as ever.
> 
> The only thing this patch actually does is allow the 'info registers' 
> command (and friends) to show '*invalid register*' when there is no way 
> to know the true value.
> 
> Andrew Stubbs

> 2005-11-16  Andrew Stubbs  <andrew.stubbs@st.com>
> 
> 	* sh-tdep.c (sh_dwarf2_frame_init_reg): New function.
> 	(sh_gdbarch_init): Call dwarf2_frame_set_init_reg().

Hi Andrew,

This is OK.  Only S/390 uses the frame_init_reg hook this way today,
but it seems sensible.  But please wait a day or two in case anyone has
comments on the downside.

The downside is that you can't do this:

(gdb) break *abort
(gdb) continue
...
(gdb) up
(gdb) info registers

Instead, you have to look at the registers while you're in the bottom
frame (i.e. abort) instead of the aborting function.

Would it be more useful if GDB could output "0x40000000 (may be
clobbered)" somehow in info regs for DWARF2_FRAME_REG_UNDEFINED?
But, not a big deal either way.

-- 
Daniel Jacobowitz
CodeSourcery


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