diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-01-20 20:57:49 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-01-20 20:57:49 -0500 |
commit | 17e593e9668c000f2bfa88d11a8957dfc52297dd (patch) | |
tree | 5bad55a82098f1247412587aae6cc943b689cba5 /gdb/dwarf2/read.c | |
parent | 6bd434d6caa4c08a5ea87fe327d802c1e00a5c5e (diff) | |
download | gdb-17e593e9668c000f2bfa88d11a8957dfc52297dd.zip gdb-17e593e9668c000f2bfa88d11a8957dfc52297dd.tar.gz gdb-17e593e9668c000f2bfa88d11a8957dfc52297dd.tar.bz2 |
gdb/dwarf: add some logging in dwarf2/read.c
This patch adds some logging that helped me diagnose the problems fixed
later in this series. I'm thinking that if it helped me now, it could
help somebody else (or myself) in the future, so I might as well add
them for real.
They can happen quite frequently and be noisy, so I used
dwarf_read_debug_printf_v for them, which means they'll only print if
`set debug dwarf-read` is >= 2.
gdb/ChangeLog:
* dwarf2/read.c (follow_die_offset): Add logging.
(dwarf2_per_objfile::age_comp_units): Add logging.
Change-Id: I7483c0b05c37bc9710b9b5d40e272935bc010863
Diffstat (limited to 'gdb/dwarf2/read.c')
-rw-r--r-- | gdb/dwarf2/read.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 9032186..30e25ca 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -23574,6 +23574,12 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz, target_cu = cu; + dwarf_read_debug_printf_v ("source CU offset: %s, target offset: %s, " + "source CU contains target offset: %d", + sect_offset_str (cu->per_cu->sect_off), + sect_offset_str (sect_off), + cu->header.offset_in_cu_p (sect_off)); + if (cu->per_cu->is_debug_types) { /* .debug_types CUs cannot reference anything outside their CU. @@ -23590,6 +23596,11 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz, per_cu = dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz, per_objfile); + dwarf_read_debug_printf_v ("target CU offset: %s, " + "target CU DIEs loaded: %d", + sect_offset_str (per_cu->sect_off), + per_objfile->get_cu (per_cu) != nullptr); + /* If necessary, add it to the queue and load its DIEs. */ if (maybe_queue_comp_unit (cu, per_cu, per_objfile, cu->language)) load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu), @@ -24970,6 +24981,8 @@ dwarf2_per_objfile::set_cu (dwarf2_per_cu_data *per_cu, dwarf2_cu *cu) void dwarf2_per_objfile::age_comp_units () { + dwarf_read_debug_printf_v ("running"); + /* Start by clearing all marks. */ for (auto pair : m_dwarf2_cus) pair.second->mark = false; @@ -24992,6 +25005,8 @@ dwarf2_per_objfile::age_comp_units () if (!cu->mark) { + dwarf_read_debug_printf_v ("deleting old CU %s", + sect_offset_str (cu->per_cu->sect_off)); delete cu; it = m_dwarf2_cus.erase (it); } |