public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrew Fish via groups.io" <afish=apple.com@groups.io>
To: edk2-devel-groups-io <devel@edk2.groups.io>, farahanimahsa99@gmail.com
Cc: koenig_regina@arcor.de
Subject: Re: [edk2-devel] Debugging Ovmf with GDB: No symbol is recognized
Date: Mon, 26 Aug 2024 13:48:31 -0700	[thread overview]
Message-ID: <6B885BB8-2FB5-4E5E-B739-FAE0FB757C8E@apple.com> (raw)
In-Reply-To: <15414.1724612740322417598@groups.io>

[-- Attachment #1: Type: text/plain, Size: 2318 bytes --]

I contributed the efi_gdb.py scripts. The gdb scripts figure out the symbols that exist when you connect. They scripts can walk the current frame, or if you are in DXE they can usually figure out the table of all the symbols that got loaded up until this point. But that only represents what was loaded when you connect. It might be possible to connect prior to the driver/app being loaded so the symbols will not exist. 

I use lldb, not gdb, so I might be botching the gdb details but you can set a pending breakpoint waiting on symbols to get loaded but you still require some mechanism for symbols to load. In the emulator and the other EFI debugger symbols get loaded as modules get loaded. These scripts don’t do that, they just load symbols when you connect, or run the `efi symbols` command. They basically have some kind of stop hook on when a new module gets loaded and load the symbols then. Bad news this generic gdb/lldb scheme does not depend on that, good news is it makes it really easy to use the scheme with any gdb-remote (JTAG debugger, OVMF, hardware emulator, etc.) . 

Worst case you can add a  CpuDeadLoop(); [1] and then connect and load symbols and step over to debug. 

[1] https://github.com/tianocore/edk2/blob/master/BaseTools/Scripts/efi_gdb.py#L26

Thanks,

Andrew Fish

> On Aug 25, 2024, at 12:05 PM, Moon Fault <farahanimahsa99@gmail.com> wrote:
> 
> Dear Regina König,
> 
> I came across your post, regarding the issue with debugging OVMF using GDB where the breakpoints weren't being hit despite loading the symbols correctly. I'm currently facing the exact same problem and was wondering if you were able to find a solution.
> 
> If you managed to resolve the issue, could you please share how you did it? It would be incredibly helpful for me as I'm stuck at the same point.
> 
> Thank you so much for your time and any guidance you can offer!
> 
> Best regards,
> 
> Mahsa
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120409): https://edk2.groups.io/g/devel/message/120409
Mute This Topic: https://groups.io/mt/91279461/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 3344 bytes --]

  reply	other threads:[~2024-08-26 20:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 13:10 Debugging Ovmf with GDB: No symbol is recognized koenig_regina
2022-05-23 12:01 ` [edk2-devel] " Oliver Steffen
2024-08-25 19:05 ` Moon Fault
2024-08-26 20:48   ` Andrew Fish via groups.io [this message]
2024-08-27  8:32     ` Moon Fault
2024-08-27 15:11       ` Andrew Fish via groups.io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6B885BB8-2FB5-4E5E-B739-FAE0FB757C8E@apple.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox