aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-03-05 18:00:02 +0000
committerDaniel Jacobowitz <drow@false.org>2003-03-05 18:00:02 +0000
commite4adbba915b3e74f7c60b33febde7994dbb83e17 (patch)
tree1433f7365708e4d3d5d991eb1af8910dc4731a64 /gdb/dwarf2loc.c
parentbba45b8bf7e27dae79bcbb58541ab62743ff7ac0 (diff)
downloadgdb-e4adbba915b3e74f7c60b33febde7994dbb83e17.zip
gdb-e4adbba915b3e74f7c60b33febde7994dbb83e17.tar.gz
gdb-e4adbba915b3e74f7c60b33febde7994dbb83e17.tar.bz2
* dwarf2expr.c (new_dwarf_expr_context): Add (void) to definition.
* dwarf2loc.c: Include "regcache.h". (dwarf_expr_read_reg): Rename regnum argument to dwarf_regnum. Use register_size. * Makefile.in (dwarf2loc.o): Update dependencies.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 55de8da..9ea9941 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -28,6 +28,7 @@
#include "inferior.h"
#include "ax.h"
#include "ax-gdb.h"
+#include "regcache.h"
#include "elf/dwarf2.h"
#include "dwarf2expr.h"
@@ -53,17 +54,21 @@ struct dwarf_expr_baton
type will be returned in LVALP, and for lval_memory the register
save address will be returned in ADDRP. */
static CORE_ADDR
-dwarf_expr_read_reg (void *baton, int regnum, enum lval_type *lvalp,
+dwarf_expr_read_reg (void *baton, int dwarf_regnum, enum lval_type *lvalp,
CORE_ADDR *addrp)
{
- CORE_ADDR result;
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
- char *buf = (char *) alloca (MAX_REGISTER_RAW_SIZE);
- int optimized, realnum;
+ CORE_ADDR result;
+ char *buf;
+ int optimized, regnum, realnum, regsize;
+
+ regnum = DWARF2_REG_TO_REGNUM (dwarf_regnum);
+ regsize = register_size (current_gdbarch, regnum);
+ buf = (char *) alloca (regsize);
- frame_register (debaton->frame, DWARF2_REG_TO_REGNUM (regnum),
- &optimized, lvalp, addrp, &realnum, buf);
- result = extract_address (buf, REGISTER_RAW_SIZE (regnum));
+ frame_register (debaton->frame, regnum, &optimized, lvalp, addrp, &realnum,
+ buf);
+ result = extract_address (buf, regsize);
return result;
}