]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: add 'maint info blocks' command
authorAndrew Burgess <aburgess@redhat.com>
Thu, 18 Jul 2024 10:16:13 +0000 (11:16 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 28 Aug 2024 09:30:31 +0000 (10:30 +0100)
commitbe85cdf4159c1f130778959d3ddff7c44f5eacde
tree0cc2cd556f9cc005a180dba1a62fba27c02ed498
parent56260065c80caf67b57ec612b85bb978e06dad2d
gdb: add 'maint info blocks' command

While reviewing a patch I wanted to understand which blocks existed at
a given address.

The 'maint print symbols' command does provide some of this
information, but that command displays all blocks within a given
symtab.  If I want to know which blocks are at a given address I have
to figure that out for myself based on the output of 'maint print
symbols' ... and I'm too lazy for that!

So this command lists just those blocks at a given address, along with
information about the blocks type.  This new command doesn't list the
symbols within each block, for that my expectation is that you'd cross
reference the output with that of 'maint print symbols'.

The new command format is:

  maintenance info blocks
  maintenance info blocks ADDRESS

This lists the blocks at ADDRESS, or at the current $pc if ADDRESS is
not given.  Blocks are listed starting at the global block, then the
static block, and then the progressively narrower scoped blocks.

For each block we list the internal block pointer (which allows easy
cross referencing with 'maint print symbols'), the inferior address
range, along with other useful information.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/NEWS
gdb/block.c
gdb/doc/gdb.texinfo
gdb/testsuite/gdb.base/maint-info-inline-frames-and-blocks.exp