From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp02.apple.com (ma1-aaemail-dr-lapp02.apple.com [17.171.2.68]) by mx.groups.io with SMTP id smtpd.web09.29793.1628808995607169622 for ; Thu, 12 Aug 2021 15:56:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=DQnhP/qp; spf=pass (domain: apple.com, ip: 17.171.2.68, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp02.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp02.apple.com (8.16.0.42/8.16.0.42) with SMTP id 17CMlaSU043339; Thu, 12 Aug 2021 15:56:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=20180706; bh=jObKkIAjBNtRv0zBeKvwt0nTfr5NS/ohAoerTDOSJaA=; b=DQnhP/qpkZS1UFhtYs2IOLi2IKIMxlRS+/heI2mAJghkRvziEGRM1GQpoSDEV5FsJfwF KfzPTWhxxT+KL4itBX7vb6PJ/mAUkhMXCj1FgQ3mh8F2KUjrSOGEcPLYXlpP9n6o/dGg 7A2gdkthEdp8vgLWYLr+IMHWqebFkyL1ezBvsf2M4T8ZWc7JEamXM/suhh8GuAZSwz+c 2tonDiArQujxV5Mg2XC1o4rOROO/ejTUdacuZNLrua9RIwhKN4Xm5yqPAhRjhgWdy5V/ Jq2lwGDxyDR8iWG6Xhh3fO534w9LEs3h6TfWz/nmyA5oN7RZzH1PZkMictMEFBFrpjLn TA== Received: from rn-mailsvcp-mta-lapp01.rno.apple.com (rn-mailsvcp-mta-lapp01.rno.apple.com [10.225.203.149]) by ma1-aaemail-dr-lapp02.apple.com with ESMTP id 3a9putnfdb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 12 Aug 2021 15:56:34 -0700 Received: from rn-mailsvcp-mmp-lapp04.rno.apple.com (rn-mailsvcp-mmp-lapp04.rno.apple.com [17.179.253.17]) by rn-mailsvcp-mta-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPS id <0QXR00I0B12ARHK0@rn-mailsvcp-mta-lapp01.rno.apple.com>; Thu, 12 Aug 2021 15:56:34 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp04.rno.apple.com by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) id <0QXR00O000Z4GG00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Thu, 12 Aug 2021 15:56:34 -0700 (PDT) X-Va-A: X-Va-T-CD: c685ff643516248aa5c8a7c38121fdf1 X-Va-E-CD: ef376605ca1d8f7041e938a896e7b117 X-Va-R-CD: 134a5ce24489a32ea40a0524e3a94233 X-Va-CD: 0 X-Va-ID: fdc6e9f4-79bb-476c-994b-3f1be76e88b3 X-V-A: X-V-T-CD: c685ff643516248aa5c8a7c38121fdf1 X-V-E-CD: ef376605ca1d8f7041e938a896e7b117 X-V-R-CD: 134a5ce24489a32ea40a0524e3a94233 X-V-CD: 0 X-V-ID: a0383306-045e-4ddf-9800-ece667514eb1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-12_06:2021-08-12,2021-08-12 signatures=0 Received: from [17.235.38.187] (unknown [17.235.38.187]) by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPSA id <0QXR008D41282Z00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Thu, 12 Aug 2021 15:56:33 -0700 (PDT) MIME-version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.1\)) Subject: Re: [edk2-devel] [PATCH 0/3] Add support for gdb and lldb From: "Andrew Fish" In-reply-to: Date: Thu, 12 Aug 2021 15:56:32 -0700 Cc: devel@edk2.groups.io Message-id: <866F84D5-4129-4578-84EF-188A25592CCC@apple.com> References: <776e36f8-df13-8b9d-7c22-948f64af65d7@nuviainc.com> <3710C965-2995-44D4-AF85-CA554C25915A@apple.com> To: Rebecca Cran X-Mailer: Apple Mail (2.3654.20.0.2.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-12_06:2021-08-12,2021-08-12 signatures=0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable Rebecca, Sorry I may have been a commit or 2 behind on the private branch.=20 > On Aug 11, 2021, at 5:30 PM, Rebecca Cran = wrote: >=20 > I should note my comments are against = https://github.com/ajfish/edk2/tree/BZ3500-gdb, not the patches you sent = out. >=20 > AARCH64 is working great! The only thing I noticed that doesn't look = quite right is the following message on startup when running gdb -ex = "target remote localhost:1234" -ex "source efi_gdb.py" -ex "efi": >=20 >=20 > Traceback (most recent call last): > File "efi_gdb.py", line 804, in invoke > self.restore_user_state() > File "efi_gdb.py", line 690, in restore_user_state > self.user_selected_frame.select() > gdb.error: Frame is invalid. > Traceback (most recent call last): > File "efi_gdb.py", line 822, in invoke > gdb.execute('efi symbols --extended') > gdb.error: Error occurred in Python: Frame is invalid. > Error occurred in Python: Error occurred in Python: Frame is invalid. >=20 >=20 Can you try again? I think I fixed this? The `efi symbols` command is = saving user context, so it can restore the context. If there is not a = valid target it can fail.=20 Also thanks for testing on AARCH64!!!! > Running `bt` shows the full set of frames except for the last one = which as expected is shown as ??. >=20 I noticed the stack unwind in the gdb builds can be a little wonky at = times, I had to add some code to filter out the cruft.=20 Thanks, Andrew Fish >=20 > --=20 >=20 > Rebecca Cran >=20 >=20 > On 8/11/21 5:22 PM, Andrew Fish wrote: >>=20 >>> On Aug 11, 2021, at 3:11 PM, Rebecca Cran = wrote: >>>=20 >>> I realized the Arm gcc 10.3 aarch64 download from = https://developer.arm.com/tools-and-software/open-source-software/develope= r-tools/gnu-toolchain/gnu-a/downloads uses Python 2.7.18 and not Python = 3, so the f-Strings and likely more cause problems. I suspect at this = point there's little point putting effort into supporting Python 2. >>>=20 >> I=E2=80=99ve not tested on ARM yet, so please let me know if it = works. I=E2=80=99d like to avoid Python 2.7 support is possible given it = is passed its best by date. >>=20 >>> I noticed a couple of issues though: in efi_debugging.py the = Attributes text is partially underlined with the non-ASCII characters = '=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94' instead of = '----------'. >>>=20 >> Thanks did not notice that. >>=20 >>> Attributes >>> =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94---- >>> _dict_ : dictionay >>>=20 >>>=20 >>> There are also a couple of typos of 'dictionary': >>>=20 >>>=20 >>> _dict_ : dictionay >>>=20 >> Shoot though I fixed those >=20 >=20 >=20 >=20 >>=20 >> Thanks, >>=20 >> Andrew Fish >>=20 >>> --=20 >>> Rebecca Cran >>>=20 >>>=20 >>> On 8/8/21 3:46 PM, Andrew Fish via groups.io wrote: >>>> This patch set adds debugging support for gdb and lldb. >>>> It also adds generic debugging classes that use a file like object = to >>>> make it easy to import into any debugger that supports Python. >>>>=20 >>>> Since these debugging scripts don't depend on any EFI code I was = thinking >>>> we could place them in the root of the repo to be easy to discover. >>>>=20 >>>> I've tested gdb on Ubuntu and lldb on macOS for IA32 and X64. >>>>=20 >>>> Andrew Fish (3): >>>> efi_debugging.py: - Add debugger agnostic debugging Python = Classes >>>> efi_gdb.py: - Add gdb EFI commands and pretty Print >>>> efi_lldb.py: - Add lldb EFI commands and pretty Print >>>>=20 >>>> efi_debugging.py | 2187 = ++++++++++++++++++++++++++++++++++++++++++++++ >>>> efi_gdb.py | 918 +++++++++++++++++++ >>>> efi_lldb.py | 1044 ++++++++++++++++++++++ >>>> 3 files changed, 4149 insertions(+) >>>> create mode 100755 efi_debugging.py >>>> create mode 100755 efi_gdb.py >>>> create mode 100755 efi_lldb.py >>>>=20