/* Read dbx symbol tables and convert to internal format, for GDB.
- Copyright (C) 1986-2013 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
This file is part of GDB.
for real. dbx_psymtab_to_symtab() is the function that does this */
#include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
#if defined(__CYGNUSCLIB__)
#include <sys/types.h>
#endif
#include "gdb_obstack.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "symtab.h"
#include "breakpoint.h"
#include "target.h"
#include "block.h"
#include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
#include "aout/aout64.h"
#include "aout/stab_gnu.h" /* We always use GNU stabs, not
static void dbx_symfile_finish (struct objfile *);
-static void record_minimal_symbol (char *, CORE_ADDR, int, struct objfile *);
+static void record_minimal_symbol (const char *, CORE_ADDR, int,
+ struct objfile *);
static void add_new_header_file (char *, int);
#endif
\f
static void
-record_minimal_symbol (char *name, CORE_ADDR address, int type,
+record_minimal_symbol (const char *name, CORE_ADDR address, int type,
struct objfile *objfile)
{
enum minimal_symbol_type ms_type;
/* Same with virtual function tables, both global and static. */
{
- char *tempstring = name;
+ const char *tempstring = name;
if (tempstring[0] == bfd_get_symbol_leading_char (objfile->obfd))
++tempstring;
val = bfd_seek (sym_bfd, DBX_SYMTAB_OFFSET (objfile), SEEK_SET);
if (val < 0)
- perror_with_name (objfile->name);
+ perror_with_name (objfile_name (objfile));
/* Size the symbol table. */
if (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)
long dynrel_count;
arelent **dynrels;
CORE_ADDR sym_value;
- char *name;
+ const char *name;
/* Check that the symbol file has dynamic symbols that we know about.
bfd_arch_unknown can happen if we are reading a sun3 symbol file
if (sym->flags & BSF_GLOBAL)
type |= N_EXT;
- record_minimal_symbol ((char *) bfd_asymbol_name (sym), sym_value,
+ record_minimal_symbol (bfd_asymbol_name (sym), sym_value,
type, objfile);
}
}
continue;
}
- name = (char *) bfd_asymbol_name (*rel->sym_ptr_ptr);
+ name = bfd_asymbol_name (*rel->sym_ptr_ptr);
prim_record_minimal_symbol (name, address, mst_solib_trampoline,
objfile);
}
record_it:
namestring = set_namestring (objfile, &nlist);
- bss_ext_symbol:
record_minimal_symbol (namestring, nlist.n_value,
nlist.n_type, objfile); /* Always */
continue;
dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
{
bfd *sym_bfd;
- struct cleanup *back_to = NULL;
if (self->readin)
{
if (LDSYMLEN (self) || self->number_of_dependencies)
{
+ struct cleanup *back_to;
+
/* Print the message now, before reading the string table,
to avoid disconcerting pauses. */
if (info_verbose)
next_symbol_text_func = dbx_next_symbol_text;
+ back_to = make_cleanup (null_cleanup, NULL);
+
if (DBX_STAB_SECTION (objfile))
{
stabs_data
NULL);
if (stabs_data)
- back_to = make_cleanup (free_current_contents,
- (void *) &stabs_data);
+ make_cleanup (free_current_contents, (void *) &stabs_data);
}
dbx_psymtab_to_symtab_1 (objfile, self);
- if (back_to)
- do_cleanups (back_to);
+ do_cleanups (back_to);
/* Match with global symbols. This only needs to be done once,
after all of the symtabs and dependencies have been read in. */
section_offsets = pst->section_offsets;
dbxread_objfile = objfile;
- subfile_stack = NULL;
stringtab_global = DBX_STRINGTAB (objfile);
set_last_source_file (NULL);
\f
static const struct sym_fns aout_sym_fns =
{
- bfd_target_aout_flavour,
dbx_new_init, /* init anything gbl to entire symtab */
dbx_symfile_init, /* read initial info, setup for sym_read() */
dbx_symfile_read, /* read a symbol file into symtab */
void
_initialize_dbxread (void)
{
- add_symtab_fns (&aout_sym_fns);
+ add_symtab_fns (bfd_target_aout_flavour, &aout_sym_fns);
dbx_objfile_data_key
= register_objfile_data_with_cleanup (NULL, dbx_free_symfile_info);