This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] dwarf2_read_address(): sign extend as appropriate
On Mon, 23 Apr 2007 17:05:20 +0200 (CEST)
"Ulrich Weigand" <uweigand@de.ibm.com> wrote:
> Kevin Buettner wrote:
>
> > Any comments regarding the patch below?
> >
> > I wrote it last summer, so my memory about it is rather hazy aside
> > from the fact that it fixed a bunch of C++ frame base problems on
> > mips64 targets.
> >
> > It shouldn't affect any architecture other than mips because mips is
> > the only one which defines an integer_to_address method. It also
> > addresses Andrew's FIXME comment from nearly four years ago...
> >
> > * dwarf2expr.c (unsigned_address_type): Add forward declaration.
> > (dwarf2_read_address): Sign extend return address as required by
> > target architecture.
>
> I've recently changed a very similar place, dwarf_expr_read_reg in
> dwarf2loc.c, to use a new "address_from_register" function to solve
> the same problem:
> http://sourceware.org/ml/gdb-patches/2006-11/msg00134.html
>
> Is there any reason you couldn't use the same function here?
We can't use address_from_register() in this instance since
dwarf2_read_address() is not fetching an address from a register, but
rather from some DWARF2 info.
Kevin