diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2025-02-18 14:31:28 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2025-03-10 16:09:02 -0400 |
commit | e9386435c94f10c3d047142fdb9b85f1486e2f14 (patch) | |
tree | f8d56b686a21baa6a1951121344c280c7cab177f /gdb/m32r-linux-nat.c | |
parent | 6cbd64aa3eb0e6749c7b75dbaac334b369912c15 (diff) | |
download | binutils-e9386435c94f10c3d047142fdb9b85f1486e2f14.zip binutils-e9386435c94f10c3d047142fdb9b85f1486e2f14.tar.gz binutils-e9386435c94f10c3d047142fdb9b85f1486e2f14.tar.bz2 |
gdb/dwarf: print DWARF CUs/TUs in "maint print objfiles"
This was useful to me, to debug some problems.
Before printing cooked index entries, print a list of CUs and TUs. The
information printed for each is a bit arbitrary, I took a look at the
types and printed what seemed relevant.
An example of output for a CU:
[0] ((dwarf2_per_cu_data *) 0x50f000007840)
type: DW_UT_compile
offset: 0x0
size: 0x1bff
artificial: false
GDB lang: c++
DWARF lang: DW_LANG_C_plus_plus
And for a TU:
[2] ((signatured_type *) 0x511000040000)
type: DW_UT_type
offset: 0x0
size: 0x94
signature: 0x2e966c0dc94b065b
I moved the call to cooked_index_functions::wait before printing the
CU/TU list, otherwise trying to call "maint print objfiles" quickly,
like this, would lead to an internal error:
$ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.dwarf2/struct-with-sig/struct-with-sig -ex "maint print objfiles"
This is because dwarf2_per_cu_data::m_unit_type was not yet set, when
trying to read it. Waiting for the index to be built ensures that it is
set, since setting the unit type is done as a side-effect somewhere.
Change-Id: Ic810ec3bb4d3f5abb481cf1cee9b2954ff4f0874
Diffstat (limited to 'gdb/m32r-linux-nat.c')
0 files changed, 0 insertions, 0 deletions