diff options
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/buildsym.c | 4 | ||||
-rw-r--r-- | gdb/symtab.c | 7 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp | 14 |
5 files changed, 30 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b802641..a07dd38 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2020-07-06 Tom de Vries <tdevries@suse.de> + * buildsym.c (buildsym_compunit::end_symtab_with_blockvector): Handle + End-Of-Sequence in lte_is_less_than. + * symtab.c (find_pc_sect_line): Revert change from commit 3d92a3e313 + "gdb: Don't reorder line table entries too much when sorting". + +2020-07-06 Tom de Vries <tdevries@suse.de> + PR tui/26205 * tui/tui-win.c (tui_partial_win_by_name): Don't test for NULL name. diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 0c4c300..bd0ca49 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -943,6 +943,10 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block, = [] (const linetable_entry &ln1, const linetable_entry &ln2) -> bool { + if (ln1.pc == ln2.pc + && ((ln1.line == 0) != (ln2.line == 0))) + return ln1.line == 0; + return (ln1.pc < ln2.pc); }; diff --git a/gdb/symtab.c b/gdb/symtab.c index 19f078e..f96ad95 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3236,12 +3236,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) struct linetable_entry *last = item + len; item = std::upper_bound (first, last, pc, pc_compare); if (item != first) - { - /* Found a matching item. Skip backwards over any end of - sequence markers. */ - for (prev = item - 1; prev->line == 0 && prev != first; prev--) - /* Nothing. */; - } + prev = item - 1; /* Found a matching item. */ /* At this point, prev points at the line whose start addr is <= pc, and item points at the next line. If we ran off the end of the linetable diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 983c431..f75ba7d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-07-06 Tom de Vries <tdevries@suse.de> + + * gdb.dwarf2/dw2-ranges-base.exp: Test line-table order. + 2020-07-03 Pedro Alves <palves@redhat.com> * gdb.base/structs2.c (main): Adjust second parem_reg call to diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp index 92f8f6c..39281a8 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp @@ -144,12 +144,26 @@ gdb_test "info line frame3" \ # Ensure that the line table correctly tracks the end of sequence markers. set end_seq_count 0 +set prev -1 +set seq_count 0 gdb_test_multiple "maint info line-table gdb.dwarf2/dw2-ranges-base.c" \ "count END markers in line table" { -re "^$decimal\[ \t\]+$decimal\[ \t\]+$hex\(\[ \t\]+Y\)? *\r\n" { + if { $prev != -1 } { + gdb_assert "$prev == 1" \ + "prev of normal entry at $seq_count is end marker" + } + set prev 0 + incr seq_count exp_continue } -re "^$decimal\[ \t\]+END\[ \t\]+$hex\(\[ \t\]+Y\)? *\r\n" { + if { $prev != -1 } { + gdb_assert "$prev == 0" \ + "prev of end marker at $seq_count is normal entry" + } + set prev 1 + incr seq_count incr end_seq_count exp_continue } |