aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>2006-05-11 09:29:52 +0000
committerFred Fish <fnf@specifix.com>2006-05-11 09:29:52 +0000
commit576c2025449a61882b04df14736f00017ed72730 (patch)
treec139a47c0fa5ecf8fa8046524bf276d56e7b1d71 /gdb/symtab.c
parent5e1b4a6d177a61c41377f96b6b19ed2723c8a229 (diff)
downloadfsf-binutils-gdb-576c2025449a61882b04df14736f00017ed72730.zip
fsf-binutils-gdb-576c2025449a61882b04df14736f00017ed72730.tar.gz
fsf-binutils-gdb-576c2025449a61882b04df14736f00017ed72730.tar.bz2
Reviewed and approved by Jim Blandy <jimb@codesourcery.com>
2006-05-11 Fred Fish <fnf@specifix.com> * symtab.c (skip_prologue_using_sal): Handle single line functions like "foo(){}", which may optimize down to a single return inst.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c5
1 files changed, 5 insertions, 0 deletions
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;