aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-linux-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-08 23:59:58 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-08 23:59:58 +0000
commit38c968cfa667941d5e91d1d0654177c9897ef60b (patch)
tree167823cfaaf509ae0f86ae536bd2566bb59c956c /gdb/i386-linux-tdep.c
parent371a6e84e5b12ed0c971ec604cfe60b8e978372c (diff)
downloadgdb-38c968cfa667941d5e91d1d0654177c9897ef60b.zip
gdb-38c968cfa667941d5e91d1d0654177c9897ef60b.tar.gz
gdb-38c968cfa667941d5e91d1d0654177c9897ef60b.tar.bz2
2002-11-08 Andrew Cagney <ac131313@redhat.com>
* i386-linux-tdep.c: Include "reggroups.h". (i386_linux_register_reggroup_p): New function. (i386_linux_init_abi): Set register_reggroup_p to i386_linux_register_reggroup_p. * i386-tdep.h (i386_register_reggroup_p): Declare. * i386-tdep.c: Include "reggroups.h". (i386_init_reggroups): New function. (i386_add_reggroups): New function. (i386_register_reggroup_p): New function. (i386_sse_reggroup, i386_mmx_reggroup): New variables. (_initialize_i386_tdep): Call i386_init_reggroups. (i386_gdbarch_init): Set register_reggroup_p and add in the i386 specific reggroups.
Diffstat (limited to 'gdb/i386-linux-tdep.c')
-rw-r--r--gdb/i386-linux-tdep.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 0d6ab40..f35c4ff 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -25,6 +25,7 @@
#include "value.h"
#include "regcache.h"
#include "inferior.h"
+#include "reggroups.h"
/* For i386_linux_skip_solib_resolver. */
#include "symtab.h"
@@ -47,6 +48,20 @@ i386_linux_register_name (int reg)
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);
+}
+
/* Recognizing signal handler frames. */
@@ -442,6 +457,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
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>. */