From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: jordan.l.justen@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Fri, 16 Aug 2019 00:40:58 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Aug 2019 00:40:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="182110813" Received: from adnanrez-mobl.amr.corp.intel.com (HELO localhost) ([10.255.228.102]) by orsmga006.jf.intel.com with ESMTP; 16 Aug 2019 00:40:57 -0700 MIME-Version: 1.0 In-Reply-To: <20190816021437.7516-7-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@intel.com> <20190816021437.7516-7-michael.d.kinney@intel.com> Cc: Ray Ni , Andrew Fish To: Michael D Kinney , devel@edk2.groups.io From: "Jordan Justen" Subject: Re: [Patch V4 06/10] EmulatorPkg: Fix XCODE5 lldb issues Message-ID: <156594125657.32637.16775516269528755196@jljusten-skl> User-Agent: alot/0.8 Date: Fri, 16 Aug 2019 00:40:56 -0700 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2019-08-15 19:14:33, Michael D Kinney wrote: > Fix scripts to support lldb symbolic debugging when > using XCODE5 tool chain. >=20 > Cc: Jordan Justen > Cc: Ray Ni > Cc: Michael D Kinney > Signed-off-by: Andrew Fish Is this a Cc/Signed-off-by typo? (See also, patches 7-10). This makes me wonder if you are taking advantage of the git commit -s switch to add your Signed-off-by. Also, I'm wondering if you are taking advantage of git-send-email automatically Cc'ing the addresses you listed in the commit message. (I thought it Cc'd for the author and Cc tags, but I wasn't sure about the Signed-off-by tag, and yet I see Andrew was Cc'd.) There's a couple long lines below. You could use \ at the end of the line to split the .sh line. I think the cd can be a separate command in a shell script. (Not in make) I hope someone that uses the XCODE toolchain could review/check the XCODE patches. -Jordan > --- > EmulatorPkg/Unix/lldbefi.py | 8 +++++--- > EmulatorPkg/build.sh | 17 ++--------------- > 2 files changed, 7 insertions(+), 18 deletions(-) >=20 > diff --git a/EmulatorPkg/Unix/lldbefi.py b/EmulatorPkg/Unix/lldbefi.py > index 218326b8cb..099192d8b5 100755 > --- a/EmulatorPkg/Unix/lldbefi.py > +++ b/EmulatorPkg/Unix/lldbefi.py > @@ -346,6 +346,7 @@ def TypePrintFormating(debugger): > debugger.HandleCommand("type summary add CHAR8 --python-function lld= befi.CHAR8_TypeSummary") > debugger.HandleCommand('type summary add --regex "CHAR8 \[[0-9]+\]" = --python-function lldbefi.CHAR8_TypeSummary') > =20 > + debugger.HandleCommand('setting set frame-format "frame #${frame.ind= ex}: ${frame.pc}{ ${module.file.basename}{:${function.name}()${function.pc-= offset}}}{ at ${line.file.fullpath}:${line.number}}\n"') > =20 > gEmulatorBreakWorkaroundNeeded =3D True > =20 > @@ -381,15 +382,16 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal= _dict): > Error =3D lldb.SBError() > FileNamePtr =3D frame.FindVariable ("FileName").GetValueAsUnsigned() > FileNameLen =3D frame.FindVariable ("FileNameLength").GetValueAsUnsi= gned() > + > 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) > # make breakpoint command contiue > - frame.GetThread().GetProcess().Continue() > + return False > =20 > debugger =3D frame.thread.process.target.debugger > if frame.FindVariable ("AddSymbolFlag").GetValueAsUnsigned() =3D=3D = 1: > - LoadAddress =3D frame.FindVariable ("LoadAddress").GetValueAsUns= igned() > + 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, FileN= ame) > @@ -405,7 +407,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_d= ict): > print "!lldb.target.RemoveModule (%s) FAILED" % SBMo= dule > =20 > # make breakpoint command contiue > - frame.thread.process.Continue() > + return False > =20 > def GuidToCStructStr (guid, Name=3DFalse): > # > diff --git a/EmulatorPkg/build.sh b/EmulatorPkg/build.sh > index 60056e1b6c..35912a7775 100755 > --- a/EmulatorPkg/build.sh > +++ b/EmulatorPkg/build.sh > @@ -209,21 +209,8 @@ fi > if [[ "$RUN_EMULATOR" =3D=3D "yes" ]]; then > case `uname` in > Darwin*) > - # > - # On Darwin we can't use dlopen, so we have to load the real PE/CO= FF images. > - # This .gdbinit script sets a breakpoint that loads symbols for th= e PE/COFFEE > - # images that get loaded in Host > - # > - if [[ "$CLANG_VER" =3D=3D *-ccc-host-triple* ]] > - then > - # only older versions of Xcode support -ccc-host-tripe, for newer = versions > - # it is -target > - cp $WORKSPACE/EmulatorPkg/Unix/lldbefi.py "$BUILD_OUTPUT_DIR/${B= UILDTARGET}_$TARGET_TOOLS/$PROCESSOR" > - cd $BUILD_ROOT_ARCH; /usr/bin/lldb --source $WORKSPACE/EmulatorP= kg/Unix/lldbinit Host > - exit $?=20 > - else > - cp $WORKSPACE/EmulatorPkg/Unix/.gdbinit "$BUILD_OUTPUT_DIR/${BUI= LDTARGET}_$TARGET_TOOLS/$PROCESSOR" > - fi > + cd $BUILD_ROOT_ARCH; /usr/bin/lldb -o "command script import $WORK= SPACE/EmulatorPkg/Unix/lldbefi.py" -o 'script lldb.debugger.SetAsync(True)'= -o "run" ./Host > + exit $? > ;; > esac > =20 > --=20 > 2.21.0.windows.1 >=20