This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Fix implptr-optimized-out.exp fail in thumb mode
- From: Yao Qi <yao at codesourcery dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 9 Oct 2014 20:39:08 +0800
- Subject: Re: [PATCH 2/2] Fix implptr-optimized-out.exp fail in thumb mode
- Authentication-results: sourceware.org; auth=none
- References: <1411951921-16168-1-git-send-email-yao at codesourcery dot com> <1411951921-16168-3-git-send-email-yao at codesourcery dot com> <CADPb22RGCXiYA1KfjfDTY0pMcmALYJrXG+OE23jdfxUqNMUU4A at mail dot gmail dot com>
Doug Evans <dje@google.com> writes:
> One question that comes to mind is: If this solution is going to
> proliferate it would be good to convince ourselves there's no better
> solution. I'm ok with this as a one-off here and there, but I'd like
> to understand how many more of these will there be. Plus I can
> imagine of course the number growing over time.
There are three, dwz.exp, implptr-optimized-out.exp and
dw2-ifort-parameter.exp, but you are right, the number will grow.
> Can we, for example, enhance the dwarf assembler and provide a hook
> for the thumb target to use to fix this there?
ppc64 target has the similar problem too. We need a way suitable for
{thumb, ppc64, other} x {gcc, clang}.
Hacking dwarf assembler doesn't help much, because we are still unable
to get the right function address.
>
> But *if* we do decide there's no better solution, there's a lot of
> boilerplate here.
Let me list the solutions I thought about and tried, so that we can
evaluate which one is the best.
- Tweak dwarf assembler to generate assembly debug info together with
__thumb__ and __thumb2__, like
#if defined (__thumb__) || defined (__thumb2__)
.uleb128 main-1 /* DW_AT_low_pc */
#else
.uleb128 main /* DW_AT_low_pc */
#endif
this doesn't work because main in "main-1" is resolved to the function
address (without lsb set). Unfortunately, "main-1+1" is resolved to
the function address *with* lsb set.
- The approach I proposed here, which should fix the problem on ppc64
(I didn't verify that on the real hardware).
- Fix ld that stop setting function address lsb if they are in debug
info. I didn't try.
- Make use of local symbols. I find gcc/clang generates local symbol on the
entry of the function but looks "-Wa,-L" doesn't keep them.
--
Yao (éå)