This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] fetch result of locdesc expressions as integer (not address)
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Tue, 04 Oct 2011 11:15:08 -0600
- Subject: Re: [RFA] fetch result of locdesc expressions as integer (not address)
- References: <1317676214-7683-1-git-send-email-brobecker@adacore.com>
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> The problem is that the debugger is treating the result of
Joel> the DWARF location expressions as addresses, whereas this is
Joel> just an offset in this case. I think that this was an unintentional
Joel> side-effect of simplifying the code that fetches the result
Joel> from the DWARF expression computation stack. We had a bit of
Joel> code that used to fetch it, and turn it into a struct value.
Joel> And we replaced it by one call to a function that seemed to
Joel> be doing the same: dwarf_expr_fetch_address. The problem is
Joel> that dwarf_expr_fetch_address treats the result as an address,
Joel> and thus applies the integer_to_address gdbarch method. We do
Joel> not want that for struct field offsets...
dwarf_expr_fetch_address also calls dwarf_require_integral, which seems
like a good defensive thing to do in the replacement code.
I think the patch makes sense, but I'd like Jan to weigh in.
Tom