public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lsix@lancelotsix.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Allow debugging of runtime loader / dynamic linker
Date: Thu, 3 Nov 2022 15:52:06 +0000	[thread overview]
Message-ID: <20221103155128.uv3mpxhinsmfxulf@ubuntu.lan> (raw)
In-Reply-To: <20221008035716.46147-2-kevinb@redhat.com>

Hi Kevin,

We have recently encountered a bug with the master branch.  Simon have
opened https://sourceware.org/bugzilla/show_bug.cgi?id=29747 to track
it.

By running `git bisect`, it seems that this problem appeared with this
patch.

Do you think you would have time to investigate this issue?  I have not
looked at the actual problem yet.  I have just been looking at when the
regression got introduced.

I do not expect it to be too long to fix, but I am not familiar with
this part of the code.

Please let me know if you do not have time to investigate this.

Best,
Lancelot.

On Fri, Oct 07, 2022 at 08:57:15PM -0700, Kevin Buettner via Gdb-patches wrote:
> At present, GDB does not allow for the debugging of the runtime loader
> and/or dynamic linker.  Much of the time, this makes sense.  An
> application programmer doesn't normally want to see symbol resolution
> code when stepping into a function that hasn't been resolved yet.
> 
> But someone who wishes to debug the runtime loader / dynamic linker
> might place a breakpoint in that code and then wish to debug it
> as normal.  At the moment, this is not possible.  Attempting to step
> will cause GDB to internally step (and not stop) until code
> unrelated to the dynamic linker is reached.
> 
> This commit makes a minor change to infrun.c which allows the dynamic
> loader / linker to be debugged in the case where a step, next, etc.
> is initiated from within that code.
> 
> While developing this fix, I tried some approaches which weren't quite
> right.  The GDB testusite definitely contains tests which FAIL when
> it's done incorrectly.  (At one point, I saw 17 regressions!) This
> commit has been tested on x86-64 linux with no regressions.
> ---
>  gdb/infrun.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/infrun.c b/gdb/infrun.c
> index 1957e8020dd..52441b7ab5c 100644
> --- a/gdb/infrun.c
> +++ b/gdb/infrun.c
> @@ -6961,7 +6961,10 @@ process_event_stop_test (struct execution_control_state *ecs)
>  
>    if (execution_direction != EXEC_REVERSE
>        && ecs->event_thread->control.step_over_calls == STEP_OVER_UNDEBUGGABLE
> -      && in_solib_dynsym_resolve_code (ecs->event_thread->stop_pc ()))
> +      && in_solib_dynsym_resolve_code (ecs->event_thread->stop_pc ())
> +      && !in_solib_dynsym_resolve_code (
> +	  ecs->event_thread->control.step_start_function->value_block ()
> +	      ->entry_pc ()))
>      {
>        CORE_ADDR pc_after_resolver =
>  	gdbarch_skip_solib_resolver (gdbarch, ecs->event_thread->stop_pc ());
> -- 
> 2.37.3
> 

  reply	other threads:[~2022-11-03 15:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-08  3:57 [PATCH 0/2] " Kevin Buettner
2022-10-08  3:57 ` [PATCH 1/2] " Kevin Buettner
2022-11-03 15:52   ` Lancelot SIX [this message]
2022-10-08  3:57 ` [PATCH 2/2] Test stepping within a " Kevin Buettner
2022-10-10 18:45   ` John Baldwin
2022-10-20  2:42     ` Kevin Buettner

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=20221103155128.uv3mpxhinsmfxulf@ubuntu.lan \
    --to=lsix@lancelotsix.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).