return sal.symtab != 0;
}
+/* Given a function symbol SYM, find the symtab and line for the start
+ of the function.
+ If the argument FUNFIRSTLINE is nonzero, we want the first line
+ of real code inside the function. */
+
+struct symtab_and_line
+find_function_start_sal (struct symbol *sym, int funfirstline)
+{
+ struct symtab_and_line sal;
+
+ fixup_symbol_section (sym, NULL);
+ sal = find_pc_sect_line (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)),
+ SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (sym), 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 (SYMBOL_OBJFILE (sym), sym);
+ }
+
+ if (funfirstline)
+ skip_prologue_sal (&sal);
+
+ return sal;
+}
+
/* Given a function start address FUNC_ADDR and SYMTAB, find the first
address for that function that has an entry in SYMTAB's line info
table. If such an entry cannot be found, return FUNC_ADDR
return func_addr;
}
-/* Given a function symbol SYM, find the symtab and line for the start
- of the function.
- If the argument FUNFIRSTLINE is nonzero, we want the first line
- of real code inside the function. */
-
-struct symtab_and_line
-find_function_start_sal (struct symbol *sym, int funfirstline)
-{
- struct symtab_and_line sal;
-
- fixup_symbol_section (sym, NULL);
- sal = find_pc_sect_line (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)),
- SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (sym), 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 (SYMBOL_OBJFILE (sym), sym);
- }
-
- if (funfirstline)
- skip_prologue_sal (&sal);
-
- return sal;
-}
-
/* Adjust SAL to the first instruction past the function prologue.
If the PC was explicitly specified, the SAL is not changed.
If the line number was explicitly specified, at most the SAL's PC