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.web12.44308.1590462734086964208 for ; Mon, 25 May 2020 20:12:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=H/on9qNw; 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 04Q2wNdl024701; Mon, 25 May 2020 20:11:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : content-type : content-transfer-encoding : mime-version : subject : date : references : to : in-reply-to : message-id; s=20180706; bh=87zVQlYHFuaMLlZn4X+GmIYWWOFuIcTx1Mv/8twEzLg=; b=H/on9qNw8hNhMfBvzTvFo5WOMzkbxKTZV8BVw18ui/qgbOsdXZOovkM712Rp4SG/ZtgZ XlfR6bXkFniloQYF5MZykjgjR+QMk3vzyn8lRzxtjuqSawP/hEgzfAa0wIGFGeYgFu9L oXA0cARgYXA1AgvYNtm8zJNRFDgeHny6QgrTLv358D4LYv7MZ45q4VZ+FMPa0wB8DAob +bTlnll8Px6TsDUB9RHEbatCb78m88XbTttR1yxKnwNp2lefWdfpLOmN/5VyvvfV5AII qIZGRAh18IPij1Sui55ww1Yfc9/jnUN3pHKR5sUtVLjDNxIQ9wejMJvN37whZiiDC2xU 6w== Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma1-aaemail-dr-lapp02.apple.com with ESMTP id 3170gs9c9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 25 May 2020 20:11:55 -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-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPS id <0QAX00FO54VUDLA0@rn-mailsvcp-mta-lapp02.rno.apple.com>; Mon, 25 May 2020 20:11:55 -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.5.20200312 64bit (built Mar 12 2020)) id <0QAX00S004NZUP00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Mon, 25 May 2020 20:11:54 -0700 (PDT) X-Va-A: X-Va-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-Va-E-CD: 1417899239537e9f91fa9996c1a966a6 X-Va-R-CD: ebc91e5e1054c40f976e0b4d4d1c6b1d X-Va-CD: 0 X-Va-ID: bf7accb9-b06d-4a18-b86f-4f6cbace8fc8 X-V-A: X-V-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-V-E-CD: 1417899239537e9f91fa9996c1a966a6 X-V-R-CD: ebc91e5e1054c40f976e0b4d4d1c6b1d X-V-CD: 0 X-V-ID: b87b4610-70c4-4550-9cab-4e6ed252e02e X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-05-25_10:2020-05-25,2020-05-25 signatures=0 Received: from [17.235.11.87] (unknown [17.235.11.87]) by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPSA id <0QAX00GHK4VS0G00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Mon, 25 May 2020 20:11:53 -0700 (PDT) From: "Andrew Fish" MIME-version: 1.0 (Mac OS X Mail 13.0 \(3594.4.17\)) Subject: Re: [edk2-devel] OVMF gdb seems to require "stone knives and bearskins" to debug code? Date: Mon, 25 May 2020 20:11:52 -0700 References: <50EEBF6E-8BB1-461D-B252-D37D2990957D@apple.com> <5ea5709b-aa92-84e5-463d-df4801635cd8@bsdio.com> To: devel@edk2.groups.io, rebecca@bsdio.com In-reply-to: <5ea5709b-aa92-84e5-463d-df4801635cd8@bsdio.com> Message-id: <492083F4-6955-4A32-BF56-FC5E3F04A8F0@apple.com> X-Mailer: Apple Mail (2.3594.4.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-05-25_10:2020-05-25,2020-05-25 signatures=0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable > On May 25, 2020, at 7:19 PM, Rebecca Cran wrote: >=20 > On 5/24/20 9:30 PM, Andrew Fish via groups.io wrote: >=20 >> I could open source an lldb symbolication Python script and I'm happy t= o explain the common logic to some one to make it easier to port this lldb= command [3] to gdb. The command can load symbols for any address that is l= ocated in a loaded PE/COFF image, and when you import the command into lldb= it symbolicates the current frame. >=20 >=20 > As Laszlo has already explained, information about debugging with gdb is= a bit scattered. I seem to recall there were discussion about getting the = DebugPkg into edk2, but there was disagreement about it. >=20 > However, since I work on platforms which have lldb in base (FreeBSD) or = are easily available (Linux), I'd certainly be interested if you were to op= en source the efi_symolicate.py script and I could learn how to use lldb. >=20 Rebecca, Thanks for the feedback, and the help over the years. When I get my other= Xcode commits upstreamed I can commit the lldb script if we can agree as = a community the location of that new content. I've already refactored the l= ldb script to use a class to abstract lldb specifics, so that should make i= t much easier to port to gdb.=20 FYI the magic to get lldb working with QEMU is: $ curl -O https://raw.githubusercontent.com/llvm-mirror/lldb/master/exampl= es/python/x86_64_target_definition.py $ lldb -o "settings set plugin.process.gdb-remote.target-definition-file x= 86_64_target_definition.py" -o "gdb-remote 1234" -o "command script impor= t efi_symbolicate.py" The issue is the lldb gdb-remote does not fall back to a primitive serial = protocol so we need to point it at x86_64_target_definition.py to know how= to connect. This also gets rid of he need to point at an executable. If yo= u remove importing my script that will give you assembly level debugging wi= th QEMU. But source is more interesting, unless you are really stuck.=20 This is a good place to start to learn lldb: http://lldb.llvm.org/use/map.= html Thanks, Andrew Fish >=20 > --=20 > Rebecca Cran >=20 >=20 >=20 >=20 >=20