From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=15.233.44.27; helo=g2t2354.austin.hpe.com; envelope-from=thomas.palmer@hpe.com; receiver=edk2-devel@lists.01.org Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 15A592279CEF7 for ; Fri, 20 Apr 2018 09:45:50 -0700 (PDT) Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2354.austin.hpe.com (Postfix) with ESMTPS id A579BAC; Fri, 20 Apr 2018 16:45:49 +0000 (UTC) Received: from G4W10205.americas.hpqcorp.net (16.207.82.15) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 20 Apr 2018 16:45:41 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (15.241.52.12) by G4W10205.americas.hpqcorp.net (16.207.82.15) with Microsoft SMTP Server (TLS) id 15.0.1178.4 via Frontend Transport; Fri, 20 Apr 2018 16:45:41 +0000 Received: from TU4PR8401MB1086.NAMPRD84.PROD.OUTLOOK.COM (10.169.48.9) by TU4PR8401MB0941.NAMPRD84.PROD.OUTLOOK.COM (10.169.46.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Fri, 20 Apr 2018 16:45:39 +0000 Received: from TU4PR8401MB1086.NAMPRD84.PROD.OUTLOOK.COM ([fe80::7470:4972:d50d:a920]) by TU4PR8401MB1086.NAMPRD84.PROD.OUTLOOK.COM ([fe80::7470:4972:d50d:a920%16]) with mapi id 15.20.0696.013; Fri, 20 Apr 2018 16:45:39 +0000 From: "Palmer, Thomas" To: Johannes Swoboda , Laszlo Ersek CC: Rebecca Cran , Michael Kinney , "edk2-devel@lists.01.org" , "clemens.hlauschek@inso.tuwien.ac.at" Thread-Topic: gdb reload-uefi missing EFI_SYSTEM_TABLE_POINTER [was: Source code debugging of OVMF] Thread-Index: AQHT2Lpa0Azk9JjiAEyHYx0Df8Hn7aQJxLYAgAAKkxCAAAtUgIAAALIA Date: Fri, 20 Apr 2018 16:45:39 +0000 Message-ID: References: <12fe2332-c864-60e1-4f12-280e9939449f@redhat.com> <81abcc10-1c8c-1012-7c08-b9cd24efa85a@bluestop.org> <020ac090-c1e9-0c73-a484-e785c1b7e423@redhat.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: student.tuwien.ac.at; dkim=none (message not signed) header.d=none;student.tuwien.ac.at; dmarc=none action=none header.from=hpe.com; x-originating-ip: [15.211.195.15] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TU4PR8401MB0941; 7:bLLhSAu4S6LvjpUQiKH4wr2tUvzsIjJ74bCibAMLVpxCUVg6j4+uxHSjt7QA/YiwGPqmIn5fr36jllaV7NAgJN5SrHnnRnoWMIX/mCjivtWuRi7M7L6GztbqDLILV0rpcjNHh5pGoqFDRxCq5V4g46laC2RrVIsiMx6EPsS3KMmk5KpeIz4o9VPnn1BSFakLNg+sokS3+1cArgauOkD7DxNWXaIjpZDaX4eyVNjzzDa/e6BLGnSN2ibVU82R9ves x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:(222181515654134); BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(5600026)(2017052603328)(7153060)(7193020); SRVR:TU4PR8401MB0941; x-ms-traffictypediagnostic: TU4PR8401MB0941: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(265634631926514)(162533806227266)(222181515654134)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231232)(944501396)(52105095)(10201501046)(6055026)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:TU4PR8401MB0941; BCL:0; PCL:0; RULEID:; SRVR:TU4PR8401MB0941; x-forefront-prvs: 0648FCFFA8 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(396003)(39380400002)(376002)(366004)(346002)(13464003)(377424004)(110136005)(74316002)(7736002)(86362001)(33656002)(478600001)(66066001)(93886005)(54906003)(316002)(55016002)(2906002)(3846002)(5660300001)(25786009)(6116002)(305945005)(6436002)(9686003)(8676002)(186003)(8936002)(81166006)(26005)(53546011)(229853002)(102836004)(6506007)(53936002)(446003)(476003)(11346002)(7696005)(5890100001)(3660700001)(4326008)(76176011)(2900100001)(59450400001)(6246003)(5250100002)(3280700002); DIR:OUT; SFP:1102; SCL:1; SRVR:TU4PR8401MB0941; H:TU4PR8401MB1086.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; MLV:sfv; x-microsoft-antispam-message-info: UMEJpj4ZheGa+o92/EEpNHhKGBBM6khkpr7m5zAPnoB7x/gME4Q9pVCVwwjb+S7Ll5LrjQne4kE5HY8xMGPsKxL8B4T8erkZfIzSU0PNFzTJ6/wUnLDpCq1v1v3hjWbVqrN6TertBXp8+ZZiqLtZDjFtFMFZMxLOCodosSmSOeZQHxtvXWWH7xuC1Y+FIJcK spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 223771de-e2d3-4edf-16dc-08d5a6de264e X-MS-Exchange-CrossTenant-Network-Message-Id: 223771de-e2d3-4edf-16dc-08d5a6de264e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2018 16:45:39.7770 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: TU4PR8401MB0941 X-OriginatorOrg: hpe.com Subject: Re: gdb reload-uefi missing EFI_SYSTEM_TABLE_POINTER [was: Source code debugging of OVMF] X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 16:45:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Can you check that the arguments for the source and reload-uefi arguments a= re real files and resolve correctly?=20 Also, remove the "-S" part and try connecting gdb when EDK2 transistions to= DXE or BDS =20 Regards, Thomas Palmer "I have only made this letter longer because I have not had the time to mak= e it shorter" - Blaise Pascal -----Original Message----- From: Johannes Swoboda [mailto:johannes.swoboda@student.tuwien.ac.at]=20 Sent: Friday, April 20, 2018 11:39 AM To: Palmer, Thomas ; Laszlo Ersek Cc: Rebecca Cran ; Michael Kinney ; edk2-devel@lists.01.org; clemens.hlauschek@inso.tuwien.ac.at Subject: RE: gdb reload-uefi missing EFI_SYSTEM_TABLE_POINTER [was: Source = code debugging of OVMF] Hello again, Thank you again for taking the time to help me with this. On 2018-04-20 17:58, Palmer, Thomas wrote: > Also, did you start qemu with the "-s" option before you started gdb? Unfortunately, I start qemu with -s -S; then, I attach gdb. I know the atta= ching works because I gdb accepts the continue command which instructs qemu= to begin execution of the virtual machine. The source [...]/gdb_uefi.py command seems to work find, but reload-efi -o = [...]/DEBUG/GdbSyms.dll throws the error "No type named EFI_SYSTEM_TABLE_PO= INTER". Here is my .gdbinit set height 0 set architecture i386:x86-64:intel target remote localhost:1234 source ~/18S/bakk/work/debug_w_andreiw/edk2/DebugPkg/Scripts/gdb_uefi.py reload-uefi -o ~/18S/bakk/work/debug_w_andreiw/edk2/Build/OvmfX64/DEBUG_GCC5/X64/DebugPkg/= GdbSyms/GdbSyms/DEBUG/GdbSyms.dll which is executed on gdb startup: [johannes@johannes-laptop efi_app_only]$ gdb [...] The target architecture = is assumed to be i386:x86-64:intel warning: No executable has been specified and target does not support deter= mining executable automatically. Try using the "file" command. 0x000000000000fff0 in ?? () Python Exception No type named EFI_SYSTEM_TABLE_POINTER.: .gdbinit:5: Error in sourced command file: Error occurred in Python command: No type named EFI_SYSTEM_TABLE_POINTER. (gdb) Do you have any other suggestions? Kind regards, Johannes > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] On 04/20/18 16:54,=20 > Johannes Swoboda wrote: >>=20 >> You advised me to use the scripts from [1]. >> I did so following this guide [2] (thank you also for putting it back=20 >> up!), with the minor adaptions that I made the script=20 >> python3-compatible[3], and applied the patches mentioned in [2]=20 >> manually. I assume they failed because they could only be applied to=20 >> older versions of the files to be patched. >>=20 >> In particular, I added the line DebugPkg/GdbSyms/GdbSyms.inf right=20 >> below line OvmfPkg/PlatformDxe/Platform.inf in line 830 of the >> vUDK2018 release. That makes sense, right? >=20 > You can add GdbSyms.inf anywhere near the other DXE phase modules. > Just make sure that you patch the DSC file(s) that you build and run=20 > afterwards. (I.e., avoid the case where you patch e.g. the X64 DSC but=20 > then build & boot the IA32 binary.) Allright, I should be safe there. >> However I ran into a problem when executing >>> (gdb) reload-uefi -o >>> ./Build/OvmfX64/DEBUG_GCC5/X64/DebugPkg/GdbSyms/GdbSyms/DEBUG/GdbSym >>> s >>> .dll >>=20 >> gdb complained: >>> Python Exception No type named >>> EFI_SYSTEM_TABLE_POINTER.: >>> Error occurred in Python command: No type named=20 >>> EFI_SYSTEM_TABLE_POINTER. >>=20 >> The EFI_SYSTEM_TABLE_POINTER is defined in=20 >> [WORKSPACE]/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c, so I'm=20 >> guessing I lack that file respectively its corresponding module. >=20 > This command will only work after you attach gdb to qemu. In general,=20 > python extensions for gdb can only look up non-standard typenames etc. > if gdb is connected to a live image that uses those types.