From: Gary Lin <glin@suse.com>
To: Johannes Swoboda <johannes.swoboda@student.tuwien.ac.at>
Cc: Rebecca Cran <rebecca@bluestop.org>,
thomas.palmer@hpe.com, lersek@redhat.com,
Michael Kinney <michael.d.kinney@intel.com>,
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]
Date: Tue, 24 Apr 2018 10:13:29 +0800 [thread overview]
Message-ID: <20180424021328.ff2igddlce3xpghp@GaryWorkstation> (raw)
In-Reply-To: <eb507d9850580c1478fc19edb20f7b40@student.tuwien.ac.at>
On Fri, Apr 20, 2018 at 04:54:06PM +0200, 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?
>
> 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 <class 'gdb.error'> 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.
>
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
> I compiled OVMF with nice OvmfPkg/build.sh -a X64 -n $(getconf
> _NPROCESSORS_ONLN).
>
> If you could tell me whether my guess make sense and how I would include
> [WORKSPACE]/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c, that would be
> great.
>
> Kind regards,
> Johannes
>
> [1]: https://github.com/andreiw/andreiw-wip.git
> [2]: https://code.bluestop.org/w/tianocore/debugging-with-gdb/
> [3]: https://github.com/johannesswoboda/andreiw-wip/blob/master/uefi/DebugPkg/Scripts/gdb_uefi.py
> - in case someone else needs it one day
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>
next prev parent reply other threads:[~2018-04-24 2:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 11:09 Source code debugging of OVMF Johannes Swoboda
2018-04-16 15:26 ` Richardson, Brian
2018-04-16 16:03 ` Blibbet
2018-04-20 13:32 ` Johannes Swoboda
2018-04-16 16:13 ` Laszlo Ersek
2018-04-16 16:53 ` Palmer, Thomas
2018-04-16 18:25 ` Rebecca Cran
2018-04-16 19:57 ` Laszlo Ersek
2018-04-19 2:46 ` Rebecca Cran
2018-04-19 8:41 ` Laszlo Ersek
2018-04-20 14:54 ` gdb reload-uefi missing EFI_SYSTEM_TABLE_POINTER [was: Source code debugging of OVMF] Johannes Swoboda
2018-04-20 15:20 ` Laszlo Ersek
2018-04-20 15:58 ` Palmer, Thomas
2018-04-20 16:38 ` Johannes Swoboda
2018-04-20 16:45 ` Palmer, Thomas
2018-04-20 16:49 ` Rebecca Cran
2018-04-24 2:13 ` Gary Lin [this message]
2018-05-24 12:52 ` Johannes Swoboda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180424021328.ff2igddlce3xpghp@GaryWorkstation \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox