From 576c2025449a61882b04df14736f00017ed72730 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 11 May 2006 09:29:52 +0000 Subject: Reviewed and approved by Jim Blandy 2006-05-11 Fred Fish * symtab.c (skip_prologue_using_sal): Handle single line functions like "foo(){}", which may optimize down to a single return inst. --- gdb/ChangeLog | 5 +++++ gdb/symtab.c | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index de0ccf2..3f4db56 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2006-05-11 Fred Fish + + * symtab.c (skip_prologue_using_sal): Handle single line functions + like "foo(){}", which may optimize down to a single return inst. + 2006-05-10 Steve Ellcey * hppa-hpux-tdep.c (initialize_hp_cxx_exception_support): Remove diff --git a/gdb/symtab.c b/gdb/symtab.c index ad4ed03..2832dd1 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4030,6 +4030,11 @@ skip_prologue_using_sal (CORE_ADDR func_addr) prologue_sal = find_pc_line (start_pc, 0); if (prologue_sal.line != 0) { + /* 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 start_pc; while (prologue_sal.end < end_pc) { struct symtab_and_line sal; -- cgit v1.1