This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
inconsistent sigtramp code in mips target
- From: Kevin Nomura <nomura at netapp dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 28 Oct 2003 13:58:14 -0800
- Subject: inconsistent sigtramp code in mips target
gdb 6.0, file gdb/mips-tdep.c, function mips_find_saved_regs:
There are calls to "set_reg_offset" in a loop, followed by
some individual calls after the loop. The latter have
no effect if the register was processed in the loop
(see the code for set_reg_offset). SP_REGNUM is like this,
but PC_REGNUM is not, because of the particular values of
these constants (ugh).
if ((get_frame_type (fci) == SIGTRAMP_FRAME))
{
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
CORE_ADDR reg_position = (get_frame_base (fci) + SIGFRAME_REGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE);
set_reg_offset (saved_regs, ireg, reg_position);
}
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
CORE_ADDR reg_position = (get_frame_base (fci)
+ SIGFRAME_FPREGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE);
set_reg_offset (saved_regs, FP0_REGNUM + ireg, reg_position);
}
set_reg_offset (saved_regs, PC_REGNUM, get_frame_base (fci) + SIGFRAME_PC_OFF);
/* SP_REGNUM, contains the value and not the address. */
set_reg_offset (saved_regs, SP_REGNUM, get_frame_base (fci));
return;
}
The logical patch would be to move the special cases up front,
but I have no way to test this out (no access to a MIPS UNIX
platform).
On the other hand this isn't purely academic. I came across this
because I need to define a custom sigtramp frame for our own
MIPS embedded platform. It was baffling for a while that my
modification to the SP_REGNUM override had no effect.