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: [rfc] Work around ARM RV compiler unwind info


Daniel Jacobowitz <drow@false.org> writes:
> ARM's compilers generate, overall, very good debug info.  It's poorly
> supported by GDB, for various reasons: a few places where the debug info is
> in fact wrong, and a number where it is so very right that GDB can't handle
> it (since we rely on less correct information typically output by GCC).
> Unfortunately this is one of the former cases, but it's one that I think is
> tentatively worth supporting in GDB.
>
> The compilers have two problems.  Both have been fixed, but the fixes are
> conditionalized, for maximum compatibility with other ARM tools that made
> the same assumptions.
>
>   - When generating DWARF2, with the version field in .debug_frame set to
>     1, they assume that DW_CFA_def_cfa and DW_CFA_def_cfa_offset take
>     factored offsets instead of unfactored.  Using --dwarf3 makes this
>     problem go away; the first ARM compilers to generate DWARF3 were
>     released after this bug was found.
>
>   - When generating either DWARF2 or DWARF3 (CIE version 1 or 3), they
>     assume that a reg_offset rule for the CFA is REG - OFFSET instead of
>     REG + OFFSET.  RVCT 3.0 has this problem.  RVCT 3.0 SP1 does not;
>     but it marks the output with an "armcc+" augmentation to indicate
>     that it has the standard DWARF meaning, again for compatibility
>     with other versions of ARM tools.
>
> These aren't reverse engineered fixes, by the way - I spoke with the ARM
> compiler team about the proper checks.  I only turn on either of the fixes
> if the file also has .debug_info, so that we can find a producer string that
> unambiguously indicates that the ARM compiler was used.
>
> What do you think?  Useful?  Too ugly?

It's hard for me to guess how much benefit these will provide to
users, but it seems like the burden this patch places on GDB
developers is pretty minor; given the task, I think it's pretty clean.
Since we want to grow GDB's user base, I'm in favor of this patch.


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