From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp01.apple.com (ma1-aaemail-dr-lapp01.apple.com [17.171.2.60]) by mx.groups.io with SMTP id smtpd.web11.475.1626845137263229768 for ; Tue, 20 Jul 2021 22:25:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=FOgTFgB1; spf=pass (domain: apple.com, ip: 17.171.2.60, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp01.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp01.apple.com (8.16.0.42/8.16.0.42) with SMTP id 16L5J1FU028417; Tue, 20 Jul 2021 22:25:19 -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=sEfdHDYBtNQVMkH4VEw94hXLgR3zMKy0vq2h5NXiK9k=; b=FOgTFgB1FlO5H1boVuHSS/YsuqvU2pCpgWY1Xj9mVnUoQ9DMbBXwT7E0g0v4VzYfrrGn DQsy6QvDeygIBHBzrC5OD0B3SAm0laz09EDs/3XHAzBrVnKQhJ+yYPOdN0qyPjrm/89A MEIsWlIU+cCFvvLUsj4619pzidjwh62t0rO1vbbYRPjnsW6qZz5A8Nd8/rQKf/StZ3tW SDg6lPhvdD8JKd6JYgtKsShSukCTD9gxJr1s/mfORfA6cnEnoIyCl1zOzL9gqREo+aB5 itTTjjYRp6p1O5yAtjyKidkmJPK9T7HS8jZZ9OIqw0NSqVRpay95Fkwz5VIoHFHp7d6z /A== Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma1-aaemail-dr-lapp01.apple.com with ESMTP id 39uwv32axk-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 20 Jul 2021 22:25:19 -0700 Received: from rn-mailsvcp-mmp-lapp03.rno.apple.com (rn-mailsvcp-mmp-lapp03.rno.apple.com [17.179.253.16]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPS id <0QWK00ZL9XQ6FZ20@rn-mailsvcp-mta-lapp02.rno.apple.com>; Tue, 20 Jul 2021 22:25:18 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp03.rno.apple.com by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) id <0QWK00K00XLR8I00@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Tue, 20 Jul 2021 22:25:18 -0700 (PDT) X-Va-A: X-Va-T-CD: fbf76c96845af0e32e156b5cd91de891 X-Va-E-CD: ee6a8837798356858710986d33d9f9a0 X-Va-R-CD: 88c296be712c2879ccaa9ffe2ae4537b X-Va-CD: 0 X-Va-ID: 2af22168-1461-4801-8f9a-af89b3ed2a10 X-V-A: X-V-T-CD: fbf76c96845af0e32e156b5cd91de891 X-V-E-CD: ee6a8837798356858710986d33d9f9a0 X-V-R-CD: 88c296be712c2879ccaa9ffe2ae4537b X-V-CD: 0 X-V-ID: b0b3d2e6-f63f-42f6-a44a-8bebf08348d4 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-21_02:2021-07-21,2021-07-21 signatures=0 Received: from [17.235.13.119] (unknown [17.235.13.119]) by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPSA id <0QWK00C8NXQ59R00@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Tue, 20 Jul 2021 22:25:18 -0700 (PDT) MIME-version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.1\)) Subject: Re: [edk2-devel] [PATCH] EmulatorPkg: Update lldbefi.py to work with current lldb which uses python3 From: "Andrew Fish" In-reply-to: <20210509192647.14478-1-rebecca@bsdio.com> Date: Tue, 20 Jul 2021 22:25:16 -0700 Cc: Ray Ni Message-id: <37EF0F13-4C27-4D4F-93D1-FEF6CB0DF8C2@apple.com> References: <20210509192647.14478-1-rebecca@bsdio.com> To: edk2-devel-groups-io , 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-07-21_02:2021-07-21,2021-07-21 signatures=0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Reviewed-by: Andrew Fish > On May 9, 2021, at 12:26 PM, Rebecca Cran wrote: >=20 > The version of lldb shipping with macOS Big Sur is lldb-1205.0.27.3, and > it uses python3. Update lldbefi.py to work with it, including removing > the unused 'commands' import and fixing the print statements. >=20 > Signed-off-by: Rebecca Cran > --- > EmulatorPkg/Unix/lldbefi.py | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) >=20 > diff --git a/EmulatorPkg/Unix/lldbefi.py b/EmulatorPkg/Unix/lldbefi.py > index c3fb2675cb..952f8bf982 100755 > --- a/EmulatorPkg/Unix/lldbefi.py > +++ b/EmulatorPkg/Unix/lldbefi.py > @@ -10,7 +10,6 @@ import lldb > import os > import uuid > import string > -import commands > import optparse > import shlex >=20 > @@ -389,7 +388,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_= dict): >=20 > FileName =3D frame.thread.process.ReadCStringFromMemory (FileNamePtr= , FileNameLen, Error) > if not Error.Success(): > - print "!ReadCStringFromMemory() did not find a %d byte C string= at %x" % (FileNameLen, FileNamePtr) > + print("!ReadCStringFromMemory() did not find a %d byte C string= at %x" % (FileNameLen, FileNamePtr)) > # make breakpoint command continue > return False >=20 > @@ -398,7 +397,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_= dict): > LoadAddress =3D frame.FindVariable ("LoadAddress").GetValueAsUns= igned() - 0x240 >=20 > debugger.HandleCommand ("target modules add %s" % FileName) > - print "target modules load --slid 0x%x %s" % (LoadAddress, File= Name) > + print("target modules load --slid 0x%x %s" % (LoadAddress, File= Name)) > debugger.HandleCommand ("target modules load --slide 0x%x --file= %s" % (LoadAddress, FileName)) > else: > target =3D debugger.GetSelectedTarget() > @@ -408,7 +407,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_= dict): > if FileName =3D=3D ModuleName or FileName =3D=3D SBModule.Ge= tFileSpec().GetFilename(): > target.ClearModuleLoadAddress (SBModule) > if not target.RemoveModule (SBModule): > - print "!lldb.target.RemoveModule (%s) FAILED" % SBM= odule > + print("!lldb.target.RemoveModule (%s) FAILED" % SBM= odule) >=20 > # make breakpoint command continue > return False > @@ -490,15 +489,15 @@ def efi_guid_command(debugger, command, result, di= ct): >=20 > if len(args) >=3D 1: > if GuidStr in guid_dict: > - print "%s =3D %s" % (guid_dict[GuidStr], GuidStr) > - print "%s =3D %s" % (guid_dict[GuidStr], GuidToCStructStr (= GuidStr)) > + print("%s =3D %s" % (guid_dict[GuidStr], GuidStr)) > + print("%s =3D %s" % (guid_dict[GuidStr], GuidToCStructStr (= GuidStr))) > else: > - print GuidStr > + print(GuidStr) > else: > # dump entire dictionary > width =3D max(len(v) for k,v in guid_dict.iteritems()) > for value in sorted(guid_dict, key=3Dguid_dict.get): > - print '%-*s %s %s' % (width, guid_dict[value], value, GuidT= oCStructStr(value)) > + print('%-*s %s %s' % (width, guid_dict[value], value, GuidT= oCStructStr(value))) >=20 > return >=20 > @@ -538,4 +537,4 @@ def __lldb_init_module (debugger, internal_dict): > if Breakpoint.GetNumLocations() =3D=3D 1: > # Set the emulator breakpoints, if we are in the emulator > debugger.HandleCommand("breakpoint command add -s python -F = lldbefi.LoadEmulatorEfiSymbols {id}".format(id=3DBreakpoint.GetID())) > - print 'Type r to run emulator. SecLldbScriptBreak armed. EF= I modules should now get source level debugging in the emulator.' > + print('Type r to run emulator. SecLldbScriptBreak armed. EF= I modules should now get source level debugging in the emulator.') > --=20 > 2.30.1 (Apple Git-130) >=20 >=20 >=20 >=20 >=20 >=20 >=20