All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org, Daniel Kiper <dkiper@net-space.pl>
Cc: Robbie Harwood <rharwood@redhat.com>,
	Peter Jones <pjones@redhat.com>,
	Glenn Washburn <development@efficientek.com>
Subject: [PATCH v6 00/14] GDB script fixes and improvements
Date: Tue, 10 Jan 2023 15:50:27 -0600	[thread overview]
Message-ID: <20230110215041.1247699-1-development@efficientek.com> (raw)

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



             reply	other threads:[~2023-01-10 21:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 21:50 Glenn Washburn [this message]
2023-01-10 21:50 ` [PATCH v6 01/14] gdb: Fix redirection issue in dump_module_sections Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 02/14] gdb: Prevent wrapping when writing to .segments.tmp Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 03/14] gdb: If no modules have been loaded, do not try to load module symbols Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 04/14] gdb: Move runtime module loading into runtime_load_module Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 05/14] gdb: Conditionally run GDB script logic for dynamically or statically positioned GRUB Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 06/14] gdb: Only connect to remote target once when first sourced Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 07/14] gdb: Replace module symbol loading implementation with Python one Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 08/14] gdb: Add functions to make loading from dynamically positioned targets easier Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 09/14] gdb: Add more support for debugging on EFI platforms Glenn Washburn
2023-02-20 20:06   ` Robbie Harwood
2023-02-21  3:07     ` Glenn Washburn
2023-03-02 18:44       ` Daniel Kiper
2023-01-10 21:50 ` [PATCH v6 10/14] gdb: Allow running user-defined commands at GRUB start Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 11/14] gdb: Fix issue with breakpoints defined before the GRUB image is loaded Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 12/14] gdb: Add extra early initialization symbols for i386-pc Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 13/14] gdb: Modify gdb prompt when running gdb_grub script Glenn Washburn
2023-01-10 21:50 ` [PATCH v6 14/14] docs: Add debugging chapter to development documentation Glenn Washburn

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-all 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=20230110215041.1247699-1-development@efficientek.com \
    --to=development@efficientek.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=pjones@redhat.com \
    --cc=rharwood@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.