aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 8732f2e..99909e7 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5420,8 +5420,18 @@ expand_line_sal_maybe (struct symtab_and_line sal)
if (sym)
expanded.sals[i] = find_function_start_sal (sym, 1);
else
- expanded.sals[i].pc
- = gdbarch_skip_prologue (current_gdbarch, pc);
+ {
+ /* Since find_pc_partial_function returned true,
+ we should really always find the section here. */
+ struct obj_section *section = find_pc_section (pc);
+ if (section)
+ {
+ struct gdbarch *gdbarch
+ = get_objfile_arch (section->objfile);
+ expanded.sals[i].pc
+ = gdbarch_skip_prologue (gdbarch, pc);
+ }
+ }
}
}
}