From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id DA97B3858D20 for ; Thu, 3 Nov 2022 15:52:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA97B3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=lancelotsix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lancelotsix.com Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 8CE0180024; Thu, 3 Nov 2022 15:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lancelotsix.com; s=2021; t=1667490733; bh=7rMJLZq+JXgiL1HjDN+Y/eL2lP8u1CByM131abJ2DpM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xz2Day+QQhvi3V37AxN3dPmA/sP35r1+TQQWLA9AbjkPGy1vywwXVmVs6ZdN09AmG 8CLa4Psymy4z8CJooGawru+9MT1Ot+0KYD4fOLCBS6a82r+W3EqdMaiTYoJdSGRVV+ 4aPWsXtzJYLwd7sUE0b9UA2TVcMnbZGJI70umzr3olxinkBys2dK30bf/pmD58+0kA e+r1IXu23kt2ZHXzxKVS5yd/XuqWHtdJpKzC80CP5Yz7yurMOvYvn6cz2joYGfhJie Xnm6/NBcLi2bQR7SehOU6fszsHLznim7YFZxtWZpAqy8/pIutDHINZdIuzm5JDxUmz anN5rHTABIY9A== Date: Thu, 3 Nov 2022 15:52:06 +0000 From: Lancelot SIX To: Kevin Buettner Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] Allow debugging of runtime loader / dynamic linker Message-ID: <20221103155128.uv3mpxhinsmfxulf@ubuntu.lan> References: <20221008035716.46147-1-kevinb@redhat.com> <20221008035716.46147-2-kevinb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221008035716.46147-2-kevinb@redhat.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Thu, 03 Nov 2022 15:52:13 +0000 (UTC) X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 >