/* Target-dependent code for GNU/Linux running on i386's, for GDB.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
#include "value.h"
#include "regcache.h"
#include "inferior.h"
+#include "reggroups.h"
/* For i386_linux_skip_solib_resolver. */
#include "symtab.h"
#include "solib-svr4.h" /* For struct link_map_offsets. */
+#include "osabi.h"
+
#include "i386-tdep.h"
#include "i386-linux-tdep.h"
return i386_register_name (reg);
}
+
+/* Return non-zero, when the register is in the corresponding register
+ group. Put the LINUX_ORIG_EAX register in the system group. */
+static int
+i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *group)
+{
+ if (regnum == I386_LINUX_ORIG_EAX_REGNUM)
+ return (group == system_reggroup
+ || group == save_reggroup
+ || group == restore_reggroup);
+ return i386_register_reggroup_p (gdbarch, regnum, group);
+}
+
\f
/* Recognizing signal handler frames. */
{
CORE_ADDR pc;
- pc = i386_linux_sigtramp_start (frame->pc);
+ pc = i386_linux_sigtramp_start (get_frame_pc (frame));
if (pc)
{
CORE_ADDR sp;
- if (frame->next)
+ if (get_next_frame (frame))
/* If this isn't the top frame, the next frame must be for the
signal handler itself. The sigcontext structure lives on
the stack, right after the signum argument. */
- return frame->next->frame + 12;
+ return get_frame_base (get_next_frame (frame)) + 12;
/* This is the top frame. We'll have to find the address of the
sigcontext structure by looking at the stack pointer. Keep
"pop %eax". If the PC is at this instruction, adjust the
returned value accordingly. */
sp = read_register (SP_REGNUM);
- if (pc == frame->pc)
+ if (pc == get_frame_pc (frame))
return sp + 4;
return sp;
}
- pc = i386_linux_rt_sigtramp_start (frame->pc);
+ pc = i386_linux_rt_sigtramp_start (get_frame_pc (frame));
if (pc)
{
- if (frame->next)
+ if (get_next_frame (frame))
/* If this isn't the top frame, the next frame must be for the
signal handler itself. The sigcontext structure is part of
the user context. A pointer to the user context is passed
as the third argument to the signal handler. */
- return read_memory_integer (frame->next->frame + 16, 4) + 20;
+ return read_memory_integer (get_frame_base (get_next_frame (frame))
+ + 16, 4) + 20;
/* This is the top frame. Again, use the stack pointer to find
the address of the sigcontext structure. */
ALL_OBJFILE_MSYMBOLS (objfile, msym)
{
- if (SYMBOL_NAME (msym)
- && STREQ (SYMBOL_NAME (msym), name))
+ if (SYMBOL_LINKAGE_NAME (msym)
+ && strcmp (SYMBOL_LINKAGE_NAME (msym), name) == 0)
{
*objfile_p = objfile;
return msym;
set_gdbarch_write_pc (gdbarch, i386_linux_write_pc);
set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS + 1);
set_gdbarch_register_name (gdbarch, i386_linux_register_name);
+ set_gdbarch_register_reggroup_p (gdbarch, i386_linux_register_reggroup_p);
set_gdbarch_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4);
tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
void
_initialize_i386_linux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_LINUX,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX,
i386_linux_init_abi);
}