From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3FDADD80808 for ; Tue, 27 Aug 2024 15:12:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UOTumB58Nn+Lk5O8bO6CTObwxqANaiMoMcVqTMkQtfg=; c=relaxed/simple; d=groups.io; h=From:MIME-version:Subject:Date:References:To:In-reply-to:Message-id:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-type; s=20240206; t=1724771535; v=1; b=DdwsaNe7J4QFzVWhvvsd45Yb0pcYRmCK91q71mE+isUrKTP7otImfEtPFdN+xrzgGeffWxD/ mpA3oaK4RS5qZH+QNkDzh1TIm1GhV1Z/FkSHZSqK9izhrjSxVmy5DfsWJw8mxslLPkN6TLmVJe/ aI2xe71ZQI1LvCIz771sJWxoCcAOb2Oy6KhOT88XkIdPM5LVAoxLWXd+QRQ5ef4ZpdWvbiLav73 9g7sv/j3gYx+p+B+QMeAYW2k8xF527qBEQCELc331DR/Xjbpgt2x9TAfBQkrcRb6QgpGOo7FBGe +Kt0/NLad36NWORkwudgacUJe5NF5VpO3HLXuCY4coPIA== X-Received: by 127.0.0.2 with SMTP id rAY3YY7687511xQY5BFOO0uU; Tue, 27 Aug 2024 08:12:13 -0700 X-Received: from ma-mailsvcp-mx-lapp02.apple.com (ma-mailsvcp-mx-lapp02.apple.com [17.32.222.23]) by mx.groups.io with SMTP id smtpd.web10.80926.1724771533037502090 for ; Tue, 27 Aug 2024 08:12:13 -0700 X-Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma-mailsvcp-mx-lapp02.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0SIV00HKKU8A4220@ma-mailsvcp-mx-lapp02.apple.com> for devel@edk2.groups.io; Tue, 27 Aug 2024 08:12:12 -0700 (PDT) X-Received: from mr55p01nt-mmpp04.apple.com (mr55p01nt-mmpp04.apple.com [10.170.185.204]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0SIV0052ZU8A7050@rn-mailsvcp-mta-lapp02.rno.apple.com>; Tue, 27 Aug 2024 08:12:10 -0700 (PDT) X-Received: from process_milters-daemon.mr55p01nt-mmpp04.apple.com by mr55p01nt-mmpp04.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0SIV24000TO3PG00@mr55p01nt-mmpp04.apple.com>; Tue, 27 Aug 2024 15:12:10 +0000 (GMT) X-Va-A: X-Va-T-CD: 0be1477bd64211c8051d01e7549551c3 X-Va-E-CD: fc7103b3d5e1dd80dedffec5a393a44f X-Va-R-CD: b3592fea5bc9af105c3cf225c817239d X-Va-ID: 1cdfe871-c735-4dea-8c85-631fc75673fb X-Va-CD: 0 X-V-A: X-V-T-CD: 0be1477bd64211c8051d01e7549551c3 X-V-E-CD: fc7103b3d5e1dd80dedffec5a393a44f X-V-R-CD: b3592fea5bc9af105c3cf225c817239d X-V-ID: e1ad7b83-559c-4c33-956a-249f4e0769f8 X-V-CD: 0 X-Received: from smtpclient.apple (unknown [17.11.157.170]) by mr55p01nt-mmpp04.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0SIV24U1OU89NL00@mr55p01nt-mmpp04.apple.com>; Tue, 27 Aug 2024 15:12:09 +0000 (GMT) From: "Andrew Fish via groups.io" MIME-version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: [edk2-devel] Debugging Ovmf with GDB: No symbol is recognized Date: Tue, 27 Aug 2024 08:11:58 -0700 References: <6B885BB8-2FB5-4E5E-B739-FAE0FB757C8E@apple.com> <15414.1724747540758980851@groups.io> To: edk2-devel-groups-io , farahanimahsa99@gmail.com In-reply-to: <15414.1724747540758980851@groups.io> Message-id: <3746B689-11E8-4020-8936-94DB22BB94AF@apple.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 27 Aug 2024 08:12:13 -0700 Resent-From: afish@apple.com Reply-To: devel@edk2.groups.io,afish@apple.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: YAzVzNOimqEDL6rsjeDB4fEvx7686176AA= Content-type: multipart/alternative; boundary="Apple-Mail=_344CD948-2321-4DFE-BF5A-1B8138281AF4" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=DdwsaNe7; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io --Apple-Mail=_344CD948-2321-4DFE-BF5A-1B8138281AF4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 27, 2024, at 1:32=E2=80=AFAM, Moon Fault wrote: >=20 > Dear Andrew, >=20 > Thank you for your detailed explanation regarding the behavior of symbol = loading in GDB when debugging OVMF. >=20 > I just want to make sure I=E2=80=99ve understood your points correctly: >=20 > Symbol Loading Timing: The issue I=E2=80=99m facing might occur because I= =E2=80=99m connecting to GDB before all the necessary drivers or applicatio= ns have been loaded. As a result, the symbols for these modules aren=E2=80= =99t available at the time of connection, leading to breakpoints not being = hit. >=20 > Pending Breakpoints: You mentioned that it=E2=80=99s possible to set pend= ing breakpoints in GDB, which will activate once the relevant symbols are l= oaded. However, this still requires some mechanism to ensure that the symbo= ls are eventually loaded as the modules initialize. >=20 > Using CpuDeadLoop(): If I insert a CpuDeadLoop(); after the modules are l= oaded, I can connect GDB, ensure the symbols are loaded, and then step over= the loop to continue debugging from that point. >=20 > Could you confirm if I=E2=80=99ve captured this correctly? Also, is using= CpuDeadLoop(); the best approach to guarantee that all symbols are loaded = before continuing the debugging process? >=20 Masha, Obviously I=E2=80=99m guessing a little bit about your specific case but yo= u did a good job summarizing my points. In general during a UEFI boot the D= XE Core will =E2=80=9Cdispatch=E2=80=9D drivers in an order based on when t= hey are needed. These drivers are loaded and relocated into malloc=E2=80=99= ed memory, so until they are loaded you can=E2=80=99t really load symbols f= or them.=20 If you get to the UEFI Shell things are generally loaded so you can also ju= st try trigging things from there, but obviously you need to attach 1st.=20 Thanks, Andrew Fish > Thank you again for your insights! >=20 > Best regards, > Mahsa >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --Apple-Mail=_344CD948-2321-4DFE-BF5A-1B8138281AF4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Aug 27, 2024, at 1:32=E2= =80=AFAM, Moon Fault <farahanimahsa99@gmail.com> wrote:

Dear Andrew,

Thank you f= or your detailed explanation regarding the behavior of symbol loading in GD= B when debugging OVMF.

I just want to make sure I=E2=80=99ve understo= od your points correctly:

  1. Symbol Loading Timing: The issue I=E2=80=99m facing= might occur because I=E2=80=99m connecting to GDB before all the necessary= drivers or applications have been loaded. As a result, the symbols for the= se modules aren=E2=80=99t available at the time of connection, leading to b= reakpoints not being hit.

  2. Pending Breakpoints: You mentioned that it=E2=80=99= 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.

  3. Using CpuDeadLoop(): If I insert a CpuDeadLoo= p(); after the modules are loaded, I can connect GDB, ensure the sym= bols are loaded, and then step over the loop to continue debugging from tha= t point.

Could you confirm if I=E2=80=99ve 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=E2=80=99m gue= ssing a little bit about your specific case but you did a good job summariz= ing my points. In general during a UEFI boot the DXE Core will =E2=80=9Cdis= patch=E2=80=9D drivers in an order based on when they are needed. These dri= vers are loaded and relocated into malloc=E2=80=99ed memory, so until they = are loaded you can=E2=80=99t 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 f= or your insights!

Best regards,
Mahsa


_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#120416) | =20 | Mute = This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--Apple-Mail=_344CD948-2321-4DFE-BF5A-1B8138281AF4--