This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] fetch result of locdesc expressions as integer (not address)

>>>>> "Joel" == Joel Brobecker <> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]