For some reason, GDB is breaking on grub_dl_add() before the function has
setup its stack frame, but GDB thinks it has. So the value of mod is bogus.
To get the correct value, create a one-time break on grub_dl_get(), which is
the first line of grub_dl_add(). When this break point hits, grub_dl_add
Many targets, such as EFI, load GRUB at addresses that are determined at
runtime. So the load addresses in kernel.exec will almost certainly be
wrong. Given the address of the start of the text and data segments, these
functions will tell GDB to load the symbols at the proper locations.
It is left
There are broadly two classes of targets to consider when loading symbols
for GRUB, targets that determine where to load GRUB at runtime (dynamically
positioned) and those that do not (statically positioned). For statically
poisitioned targets, symbol loading is determined at link time, so nothing
If the macro PRINT_GDB_SYM_LOAD_CMD is non-zero, compile code which will
print the command needed to load symbols for the GRUB EFI kernel. This is
needed because EFI firmware determines where to load the GRUB EFI
at runtime, and so the relevant addresses are not known ahead of time.
The command is
This prevents load_all_modules from failing when called before any modules
have been loaded. Failures in GDB user-defined functions cause any function
which called them to also fail.
Signed-off-by: Glenn Washburn
---
grub-core/gdb_grub.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
GDB logging is redirected to write .segments.tmp, which means that GDB will
wrap lines longer than what it thinks is the screen width (typically 80
characters). When wrapping does occur it causes gmodule.pl to misbehave. So
disable line wrapping.
Signed-off-by: Glenn Washburn
---
grub-core/gdb_g
When loading module symbols, tell GDB to load them all right away. GDB by
default will lazy load symbols as needed in the background. However, this
process will output to GDB's stdout some messages. This fixes a bug where
output from the loading process gets printed to the .segments.tmp file
causin
This is a collection of fixes and improvements mostly to the GDB script,
gdb_grub. I don't think the first 4 need commnt.
A major benefit added in patch #5 is the ability to properly load symbols on
EFI targets given the load address for the text and data segments. This is
written as a shell scrip
Signed-off-by: Glenn Washburn
---
grub-core/gdb_grub.in | 20 +---
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/grub-core/gdb_grub.in b/grub-core/gdb_grub.in
index e322d3dc1..b0e8d1ed1 100644
--- a/grub-core/gdb_grub.in
+++ b/grub-core/gdb_grub.in
@@ -70,16 +70,2