summaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2006-11-24 19:59:57 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2006-11-24 19:59:57 +0000
commit2913cc917e239800b05f03468df72fa8971e0950 (patch)
tree74104ebd1d8e97dac7da85362b883870612198bd /gdb/dwarf2loc.c
parenta97aabe2a2ee203f5b84186e52d84b12cf0f5a24 (diff)
downloadgdb-2913cc917e239800b05f03468df72fa8971e0950.tar.gz
* findvar.c (address_from_register): New function.
* value.h (address_from_register): Add prototype. * dwarf2loc.c (dwarf_expr_read_reg): Use address_from_register.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index f4f725ee438..1b29dc9a0b0 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -115,24 +115,17 @@ struct dwarf_expr_baton
/* Helper functions for dwarf2_evaluate_loc_desc. */
/* Using the frame specified in BATON, return the value of register
- REGNUM, treated as an unsigned integer. */
+ REGNUM, treated as a pointer. */
static CORE_ADDR
dwarf_expr_read_reg (void *baton, int dwarf_regnum)
{
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
CORE_ADDR result;
- gdb_byte *buf;
- int regnum, regsize;
+ int regnum;
regnum = DWARF2_REG_TO_REGNUM (dwarf_regnum);
- regsize = register_size (current_gdbarch, regnum);
- buf = alloca (regsize);
-
- frame_register_read (debaton->frame, regnum, buf);
- /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2
- address is always unsigned. That may or may not be true. */
- result = extract_unsigned_integer (buf, regsize);
-
+ result = address_from_register (builtin_type_void_data_ptr,
+ regnum, debaton->frame);
return result;
}