public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Help with debugging
@ 2021-06-11 17:06 Ethin Probst
  2021-06-11 18:23 ` [edk2-devel] " Andrew Fish
  2021-06-23 11:39 ` Laszlo Ersek
  0 siblings, 2 replies; 14+ messages in thread
From: Ethin Probst @ 2021-06-11 17:06 UTC (permalink / raw)
  To: devel

Hey all,

So Leif and I have discussed this at length but I thought I'd reach
out to all of you for more help.

I'm having a lot of trouble debugging my UEFI app. Here's how I do things:

- I load the app using uefi-run
(https://github.com/Richard-W/uefi-run) like this (from the main EDK
II directory): uefi-run -b Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd
Build/OvmfX64/DEBUG_GCC5/X64/Shell.efi -- -M q35 -m 24G -usb -device
qemu-xhci -device usb-audio,audiodev=audio -audiodev alsa,id=audio -s
-debugcon file:../debug.log -global isa-debugcon.iobase=0x402
-nographic
Or:
uefi-run -b Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd
Build/OvmfX64/DEBUG_GCC5/X64/Shell.efi -- -M q35 -m 24G -usb -device
qemu-xhci -device usb-audio,audiodev=audio -audiodev alsa,id=audio -s
-debugcon stdio -global isa-debugcon.iobase=0x402
- I connect to the remote GDB stub (localhost:1234) and wait until
OVMF gives me the image base. Then I use:
add-symbol-file UsbAudio.debug <image base>
Here's where everything breaks down. One of two things happens at this point:
1. Either I get the wrong debug information (I get source code but the
image isn't loaded anymore), and resetting the system and placing a
breakpoint (either software or hardware) has no effect; or
2. If I use CpuBreakpoint(), the firmware gives me the registers and
the image base and entry point addresses, and then appears to just sit
there waiting for something. Once I load the symbols using the image
base it gives me, I can't actually do anything in the debugger; I
can't list code because I get "1 in <artificial>", I can't jump into
my code without triggering a general protection exception or not
actually causing anything to happen... You get the idea.

So I'm really, really confused on what's going wrong. Do you guys have
any advice?

-- 
Signed,
Ethin D. Probst

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

end of thread, other threads:[~2021-06-23 17:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-11 17:06 Help with debugging Ethin Probst
2021-06-11 18:23 ` [edk2-devel] " Andrew Fish
2021-06-11 18:39   ` Ethin Probst
2021-06-11 19:42     ` Andrew Fish
2021-06-11 20:48       ` Ethin Probst
2021-06-11 20:58         ` Andrew Fish
2021-06-11 21:29           ` Ethin Probst
2021-06-11 23:09             ` Andrew Fish
2021-06-11 23:29               ` Ethin Probst
2021-06-11 23:48                 ` Andrew Fish
2021-06-12  4:47                   ` Ethin Probst
2021-06-12 19:03                     ` Andrew Fish
2021-06-23 11:39 ` Laszlo Ersek
2021-06-23 17:20   ` Ethin Probst

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