From: Yao Qi <yao@codesourcery.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] Fix implptr-optimized-out.exp fail in thumb mode
Date: Thu, 09 Oct 2014 12:43:00 -0000 [thread overview]
Message-ID: <87vbnts9hv.fsf@codesourcery.com> (raw)
In-Reply-To: <CADPb22RGCXiYA1KfjfDTY0pMcmALYJrXG+OE23jdfxUqNMUU4A@mail.gmail.com> (Doug Evans's message of "Wed, 8 Oct 2014 11:31:59 -0400")
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 (齐尧)
next prev parent reply other threads:[~2014-10-09 12:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 0:56 [PATCH 0/2] " Yao Qi
2014-09-29 0:56 ` [PATCH 1/2] Use Dwarf::assemble in implptr-optimized-out.exp Yao Qi
2014-09-29 0:56 ` [PATCH 2/2] Fix implptr-optimized-out.exp fail in thumb mode Yao Qi
2014-10-07 15:35 ` Pedro Alves
2014-10-08 11:43 ` Yao Qi
2014-10-08 15:32 ` Doug Evans
2014-10-09 12:43 ` Yao Qi [this message]
2014-10-07 14:06 ` [PATCH 0/2] " Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vbnts9hv.fsf@codesourcery.com \
--to=yao@codesourcery.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).