This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] dwarf2loc.c: Add missing DWARF2_REG_TO_REGNUM call
On Apr 22, 10:20am, Elena Zannoni wrote:
> OK from my side, except, could you introduce a new variable 'regnum'?
Here's what I committed:
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Invoke DWARF2_REG_TO_REGNUM
on the DWARF2 register number prior to fetching a register.
Index: dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- dwarf2loc.c 13 Apr 2003 15:53:44 -0000 1.6
+++ dwarf2loc.c 22 Apr 2003 23:18:26 -0000 1.7
@@ -223,7 +223,10 @@ dwarf2_evaluate_loc_desc (struct symbol
result = dwarf_expr_fetch (ctx, 0);
if (ctx->in_reg)
- retval = value_from_register (SYMBOL_TYPE (var), result, frame);
+ {
+ int regnum = DWARF2_REG_TO_REGNUM (result);
+ retval = value_from_register (SYMBOL_TYPE (var), regnum, frame);
+ }
else
{
retval = allocate_value (SYMBOL_TYPE (var));