aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-04-26 13:01:26 +0100
committerPedro Alves <palves@redhat.com>2018-04-26 13:07:47 +0100
commit42ddae103c9eb20fb87378548ee95b4bd23648a5 (patch)
tree5c80aa1d1f176e414687769979a72961ea20ecaa /gdb/symtab.h
parenta0aca7b0e13d884f43ba77c4c6d752d9140cb54b (diff)
downloadgdb-42ddae103c9eb20fb87378548ee95b4bd23648a5.zip
gdb-42ddae103c9eb20fb87378548ee95b4bd23648a5.tar.gz
gdb-42ddae103c9eb20fb87378548ee95b4bd23648a5.tar.bz2
Factor out minsym_found/find_function_start_sal overload
I need to make the ifunc resolving code in elfread.c skip the target function's prologue like minsym_found does. I thought of factoring that out to a separate function, but turns out there's already a comment in find_function_start_sal that says that should agree with minsym_found... Instead of making sure the code agrees with a comment, factor out the common code to a separate function and use it from both places. Note that the current find_function_start_sal does a bit more than minsym_found's equivalent (the "We always should ..." bit), though that's probably a latent bug. gdb/ChangeLog: 2018-04-26 Pedro Alves <palves@redhat.com> * linespec.c (minsym_found): Use find_function_start_sal CORE_ADDR overload. * symtab.c (find_function_start_sal(CORE_ADDR, obj_section *,bool)): New, factored out from ... (find_function_start_sal(symbol *, int)): ... this. Reimplement and use bool. * symtab.h (find_function_start_sal(CORE_ADDR, obj_section *,bool)): New. (find_function_start_sal(symbol *, int)): Change boolean parameter type to bool.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index a89d597..0bd95fa 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1899,8 +1899,17 @@ int matching_obj_sections (struct obj_section *, struct obj_section *);
extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
-extern struct symtab_and_line find_function_start_sal (struct symbol *sym,
- int);
+/* Given a function symbol SYM, find the symtab and line for the start
+ of the function. If FUNFIRSTLINE is true, we want the first line
+ of real code inside the function. */
+extern symtab_and_line find_function_start_sal (symbol *sym, bool
+ funfirstline);
+
+/* Same, but start with a function address/section instead of a
+ symbol. */
+extern symtab_and_line find_function_start_sal (CORE_ADDR func_addr,
+ obj_section *section,
+ bool funfirstline);
extern void skip_prologue_sal (struct symtab_and_line *);