diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-02-12 16:10:56 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-02-24 16:58:02 +0000 |
commit | 02a79309925c71591d825f8fc4e2b79ce0faa45b (patch) | |
tree | 45cef59400fc764b30f655e1933f46b30d2ed087 /gdb/target.c | |
parent | 895b7b4e4bed9eee9d4a3d55bee876055736bfd3 (diff) | |
download | gdb-02a79309925c71591d825f8fc4e2b79ce0faa45b.zip gdb-02a79309925c71591d825f8fc4e2b79ce0faa45b.tar.gz gdb-02a79309925c71591d825f8fc4e2b79ce0faa45b.tar.bz2 |
gdb: add a new 'maint info target-sections' command
We already have a command 'maint info sections', this command prints
all sections from all known object files.
However, GDB maintains a second section table internally. This
section table is used when GDB wants to read directly from an object
file rather than actually reading memory on the target. As such only
some sections (the allocatable ones) are added to this secondary
section table.
I recently ran into a situation where some of GDB's optimisations for
reading directly from the files were not working. In 'maint info
sections' I could see that GDB knew about the object file, and did
know about the sections that it _should_ have been reading from. But
I couldn't ask GDB which sections it had copied into its secondary
section table.
This commit adds a new command 'maint info target-sections' that fills
this gap. This command lists only those sections that GDB has copied
into its secondary table.
You'll notice that the testsuite includes a comment indicating that
there's a bug in GDB. Normally this is not something I would add to
the testsuite, instead we should raise an actual bugzilla bug and then
mark an xfail, however, a later patch in this series will remove this
comment once the actual bug in GDB is fixed.
gdb/ChangeLog:
* NEWS: Mention new 'maint info target-sections' command.
* maint.c (maintenance_info_target_sections): New function.
(_initialize_maint_cmds): Register new command.
gdb/doc/ChangeLog:
* gdb.texinfo (Files): Document new 'maint info target-sections'
command.
gdb/testsuite/ChangeLog:
* gdb.base/maint-info-sections.exp: Add new tests.
(check_maint_info_target_sections_output): New proc.
Diffstat (limited to 'gdb/target.c')
0 files changed, 0 insertions, 0 deletions