diff options
author | Alan Modra <amodra@gmail.com> | 2014-10-15 21:52:20 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-10-28 16:41:11 +1030 |
commit | 986b34e134011175be26b4504ba8a4f8e38de2bf (patch) | |
tree | 91ebf4afd4e2d91e0a719e86f7a007920027ed5c /bfd | |
parent | 952d0b7d11c8e13f74df3651b28c4d49bc4d9d80 (diff) | |
download | binutils-986b34e134011175be26b4504ba8a4f8e38de2bf.tar.gz binutils-986b34e134011175be26b4504ba8a4f8e38de2bf.tar.bz2 binutils-986b34e134011175be26b4504ba8a4f8e38de2bf.zip |
Merge bfd_find_nearest_line variants
When bfd_find_nearest_line_discriminator was added, not enough care
was taken to ensure all targets had a proper definition of the function.
This patch cures that by merging bfd_find_nearest_line_discriminator
and bfd_find_nearest_line target implementations.
PR 17481
* aoutx.h (NAME (aout, find_nearest_line)): Add "discriminator_ptr"
param, group "section" and "offset" params. Zero discriminator.
* bfd.c (bfd_find_nearest_line): Implement with new
_bfd_find_nearest_line.
(bfd_find_nearest_line_discriminator): Likewise.
* coff-i386.c (_bfd_generic_find_nearest_line_discriminator): Don't
define.
* coff-rs6000.c (xcoff_find_nearest_line,
xcoff_find_nearest_line_discriminator): Delete.
(_bfd_xcoff_find_nearest_line): Don't define.
(_bfd_xcoff_find_nearest_line): Define as coff_find_nearest_line.
* coff-x86_64.c (_bfd_generic_find_nearest_line_discriminator): Don't
define.
* coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Adjust.
* coffgen.c (coff_find_nearest_line_with_names): Reorder params,
adjust _bfd_dwarf2_find_nearest_line call.
(coff_find_nearest_line): Add "discriminator_ptr" param, reorder
others. Set discriminator. Adjust call.
(coff_find_nearest_line_discriminator): Delete.
* dwarf1.c (_bfd_dwarf1_find_nearest_line): Reorder params.
* dwarf2.c (find_line): Rename to..
(_bfd_dwarf2_find_nearest_line): ..this, reordering params.
Simplify setting of do_line. Delete old function.
(_bfd_dwarf2_find_line): Delete.
* ecoff.c (_bfd_ecoff_find_nearest_line): Reorder params, add
discriminator_ptr and set it.
* elf-bfd.h (_bfd_elf_find_nearest_line): Update prototype.
(_bfd_elf_find_nearest_line_discriminator): Delete.
(_bfd_elf_find_line_discriminator): Delete.
(_bfd_generic_find_nearest_line_discriminator): Don't define.
* elf.c (elf_find_function): Reorder params.
(_bfd_elf_find_nearest_line): Reorder params, add discriminator_ptr.
Adjust calls.
(_bfd_elf_find_nearest_line_discriminator): Delete.
(_bfd_elf_find_line): Adjust call.
* elf32-arm.c (arm_elf_find_function): Reorder params.
(elf32_arm_find_nearest_line): Reorder params, add discriminator_ptr.
Adjust calls.
* elf64-alpha.c (elf64_alpha_find_nearest_line): Similarly.
* elfnn-aarch64.c (aarch64_elf_find_function): Reorder params.
(elfNN_aarch64_find_nearest_line): Reorder params, add
discriminator_ptr. Adjust calls.
* elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Similarly.
* elfxx-mips.h (_bfd_mips_elf_find_nearest_line): Update prototype.
* libaout.h (NAME (aout, find_nearest_line)): Update prototype.
* libbfd-in.h (_bfd_nosymbols_find_nearest_line): Update.
(_bfd_dwarf1_find_nearest_line): Likewise.
(_bfd_dwarf2_find_nearest_line): Likewise.
(_bfd_dwarf2_find_line): Delete.
(_bfd_generic_find_nearest_line_discriminator): Delete.
* libbfd.c (_bfd_generic_find_nearest_line_discriminator): Delete.
* libcoff-in.h (coff_find_nearest_line): Update prototype.
(coff_find_nearest_line_discriminator): Delete.
(coff_find_nearest_line_with_names): Update prototype.
* libecoff.h (_bfd_ecoff_find_nearest_line): Update prototype.
* mach-o.c (bfd_mach_o_find_nearest_line): Reorder params, add
discriminator_ptr. Adjust calls.
* mach-o.h (bfd_mach_o_find_nearest_line): Update prototype.
* pdp11.c (NAME (aout, find_nearest_line)): Reorder params, add
discriminator_ptr and set.
* som.c (som_find_nearest_line): Similarly.
* targets.c (BFD_JUMP_TABLE_SYMBOLS): Delete entry for
_bfd_find_nearest_line_discriminator.
(struct bfd_target <_bfd_find_nearest_line>): Adjust prototype.
(struct bfd_target <_bfd_find_nearest_line_discriminator>): Delete.
* vms-alpha.c (_bfd_vms_find_nearest_dst_line): Rename to..
(_bfd_vms_find_nearest_line): ..this. Reorder params, add
"discriminator" and set.
(_bfd_vms_find_nearest_line_discriminator): Delete.
(_bfd_generic_find_nearest_line_discriminator): Don't define.
(alpha_vms_find_nearest_line): Update define.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 77 | ||||
-rw-r--r-- | bfd/aoutx.h | 7 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 12 | ||||
-rw-r--r-- | bfd/bfd.c | 6 | ||||
-rw-r--r-- | bfd/coff-i386.c | 3 | ||||
-rw-r--r-- | bfd/coff-rs6000.c | 37 | ||||
-rw-r--r-- | bfd/coff-x86_64.c | 3 | ||||
-rw-r--r-- | bfd/coff64-rs6000.c | 2 | ||||
-rw-r--r-- | bfd/coffgen.c | 41 | ||||
-rw-r--r-- | bfd/dwarf1.c | 2 | ||||
-rw-r--r-- | bfd/dwarf2.c | 82 | ||||
-rw-r--r-- | bfd/ecoff.c | 9 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 11 | ||||
-rw-r--r-- | bfd/elf.c | 61 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 22 | ||||
-rw-r--r-- | bfd/elf64-alpha.c | 18 | ||||
-rw-r--r-- | bfd/elfnn-aarch64.c | 23 | ||||
-rw-r--r-- | bfd/elfxx-mips.c | 24 | ||||
-rw-r--r-- | bfd/elfxx-mips.h | 4 | ||||
-rw-r--r-- | bfd/libaout.h | 4 | ||||
-rw-r--r-- | bfd/libbfd-in.h | 24 | ||||
-rw-r--r-- | bfd/libbfd.c | 13 | ||||
-rw-r--r-- | bfd/libbfd.h | 24 | ||||
-rw-r--r-- | bfd/libcoff-in.h | 11 | ||||
-rw-r--r-- | bfd/libcoff.h | 11 | ||||
-rw-r--r-- | bfd/libecoff.h | 4 | ||||
-rw-r--r-- | bfd/mach-o.c | 17 | ||||
-rw-r--r-- | bfd/mach-o.h | 7 | ||||
-rw-r--r-- | bfd/pdp11.c | 7 | ||||
-rw-r--r-- | bfd/som.c | 8 | ||||
-rw-r--r-- | bfd/targets.c | 6 | ||||
-rw-r--r-- | bfd/vms-alpha.c | 38 |
32 files changed, 260 insertions, 358 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c1c8e1c938b..aa6ea5b4cbf 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -2,6 +2,83 @@ Apply trunk patches 2014-10-15 Alan Modra <amodra@gmail.com> + PR 17481 + * aoutx.h (NAME (aout, find_nearest_line)): Add "discriminator_ptr" + param, group "section" and "offset" params. Zero discriminator. + * bfd.c (bfd_find_nearest_line): Implement with new + _bfd_find_nearest_line. + (bfd_find_nearest_line_discriminator): Likewise. + * coff-i386.c (_bfd_generic_find_nearest_line_discriminator): Don't + define. + * coff-rs6000.c (xcoff_find_nearest_line, + xcoff_find_nearest_line_discriminator): Delete. + (_bfd_xcoff_find_nearest_line): Don't define. + (_bfd_xcoff_find_nearest_line): Define as coff_find_nearest_line. + * coff-x86_64.c (_bfd_generic_find_nearest_line_discriminator): Don't + define. + * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Adjust. + * coffgen.c (coff_find_nearest_line_with_names): Reorder params, + adjust _bfd_dwarf2_find_nearest_line call. + (coff_find_nearest_line): Add "discriminator_ptr" param, reorder + others. Set discriminator. Adjust call. + (coff_find_nearest_line_discriminator): Delete. + * dwarf1.c (_bfd_dwarf1_find_nearest_line): Reorder params. + * dwarf2.c (find_line): Rename to.. + (_bfd_dwarf2_find_nearest_line): ..this, reordering params. + Simplify setting of do_line. Delete old function. + (_bfd_dwarf2_find_line): Delete. + * ecoff.c (_bfd_ecoff_find_nearest_line): Reorder params, add + discriminator_ptr and set it. + * elf-bfd.h (_bfd_elf_find_nearest_line): Update prototype. + (_bfd_elf_find_nearest_line_discriminator): Delete. + (_bfd_elf_find_line_discriminator): Delete. + (_bfd_generic_find_nearest_line_discriminator): Don't define. + * elf.c (elf_find_function): Reorder params. + (_bfd_elf_find_nearest_line): Reorder params, add discriminator_ptr. + Adjust calls. + (_bfd_elf_find_nearest_line_discriminator): Delete. + (_bfd_elf_find_line): Adjust call. + * elf32-arm.c (arm_elf_find_function): Reorder params. + (elf32_arm_find_nearest_line): Reorder params, add discriminator_ptr. + Adjust calls. + * elf64-alpha.c (elf64_alpha_find_nearest_line): Similarly. + * elfnn-aarch64.c (aarch64_elf_find_function): Reorder params. + (elfNN_aarch64_find_nearest_line): Reorder params, add + discriminator_ptr. Adjust calls. + * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Similarly. + * elfxx-mips.h (_bfd_mips_elf_find_nearest_line): Update prototype. + * libaout.h (NAME (aout, find_nearest_line)): Update prototype. + * libbfd-in.h (_bfd_nosymbols_find_nearest_line): Update. + (_bfd_dwarf1_find_nearest_line): Likewise. + (_bfd_dwarf2_find_nearest_line): Likewise. + (_bfd_dwarf2_find_line): Delete. + (_bfd_generic_find_nearest_line_discriminator): Delete. + * libbfd.c (_bfd_generic_find_nearest_line_discriminator): Delete. + * libcoff-in.h (coff_find_nearest_line): Update prototype. + (coff_find_nearest_line_discriminator): Delete. + (coff_find_nearest_line_with_names): Update prototype. + * libecoff.h (_bfd_ecoff_find_nearest_line): Update prototype. + * mach-o.c (bfd_mach_o_find_nearest_line): Reorder params, add + discriminator_ptr. Adjust calls. + * mach-o.h (bfd_mach_o_find_nearest_line): Update prototype. + * pdp11.c (NAME (aout, find_nearest_line)): Reorder params, add + discriminator_ptr and set. + * som.c (som_find_nearest_line): Similarly. + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Delete entry for + _bfd_find_nearest_line_discriminator. + (struct bfd_target <_bfd_find_nearest_line>): Adjust prototype. + (struct bfd_target <_bfd_find_nearest_line_discriminator>): Delete. + * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Rename to.. + (_bfd_vms_find_nearest_line): ..this. Reorder params, add + "discriminator" and set. + (_bfd_vms_find_nearest_line_discriminator): Delete. + (_bfd_generic_find_nearest_line_discriminator): Don't define. + (alpha_vms_find_nearest_line): Update define. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + + 2014-10-15 Alan Modra <amodra@gmail.com> * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_find_line. * aout-adobe.c (aout_32_find_line): Define. (aout_32_bfd_make_debug_symbol, aout_32_bfd_reloc_type_lookup, diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 37365c4e253..bef59b42366 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -2640,12 +2640,13 @@ NAME (aout, minisymbol_to_symbol) (bfd *abfd, bfd_boolean NAME (aout, find_nearest_line) (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *disriminator_ptr) { /* Run down the file looking for the filename, function and linenumber. */ asymbol **p; @@ -2663,6 +2664,8 @@ NAME (aout, find_nearest_line) (bfd *abfd, *filename_ptr = abfd->filename; *functionname_ptr = 0; *line_ptr = 0; + if (disriminator_ptr) + *disriminator_ptr = 0; if (symbols != NULL) { diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 5d09aaca7a8..c7a2bb52738 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6651,12 +6651,12 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -7018,7 +7018,6 @@ typedef struct bfd_target NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ @@ -7040,10 +7039,7 @@ typedef struct bfd_target bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma, const char **, const char **, unsigned int *, unsigned int *); bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, struct bfd_symbol *, diff --git a/bfd/bfd.c b/bfd/bfd.c index 8b609115064..2d9397b5b29 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1444,12 +1444,12 @@ DESCRIPTION . .#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ . BFD_SEND (abfd, _bfd_find_nearest_line, \ -. (abfd, sec, syms, off, file, func, line)) +. (abfd, syms, sec, off, file, func, line, NULL)) . .#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ . line, disc) \ -. BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ -. (abfd, sec, syms, off, file, func, line, disc)) +. BFD_SEND (abfd, _bfd_find_nearest_line, \ +. (abfd, syms, sec, off, file, func, line, disc)) . .#define bfd_find_line(abfd, syms, sym, file, line) \ . BFD_SEND (abfd, _bfd_find_line, \ diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 6a9dbcaf9d2..87b014b9174 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -605,9 +605,6 @@ coff_i386_is_local_label_name (bfd *abfd, const char *name) #include "coffcode.h" -#define _bfd_generic_find_nearest_line_discriminator \ - coff_find_nearest_line_discriminator - const bfd_target #ifdef TARGET_SYM TARGET_SYM = diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 2cb580c3f39..fea5f3bc5e4 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -430,39 +430,6 @@ static const struct dwarf_debug_section xcoff_debug_sections[] = { NULL, NULL }, /* .debug_weaknames */ { NULL, NULL }, }; - -static bfd_boolean -xcoff_find_nearest_line (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr) -{ - return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - -static bfd_boolean -xcoff_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator) -{ - *discriminator = 0; - return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - void _bfd_xcoff_swap_sym_in (bfd *abfd, void * ext1, void * in1) @@ -4045,9 +4012,7 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { #define _bfd_xcoff_bfd_is_target_special_symbol \ coff_bfd_is_target_special_symbol #define _bfd_xcoff_get_lineno coff_get_lineno -#define _bfd_xcoff_find_nearest_line xcoff_find_nearest_line -#define _bfd_generic_find_nearest_line_discriminator \ - xcoff_find_nearest_line_discriminator +#define _bfd_xcoff_find_nearest_line coff_find_nearest_line #define _bfd_xcoff_find_line coff_find_line #define _bfd_xcoff_find_inliner_info coff_find_inliner_info #define _bfd_xcoff_bfd_make_debug_symbol coff_bfd_make_debug_symbol diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c index 682658fcb17..8d237338bf7 100644 --- a/bfd/coff-x86_64.c +++ b/bfd/coff-x86_64.c @@ -730,9 +730,6 @@ coff_amd64_is_local_label_name (bfd *abfd, const char *name) #define amd64coff_object_p coff_object_p #endif -#define _bfd_generic_find_nearest_line_discriminator \ - coff_find_nearest_line_discriminator - const bfd_target #ifdef TARGET_SYM TARGET_SYM = diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index b1968ce7b1f..5985d817d9a 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -2716,7 +2716,6 @@ const bfd_target rs6000_xcoff64_vec = coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, - _bfd_generic_find_nearest_line_discriminator, coff_find_line, coff_find_inliner_info, coff_bfd_make_debug_symbol, @@ -2974,7 +2973,6 @@ const bfd_target rs6000_xcoff64_aix_vec = coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, - _bfd_generic_find_nearest_line_discriminator, coff_find_line, coff_find_inliner_info, coff_bfd_make_debug_symbol, diff --git a/bfd/coffgen.c b/bfd/coffgen.c index a7d5e485be8..3f223897f66 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -2191,13 +2191,13 @@ _bfd_coff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean coff_find_nearest_line_with_names (bfd *abfd, - const struct dwarf_debug_section *debug_sections, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + const struct dwarf_debug_section *debug_sections) { bfd_boolean found; unsigned int i; @@ -2222,10 +2222,9 @@ coff_find_nearest_line_with_names (bfd *abfd, return TRUE; /* Also try examining DWARF2 debugging information. */ - if (_bfd_dwarf2_find_nearest_line (abfd, debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, 0, + line_ptr, NULL, debug_sections, 0, &coff_data(abfd)->dwarf2_find_line_info)) return TRUE; @@ -2407,38 +2406,22 @@ coff_find_nearest_line_with_names (bfd *abfd, bfd_boolean coff_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { - return coff_find_nearest_line_with_names (abfd, dwarf_debug_sections, - section, symbols, offset, + if (discriminator_ptr) + *discriminator_ptr = 0; + return coff_find_nearest_line_with_names (abfd, symbols, section, offset, filename_ptr, functionname_ptr, - line_ptr); + line_ptr, dwarf_debug_sections); } bfd_boolean -coff_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator) -{ - *discriminator = 0; - return coff_find_nearest_line_with_names (abfd, dwarf_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - - -bfd_boolean coff_find_inliner_info (bfd *abfd, const char **filename_ptr, const char **functionname_ptr, diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c index 7a5382d0893..6c292efa4e3 100644 --- a/bfd/dwarf1.c +++ b/bfd/dwarf1.c @@ -449,8 +449,8 @@ dwarf1_unit_find_nearest_line (struct dwarf1_debug* stash, bfd_boolean _bfd_dwarf1_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 1ca69b6915f..8375da43ac5 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -3602,19 +3602,19 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd, field and in the abbreviation offset, or zero to indicate that the default value should be used. */ -static bfd_boolean -find_line (bfd *abfd, - const struct dwarf_debug_section *debug_sections, - asection *section, - bfd_vma offset, - asymbol *symbol, - asymbol **symbols, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *linenumber_ptr, - unsigned int *discriminator_ptr, - unsigned int addr_size, - void **pinfo) +bfd_boolean +_bfd_dwarf2_find_nearest_line (bfd *abfd, + asymbol **symbols, + asymbol *symbol, + asection *section, + bfd_vma offset, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *linenumber_ptr, + unsigned int *discriminator_ptr, + const struct dwarf_debug_section *debug_sections, + unsigned int addr_size, + void **pinfo) { /* Read each compilation unit from the section .debug_info, and check to see if it contains the address we are searching for. If yes, @@ -3645,21 +3645,18 @@ find_line (bfd *abfd, stash = (struct dwarf2_debug *) *pinfo; - do_line = (section == NULL - && offset == 0 - && functionname_ptr == NULL - && symbol != NULL); + do_line = symbol != NULL; if (do_line) { - addr = symbol->value; + BFD_ASSERT (section == NULL && offset == 0 && functionname_ptr == NULL); section = bfd_get_section (symbol); + addr = symbol->value; } - else if (section != NULL - && functionname_ptr != NULL - && symbol == NULL) - addr = offset; else - abort (); + { + BFD_ASSERT (section != NULL && functionname_ptr != NULL); + addr = offset; + } if (section->output_section) addr += section->output_section->vma + section->output_offset; @@ -3874,45 +3871,6 @@ find_line (bfd *abfd, return found; } -/* The DWARF2 version of find_nearest_line. - Return TRUE if the line is found without error. */ - -bfd_boolean -_bfd_dwarf2_find_nearest_line (bfd *abfd, - const struct dwarf_debug_section *debug_sections, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *linenumber_ptr, - unsigned int *discriminator_ptr, - unsigned int addr_size, - void **pinfo) -{ - return find_line (abfd, debug_sections, section, offset, NULL, symbols, - filename_ptr, functionname_ptr, linenumber_ptr, - discriminator_ptr, addr_size, pinfo); -} - -/* The DWARF2 version of find_line. - Return TRUE if the line is found without error. */ - -bfd_boolean -_bfd_dwarf2_find_line (bfd *abfd, - asymbol **symbols, - asymbol *symbol, - const char **filename_ptr, - unsigned int *linenumber_ptr, - unsigned int *discriminator_ptr, - unsigned int addr_size, - void **pinfo) -{ - return find_line (abfd, dwarf_debug_sections, NULL, 0, symbol, symbols, - filename_ptr, NULL, linenumber_ptr, discriminator_ptr, - addr_size, pinfo); -} - bfd_boolean _bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED, const char **filename_ptr, diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 6a9d206e5c0..01f51e644e4 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -1704,12 +1704,13 @@ _bfd_ecoff_canonicalize_reloc (bfd *abfd, bfd_boolean _bfd_ecoff_find_nearest_line (bfd *abfd, + asymbol **symbols ATTRIBUTE_UNUSED, asection *section, - asymbol **ignore_symbols ATTRIBUTE_UNUSED, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *retline_ptr) + unsigned int *retline_ptr, + unsigned int *discriminator_ptr) { const struct ecoff_debug_swap * const debug_swap = &ecoff_backend (abfd)->debug_swap; @@ -1730,8 +1731,10 @@ _bfd_ecoff_find_nearest_line (bfd *abfd, if (ecoff_data (abfd)->find_line_info == NULL) return FALSE; } - line_info = ecoff_data (abfd)->find_line_info; + if (discriminator_ptr) + *discriminator_ptr = 0; + line_info = ecoff_data (abfd)->find_line_info; return _bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap, line_info, filename_ptr, functionname_ptr, retline_ptr); diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 4d0583e1615..0c82278b289 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1898,17 +1898,10 @@ extern alent *_bfd_elf_get_lineno extern bfd_boolean _bfd_elf_set_arch_mach (bfd *, enum bfd_architecture, unsigned long); extern bfd_boolean _bfd_elf_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, - unsigned int *); -extern bfd_boolean _bfd_elf_find_nearest_line_discriminator - (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, - unsigned int *, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); extern bfd_boolean _bfd_elf_find_line (bfd *, asymbol **, asymbol *, const char **, unsigned int *); -extern bfd_boolean _bfd_elf_find_line_discriminator - (bfd *, asymbol **, asymbol *, const char **, unsigned int *, unsigned int *); -#define _bfd_generic_find_nearest_line_discriminator \ - _bfd_elf_find_nearest_line_discriminator extern bfd_boolean _bfd_elf_find_inliner_info (bfd *, const char **, const char **, unsigned int *); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols diff --git a/bfd/elf.c b/bfd/elf.c index a772db0e74f..c884d1d6a93 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -7549,8 +7549,8 @@ _bfd_elf_set_arch_mach (bfd *abfd, static bfd_boolean elf_find_function (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr) @@ -7652,52 +7652,35 @@ elf_find_function (bfd *abfd, bfd_boolean _bfd_elf_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) -{ - return _bfd_elf_find_nearest_line_discriminator (abfd, section, symbols, - offset, filename_ptr, - functionname_ptr, - line_ptr, - NULL); -} - -bfd_boolean -_bfd_elf_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { bfd_boolean found; - if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr)) + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, + &elf_tdata (abfd)->dwarf2_find_line_info)) { if (!*functionname_ptr) - elf_find_function (abfd, section, symbols, offset, + elf_find_function (abfd, symbols, section, offset, *filename_ptr ? NULL : filename_ptr, functionname_ptr); return TRUE; } - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr, discriminator_ptr, 0, - &elf_tdata (abfd)->dwarf2_find_line_info)) + if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset, + filename_ptr, functionname_ptr, line_ptr)) { if (!*functionname_ptr) - elf_find_function (abfd, section, symbols, offset, + elf_find_function (abfd, symbols, section, offset, *filename_ptr ? NULL : filename_ptr, functionname_ptr); @@ -7715,7 +7698,7 @@ _bfd_elf_find_nearest_line_discriminator (bfd *abfd, if (symbols == NULL) return FALSE; - if (! elf_find_function (abfd, section, symbols, offset, + if (! elf_find_function (abfd, symbols, section, offset, filename_ptr, functionname_ptr)) return FALSE; @@ -7729,20 +7712,10 @@ bfd_boolean _bfd_elf_find_line (bfd *abfd, asymbol **symbols, asymbol *symbol, const char **filename_ptr, unsigned int *line_ptr) { - return _bfd_elf_find_line_discriminator (abfd, symbols, symbol, - filename_ptr, line_ptr, - NULL); -} - -bfd_boolean -_bfd_elf_find_line_discriminator (bfd *abfd, asymbol **symbols, asymbol *symbol, - const char **filename_ptr, - unsigned int *line_ptr, - unsigned int *discriminator_ptr) -{ - return _bfd_dwarf2_find_line (abfd, symbols, symbol, - filename_ptr, line_ptr, discriminator_ptr, 0, - &elf_tdata (abfd)->dwarf2_find_line_info); + return _bfd_dwarf2_find_nearest_line (abfd, symbols, symbol, NULL, 0, + filename_ptr, NULL, line_ptr, NULL, + dwarf_debug_sections, 0, + &elf_tdata (abfd)->dwarf2_find_line_info); } /* After a call to bfd_find_nearest_line, successive calls to diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 08aa3f9e396..b4bf5e652f3 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -13083,8 +13083,8 @@ elf32_arm_is_target_special_symbol (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym) static bfd_boolean arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED, - asection * section, asymbol ** symbols, + asection * section, bfd_vma offset, const char ** filename_ptr, const char ** functionname_ptr) @@ -13145,31 +13145,33 @@ arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED, static bfd_boolean elf32_arm_find_nearest_line (bfd * abfd, - asection * section, asymbol ** symbols, + asection * section, bfd_vma offset, const char ** filename_ptr, const char ** functionname_ptr, - unsigned int * line_ptr) + unsigned int * line_ptr, + unsigned int * discriminator_ptr) { bfd_boolean found = FALSE; - /* We skip _bfd_dwarf1_find_nearest_line since no known ARM toolchain uses it. */ - - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, 0, + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, & elf_tdata (abfd)->dwarf2_find_line_info)) { if (!*functionname_ptr) - arm_elf_find_function (abfd, section, symbols, offset, + arm_elf_find_function (abfd, symbols, section, offset, *filename_ptr ? NULL : filename_ptr, functionname_ptr); return TRUE; } + /* Skip _bfd_dwarf1_find_nearest_line since no known ARM toolchain + uses DWARF1. */ + if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, & found, filename_ptr, functionname_ptr, line_ptr, @@ -13182,7 +13184,7 @@ elf32_arm_find_nearest_line (bfd * abfd, if (symbols == NULL) return FALSE; - if (! arm_elf_find_function (abfd, section, symbols, offset, + if (! arm_elf_find_function (abfd, symbols, section, offset, filename_ptr, functionname_ptr)) return FALSE; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 968e45c685a..1a4fc236b0a 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1442,17 +1442,19 @@ elf64_alpha_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name) } static bfd_boolean -elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols, - bfd_vma offset, const char **filename_ptr, +elf64_alpha_find_nearest_line (bfd *abfd, asymbol **symbols, + asection *section, bfd_vma offset, + const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { asection *msec; - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, 0, + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, &elf_tdata (abfd)->dwarf2_find_line_info)) return TRUE; @@ -1532,9 +1534,9 @@ elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols, /* Fall back on the generic ELF find_nearest_line routine. */ - return _bfd_elf_find_nearest_line (abfd, section, symbols, offset, + return _bfd_elf_find_nearest_line (abfd, symbols, section, offset, filename_ptr, functionname_ptr, - line_ptr); + line_ptr, discriminator_ptr); } /* Structure used to pass information to alpha_elf_output_extsym. */ diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index dbbcade7157..19ad4d29b57 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -5968,8 +5968,8 @@ elfNN_aarch64_is_target_special_symbol (bfd *abfd ATTRIBUTE_UNUSED, static bfd_boolean aarch64_elf_find_function (bfd *abfd ATTRIBUTE_UNUSED, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr) @@ -6028,32 +6028,33 @@ aarch64_elf_find_function (bfd *abfd ATTRIBUTE_UNUSED, static bfd_boolean elfNN_aarch64_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { bfd_boolean found = FALSE; - /* We skip _bfd_dwarf1_find_nearest_line since no known AArch64 - toolchain uses it. */ - - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, 0, + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, &elf_tdata (abfd)->dwarf2_find_line_info)) { if (!*functionname_ptr) - aarch64_elf_find_function (abfd, section, symbols, offset, + aarch64_elf_find_function (abfd, symbols, section, offset, *filename_ptr ? NULL : filename_ptr, functionname_ptr); return TRUE; } + /* Skip _bfd_dwarf1_find_nearest_line since no known AArch64 + toolchain uses DWARF1. */ + if (!_bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, &found, filename_ptr, functionname_ptr, line_ptr, @@ -6066,7 +6067,7 @@ elfNN_aarch64_find_nearest_line (bfd *abfd, if (symbols == NULL) return FALSE; - if (!aarch64_elf_find_function (abfd, section, symbols, offset, + if (!aarch64_elf_find_function (abfd, symbols, section, offset, filename_ptr, functionname_ptr)) return FALSE; diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 73438357922..a1e9945c79f 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -12591,24 +12591,26 @@ struct mips_elf_find_line }; bfd_boolean -_bfd_mips_elf_find_nearest_line (bfd *abfd, asection *section, - asymbol **symbols, bfd_vma offset, +_bfd_mips_elf_find_nearest_line (bfd *abfd, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { asection *msec; - if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr)) + line_ptr, discriminator_ptr, + dwarf_debug_sections, + ABI_64_P (abfd) ? 8 : 0, + &elf_tdata (abfd)->dwarf2_find_line_info)) return TRUE; - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, + if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, ABI_64_P (abfd) ? 8 : 0, - &elf_tdata (abfd)->dwarf2_find_line_info)) + line_ptr)) return TRUE; msec = bfd_get_section_by_name (abfd, ".mdebug"); @@ -12687,9 +12689,9 @@ _bfd_mips_elf_find_nearest_line (bfd *abfd, asection *section, /* Fall back on the generic ELF find_nearest_line routine. */ - return _bfd_elf_find_nearest_line (abfd, section, symbols, offset, + return _bfd_elf_find_nearest_line (abfd, symbols, section, offset, filename_ptr, functionname_ptr, - line_ptr); + line_ptr, discriminator_ptr); } bfd_boolean diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index a4d1b27f1a2..8f5c53ee650 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -86,8 +86,8 @@ extern bfd_boolean _bfd_mips_elf_ignore_discarded_relocs extern bfd_boolean _bfd_mips_elf_is_target_special_symbol (bfd *abfd, asymbol *sym); extern bfd_boolean _bfd_mips_elf_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); extern bfd_boolean _bfd_mips_elf_find_inliner_info (bfd *, const char **, const char **, unsigned int *); extern bfd_boolean _bfd_mips_elf_set_section_contents diff --git a/bfd/libaout.h b/bfd/libaout.h index 2ec3049728a..25277cbd087 100644 --- a/bfd/libaout.h +++ b/bfd/libaout.h @@ -551,8 +551,8 @@ extern void NAME (aout, get_symbol_info) (bfd *, asymbol *, symbol_info *); extern bfd_boolean NAME (aout, find_nearest_line) - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); extern long NAME (aout, read_minisymbols) (bfd *, bfd_boolean, void * *, unsigned int *); diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 23769f37a70..50a46ac4d26 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -399,8 +399,9 @@ extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); #define _bfd_nosymbols_get_lineno \ ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) #define _bfd_nosymbols_find_nearest_line \ - ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \ - const char **, unsigned int *)) \ + ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \ + const char **, const char **, unsigned int *, \ + unsigned int *)) \ bfd_false) #define _bfd_nosymbols_find_line \ ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \ @@ -524,8 +525,8 @@ extern bfd_boolean _bfd_stab_section_find_nearest_line /* Find the nearest line using DWARF 1 debugging information. */ extern bfd_boolean _bfd_dwarf1_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *); struct dwarf_debug_section { @@ -540,18 +541,9 @@ extern const struct dwarf_debug_section dwarf_debug_sections[]; /* Find the nearest line using DWARF 2 debugging information. */ extern bfd_boolean _bfd_dwarf2_find_nearest_line - (bfd *, const struct dwarf_debug_section *, asection *, asymbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *, unsigned int, - void **); - -/* Find the line using DWARF 2 debugging information. */ -extern bfd_boolean _bfd_dwarf2_find_line - (bfd *, asymbol **, asymbol *, const char **, - unsigned int *, unsigned int *, unsigned int, void **); - -bfd_boolean _bfd_generic_find_nearest_line_discriminator - (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, - unsigned int *, unsigned int *); + (bfd *, asymbol **, asymbol *, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *, + const struct dwarf_debug_section *, unsigned int, void **); /* Find inliner info after calling bfd_find_nearest_line. */ extern bfd_boolean _bfd_dwarf2_find_inliner_info diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 59b0e1f6238..6352c9cf836 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -1105,19 +1105,6 @@ read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED, } bfd_boolean -_bfd_generic_find_nearest_line_discriminator (bfd *abfd ATTRIBUTE_UNUSED, - asection *section ATTRIBUTE_UNUSED, - asymbol **symbols ATTRIBUTE_UNUSED, - bfd_vma offset ATTRIBUTE_UNUSED, - const char **filename_ptr ATTRIBUTE_UNUSED, - const char **functionname_ptr ATTRIBUTE_UNUSED, - unsigned int *line_ptr ATTRIBUTE_UNUSED, - unsigned int *discriminator_ptr ATTRIBUTE_UNUSED) -{ - return FALSE; -} - -bfd_boolean _bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED, asection *isec ATTRIBUTE_UNUSED, bfd *obfd ATTRIBUTE_UNUSED, diff --git a/bfd/libbfd.h b/bfd/libbfd.h index af8ccc5f755..6c48f82a5db 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -404,8 +404,9 @@ extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); #define _bfd_nosymbols_get_lineno \ ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) #define _bfd_nosymbols_find_nearest_line \ - ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \ - const char **, unsigned int *)) \ + ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \ + const char **, const char **, unsigned int *, \ + unsigned int *)) \ bfd_false) #define _bfd_nosymbols_find_line \ ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \ @@ -529,8 +530,8 @@ extern bfd_boolean _bfd_stab_section_find_nearest_line /* Find the nearest line using DWARF 1 debugging information. */ extern bfd_boolean _bfd_dwarf1_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *); struct dwarf_debug_section { @@ -545,18 +546,9 @@ extern const struct dwarf_debug_section dwarf_debug_sections[]; /* Find the nearest line using DWARF 2 debugging information. */ extern bfd_boolean _bfd_dwarf2_find_nearest_line - (bfd *, const struct dwarf_debug_section *, asection *, asymbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *, unsigned int, - void **); - -/* Find the line using DWARF 2 debugging information. */ -extern bfd_boolean _bfd_dwarf2_find_line - (bfd *, asymbol **, asymbol *, const char **, - unsigned int *, unsigned int *, unsigned int, void **); - -bfd_boolean _bfd_generic_find_nearest_line_discriminator - (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, - unsigned int *, unsigned int *); + (bfd *, asymbol **, asymbol *, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *, + const struct dwarf_debug_section *, unsigned int, void **); /* Find inliner info after calling bfd_find_nearest_line. */ extern bfd_boolean _bfd_dwarf2_find_inliner_info diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index 44185a5f33d..6162f2ee57c 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -355,16 +355,13 @@ extern bfd_boolean _bfd_coff_is_local_label_name extern asymbol *coff_bfd_make_debug_symbol (bfd *, void *, unsigned long); extern bfd_boolean coff_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *); -extern bfd_boolean coff_find_nearest_line_discriminator - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); #define coff_find_line _bfd_nosymbols_find_line struct dwarf_debug_section; extern bfd_boolean coff_find_nearest_line_with_names - (bfd *, const struct dwarf_debug_section *, asection *, asymbol **, - bfd_vma, const char **, const char **, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **, + unsigned int *, const struct dwarf_debug_section *); extern bfd_boolean coff_find_inliner_info (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 67fb13637df..12f19d07f6f 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -359,16 +359,13 @@ extern bfd_boolean _bfd_coff_is_local_label_name extern asymbol *coff_bfd_make_debug_symbol (bfd *, void *, unsigned long); extern bfd_boolean coff_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *); -extern bfd_boolean coff_find_nearest_line_discriminator - (bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); #define coff_find_line _bfd_nosymbols_find_line struct dwarf_debug_section; extern bfd_boolean coff_find_nearest_line_with_names - (bfd *, const struct dwarf_debug_section *, asection *, asymbol **, - bfd_vma, const char **, const char **, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **, + unsigned int *, const struct dwarf_debug_section *); extern bfd_boolean coff_find_inliner_info (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers diff --git a/bfd/libecoff.h b/bfd/libecoff.h index a9afd8b9db4..06434c27e0d 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -289,8 +289,8 @@ extern bfd_boolean _bfd_ecoff_bfd_is_local_label_name (bfd *, const char *); #define _bfd_ecoff_get_lineno _bfd_nosymbols_get_lineno extern bfd_boolean _bfd_ecoff_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, - unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); #define _bfd_ecoff_find_line _bfd_nosymbols_find_line #define _bfd_ecoff_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define _bfd_ecoff_read_minisymbols _bfd_generic_read_minisymbols diff --git a/bfd/mach-o.c b/bfd/mach-o.c index 344bb3f4a3f..39526898d5b 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -5631,12 +5631,13 @@ bfd_mach_o_follow_dsym (bfd *abfd) bfd_boolean bfd_mach_o_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); if (mdata == NULL) @@ -5668,13 +5669,11 @@ bfd_mach_o_find_nearest_line (bfd *abfd, default: return FALSE; } - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr, NULL, 0, - &mdata->dwarf2_find_line_info)) - return TRUE; - return FALSE; + return _bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, + filename_ptr, functionname_ptr, + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, + &mdata->dwarf2_find_line_info); } bfd_boolean diff --git a/bfd/mach-o.h b/bfd/mach-o.h index 415c17507b6..afe2dee071b 100644 --- a/bfd/mach-o.h +++ b/bfd/mach-o.h @@ -680,9 +680,10 @@ unsigned int bfd_mach_o_get_section_attribute_from_name (const char *); void bfd_mach_o_convert_section_name_to_bfd (bfd *, const char *, const char *, const char **, flagword *); -bfd_boolean bfd_mach_o_find_nearest_line (bfd *, asection *, asymbol **, - bfd_vma, const char **, - const char **, unsigned int *); +bfd_boolean bfd_mach_o_find_nearest_line (bfd *, asymbol **, + asection *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); #define bfd_mach_o_find_line _bfd_nosymbols_find_line bfd_boolean bfd_mach_o_close_and_cleanup (bfd *); bfd_boolean bfd_mach_o_free_cached_info (bfd *); diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 8bce8651324..593c5ca9b50 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -2182,12 +2182,13 @@ NAME (aout, minisymbol_to_symbol) (bfd *abfd, bfd_boolean NAME (aout, find_nearest_line) (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { /* Run down the file looking for the filename, function and linenumber. */ asymbol **p; @@ -2204,6 +2205,8 @@ NAME (aout, find_nearest_line) (bfd *abfd, *filename_ptr = abfd->filename; *functionname_ptr = 0; *line_ptr = 0; + if (discriminator_ptr) + *discriminator_ptr = 0; if (symbols != NULL) { diff --git a/bfd/som.c b/bfd/som.c index 6bc4ac922cc..513e4fa6049 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -5715,18 +5715,22 @@ som_set_arch_mach (bfd *abfd, static bfd_boolean som_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { bfd_boolean found; asymbol *func; bfd_vma low_func; asymbol **p; + if (discriminator_ptr) + *discriminator_ptr = 0; + if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, & found, filename_ptr, functionname_ptr, line_ptr, diff --git a/bfd/targets.c b/bfd/targets.c index 6112aa1515a..8323e9256a1 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -367,7 +367,6 @@ BFD_JUMP_TABLE macros. . NAME##_bfd_is_target_special_symbol, \ . NAME##_get_lineno, \ . NAME##_find_nearest_line, \ -. _bfd_generic_find_nearest_line_discriminator, \ . NAME##_find_line, \ . NAME##_find_inliner_info, \ . NAME##_bfd_make_debug_symbol, \ @@ -389,10 +388,7 @@ BFD_JUMP_TABLE macros. . bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); . alent * (*_get_lineno) (bfd *, struct bfd_symbol *); . bfd_boolean (*_bfd_find_nearest_line) -. (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, -. const char **, const char **, unsigned int *); -. bfd_boolean (*_bfd_find_nearest_line_discriminator) -. (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, +. (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma, . const char **, const char **, unsigned int *, unsigned int *); . bfd_boolean (*_bfd_find_line) . (bfd *, struct bfd_symbol **, struct bfd_symbol *, diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index a6344223953..5ff5bfd4ea9 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -4575,10 +4575,14 @@ module_find_nearest_line (bfd *abfd, struct module *module, bfd_vma addr, location. */ static bfd_boolean -_bfd_vms_find_nearest_dst_line (bfd *abfd, asection *section, - asymbol **symbols ATTRIBUTE_UNUSED, - bfd_vma offset, const char **file, - const char **func, unsigned int *line) +_bfd_vms_find_nearest_line (bfd *abfd, + asymbol **symbols ATTRIBUTE_UNUSED, + asection *section, + bfd_vma offset, + const char **file, + const char **func, + unsigned int *line, + unsigned int *discriminator) { struct module *module; @@ -4588,6 +4592,8 @@ _bfd_vms_find_nearest_dst_line (bfd *abfd, asection *section, *file = NULL; *func = NULL; *line = 0; + if (discriminator) + *discriminator = 0; /* We can't do anything if there is no DST (debug symbol table). */ if (PRIV (dst_section) == NULL) @@ -4607,26 +4613,6 @@ _bfd_vms_find_nearest_dst_line (bfd *abfd, asection *section, return FALSE; } - -/* Likewise but with a discriminator. */ - -static bfd_boolean -_bfd_vms_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator) -{ - *discriminator = 0; - - return _bfd_vms_find_nearest_dst_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - /* Canonicalizations. */ /* Set name, value, section and flags of SYM from E. */ @@ -9207,9 +9193,7 @@ bfd_vms_get_data (bfd *abfd) #define alpha_vms_get_lineno _bfd_nosymbols_get_lineno #define alpha_vms_find_inliner_info _bfd_nosymbols_find_inliner_info #define alpha_vms_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol -#define alpha_vms_find_nearest_line _bfd_vms_find_nearest_dst_line -#define _bfd_generic_find_nearest_line_discriminator \ - _bfd_vms_find_nearest_line_discriminator +#define alpha_vms_find_nearest_line _bfd_vms_find_nearest_line #define alpha_vms_find_line _bfd_nosymbols_find_line #define alpha_vms_bfd_is_local_label_name vms_bfd_is_local_label_name |