From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web12.16323.1627883282519205194 for ; Sun, 01 Aug 2021 22:48:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=F4RNhM+a; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 4A90B240026 for ; Mon, 2 Aug 2021 07:48:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1627883280; bh=v8ho0iLlU81d2LRIbD65dEtg4OwUlA/P5XMcP8+RhFo=; h=Date:From:To:Cc:Subject:From; b=F4RNhM+aSd0iyHSEsfXIMNf4AM2PsEPqulgHbPh1O/GB7F9mEoD7ye343QORZHr/L oZ638YJfvG2aPTEzeDPlKbky+SuzXIl5R1JWN+LcJc/UESMgX+4Le3QcwA2hwxNoFF hqfqZbiLG9tf1vBCKUAOZHUJxm7mwGjxEUflItcW+IDTc+ED37Ylrh8AnwDD6iFe2v sjI8BcEEBuWgPvBfGlirLo61QVOSNqa/7jfIzwAM+O//cKdiRvh9EMZ5bCnn026xzr j/51VccpHVnY6swJ76O9BEuN8abqLK9QLJYn1xv6U+EEq5UvluRDtj8cpdtfN7Vw0S j7D6aNP7ZRzuA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GdRqf6K85z9rxL; Mon, 2 Aug 2021 07:47:58 +0200 (CEST) MIME-Version: 1.0 Date: Mon, 02 Aug 2021 05:47:58 +0000 From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io, fanjianfeng@byosoft.com.cn Cc: Hao A Wu Subject: Re: [edk2-devel] SLDP: Usage of PE library context by debugger? In-Reply-To: <2021080211280782338912@byosoft.com.cn> References: <20b13677-098e-6105-bbd6-c708321f839a@posteo.de> <2021080211280782338912@byosoft.com.cn> Message-ID: <1e44ed09-016e-40bc-b03d-da6f231e687e@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 02.08.2021 06:51:39 Jeff Fan : > Marvin, >=20 > ImageBase was saved in DR2 to help HOST debugger to locate the image=20 > base more easily, even though the HOST debugger could find the image=20 > base through searching the DOS image signagure. >=20 > The reason choosing DR1 and DR2 to save PDB & ImageBase contexts is=20 > just implementation only. And it could co-work with Debug Agent Lib=20 > implementation and SIMCS.=C2=A0 I am not sure whether is could co-work w= ith=20 > INTEl System Debugging tools or not. Good day Jeff, Thanks for your response! I've read that Intel System Debugger superseded the UDK debugging tool,=20 maybe that was incorrect though. I use GDB. :) > I don't understand why=C2=A0the new PeCoffLib implementation would break= the=20 > existing=C2=A0debugging=C2=A0tools=EF=BC=9FCould you explain it more det= ails? Please refer to the mail from Ray and my response. It is not the Image=20 base address that is saved in DR2, but the PeCoffLib context address,=20 and my new library simply has a new context structure for various=20 reasons. Best regards, Marvin >=20 > ---------------------------------------- >=20 > Jeff > fanjianfeng@byosoft.com.cn >=20 > =C2=A0 > *From:*=C2=A0Marvin H=C3=A4user[mhaeuser@posteo.de] > *Date:*=C2=A02021-08-01=C2=A001:21 > *To:*=C2=A0devel@edk2.groups.io > *CC:*=C2=A0Hao A Wu[hao.a.wu@intel.com] > *Subject:*=C2=A0[edk2-devel] SLDP: Usage of PE library context by debugg= er? > Good day everyone, > =C2=A0 > 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: > =C2=A0 > 1) Which data are retrieved from the context structure? For GDB, I=20 > 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? > =C2=A0 > Thank you for your time! > =C2=A0 > Best regards, > Marvin > =C2=A0 > =C2=A0 > [1] > https://github.com/tianocore/edk2/blob/610bcc69ed3d1e8c016332a1862465d41= d95dd6c/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraAc= tionLib.c#L126 > =C2=A0 > =C2=A0 > =C2=A0 > =C2=A0 > =C2=A0 >=20