aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch-utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-08-10 02:00:16 +0000
committerAndrew Cagney <cagney@redhat.com>2002-08-10 02:00:16 +0000
commita7e3c2ad4b6733e3011e00d214ec83139fa3c3d2 (patch)
treee630433577f79d66d17aaa1e25127cc6b56c6ecb /gdb/arch-utils.c
parent119d55d8e40fb1ccbd7a92e8c4cd05de0ea2c0c9 (diff)
downloadgdb-a7e3c2ad4b6733e3011e00d214ec83139fa3c3d2.zip
gdb-a7e3c2ad4b6733e3011e00d214ec83139fa3c3d2.tar.gz
gdb-a7e3c2ad4b6733e3011e00d214ec83139fa3c3d2.tar.bz2
2002-08-09 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_dump): Compare the register offset with REGISTER_BYTE. * arch-utils.c (generic_register_byte): New function. * arch-utils.h (generic_register_byte): Declare. * gdbarch.sh (REGISTER_BYTE): Default to generic_register_byte. * gdbarch.h, gdbarch.c: Regenerate.
Diffstat (limited to 'gdb/arch-utils.c')
-rw-r--r--gdb/arch-utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index a407f9e..5497e83 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -444,6 +444,23 @@ generic_register_size (int regnum)
(name && STREQ ("_sigtramp", name))
#endif
#endif
+
+/* Assume all registers are adjacent. */
+
+int
+generic_register_byte (int regnum)
+{
+ int byte;
+ int i;
+ gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS);
+ byte = 0;
+ for (i = 0; i < regnum; i++)
+ {
+ byte += TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i));
+ }
+ return byte;
+}
+
int
legacy_pc_in_sigtramp (CORE_ADDR pc, char *name)