/* Read coff symbol tables and convert to internal format, for GDB.
- Copyright (C) 1987-2016 Free Software Foundation, Inc.
+ Copyright (C) 1987-2018 Free Software Foundation, Inc.
Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
This file is part of GDB.
#include "psymtab.h"
#include "build-id.h"
-extern void _initialize_coffread (void);
-
/* Key for COFF-associated data. */
static const struct objfile_data *coff_objfile_data_key;
NULL,
/* The start address is irrelevant, since we set
last_source_start_addr in coff_end_symtab. */
- 0);
+ 0,
+ /* Let buildsym.c deduce the language for this symtab. */
+ language_unknown);
record_debugformat ("COFF");
}
}
}
- bfd_map_over_sections (abfd, coff_locate_sections, (void *) info);
+ if (!(objfile->flags & OBJF_READNEVER))
+ bfd_map_over_sections (abfd, coff_locate_sections, (void *) info);
if (info->stabsects)
{
/* Try to add separate debug file if no symbols table found. */
if (!objfile_has_partial_symbols (objfile))
{
- char *debugfile;
-
- debugfile = find_separate_debug_file_by_buildid (objfile);
+ std::string debugfile = find_separate_debug_file_by_buildid (objfile);
- if (debugfile == NULL)
+ if (debugfile.empty ())
debugfile = find_separate_debug_file_by_debuglink (objfile);
- make_cleanup (xfree, debugfile);
- if (debugfile)
+ if (!debugfile.empty ())
{
- bfd *abfd = symfile_bfd_open (debugfile);
+ gdb_bfd_ref_ptr abfd (symfile_bfd_open (debugfile.c_str ()));
- make_cleanup_bfd_unref (abfd);
- symbol_file_add_separate (abfd, debugfile, symfile_flags, objfile);
+ symbol_file_add_separate (abfd.get (), debugfile.c_str (),
+ symfile_flags, objfile);
}
}
backtraces, so filter them out (from phdm@macqel.be). */
if (within_function)
break;
+ /* Fall through. */
case C_STAT:
case C_THUMBLABEL:
case C_THUMBSTAT:
/* At least on a 3b1, gcc generates swbeg and string labels
that look like this. Ignore them. */
break;
- /* Fall in for static symbols that don't start with '.' */
+ /* For static symbols that don't start with '.'... */
+ /* Fall through. */
case C_THUMBEXT:
case C_THUMBEXTFUNC:
case C_EXT: