aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-05-17 14:53:02 +0000
committerDaniel Jacobowitz <drow@false.org>2006-05-17 14:53:02 +0000
commitf2da6b3ac39c99dc54916518e57cebadc05b53bf (patch)
tree08e61d50f55276bd8800b2a76c2da4080876994c /gdb/dwarf2-frame.c
parent1f5befc17b5cca250ded0845cb1e86d517592725 (diff)
downloadgdb-f2da6b3ac39c99dc54916518e57cebadc05b53bf.zip
gdb-f2da6b3ac39c99dc54916518e57cebadc05b53bf.tar.gz
gdb-f2da6b3ac39c99dc54916518e57cebadc05b53bf.tar.bz2
* dwarf2-frame.c: Include "value.h".
(read_reg): Use unpack_long and register_type. * Makefile.in (dwarf2-frame.o): Update.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 3f7fbfe..a11aac9 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -32,6 +32,7 @@
#include "symtab.h"
#include "objfiles.h"
#include "regcache.h"
+#include "value.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -218,7 +219,13 @@ read_reg (void *baton, int reg)
buf = alloca (register_size (gdbarch, regnum));
frame_unwind_register (next_frame, regnum, buf);
- return extract_typed_address (buf, builtin_type_void_data_ptr);
+
+ /* Convert the register to an integer. This returns a LONGEST
+ rather than a CORE_ADDR, but unpack_pointer does the same thing
+ under the covers, and this makes more sense for non-pointer
+ registers. Maybe read_reg and the associated interfaces should
+ deal with "struct value" instead of CORE_ADDR. */
+ return unpack_long (register_type (gdbarch, regnum), buf);
}
static void