/* Read dbx symbol tables and convert to internal format, for GDB.
- Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
#include "obstack.h"
#include "gdb_stat.h"
-#include <ctype.h>
#include "symtab.h"
#include "breakpoint.h"
-#include "command.h"
#include "target.h"
#include "gdbcore.h" /* for bfd stuff */
#include "libaout.h" /* FIXME Secret internal BFD stuff for a.out */
#include "demangle.h"
#include "language.h" /* Needed inside partial-stab.h */
#include "complaints.h"
+#include "cp-abi.h"
#include "aout/aout64.h"
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native, now */
{
asection *sec;
int found_any = 0;
- CORE_ADDR start, end;
+ CORE_ADDR start = 0;
+ CORE_ADDR end = 0;
for (sec = sym_bfd->sections; sec; sec = sec->next)
if (bfd_get_section_flags (sym_bfd, sec) & SEC_CODE)
{
if (this_object_header_files)
{
- free ((PTR) this_object_header_files);
+ xfree (this_object_header_files);
this_object_header_files = NULL;
}
n_allocated_this_object_header_files = 0;
char *tempstring = name;
if (tempstring[0] == bfd_get_symbol_leading_char (objfile->obfd))
++tempstring;
- if (VTBL_PREFIX_P ((tempstring)))
+ if (is_vtable_name (tempstring))
ms_type = mst_data;
}
section = SECT_OFF_DATA (objfile);
table (as opposed to a shared lib or dynamically loaded file). */
static void
-dbx_symfile_read (objfile, mainline)
- struct objfile *objfile;
- int mainline; /* FIXME comments above */
+dbx_symfile_read (struct objfile *objfile, int mainline)
{
bfd *sym_bfd;
int val;
while (--i >= 0)
{
- free (hfiles[i].name);
- free (hfiles[i].vector);
+ xfree (hfiles[i].name);
+ xfree (hfiles[i].vector);
}
- free ((PTR) hfiles);
+ xfree (hfiles);
}
mfree (objfile->md, objfile->sym_stab_info);
}
completed after all the stabs are read. */
struct cont_elem
{
- /* sym and stabsstring for continuing information in cfront */
+ /* sym and stabstring for continuing information in cfront */
struct symbol *sym;
char *stabs;
- /* state dependancies (statics that must be preserved) */
+ /* state dependencies (statics that must be preserved) */
int sym_idx;
int sym_end;
int symnum;
int (*func) (struct objfile *, struct symbol *, char *);
- /* other state dependancies include:
+ /* other state dependencies include:
(assumption is that these will not change since process_now FIXME!!)
stringtab_global
n_stabs
/* Arrange for function F to be called with arguments SYM and P later
in the stabs reading process. */
void
-process_later (sym, p, f)
- struct symbol *sym;
- char *p;
- int (*f) (struct objfile *, struct symbol *, char *);
+process_later (struct symbol *sym, char *p,
+ int (*f) (struct objfile *, struct symbol *, char *))
{
/* Allocate more space for the deferred list. */
return;
dynsyms = (asymbol **) xmalloc (dynsym_size);
- back_to = make_cleanup (free, dynsyms);
+ back_to = make_cleanup (xfree, dynsyms);
dynsym_count = bfd_canonicalize_dynamic_symtab (abfd, dynsyms);
if (dynsym_count < 0)
}
dynrels = (arelent **) xmalloc (dynrel_size);
- make_cleanup (free, dynrels);
+ make_cleanup (xfree, dynrels);
dynrel_count = bfd_canonicalize_dynamic_reloc (abfd, dynrels, dynsyms);
if (dynrel_count < 0)
/* Try to select a C++ demangling based on the compilation unit
producer. */
+#if 0
+ /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
+ know whether it will use the old style or v3 mangling. */
if (processing_gcc_compilation)
{
if (AUTO_DEMANGLING)
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
}
}
+#endif
}
else
{
else if (STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL))
processing_gcc_compilation = 2;
+#if 0
+ /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
+ know whether it will use the old style or v3 mangling. */
if (AUTO_DEMANGLING)
{
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
}
+#endif
}
else if (type & N_EXT || type == (unsigned char) N_TEXT
|| type == (unsigned char) N_NBTEXT
pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
- /* Process items which we had to "process_later" due to dependancies
+ /* Process items which we had to "process_later" due to dependencies
on other stabs. */
process_now (objfile);
case N_ROSYM:
goto case_N_ROSYM;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
if (STREQ (name, GCC2_COMPILED_FLAG_SYMBOL))
{
processing_gcc_compilation = 2;
-#if 1 /* Works, but is experimental. -fnf */
+#if 0 /* Works, but is experimental. -fnf */
+ /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
+ know whether it will use the old style or v3 mangling. */
if (AUTO_DEMANGLING)
{
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);