From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 83C9121EBD1A9 for ; Fri, 20 Apr 2018 08:20:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF132402314E; Fri, 20 Apr 2018 15:20:18 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-11.rdu2.redhat.com [10.10.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D7452026DFD; Fri, 20 Apr 2018 15:20:16 +0000 (UTC) To: Johannes Swoboda , Rebecca Cran , thomas.palmer@hpe.com Cc: Michael Kinney , edk2-devel@lists.01.org, clemens.hlauschek@inso.tuwien.ac.at References: <12fe2332-c864-60e1-4f12-280e9939449f@redhat.com> <81abcc10-1c8c-1012-7c08-b9cd24efa85a@bluestop.org> From: Laszlo Ersek Message-ID: <020ac090-c1e9-0c73-a484-e785c1b7e423@redhat.com> Date: Fri, 20 Apr 2018 17:20:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 20 Apr 2018 15:20:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 20 Apr 2018 15:20:18 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' 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 15:20:19 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 04/20/18 16:54, Johannes Swoboda wrote: > Hello, > > Thank you all for your insights. > > You advised me to use the scripts from [1]. > I did so following this guide [2] (thank you also for putting it back > up!), with the minor adaptions that I made the script > python3-compatible[3], and applied the patches mentioned in [2] > manually. I assume they failed because they could only be applied to > older versions of the files to be patched. > > In particular, I added the line DebugPkg/GdbSyms/GdbSyms.inf right below > line OvmfPkg/PlatformDxe/Platform.inf in line 830 of the vUDK2018 > release. That makes sense, right? 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 afterwards. (I.e., avoid the case where you patch e.g. the X64 DSC but then build & boot the IA32 binary.) > > The guide looks promising; I think this would give me everything I need. > However I ran into a problem when executing >> (gdb) reload-uefi -o >> ./Build/OvmfX64/DEBUG_GCC5/X64/DebugPkg/GdbSyms/GdbSyms/DEBUG/GdbSyms.dll > > gdb complained: >> Python Exception No type named >> EFI_SYSTEM_TABLE_POINTER.: >> Error occurred in Python command: No type named EFI_SYSTEM_TABLE_POINTER. > > The EFI_SYSTEM_TABLE_POINTER is defined in > [WORKSPACE]/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c, so I'm guessing > I lack that file respectively its corresponding module. This command will only work after you attach gdb to qemu. In general, python extensions for gdb can only look up non-standard typenames etc. if gdb is connected to a live image that uses those types. People generally create gdb scripts as follows: set height 0 set architecture i386:intel target remote localhost:1234 source /.../edk2/DebugPkg/Scripts/gdb_uefi.py reload-uefi -o /.../edk2/Build/Ovmf.../.../.../DebugPkg/GdbSyms/GdbSyms/DEBUG/GdbSyms.dll And then pass this command script to gdb with the "-x" option. Thanks, Laszlo