From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=193.170.73.221; helo=mail1.student.tuwien.ac.at; envelope-from=johannes.swoboda@student.tuwien.ac.at; receiver=edk2-devel@lists.01.org Received: from mail1.student.tuwien.ac.at (mail1.student.tuwien.ac.at [193.170.73.221]) (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 66F3F203BBBA6 for ; Thu, 24 May 2018 05:52:33 -0700 (PDT) Received: from [128.131.196.78] (t196-078.demo.tuwien.ac.at [128.131.196.78]) (authenticated bits=0) by mail1.student.tuwien.ac.at (8.14.7/8.14.7) with ESMTP id w4OCq2N4006117 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 24 May 2018 14:52:19 +0200 To: Gary Lin Cc: Rebecca Cran , thomas.palmer@hpe.com, lersek@redhat.com, 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> <20180424021328.ff2igddlce3xpghp@GaryWorkstation> From: Johannes Swoboda Message-ID: Date: Thu, 24 May 2018 14:52:02 +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: <20180424021328.ff2igddlce3xpghp@GaryWorkstation> 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: Thu, 24 May 2018 12:52:34 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hello, I asked you for help for source level debugging of ovmf some time ago. Things got in the way after that, but now I was able to follow your advice and achieved my goal. In particular, 1. I added the debug-lines below to GdbSyms.c 2. I started debugging later in the BDS phase (as suggested by several of you) 3. I got rid of the qemu flag -enable-kvm (it screwed up the stepping in gdb) Thank you very much! Kind regards, Johannes On 2018-04-24 04:13, Gary Lin wrote: > On Fri, Apr 20, 2018 at 04:54:06PM +0200, Johannes Swoboda wrote: >> gdb complained: >>> Python Exception No type named >>> EFI_SYSTEM_TABLE_POINTER.: >>> [...] > I encountered the issue before and it seems caused by the linker option, > "--whole-archive", which drops the symbols not used. > > As a workaround, I add the following lines to Initialize(): > > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &ESTP)); > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &EDIITH)); > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &EIDH)); > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &EIOHU)); > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &EIDDE)); > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &EIDCNE)); > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &EIDCRE)); > DEBUG ((DEBUG_VERBOSE, "%a: %llx\n", __FUNCTION__, &EIDCME)); > > It at least makes the linker believe the symbols are important. > Maybe you can try it. > > Cheers, > > Gary Lin