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
Subject: Re: [edk2-devel] Debugging Ovmf with GDB: No symbol is recognized
Date: Tue, 27 Aug 2024 08:11:58 -0700	[thread overview]
Message-ID: <3746B689-11E8-4020-8936-94DB22BB94AF@apple.com> (raw)
In-Reply-To: <15414.1724747540758980851@groups.io>

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



> On Aug 27, 2024, at 1:32 AM, Moon Fault <farahanimahsa99@gmail.com> wrote:
> 
> Dear Andrew,
> 
> Thank you for your detailed explanation regarding the behavior of symbol loading in GDB when debugging OVMF.
> 
> I just want to make sure I’ve understood your points correctly:
> 
> Symbol Loading Timing: The issue I’m facing might occur because I’m connecting to GDB before all the necessary drivers or applications have been loaded. As a result, the symbols for these modules aren’t available at the time of connection, leading to breakpoints not being hit.
> 
> Pending Breakpoints: You mentioned that it’s possible to set pending breakpoints in GDB, which will activate once the relevant symbols are loaded. However, this still requires some mechanism to ensure that the symbols are eventually loaded as the modules initialize.
> 
> Using CpuDeadLoop(): If I insert a CpuDeadLoop(); after the modules are loaded, I can connect GDB, ensure the symbols are loaded, and then step over the loop to continue debugging from that point.
> 
> Could you confirm if I’ve captured this correctly? Also, is using CpuDeadLoop(); the best approach to guarantee that all symbols are loaded before continuing the debugging process?
> 
Masha,

Obviously I’m guessing a little bit about your specific case but you did a good job summarizing my points. In general during a UEFI boot the DXE Core will “dispatch” drivers in an order based on when they are needed. These drivers are loaded and relocated into malloc’ed memory, so until they are loaded you can’t really load symbols for them. 

If you get to the UEFI Shell things are generally loaded so you can also just try trigging things from there, but obviously you need to attach 1st. 

Thanks,

Andrew Fish
> Thank you again for your insights!
> 
> Best regards,
> Mahsa
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120416): https://edk2.groups.io/g/devel/message/120416
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: 3309 bytes --]

      reply	other threads:[~2024-08-27 15:12 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
2024-08-27  8:32     ` Moon Fault
2024-08-27 15:11       ` Andrew Fish via groups.io [this message]

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=3746B689-11E8-4020-8936-94DB22BB94AF@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