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: [PATCH 2/2] Fix implptr-optimized-out.exp fail in thumb mode


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 (éå)


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