This is the mail archive of the gdb-patches@sourceware.org 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/DWARF] constant class of DW_AT_high_pc is offset for version >=4 only.


Hi Mark,

> Sorry about that. I read the spec as disallowing anything except
> DW_FORM_addr to encode class address. And since before DWARF4
> DW_AT_high_pc only allowed class address it hadn't occurred to me that
> it could have been encoded differently. I do think this really is a bug
> in the compiler that generated this.

Not to worry! I did find the use of data4 for a high_pc to be unusual,
for sure, and had to read the DWARF standard a couple of times to make
sure there was no such restriction. I'm pretty sure that I would have
made the same decision.

> > This patch fixes it by ammending a bit the changes from the commit
> > mentioned above to use the new interpretation of a relative address
> > only when the CU's DWARF version is 4 or greater.
> 
> That should work fine. GCC at least doesn't generate DW_AT_high_pc
> attributes as offsets (constant class) unless it generates DWARF4+.

Yes, I forgot to mention that I double-checked that it wouldn't
break GCC-compiled binaries.

Thanks!
-- 
Joel

PS: Since I have you - do you think binutils would need the same
    sort of change? I thought so too, when I looked at the code,
    but I couldn't get readelf to print the wrong address. Do you
    happen to know?


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