#include "complaints.h"
#include "gdb-stabs.h"
#include "gdbtypes.h"
+#include "demangle.h"
/* Private information attached to an objfile which we use to find
and internalize the HP C debug symbols within that objfile. */
\f
void hpread_symfile_init PARAMS ((struct objfile *));
+static struct type *
+hpread_read_array_type PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+
static struct type *hpread_alloc_type
PARAMS ((dnttpointer, struct objfile *));
static struct partial_symtab *hpread_start_psymtab
PARAMS ((struct objfile *, struct section_offsets *, char *, CORE_ADDR, int,
- struct partial_symbol *, struct partial_symbol *));
+ struct partial_symbol **, struct partial_symbol **));
static struct partial_symtab *hpread_end_psymtab
PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR,
int dependencies_used, dependencies_allocated;
/* Just in case the stabs reader left turds lying around. */
- pending_blocks = 0;
+ free_pending_blocks ();
make_cleanup (really_free_pendings, 0);
pst = (struct partial_symtab *) 0;
valu = dn_bufp->dfunc.lowaddr +
ANOFFSET (section_offsets, SECT_OFF_TEXT);
SET_NAMESTRING (dn_bufp, &namestring, objfile);
- ADD_PSYMBOL_TO_LIST (namestring, strlen (namestring),
+ add_psymbol_to_list (namestring, strlen (namestring),
VAR_NAMESPACE, LOC_BLOCK,
- objfile->static_psymbols, valu,
- language_unknown, objfile);
+ &objfile->static_psymbols, valu,
+ 0, language_unknown, objfile);
within_function = 1;
continue;
case DNTT_TYPE_BEGIN:
{
/* Variables, typedefs an the like. */
enum address_class storage;
- enum namespace namespace;
+ namespace_enum namespace;
/* Don't add locals to the partial symbol table. */
if (within_function
}
if (dn_bufp->dsvar.global)
{
- ADD_PSYMBOL_TO_LIST (namestring, strlen (namestring),
+ add_psymbol_to_list (namestring, strlen (namestring),
namespace, storage,
- objfile->global_psymbols,
+ &objfile->global_psymbols,
dn_bufp->dsvar.location,
- language_unknown, objfile);
+ 0, language_unknown, objfile);
}
else
{
- ADD_PSYMBOL_TO_LIST (namestring, strlen (namestring),
+ add_psymbol_to_list (namestring, strlen (namestring),
namespace, storage,
- objfile->static_psymbols,
+ &objfile->static_psymbols,
dn_bufp->dsvar.location,
- language_unknown, objfile);
+ 0, language_unknown, objfile);
}
continue;
}
objfile->global_psymbols.next,
objfile->static_psymbols.next);
}
- ADD_PSYMBOL_TO_LIST (namestring, strlen (namestring),
+ add_psymbol_to_list (namestring, strlen (namestring),
VAR_NAMESPACE, LOC_CONST,
- objfile->static_psymbols, 0,
- language_unknown, objfile);
+ &objfile->static_psymbols, 0,
+ 0, language_unknown, objfile);
continue;
default:
continue;
char *filename;
CORE_ADDR textlow;
int ldsymoff;
- struct partial_symbol *global_syms;
- struct partial_symbol *static_syms;
+ struct partial_symbol **global_syms;
+ struct partial_symbol **static_syms;
{
struct partial_symtab *result =
start_psymtab_common (objfile, section_offsets,
dn_bufp = hpread_get_lntt (sym_index, objfile);
if (!((dn_bufp->dblock.kind == (unsigned char) DNTT_TYPE_SRCFILE) ||
(dn_bufp->dblock.kind == (unsigned char) DNTT_TYPE_MODULE)))
- start_symtab ("globals", NULL, 0);
+ {
+ start_symtab ("globals", NULL, 0);
+ record_debugformat ("HP");
+ }
max_symnum = sym_size / sizeof (struct dntt_type_block);
{
TYPE_VECTOR_LENGTH (objfile) = 100;
TYPE_VECTOR (objfile) = (struct type **)
- malloc (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
+ xmmalloc (objfile -> md,
+ TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
}
while (index >= TYPE_VECTOR_LENGTH (objfile))
TYPE_VECTOR_LENGTH (objfile) *= 2;
TYPE_VECTOR (objfile) = (struct type **)
- xrealloc ((char *) TYPE_VECTOR (objfile),
+ xmrealloc (objfile -> md,
+ (char *) TYPE_VECTOR (objfile),
(TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
memset (&TYPE_VECTOR (objfile)[old_len], 0,
(TYPE_VECTOR_LENGTH (objfile) - old_len) *
sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- SYMBOL_NAME (sym) = name;
+ SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
+ &objfile->symbol_obstack);
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
SYMBOL_VALUE (sym) = memp->dmember.value;
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
- TYPE_FIELD_VALUE (type, n) = 0;
TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
TYPE_FIELD_BITSIZE (type, n) = 0;
}
sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
sizeof (struct symbol));
(void) memset (sym, 0, sizeof (struct symbol));
- SYMBOL_NAME (sym) = name;
+ SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
+ &objfile->symbol_obstack);
/* Figure out where it lives. */
if (paramp->dfparam.regparam)
list = new;
list->field.name = VT (objfile) + fieldp->dfield.name;
- list->field.bitpos = fieldp->dfield.bitoffset;
+ FIELD_BITPOS (list->field) = fieldp->dfield.bitoffset;
if (fieldp->dfield.bitlength % 8)
- list->field.bitsize = fieldp->dfield.bitlength;
+ FIELD_BITSIZE (list->field) = fieldp->dfield.bitlength;
else
- list->field.bitsize = 0;
+ FIELD_BITSIZE (list->field) = 0;
nfields++;
field = fieldp->dfield.nextfield;
- list->field.type = hpread_type_lookup (fieldp->dfield.type, objfile);
+ FIELD_TYPE (list->field) = hpread_type_lookup (fieldp->dfield.type,
+ objfile);
}
TYPE_NFIELDS (type) = nfields;
sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- SYMBOL_NAME (sym) = name;
+ SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack);
SYMBOL_LANGUAGE (sym) = language_auto;
SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
if (!last_source_file)
{
start_symtab (name, NULL, valu);
+ record_debugformat ("HP");
SL_INDEX (objfile) = dn_bufp->dsfile.address;
}
else