[RFA] Dwarf2 fix

Michal Ludvig
2002-05-13T16:31:59Z

Hi all,
this simple patch mysteriously solves problems that we have had on
x86-64 with stack unwinding. Can I commit? I believe so :-)

2002-05-13 Michal Ludvig <mludvig@suse.cz>
* dwarf2cfi.c (context_cpy): Copy registers correctly.
(update_context): Use __func__ in notes.

Index: dwarf2cfi.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2cfi.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 dwarf2cfi.c
*** dwarf2cfi.c 7 May 2002 11:22:54 -0000 1.4
--- dwarf2cfi.c 13 May 2002 16:24:00 -0000
*************** static void
*** 318,325 ****
--- 318,329 ----
context_cpy (struct context *dst, struct context *src)
{
int regs_size = sizeof (struct context_reg) * NUM_REGS;
+ struct context_reg *dreg;

+ dreg = dst->reg;
*dst = *src;
+ dst->reg = dreg;
+
memcpy (dst->reg, src->reg, regs_size);
}
^L
*************** update_context (struct context *context,
*** 1301,1307 ****
orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr;
default:
internal_error (__FILE__, __LINE__,
! "cfi_update_context: unknown register rule");
}
break;
case REG_SAVED_EXP:
--- 1305,1311 ----
orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr;
default:
internal_error (__FILE__, __LINE__,
! "%s: unknown register rule", __func__);
}
break;
case REG_SAVED_EXP:
*************** update_context (struct context *context,
*** 1319,1326 ****
break;
default:
internal_error (__FILE__, __LINE__,
! "cfi_update_context: unknown register rule");
!
}
get_reg ((char *) &context->ra, context, fs->retaddr_column);
unwind_tmp_obstack_free ();
--- 1323,1329 ----
break;
default:
internal_error (__FILE__, __LINE__,
! "%s: unknown register rule", __func__);
}
get_reg ((char *) &context->ra, context, fs->retaddr_column);
unwind_tmp_obstack_free ();