summaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2003-03-05 18:00:02 +0000
committerDaniel Jacobowitz <dan@debian.org>2003-03-05 18:00:02 +0000
commit89b09fdb482f1edd45d8feea7ac134c623c7e438 (patch)
treed2dae407c6cb9907e798738a9c91d839649172cd /gdb/dwarf2loc.c
parent161d3bf30fe69040eddeb1e1cfc3ddbbe2b6c5f3 (diff)
downloadgdb-89b09fdb482f1edd45d8feea7ac134c623c7e438.tar.gz
* 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 55de8dae74e..9ea9941f249 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;
}