From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 5673B3858C41 for ; Mon, 4 Dec 2023 17:34:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5673B3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=lancelotsix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lancelotsix.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5673B3858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=51.195.220.111 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701711288; cv=none; b=Hs5NWtnEoi/b10yb5b3pno+bFUaSSnHcAYK4AthcqDKkXaWIhM32FlyxtiITap98BgpL4ltW+F/cxcPuaDl5SkefJfAp0rB63Jp1AIwYuwxpr9yAqNE77Ss1yiKlsJdkTLQ9GDOaYCjSWR2898IHfNS9X87xluXY01AEv/HUz4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701711288; c=relaxed/simple; bh=gGt7u9/Ive41MT9kVf5cQUzlviMwFnWF9/PqOqnWSvI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=egnPF+G4lUz39C3LCW0GbnTwuqXbGS0PIseiO+v5aKjc/04zqpHMZrJeg7o1ViSOaMrv3JSmoUrq4GvGkXS0Rlem5yObFZaeFbgBd7slyIJk0bnG+u9CLZaK+ZinU5DW4T7nOOdYX0GJXoJcDTn3J7MPRwag3qf6azD42BoBbjg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from octopus (cust120-dsl54.idnet.net [212.69.54.120]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 57E538C4EC; Mon, 4 Dec 2023 17:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lancelotsix.com; s=2021; t=1701711285; bh=gGt7u9/Ive41MT9kVf5cQUzlviMwFnWF9/PqOqnWSvI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xo/A+Oe5dbAY7T+qyafnjQNVnpYdMOVLH1ZKx7k3rBeDaj6t16va6hdTSKyEzLYGa xmTtOA1oMuQSrtC/D1e8jYuAFkK5CtYzpBFBZd0kOpaXBG4OYs2BKOWCOjYaik7Yd1 ldyVo3EuR5nsCMBkfAMnIf4bKxiFVVDEEbHnYuVgsaqJNlSe+ogJi3YL1jmkzpFPtZ mqWBjbHRTdcDrJE3KGbTDi+MZCODrlMvbP4tmbUS08kwjYbx9gT6oqsVuy9v1FYUaQ ov68PKqnL4FHiEBBj3dWYRqf6RgeXOjp9cGW3P5bI4eZuoc1njkZZComgdhrk3BTsa FCTW+ourHJiPg== Date: Mon, 4 Dec 2023 17:34:40 +0000 From: Lancelot SIX To: Hannes Domani Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix DLL export forwarding Message-ID: <20231204173440.s2qabznnrensgjy2@octopus> References: <20231204165029.408-1-ssbssa.ref@yahoo.de> <20231204165029.408-1-ssbssa@yahoo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231204165029.408-1-ssbssa@yahoo.de> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (lndn.lancelotsix.com [0.0.0.0]); Mon, 04 Dec 2023 17:34:45 +0000 (UTC) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 Hannes, I am not familiar with this part of the code so I'll let someone else comment on the actual change, but found a minor typo. Other than this, and FWIW, the change seem reasonable to me. On Mon, Dec 04, 2023 at 05:50:29PM +0100, Hannes Domani wrote: > I noticed it when I was trying to set a breakpoint at ExitProcess: > ``` > (gdb) b ExitProcess > Breakpoint 1 at 0x14001fdd0 > (gdb) r > Starting program: C:\qiewer\heob\heob64.exe > Warning: > Cannot insert breakpoint 1. > Cannot access memory at address 0x3dbf4120 > Cannot insert breakpoint 1. > Cannot access memory at address 0x77644120 > ``` > > The problem doesn't exist in gdb 13.2, and the difference can easily be > seen when printing ExitProcess. > gdb 14.1: > ``` > (gdb) p ExitProcess > $1 = {} 0x77644120 > ``` > gdb 13.2: > ``` > (gdb) p ExitProcess > $1 = {} 0x77734120 > ``` > > The new behavior started with 9675da25357c7a3f472731ddc6eb3becc65b469a, > where VMA was then calculated relative to FORWARD_DLL_NAME, while it was > relative to DLL_NAME before. > > Fixed by calculating VMA relative to DLL_NAME again. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31112 > --- > gdb/coff-pe-read.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c > index 56137ac4dd0..c9d6d86a085 100644 > --- a/gdb/coff-pe-read.c > +++ b/gdb/coff-pe-read.c > @@ -210,7 +210,10 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader, > " \"%s\" in dll \"%s\", pointing to \"%s\"\n"), > sym_name, dll_name, forward_qualified_name.c_str ()); > > - unrelocated_addr vma = msymbol.minsym->unrelocated_address (); > + /* Calculate VMA as if if where relative to DLL_NAME/OBJFILE, even though ^ s/if if/if it/ > + it actually points inside another dll (FORWARD_DLL_NAME). */ > + unrelocated_addr vma = unrelocated_addr(msymbol.value_address () > + - objfile->text_section_offset ()); > msymtype = msymbol.minsym->type (); > section = msymbol.minsym->section_index (); > > -- > 2.35.1 > Best, Lancelot.