From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web09.16193.1627882600723684228 for ; Sun, 01 Aug 2021 22:36:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=NNOehweD; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 0C1AA240103 for ; Mon, 2 Aug 2021 07:36:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1627882598; bh=ADf06Rp7Onw2ZrWMFC/U+2PdNBOZX+X/HzGEncp3L+U=; h=Date:From:To:Cc:Subject:From; b=NNOehweDiJM03FncXt9+xrYr+jpMacXDZHSpBFQOtxFAO8L/jGga/COuI+5TDQKq3 ucejja4vS2UnyX9BmIj9EIbso6kOWSXZFDA3BzgNX/tIv1755kX3n1HMK9sMUgqJk3 Y4vuWEc87eswej8Y0JTQbMgjg3REXxAD2+QSD3L3ieU+Ga9ly3OuY8SlaxkvHBF2/v xBvMIEzmmVzRlvxSMsmbeppf36RPvY7y+Exoib+H2a/tbMn6ouvnwjF9Yjs35Ps/cS ILwEjyxEdAeHSyclw12mbNtFruydrne9FfXC1X0xKuIr1d7BjCrHqMEv90ksmkiWiD a4sNdc9N7tI+A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GdRZY0S94z9rxH; Mon, 2 Aug 2021 07:36:36 +0200 (CEST) Date: Mon, 2 Aug 2021 05:36:36 +0000 (UTC) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: "Ni, Ray" Cc: devel@edk2.groups.io, "Wu, Hao A" Message-ID: In-Reply-To: References: <20b13677-098e-6105-bbd6-c708321f839a@posteo.de> Subject: Re: [edk2-devel] SLDP: Usage of PE library context by debugger? MIME-Version: 1.0 X-Correlation-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 02.08.2021 05:09:29 Ni, Ray : > Marvin, > Host assumes first 8-byte (little endian) of memory pointed by DR2 is the value of Image base address. Thanks Ray! So I can be confident no further data from the context are or will be queried and I can just publish the Image base from the stack for example? Maybe another thing, is the Image base address used for anything but loading the symbols (analogous to GCC "add-symbol-file")? E.g. does it ever try to read and parse the Image header? Mostly I am interested in how changes to the TE format would affect the tool. Best regards, Marvin > DR1 points to the PDB path (I am sure you noticed that in the SourceLevelDebugPkg code). > > There is no plan to provide detailed documentation of host/client communication protocol. So far, the brief explanation can be seen in SourceLevelDebugPkg\Include\TransferProtocol.h. > > I admit that if the old me had the mindset of today's me, a detailed markdown doc should have been provided in SourceLevelDebugPkg. > I will check internally on the open source plan, but please don't heavily rely on that. Thanks! > > Thanks, > Ray > > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Marvin H?user > Sent: Sunday, August 1, 2021 1:21 AM > To: devel@edk2.groups.io > Cc: Wu, Hao A > Subject: [edk2-devel] SLDP: Usage of PE library context by debugger? > > Good day everyone, > > While refining the port of SourceLevelDebugPkg to my newly proposed PeCoffLib rework (RFC upcoming), I noticed that the address of the PE Image context is written to DR2 [1]. Because the UDK and Intel System Studio debugging tools are closed source, I cannot verify what happens to this value. Does the host read the library context and retrieve data from it? If not, why is its address written to DR2? If so, this would mean the new PeCoffLib implementation breaks the existing debugging tools. The following questions would arise: > > 1) Which data are retrieved from the context structure? For GDB, I think only the Image address and symbol file path are required (to load the symbols), while PDB is saved in DR1 already. > 2) Are there any plans to provide detailed documentation of the host/client communication protocol? > 3) Are there any plans to provide an open source debugger, or at least the EDK II communication protocol portion? > > Thank you for your time! > > Best regards, > Marvin > > > [1] > https://github.com/tianocore/edk2/blob/610bcc69ed3d1e8c016332a1862465d41d95dd6c/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLib.c#L126 > > >