aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-07-31 19:58:40 +0000
committerDaniel Jacobowitz <drow@false.org>2007-07-31 19:58:40 +0000
commite48883f7911b90ba2b9af24705be25a0289db16a (patch)
tree7b2af36ecd822f93000c73daf9532025d72a569d /gdb/linespec.c
parent6b3d9b8313db583e6b6ba5d897bced21f01d81db (diff)
downloadgdb-e48883f7911b90ba2b9af24705be25a0289db16a.zip
gdb-e48883f7911b90ba2b9af24705be25a0289db16a.tar.gz
gdb-e48883f7911b90ba2b9af24705be25a0289db16a.tar.bz2
* linespec.c (minsym_found): Advance to the next line if possible.
* gdb.base/prologue.c, gdb.base/prologue.exp: New. * lib/gdb.exp (gdb_breakpoint): Handle "temporary".
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 9043ca6..a00cffe 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1833,11 +1833,27 @@ minsym_found (int funfirstline, struct minimal_symbol *msymbol)
values.sals[0].section = SYMBOL_BFD_SECTION (msymbol);
if (funfirstline)
{
+ struct symtab_and_line sal;
+
values.sals[0].pc
+= gdbarch_deprecated_function_start_offset (current_gdbarch);
values.sals[0].pc = gdbarch_skip_prologue
(current_gdbarch, values.sals[0].pc);
+
+ sal = find_pc_sect_line (values.sals[0].pc, values.sals[0].section, 0);
+
+ /* Check if SKIP_PROLOGUE left us in mid-line, and the next
+ line is still part of the same function. If there is no
+ line information here, sal.pc will be the passed in PC. */
+ if (sal.pc != values.sals[0].pc
+ && (lookup_minimal_symbol_by_pc_section (values.sals[0].pc,
+ values.sals[0].section)
+ == lookup_minimal_symbol_by_pc_section (sal.end,
+ values.sals[0].section)))
+ /* Recalculate the line number (might not be N+1). */
+ values.sals[0] = find_pc_sect_line (sal.end, values.sals[0].section, 0);
}
+
values.nelts = 1;
return values;
}