Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
	  "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	 teawater <teawater@gmail.com>
Subject: Re: [RFA] Handle runtime loader dyn sym resolution in reverse
Date: Mon, 27 Oct 2008 05:00:00 -0000	[thread overview]
Message-ID: <4905496E.9080204@vmware.com> (raw)
In-Reply-To: <490546A7.9020002@vmware.com>

Michael Snyder wrote:
> Joel Brobecker wrote:
> 
>>> 2008-10-24  Michael Snyder  <msnyder@vmware.com>
>>>
>>>       * infrun.c (handle_inferior_event): Handle dynamic symbol
>>>       resolution in reverse.
>> Looks OK to me, but I don't understand why you check that stop_func_start
>> is zero. If I were to make a guess, it would be to quickly dismiss
>> the case were we reverse stepped into a function call, and so don't
>> need to check for trampolines (in other words, a CPU saver).
> 
> Correct, but it's more than a CPU saver.
> If we are in a function (stop_func_start is non-zero),
> then we can set a step_resume breakpoint and continue,
> which is way faster than single stepping.
> 
> We single-step only when we have to, ie. when we have
> actually stepped into the fixup jump table.

The big difference is, 'in_solib_dynsym_resolve_code'
returns true when we're in the dynamic loader function
"_dl_runtime_resolve", but we really don't want to single
step through that.  Since it's a function with a minsym,
we can jump over it just like any other function -- but
then we hit the jump table and have to singlestep a few
times.

The test case was sent to me by teawater, who tried to
reverse-next over a printf.  GDB handled the printf call
fine, then it stepped into _dl_runtime_resolve, which it
also handled, but it stumbled over the jump table.

Committed, by the way.


      reply	other threads:[~2008-10-27  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-25  3:04 Michael Snyder
2008-10-25  6:50 ` teawater
2008-10-25 16:10 ` Joel Brobecker
2008-10-26 14:15   ` teawater
2008-10-27  4:48   ` Michael Snyder
2008-10-27  5:00     ` Michael Snyder [this message]

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=4905496E.9080204@vmware.com \
    --to=msnyder@vmware.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=teawater@gmail.com \
    /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