+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.
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;
*filename_ptr = abfd->filename;
*functionname_ptr = 0;
*line_ptr = 0;
+ if (disriminator_ptr)
+ *disriminator_ptr = 0;
if (symbols != NULL)
{
#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, \
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, \
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 *,
.
.#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, \
#include "coffcode.h"
-#define _bfd_generic_find_nearest_line_discriminator \
- coff_find_nearest_line_discriminator
-
const bfd_target
#ifdef TARGET_SYM
TARGET_SYM =
{ 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)
#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
#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 =
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,
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,
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;
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;
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,
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,
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,
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;
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,
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;
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);
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
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)
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);
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;
_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
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)
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,
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;
}
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;
/* 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. */
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)
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,
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;
};
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");
/* 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
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
(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 *);
#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 *, \
/* 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
{
/* 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
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,
#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 *, \
/* 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
{
/* 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
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
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
(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
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)
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
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 *);
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;
*filename_ptr = abfd->filename;
*functionname_ptr = 0;
*line_ptr = 0;
+ if (discriminator_ptr)
+ *discriminator_ptr = 0;
if (symbols != NULL)
{
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,
. 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, \
. 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 *,
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;
*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)
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. */
#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