[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] efi: Print GDB command for loading symbols if variable exist
From: |
Glenn Washburn |
Subject: |
[PATCH 4/4] efi: Print GDB command for loading symbols if variable exists |
Date: |
Wed, 26 Jul 2023 16:00:02 -0500 |
If the variable "enable_earlyinit_gdbinfo" exists, print the GDB command
needed to properly load symbols in an attached GDB session. This variable
must come from the environment block stored in the GRUB_ENV EFI variable,
which allows this to get printed as early as possible.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/kern/efi/init.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
index 18329b1eacd7..3dce0308cce8 100644
--- a/grub-core/kern/efi/init.c
+++ b/grub-core/kern/efi/init.c
@@ -142,6 +142,8 @@ grub_efi_env_init (void)
void
grub_efi_init (void)
{
+ const char *value;
+
grub_modbase = grub_efi_section_addr ("mods");
/* First of all, initialize the console so that GRUB can display
messages. */
@@ -155,6 +157,10 @@ grub_efi_init (void)
/* Populate environment with variables from EFI envblk, if it exists. */
grub_efi_env_init ();
+ value = grub_env_get ("enable_earlyinit_gdbinfo");
+ if (value != NULL && !grub_strcmp (value, "1"))
+ grub_efi_print_gdb_info ();
+
/*
* Lockdown the GRUB and register the shim_lock verifier
* if the UEFI Secure Boot is enabled.
--
2.34.1