aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-10-11 17:38:59 +0000
committerDaniel Jacobowitz <drow@false.org>2007-10-11 17:38:59 +0000
commit607ae575a784d7d02956031883ae407faf06fd89 (patch)
tree9674195e590ad9fd8a98f484d83d59c9a502c822
parentad4b42b49f5c441c67fadea7b3481311d0cb2ec1 (diff)
downloadgdb-607ae575a784d7d02956031883ae407faf06fd89.zip
gdb-607ae575a784d7d02956031883ae407faf06fd89.tar.gz
gdb-607ae575a784d7d02956031883ae407faf06fd89.tar.bz2
* buildsym.c (record_line): Remove empty lines followed by
end-of-sequence markers.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/buildsym.c27
2 files changed, 31 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2da3eda..6482dc0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-11 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * buildsym.c (record_line): Remove empty lines followed by
+ end-of-sequence markers.
+
2007-10-11 Kazu Hirata <kazu@codesourcery.com>
* configure.tgt: Recognize fido-*-elf.
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index d3af35e..f640679 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -752,9 +752,34 @@ record_line (struct subfile *subfile, int line, CORE_ADDR pc)
* sizeof (struct linetable_entry))));
}
+ pc = gdbarch_addr_bits_remove (current_gdbarch, pc);
+
+ /* Normally, we treat lines as unsorted. But the end of sequence
+ marker is special. We sort line markers at the same PC by line
+ number, so end of sequence markers (which have line == 0) appear
+ first. This is right if the marker ends the previous function,
+ and there is no padding before the next function. But it is
+ wrong if the previous line was empty and we are now marking a
+ switch to a different subfile. We must leave the end of sequence
+ marker at the end of this group of lines, not sort the empty line
+ to after the marker. The easiest way to accomplish this is to
+ delete any empty lines from our table, if they are followed by
+ end of sequence markers. All we lose is the ability to set
+ breakpoints at some lines which contain no instructions
+ anyway. */
+ if (line == 0 && subfile->line_vector->nitems > 0)
+ {
+ e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
+ while (subfile->line_vector->nitems > 0 && e->pc == pc)
+ {
+ e--;
+ subfile->line_vector->nitems--;
+ }
+ }
+
e = subfile->line_vector->item + subfile->line_vector->nitems++;
e->line = line;
- e->pc = gdbarch_addr_bits_remove (current_gdbarch, pc);
+ e->pc = pc;
}
/* Needed in order to sort line tables from IBM xcoff files. Sigh! */