aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-11-05 16:00:26 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-01-24 23:39:31 +0000
commit94a72be7086fa1870eca83d4d6f55cadf48f66b2 (patch)
treea192bf52d83a7b102df54ba551482e9c13120078 /gdb/symmisc.c
parentb5f998b2dd80e673b1506fbe5113e5e4834346bc (diff)
downloadgdb-94a72be7086fa1870eca83d4d6f55cadf48f66b2.zip
gdb-94a72be7086fa1870eca83d4d6f55cadf48f66b2.tar.gz
gdb-94a72be7086fa1870eca83d4d6f55cadf48f66b2.tar.bz2
gdb: Include end of sequence markers in the line table
In this commit: commit d9b3de22f33e400f7f409cce3acf6c7dab07dd79 Date: Wed May 27 14:44:29 2015 -0700 Add struct to record dwarf line number state machine. I believe an unintended change was made to how we store the DWARF line table, the end of sequence markers between sequences of lines were lost from the line table. This commit fixes this small oversight and restores the end of sequence markers. Given that we've survived this long without noticing is clearly an indication that this isn't that serious, however, a later patch that I am developing would benefit from having the markers in place, so I'd like to restore them. Having the markers also means that the output of 'maintenance info line-table' now more closely reflects the DWARF line table. I've taken this opportunity to improve how 'maintenance info line-table' displays the end of sequence markers - it now uses the END keyword, rather than just printing an entry with line number 0. So we see this: INDEX LINE ADDRESS 0 12 0x00000000004003b0 1 17 0x00000000004003b0 2 18 0x00000000004003b0 3 END 0x00000000004003b7 4 5 0x00000000004004a0 5 6 0x00000000004004a0 6 END 0x00000000004004a7 Instead of what we would have seen, which was this: INDEX LINE ADDRESS 0 12 0x00000000004003b0 1 17 0x00000000004003b0 2 18 0x00000000004003b0 3 0 0x00000000004003b7 4 5 0x00000000004004a0 5 6 0x00000000004004a0 6 0 0x00000000004004a7 I've added a small test that uses 'maintenance info line-table' to ensure that we don't regress this again. gdb/ChangeLog: * dwarf2read.c (lnp_state_machine::record_line): Include end_sequence parameter in debug print out. Record the line if we are at an end_sequence marker even if it's not the start of a statement. * symmisc.c (maintenance_print_one_line_table): Print end of sequence markers with 'END' not '0'. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update line table parsing test. * gdb.dwarf2/dw2-ranges-base.exp: Add new line table parsing test. Change-Id: I002f872248db82a1d4fefdc6b51ff5dbf932d8a8
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r--gdb/symmisc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 393a034..a6a7e72 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -999,8 +999,12 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
struct linetable_entry *item;
item = &linetable->item [i];
- printf_filtered (_("%-6d %6d %s\n"), i, item->line,
- core_addr_to_string (item->pc));
+ printf_filtered ("%-6d ", i);
+ if (item->line > 0)
+ printf_filtered ("%6d ", item->line);
+ else
+ printf_filtered ("%6s ", _("END"));
+ printf_filtered ("%s\n", core_addr_to_string (item->pc));
}
}