public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Adding DebugPkg to the main edk2 repo
@ 2019-05-07  2:04 rebecca
  2019-05-07  6:13 ` [edk2-devel] " Michael D Kinney
  0 siblings, 1 reply; 5+ messages in thread
From: rebecca @ 2019-05-07  2:04 UTC (permalink / raw)
  To: devel

I think this has been discussed previously, but since time has passed
I'd like to check again: is there any possibility of having the DebugPkg
from https://github.com/andreiw/andreiw-wip/tree/master/uefi/DebugPkg
added to the main edk2 repo in some way (perhaps not as DebugPkg, but
renamed/reorganized/integrated)?


It seems such a useful addition for debugging UEFI code running under
OVMF that it would be nice to have it somewhere it has less chance of
bitrotting.


-- 
Rebecca Cran


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] Adding DebugPkg to the main edk2 repo
  2019-05-07  2:04 Adding DebugPkg to the main edk2 repo rebecca
@ 2019-05-07  6:13 ` Michael D Kinney
  2019-05-07  8:59   ` Ryszard Knop
  0 siblings, 1 reply; 5+ messages in thread
From: Michael D Kinney @ 2019-05-07  6:13 UTC (permalink / raw)
  To: devel@edk2.groups.io, rebecca@bluestop.org

Hi Rebecca,

This content does not look OVMF specific.

Does it depend on QEMU?  Or would this
Potentially work on any target that supports
gdb?

How about adding to SourceLevelDebugPkg as 
an another method to load symbols?  Not sure 
why the extra module is required.  The Debug 
Image Info Table is defined to be on a 4MB 
boundary and can be found with a search.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
> On Behalf Of rebecca@bluestop.org
> Sent: Monday, May 6, 2019 7:04 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] Adding DebugPkg to the main edk2
> repo
> 
> I think this has been discussed previously, but since
> time has passed
> I'd like to check again: is there any possibility of
> having the DebugPkg
> from https://github.com/andreiw/andreiw-
> wip/tree/master/uefi/DebugPkg
> added to the main edk2 repo in some way (perhaps not as
> DebugPkg, but
> renamed/reorganized/integrated)?
> 
> 
> It seems such a useful addition for debugging UEFI code
> running under
> OVMF that it would be nice to have it somewhere it has
> less chance of
> bitrotting.
> 
> 
> --
> Rebecca Cran
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] Adding DebugPkg to the main edk2 repo
  2019-05-07  6:13 ` [edk2-devel] " Michael D Kinney
@ 2019-05-07  8:59   ` Ryszard Knop
  2019-05-07 11:49     ` Laszlo Ersek
  0 siblings, 1 reply; 5+ messages in thread
From: Ryszard Knop @ 2019-05-07  8:59 UTC (permalink / raw)
  To: devel, michael.d.kinney, rebecca@bluestop.org

Hi Mike,

GdbSyms can be built separately from the debugged image. It produces a
DLL file to load while starting GDB so that it properly detects the
target once connected. The associated gdb_uefi.py script loads it with
symbol-file to get some info required to find the system table, etc
(see search_est function).

I'm using this script (with QEMU only, not sure about other platforms,
but could work I guess?) and have a Python 3 port if someone needs it.

Thanks, Richard

On 2019-05-07 8:13, Michael D Kinney wrote:
> Hi Rebecca,
>
> This content does not look OVMF specific.
>
> Does it depend on QEMU?  Or would this
> Potentially work on any target that supports
> gdb?
>
> How about adding to SourceLevelDebugPkg as
> an another method to load symbols?  Not sure
> why the extra module is required.  The Debug
> Image Info Table is defined to be on a 4MB
> boundary and can be found with a search.
>
> Mike
>
>> -----Original Message-----
>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
>> On Behalf Of rebecca@bluestop.org
>> Sent: Monday, May 6, 2019 7:04 PM
>> To: devel@edk2.groups.io
>> Subject: [edk2-devel] Adding DebugPkg to the main edk2
>> repo
>>
>> I think this has been discussed previously, but since
>> time has passed
>> I'd like to check again: is there any possibility of
>> having the DebugPkg
>> from https://github.com/andreiw/andreiw-
>> wip/tree/master/uefi/DebugPkg
>> added to the main edk2 repo in some way (perhaps not as
>> DebugPkg, but
>> renamed/reorganized/integrated)?
>>
>>
>> It seems such a useful addition for debugging UEFI code
>> running under
>> OVMF that it would be nice to have it somewhere it has
>> less chance of
>> bitrotting.
>>
>>
>> --
>> Rebecca Cran
>>
>>
>>
>
> 
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] Adding DebugPkg to the main edk2 repo
  2019-05-07  8:59   ` Ryszard Knop
@ 2019-05-07 11:49     ` Laszlo Ersek
  2019-05-07 15:28       ` rebecca
  0 siblings, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2019-05-07 11:49 UTC (permalink / raw)
  To: devel, ryszard.knop, michael.d.kinney, rebecca@bluestop.org

On 05/07/19 10:59, Ryszard Knop wrote:
> Hi Mike,
> 
> GdbSyms can be built separately from the debugged image. It produces a
> DLL file to load while starting GDB so that it properly detects the
> target once connected. The associated gdb_uefi.py script loads it with
> symbol-file to get some info required to find the system table, etc
> (see search_est function).

Yes, that function performs the 4MB-aligned search that Mike mentioned.

> 
> I'm using this script (with QEMU only, not sure about other platforms,
> but could work I guess?) and have a Python 3 port if someone needs it.
> 
> Thanks, Richard
> 
> On 2019-05-07 8:13, Michael D Kinney wrote:
>> Hi Rebecca,
>>
>> This content does not look OVMF specific.
>>
>> Does it depend on QEMU?  Or would this
>> Potentially work on any target that supports
>> gdb?

I'd expect it to interoperate with any gdb server implementation.

Whenever I use DebugPkg, to connect to a running QEMU instance, I launch the following gdb scriptlet (with "gdb -x") from a file:

set height 0
set architecture i386:x86-64:intel
target remote localhost:1234
source .../DebugPkg/Scripts/gdb_uefi.py
reload-uefi -o .../Build/Ovmf3264/NOOPT_GCC48/X64/DebugPkg/GdbSyms/GdbSyms/DEBUG/GdbSyms.dll

Thanks
Laszlo

>>
>> How about adding to SourceLevelDebugPkg as
>> an another method to load symbols?  Not sure
>> why the extra module is required.  The Debug
>> Image Info Table is defined to be on a 4MB
>> boundary and can be found with a search.
>>
>> Mike
>>
>>> -----Original Message-----
>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
>>> On Behalf Of rebecca@bluestop.org
>>> Sent: Monday, May 6, 2019 7:04 PM
>>> To: devel@edk2.groups.io
>>> Subject: [edk2-devel] Adding DebugPkg to the main edk2
>>> repo
>>>
>>> I think this has been discussed previously, but since
>>> time has passed
>>> I'd like to check again: is there any possibility of
>>> having the DebugPkg
>>> from https://github.com/andreiw/andreiw-
>>> wip/tree/master/uefi/DebugPkg
>>> added to the main edk2 repo in some way (perhaps not as
>>> DebugPkg, but
>>> renamed/reorganized/integrated)?
>>>
>>>
>>> It seems such a useful addition for debugging UEFI code
>>> running under
>>> OVMF that it would be nice to have it somewhere it has
>>> less chance of
>>> bitrotting.
>>>
>>>
>>> -- 
>>> Rebecca Cran
>>>
>>>
>>>
>>
>>
>>
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] Adding DebugPkg to the main edk2 repo
  2019-05-07 11:49     ` Laszlo Ersek
@ 2019-05-07 15:28       ` rebecca
  0 siblings, 0 replies; 5+ messages in thread
From: rebecca @ 2019-05-07 15:28 UTC (permalink / raw)
  To: devel, lersek, ryszard.knop, michael.d.kinney

On 2019-05-07 05:49, Laszlo Ersek wrote:
>
> I'd expect it to interoperate with any gdb server implementation.
>
> Whenever I use DebugPkg, to connect to a running QEMU instance, I launch the following gdb scriptlet (with "gdb -x") from a file:
>
> set height 0
> set architecture i386:x86-64:intel
> target remote localhost:1234
> source .../DebugPkg/Scripts/gdb_uefi.py
> reload-uefi -o .../Build/Ovmf3264/NOOPT_GCC48/X64/DebugPkg/GdbSyms/GdbSyms/DEBUG/GdbSyms.dll


Yup, I've documented the steps to use it at
https://code.bluestop.org/w/tianocore/debugging-with-gdb/ .

To work with modern versions of gdb which use Python 3, you can just run
2to3 (https://docs.python.org/3.7/library/2to3.html) on gdb_uefi.py
which I checked last night works.


I tried using it with a Bhyve build of OVMF
(https://github.com/freebsd/uefi-edk2/tree/bhyve/edk2-stable201903) but
it didn't work and I didn't have time to look into why. It might just be
because Bhyve's gdb server is fairly basic at the moment.


-- 
Rebecca Cran


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-07 15:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-07  2:04 Adding DebugPkg to the main edk2 repo rebecca
2019-05-07  6:13 ` [edk2-devel] " Michael D Kinney
2019-05-07  8:59   ` Ryszard Knop
2019-05-07 11:49     ` Laszlo Ersek
2019-05-07 15:28       ` rebecca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox