diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2010-04-09 15:31:41 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2010-04-09 15:31:41 +0000 |
commit | 86da934b14f15b2262b82308130829f68b0791c0 (patch) | |
tree | 3e0ca47bc7564fc3afd8aa468ccfa04824069918 /gdb/symtab.c | |
parent | d337e9f09eed4c2c3d58abf23d2da25ff4fc5e5e (diff) | |
download | gdb-86da934b14f15b2262b82308130829f68b0791c0.zip gdb-86da934b14f15b2262b82308130829f68b0791c0.tar.gz gdb-86da934b14f15b2262b82308130829f68b0791c0.tar.bz2 |
* symtab.c (find_function_start_sal): Never return SAL pointing
before function start address, even if line info is missing.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index b10cdc8..29142da 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2295,6 +2295,18 @@ find_function_start_sal (struct symbol *sym, int funfirstline) sal = find_pc_sect_line (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)), SYMBOL_OBJ_SECTION (sym), 0); + /* We always should have a line for the function start address. + If we don't, something is odd. Create a plain SAL refering + just the PC and hope that skip_prologue_sal (if requested) + can find a line number for after the prologue. */ + if (sal.pc < BLOCK_START (SYMBOL_BLOCK_VALUE (sym))) + { + init_sal (&sal); + sal.pspace = current_program_space; + sal.pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); + sal.section = SYMBOL_OBJ_SECTION (sym); + } + if (funfirstline) skip_prologue_sal (&sal); |