aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-09-22 14:56:17 +0000
committerDaniel Jacobowitz <drow@false.org>2008-09-22 14:56:17 +0000
commitd54be744b72d40a79d9c434e7b23063087a697dc (patch)
tree29f1d93562e2d6f9fe3ad3e830a59b3f665c4288 /gdb
parent26fae1d6e38b9f8c6470326487fe7d2a5c1dcae7 (diff)
downloadgdb-d54be744b72d40a79d9c434e7b23063087a697dc.zip
gdb-d54be744b72d40a79d9c434e7b23063087a697dc.tar.gz
gdb-d54be744b72d40a79d9c434e7b23063087a697dc.tar.bz2
* symtab.c (skip_prologue_using_sal): Treat two consecutive lines
at the same address as a prologue marker. Do not skip an entire function.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/symtab.c34
2 files changed, 39 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c8163b7..54d0f74 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-22 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * symtab.c (skip_prologue_using_sal): Treat two consecutive lines
+ at the same address as a prologue marker. Do not skip an entire
+ function.
+
2008-09-22 Andrew Stubbs <ams@codesourcery.com>
* frame.c (get_frame_register_bytes): Comment improvments.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 1a0dcba..10987e2 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4198,6 +4198,7 @@ skip_prologue_using_sal (CORE_ADDR func_addr)
struct symtab_and_line prologue_sal;
CORE_ADDR start_pc;
CORE_ADDR end_pc;
+ struct block *bl;
/* Get an initial range for the function. */
find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc);
@@ -4206,11 +4207,35 @@ skip_prologue_using_sal (CORE_ADDR func_addr)
prologue_sal = find_pc_line (start_pc, 0);
if (prologue_sal.line != 0)
{
+ /* For langauges other than assembly, treat two consecutive line
+ entries at the same address as a zero-instruction prologue.
+ The GNU assembler emits separate line notes for each instruction
+ in a multi-instruction macro, but compilers generally will not
+ do this. */
+ if (prologue_sal.symtab->language != language_asm)
+ {
+ struct linetable *linetable = LINETABLE (prologue_sal.symtab);
+ int exact;
+ int idx = 0;
+
+ /* Skip any earlier lines, and any end-of-sequence marker
+ from a previous function. */
+ while (linetable->item[idx].pc != prologue_sal.pc
+ || linetable->item[idx].line == 0)
+ idx++;
+
+ if (idx+1 < linetable->nitems
+ && linetable->item[idx+1].line != 0
+ && linetable->item[idx+1].pc == start_pc)
+ return start_pc;
+ }
+
/* If there is only one sal that covers the entire function,
then it is probably a single line function, like
"foo(){}". */
if (prologue_sal.end >= end_pc)
return 0;
+
while (prologue_sal.end < end_pc)
{
struct symtab_and_line sal;
@@ -4232,7 +4257,14 @@ skip_prologue_using_sal (CORE_ADDR func_addr)
prologue_sal = sal;
}
}
- return prologue_sal.end;
+
+ if (prologue_sal.end < end_pc)
+ /* Return the end of this line, or zero if we could not find a
+ line. */
+ return prologue_sal.end;
+ else
+ /* Don't return END_PC, which is past the end of the function. */
+ return prologue_sal.pc;
}
struct symtabs_and_lines