[edk2-devel] SLDP: Usage of PE library context by debugger?

Marvin Häuser mhaeuser at posteo.de
Mon Aug 2 05:47:58 UTC 2021


02.08.2021 06:51:39 Jeff Fan <fanjianfeng at byosoft.com.cn>:

> Marvin,
> 
> ImageBase was saved in DR2 to help HOST debugger to locate the image 
> base more easily, even though the HOST debugger could find the image 
> base through searching the DOS image signagure.
> 
> The reason choosing DR1 and DR2 to save PDB & ImageBase contexts is 
> just implementation only. And it could co-work with Debug Agent Lib 
> implementation and SIMCS.  I am not sure whether is could co-work with 
> 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, 
maybe that was incorrect though. I use GDB. :)

> I don't understand why the new PeCoffLib implementation would break the 
> existing debugging tools?Could you explain it more details?

Please refer to the mail from Ray and my response. It is not the Image 
base address that is saved in DR2, but the PeCoffLib context address, 
and my new library simply has a new context structure for various 
reasons.

Best regards,
Marvin

> 
> ----------------------------------------
> 
> Jeff
> fanjianfeng at byosoft.com.cn
> 
>  
> *From:* Marvin Häuser[mhaeuser at posteo.de]
> *Date:* 2021-08-01 01:21
> *To:* devel at edk2.groups.io
> *CC:* Hao A Wu[hao.a.wu at intel.com]
> *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
>  
>  
>  
>  
>  
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78493): https://edk2.groups.io/g/devel/message/78493
Mute This Topic: https://groups.io/mt/84574370/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list