From: Pedro Alves <palves@redhat.com>
To: Dmitry Antipov <dantipov@nvidia.com>, gdb@sourceware.org
Subject: Re: Handling language trampoline
Date: Fri, 08 Dec 2017 11:12:00 -0000 [thread overview]
Message-ID: <2a2ad2bb-060b-cdd2-ad18-a6773998edbc@redhat.com> (raw)
In-Reply-To: <8ea7083d-d914-c463-c7f3-22bd57ac5a6d@nvidia.com>
On 12/08/2017 06:39 AM, Dmitry Antipov wrote:
> On 12/07/2017 05:58 PM, Pedro Alves wrote:
>
>> I don't offhand see how can GDB know which is the right
>> language for the current PC the program just stopped at, and
>> if the program stopped inside a trampoline. That's part of
>> each language's skip_trampoline's job, so seems reasonable
>> that GDB has to try them all.
>
> I'm not an expert in this area too, but, in theory, what's the
> problem if we have (presumably valid) DWARF info? Looking through
> DWARF4 specs, each CU should have DW_AT_low_pc and DW_AT_high_pc;
> so, if CU->DW_AT_low_pc <= current PC <= CU->DW_AT_high_pc, then
> CU->DW_AT_language is the language in question, isn't it?
Some trampolines are generated by the compiler/linker, and I
assume there's no debug info for them? E.g., for C++, see
gnuv3_skip_trampoline, and virtual thunks.
I don't know whether that's the case for objc, but from:
/* Determine if we are currently in the Objective-C dispatch function.
If so, get the address of the method function that the dispatcher
would call and use that as the function to step into instead. Also
skip over the trampoline for the function (if any). This is better
for the user since they are only interested in stepping into the
method function anyway. */
static CORE_ADDR
objc_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
{
I'd assume that the "dispatch function" is a part of the objc runtime and
that this is meant to work if there's no debug info for the objc runtime
installed.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-12-08 11:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-06 20:21 gdbarch_init, ABI, and registers Tim Newsome
2017-12-07 14:21 ` Handling language trampoline Dmitry Antipov
2017-12-07 14:58 ` Pedro Alves
2017-12-08 6:39 ` Dmitry Antipov
2017-12-08 11:12 ` Pedro Alves [this message]
2017-12-07 21:22 ` gdbarch_init, ABI, and registers Tim Newsome
2017-12-08 12:20 ` Ulrich Weigand
2017-12-08 20:03 ` Tim Newsome
2017-12-09 11:27 ` Ulrich Weigand
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=2a2ad2bb-060b-cdd2-ad18-a6773998edbc@redhat.com \
--to=palves@redhat.com \
--cc=dantipov@nvidia.com \
--cc=gdb@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