diff options
author | Pedro Alves <palves@redhat.com> | 2018-04-26 13:01:26 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2018-04-26 13:07:47 +0100 |
commit | 42ddae103c9eb20fb87378548ee95b4bd23648a5 (patch) | |
tree | 5c80aa1d1f176e414687769979a72961ea20ecaa /gdb/linespec.c | |
parent | a0aca7b0e13d884f43ba77c4c6d752d9140cb54b (diff) | |
download | binutils-gdb-42ddae103c9eb20fb87378548ee95b4bd23648a5.tar.gz |
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/linespec.c')
-rw-r--r-- | gdb/linespec.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c index b2deabe3af0..045c97af738 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -4292,25 +4292,7 @@ minsym_found (struct linespec_state *self, struct objfile *objfile, symtab_and_line sal; if (is_function && want_start_sal) - { - sal = find_pc_sect_line (func_addr, NULL, 0); - - if (self->funfirstline) - { - if (sal.symtab != NULL - && (COMPUNIT_LOCATIONS_VALID (SYMTAB_COMPUNIT (sal.symtab)) - || SYMTAB_LANGUAGE (sal.symtab) == language_asm)) - { - struct gdbarch *gdbarch = get_objfile_arch (objfile); - - sal.pc = func_addr; - if (gdbarch_skip_entrypoint_p (gdbarch)) - sal.pc = gdbarch_skip_entrypoint (gdbarch, sal.pc); - } - else - skip_prologue_sal (&sal); - } - } + sal = find_function_start_sal (func_addr, NULL, self->funfirstline); else { sal.objfile = objfile; |