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 9078EAC19F2 for ; Mon, 26 Aug 2024 20:48:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=q/DYo76Hg5DUHmsTjyb0Tx2CSUQ5HjaIUFt32VsWAuQ=; c=relaxed/simple; d=groups.io; h=From:Message-id:MIME-version:Subject:Date:In-reply-to:Cc:To:References: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=1724705326; v=1; b=CWnUjRIQjV4MnS+xvBGGyYfa5tYDYB6wvB+1q3xsdzw7DFcX30glYwDW4RGz33vNOXm6DBBw mo7uItUSvT3qOw9T1z70vrmL0W2YKsebO18ezILdNBnK7PKVwb3zktwbJlNax4S+7priLy4hLI6 7Vf1O8ibzmLeneaY3DS1uUcTfZmIex86wOaxQigiXfxNF4fMfeCVY3FPZTEHSUmaKuu7OdXVAOF W7H9s62pu2WgVLqUPZLAHw4QV21oN/wrSu6bgLUvwNhs74hFCL7zXdGAPE+PoCrkJsnbQdp01Qr 4kmPOIGnsO/HnszF/+wMyjhWIdLcqyP2kpbRL9Rjs8zDQ== X-Received: by 127.0.0.2 with SMTP id JSysYY7687511xmzH6lPHvV3; Mon, 26 Aug 2024 13:48:44 -0700 X-Received: from ma-mailsvcp-mx-lapp01.apple.com (ma-mailsvcp-mx-lapp01.apple.com [17.32.222.22]) by mx.groups.io with SMTP id smtpd.web10.63510.1724705324085663969 for ; Mon, 26 Aug 2024 13:48:44 -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-lapp01.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0SIU00PV7F559F20@ma-mailsvcp-mx-lapp01.apple.com> for devel@edk2.groups.io; Mon, 26 Aug 2024 13:48:43 -0700 (PDT) X-Received: from mr55p01nt-mmpp08.apple.com (mr55p01nt-mmpp08.apple.com [10.170.185.194]) 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 <0SIU00CJCF5689H0@rn-mailsvcp-mta-lapp02.rno.apple.com>; Mon, 26 Aug 2024 13:48:42 -0700 (PDT) X-Received: from process_milters-daemon.mr55p01nt-mmpp08.apple.com by mr55p01nt-mmpp08.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0SIU2AF00F476L00@mr55p01nt-mmpp08.apple.com>; Mon, 26 Aug 2024 20:48:42 +0000 (GMT) X-Va-A: X-Va-T-CD: 0be1477bd64211c8051d01e7549551c3 X-Va-E-CD: fc7103b3d5e1dd80dedffec5a393a44f X-Va-R-CD: b3592fea5bc9af105c3cf225c817239d X-Va-ID: 5e5b04ad-2398-49d9-b6fd-a0344cf74909 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: 65279612-7717-4c1a-a72d-1df4817506a3 X-V-CD: 0 X-Received: from smtpclient.apple (unknown [17.11.157.170]) by mr55p01nt-mmpp08.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0SIU29NACF55EG00@mr55p01nt-mmpp08.apple.com>; Mon, 26 Aug 2024 20:48:42 +0000 (GMT) From: "Andrew Fish via groups.io" Message-id: <6B885BB8-2FB5-4E5E-B739-FAE0FB757C8E@apple.com> 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: Mon, 26 Aug 2024 13:48:31 -0700 In-reply-to: <15414.1724612740322417598@groups.io> Cc: koenig_regina@arcor.de To: edk2-devel-groups-io , farahanimahsa99@gmail.com References: <15414.1724612740322417598@groups.io> 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: Mon, 26 Aug 2024 13:48:44 -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: u0tlAFFZaKyykatnPQk85zSIx7686176AA= Content-type: multipart/alternative; boundary="Apple-Mail=_2C3B12D1-3016-48A5-8C07-A8DE16D8DC53" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=CWnUjRIQ; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --Apple-Mail=_2C3B12D1-3016-48A5-8C07-A8DE16D8DC53 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I contributed the efi_gdb.py scripts. The gdb scripts figure out the symbol= s 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 load= ed when you connect. It might be possible to connect prior to the driver/ap= p being loaded so the symbols will not exist.=20 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 requir= e some mechanism for symbols to load. In the emulator and the other EFI deb= ugger symbols get loaded as modules get loaded. These scripts don=E2=80=99t= 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 g= ets 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 s= cheme with any gdb-remote (JTAG debugger, OVMF, hardware emulator, etc.) .= =20 Worst case you can add a CpuDeadLoop(); [1] and then connect and load symb= ols and step over to debug.=20 [1] https://github.com/tianocore/edk2/blob/master/BaseTools/Scripts/efi_gdb= .py#L26 Thanks, Andrew Fish > On Aug 25, 2024, at 12:05=E2=80=AFPM, Moon Fault wrote: >=20 > Dear Regina K=C3=B6nig, >=20 > I came across your post, regarding the issue with debugging OVMF using GD= B where the breakpoints weren't being hit despite loading the symbols corre= ctly. I'm currently facing the exact same problem and was wondering if you = were able to find a solution. >=20 > If you managed to resolve the issue, could you please share how you did i= t? It would be incredibly helpful for me as I'm stuck at the same point. >=20 > Thank you so much for your time and any guidance you can offer! >=20 > Best regards, >=20 > 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 (#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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --Apple-Mail=_2C3B12D1-3016-48A5-8C07-A8DE16D8DC53 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I contributed the efi_gdb.py scri= pts. The gdb scripts figure out the symbols that exist when you connect. Th= ey scripts can walk the current frame, or if you are in DXE they can usuall= y figure out the table of all the symbols that got loaded up until this poi= nt. 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 wil= l not exist. 

I use lldb, not gdb, so I might be bo= tching the gdb details but you can set a pending breakpoint waiting on symb= ols 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 g= et loaded. These scripts don=E2=80=99t do that, they just load symbols when= you connect, or run the `efi symbols` command. They basically have some ki= nd 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 i= s it makes it really easy to use the scheme with any gdb-remote (JTAG debug= ger, 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/Script= s/efi_gdb.py#L26

Thanks,

Andrew Fish

On Aug 25, 2024, at 12:05=E2=80=AFPM, Moon Fault <far= ahanimahsa99@gmail.com> wrote:

Dear Regina K=C3=B6nig,

I came acro= ss your post, regarding the issue with debugging OVMF using GDB where the b= reakpoints weren't being hit despite loading the symbols correctly. I'm cur= rently 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 pleas= e 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 y= ou can offer!

Best regards,

Mahsa


_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--Apple-Mail=_2C3B12D1-3016-48A5-8C07-A8DE16D8DC53--