Merge bfd_find_nearest_line variants
authorAlan Modra <amodra@gmail.com>
Wed, 15 Oct 2014 11:22:20 +0000 (21:52 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 15 Oct 2014 12:25:25 +0000 (22:55 +1030)
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.

32 files changed:
bfd/ChangeLog
bfd/aoutx.h
bfd/bfd-in2.h
bfd/bfd.c
bfd/coff-i386.c
bfd/coff-rs6000.c
bfd/coff-x86_64.c
bfd/coff64-rs6000.c
bfd/coffgen.c
bfd/dwarf1.c
bfd/dwarf2.c
bfd/ecoff.c
bfd/elf-bfd.h
bfd/elf.c
bfd/elf32-arm.c
bfd/elf64-alpha.c
bfd/elfnn-aarch64.c
bfd/elfxx-mips.c
bfd/elfxx-mips.h
bfd/libaout.h
bfd/libbfd-in.h
bfd/libbfd.c
bfd/libbfd.h
bfd/libcoff-in.h
bfd/libcoff.h
bfd/libecoff.h
bfd/mach-o.c
bfd/mach-o.h
bfd/pdp11.c
bfd/som.c
bfd/targets.c
bfd/vms-alpha.c

index 60dafe047aefbf2f43ad921db83e7f1e8c769770..33dfb4ae9fa17089e746ec11ddbbbca4212857ad 100644 (file)
@@ -1,3 +1,81 @@
+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.
index 37365c4e2533c7f68e5109e586c6e2fa3690de49..bef59b423667fab30cf26666391de17e08149d12 100644 (file)
@@ -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)
     {
index 2d64300c36fd67a9c87a64beeeb0dad6c38497a0..928aa3598dfc236f1e848be4e73138ee97107b51 100644 (file)
@@ -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 *,
index 8b609115064ca7a356f4bc3a3ccc3a73d2b43890..2d9397b5b2981b683956eefe3cb59940776fdf79 100644 (file)
--- 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, \
index 6a9dbcaf9d22732372d30c62a455cd84c32afd14..87b014b9174a68cf721cf7b965b38cc75c8ef775 100644 (file)
@@ -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 =
index 2cb580c3f39fa5be08de6500c7889751f627fda8..fea5f3bc5e420f0ba2b2841dcdf9573b370d64ae 100644 (file)
@@ -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);
-}
-
 \f
 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
index 682658fcb175195e706384501d969e05b363bbc2..8d237338bf73b2f89c270385b2fb784ee5ba18fc 100644 (file)
@@ -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 =
index b1968ce7b1f59bb2d6432985f13168d61e242172..5985d817d9a0fa06bdb00a8b4e71c77feb44ce43 100644 (file)
@@ -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,
index a7d5e485be84d8aea17130a30cccb65d33527c7c..3f223897f66767cb5e6be32f1a58cbf7441f5b46 100644 (file)
@@ -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,37 +2406,21 @@ 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,
index 7a5382d0893cb8bceefeb30244ba6849835b891b..6c292efa4e323ad05ac1d114e67a3aab1c058cdc 100644 (file)
@@ -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,
index 1ca69b6915fea167c60c19e4433c54b7674c8d17..8375da43ac5e6267992c9876cf1d979ee10aec49 100644 (file)
@@ -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,
index 6a9d206e5c0252aeb13297f53b7e1d96e48ca9b8..01f51e644e416133656617c709c0206052dc4f6a 100644 (file)
@@ -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);
index 4d0583e1615241931bebddd0c1b9a78f15880b46..0c82278b289450009bfa914e328c2db2c492adac 100644 (file)
@@ -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
index a772db0e74f1a3acfd105aec8cdb20e542608529..c884d1d6a930d01d38599b813a24b2a12fb4fcf7 100644 (file)
--- 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
index 08aa3f9e39617a7b4dbe701d25d8c4a6649b5924..b4bf5e652f3dc1aa40e0d4330003ceae28c78cbc 100644 (file)
@@ -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;
 
index 968e45c685a44317e50de2a7b6d1cf8e6913f465..1a4fc236b0ad96a93cf637549ca482ea4b7b7ba7 100644 (file)
@@ -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);
 }
 \f
 /* Structure used to pass information to alpha_elf_output_extsym.  */
index d7b30374370e350ec56b0ace05956eb3ff1b6929..9e000690dde3e2ac4b18b679ad98395af9c49ed4 100644 (file)
@@ -5353,8 +5353,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)
@@ -5413,32 +5413,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,
@@ -5451,7 +5452,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;
 
index 734383579226fe4ec827410e8650941381e6c269..a1e9945c79f1a3118fbd9585f661361e3f4ac120 100644 (file)
@@ -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
index a4d1b27f1a23b739cee689f45bef9439be1cc701..8f5c53ee65023ced19c7af91a3f86994f16165e2 100644 (file)
@@ -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
index 2ec3049728a89f2071af7db1560896ee09bee0fd..25277cbd087f100ec8815578e654641518fa1cbf 100644 (file)
@@ -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 *);
index 23769f37a70f784d09f2d84f42ecf5207a8cc3ce..50a46ac4d261ab8addef375eb523877e679b5434 100644 (file)
@@ -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
index 59b0e1f62387095783110decf38d2ee625aaf061..6352c9cf8369af0b8004557d5d35eb28b67f2787 100644 (file)
@@ -1104,19 +1104,6 @@ read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
   return result;
 }
 
-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,
index af8ccc5f755cd29f1b9eed24e687efc7148e2ed2..6c48f82a5db8c9a7dee8b605f0cd627542147d6e 100644 (file)
@@ -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
index 44185a5f33d86567e33f03c91bcdca600294d0d4..6162f2ee57c3612dd37de2b866e29f45ac00bff3 100644 (file)
@@ -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
index 67fb13637dff5dae51135e192c2466273570e804..12f19d07f6f03168cb00382b005d007cb87e730b 100644 (file)
@@ -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
index a9afd8b9db40f45085d34851b2971ee271b37179..06434c27e0dcd0594c99dc87be9a66151cb12726 100644 (file)
@@ -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
index 344bb3f4a3f4c4d2f4797a389ceec59ffe7f716e..39526898d5bb70fc891c6cb32574ff7ecb4838ba 100644 (file)
@@ -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
index 415c17507b65a83f45e16e28347600bb7cc136c5..afe2dee071b0841134b34392878e7d2a8b932556 100644 (file)
@@ -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 *);
index 8bce86513246a1351b3c791e19b818bb17eafd91..593c5ca9b503fe32b4d0d1cdb71cc4ab61081d6c 100644 (file)
@@ -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)
     {
index 6bc4ac922ccdd7f75bd51b0b5de131c5044576ca..513e4fa6049874e866e4b9e2212de802fbe557b1 100644 (file)
--- 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,
index 6112aa1515a38a2c191a1640adb93f43534333c1..8323e9256a12cfd689b18f243e29d7832a9579e1 100644 (file)
@@ -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 *,
index a6344223953cb485007652c2f4107ce432cc21eb..5ff5bfd4ea991e16d38c18b784714f2a72d86f74 100644 (file)
@@ -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);
-}
-
 \f
 /* 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