Update since v5: * Need to declare grub_efi_print_gdb_info() as static and inline, which fixes a compiler error.
This series has been substantially rewritten since v4, although a large minority of the patches haven't changed much. The biggest change is that the implementation has been converted to Python instead of what was done in shell script. I have always felt it should be done in Python, but it seemed daunting to learn the Python-GDB API, so the shell script seemed the path of least resistance. I decided to give it a second look and was surprised it wasn't as bad as I thought it would be. Because the python API is so tightly integrated into GDB, there are things you can do with it that either aren't possible or which look like ugly hacks when attempting with the native script. The other big change is that there is a new --enable-efi-debug option to configure which enables the printing of the gdb command for loading the GRUB kernel symbols. This is disallowed when booting with Secure Boot on. There are two ways the GDB command is printed: (1) in early EFI setup and (2) on-demand by a user using the gdbinfo command. There are a couple new features to the GDB script, like a trivial one that changes the gdb prompt and another that allows for software breakpoints to be set before the GRUB image is loaded. This series also incorporates suggestions given for v4 and adds more to the documentation. Glenn Glenn Washburn (14): gdb: Fix redirection issue in dump_module_sections gdb: Prevent wrapping when writing to .segments.tmp gdb: If no modules have been loaded, do not try to load module symbols gdb: Move runtime module loading into runtime_load_module gdb: Conditionally run GDB script logic for dynamically or statically positioned GRUB gdb: Only connect to remote target once when first sourced gdb: Replace module symbol loading implementation with Python one gdb: Add functions to make loading from dynamically positioned targets easier gdb: Add more support for debugging on EFI platforms gdb: Allow running user-defined commands at GRUB start gdb: Fix issue with breakpoints defined before the GRUB image is loaded gdb: Add extra early initialization symbols for i386-pc gdb: Modify gdb prompt when running gdb_grub script docs: Add debugging chapter to development documentation config.h.in | 3 + configure.ac | 11 ++ docs/grub-dev.texi | 233 ++++++++++++++++++++++++++++++++++++ grub-core/Makefile.core.def | 5 +- grub-core/gdb_grub.in | 159 +++++++++++++++--------- grub-core/gdb_helper.py.in | 173 ++++++++++++++++++++++++++ grub-core/gmodule.pl.in | 30 ----- grub-core/kern/efi/debug.c | 40 +++++++ grub-core/kern/efi/efi.c | 4 +- grub-core/kern/efi/init.c | 7 +- include/grub/efi/debug.h | 43 +++++++ include/grub/efi/efi.h | 2 +- 12 files changed, 620 insertions(+), 90 deletions(-) create mode 100644 grub-core/gdb_helper.py.in delete mode 100644 grub-core/gmodule.pl.in create mode 100644 grub-core/kern/efi/debug.c create mode 100644 include/grub/efi/debug.h Range-diff against v5: 1: 9f273b8fa5 = 1: ef2b93c7df gdb: Fix redirection issue in dump_module_sections 2: 85f68a8369 = 2: fafc15ba07 gdb: Prevent wrapping when writing to .segments.tmp 3: 88b3973cdb = 3: 9a8bc8c099 gdb: If no modules have been loaded, do not try to load module symbols 4: 3037c1da91 = 4: 81eef1558d gdb: Move runtime module loading into runtime_load_module 5: f6288016f6 = 5: 835f19b2a3 gdb: Conditionally run GDB script logic for dynamically or statically positioned GRUB 6: da13fbe653 = 6: ea32a6d83e gdb: Only connect to remote target once when first sourced 7: 8e6059955a = 7: 13a5e05cd9 gdb: Replace module symbol loading implementation with Python one 8: 878900d69b = 8: c918d24d35 gdb: Add functions to make loading from dynamically positioned targets easier 9: 036549604d ! 9: fd6d2a3ffd gdb: Add more support for debugging on EFI platforms @@ include/grub/efi/debug.h (new) + +void grub_efi_register_debug_commands (void); + -+void ++static inline void +grub_efi_print_gdb_info (void) +{ +#if PRINT_GDB_SYM_LOAD_CMD 10: 0000959b2f = 10: 649bfc0a4d gdb: Allow running user-defined commands at GRUB start 11: ac9f52b1d9 = 11: 8e9148a32b gdb: Fix issue with breakpoints defined before the GRUB image is loaded 12: eac4405ffb = 12: eb5f1b5d89 gdb: Add extra early initialization symbols for i386-pc 13: e58715e227 = 13: 0e85de3667 gdb: Modify gdb prompt when running gdb_grub script 14: 1979dc664e = 14: d78a1b27f0 docs: Add debugging chapter to development documentation -- 2.34.1 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel