+Sat Apr 6 00:46:26 1996 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (INLINE_ADD_PSYMBOL): Remove ifdef.
+ (add_psymbol_to_list): Add an arg for passing CORE_ADDR values and
+ use it, rather than calling add_psymbol_addr_to_list.
+ (add_psymbol_addr_to_list): Delete.
+ (add_psymbol_to_list): Make psymbol static to avoid random data in
+ gaps due to alignment of structure members.
+ * symfile.h (INLINE_ADD_PSYMBOL, ADD_PSYMBOL_TO_LIST,
+ ADD_PSYMBOL_ADDR_TO_LIST): Remove. Real world tests show no
+ performance improvements by inlining via complicated macros and
+ they just make gdb larger and harder to maintain.
+ * dwarfread.c (add_enum_psymbol): Replace ADD_PSYMBOL_TO_LIST
+ and/or ADD_PSYMBOL_ADDR_TO_LIST macro(s) with call to
+ add_psymbol_to_list with appropriate long or CORE_ADDR args.
+ (add_partial_symbol): Ditto.
+ * partial-stab.h: Ditto.
+ * os9kread.c (read_os9k_psymtab): Ditto
+ * mdebugread.c (parse_partial_symbols): Ditto.
+ (handle_psymbol_enumerators): Ditto.
+ (demangle.h): Include.
+ * hpread.c (hpread_build_psymtabs): Ditto.
+ (hpread_build_psymtabs): Ditto.
+ (demangle.h): Include
+
start-sanitize-gdbtk
Fri Apr 5 13:44:40 1996 Stan Shebs <shebs@andros.cygnus.com>
while (scan < listend)
{
scan += TARGET_FT_LONG_SIZE (objfile);
- ADD_PSYMBOL_TO_LIST (scan, strlen (scan), VAR_NAMESPACE, LOC_CONST,
- objfile -> static_psymbols, 0, cu_language,
+ add_psymbol_to_list (scan, strlen (scan), VAR_NAMESPACE, LOC_CONST,
+ &objfile -> static_psymbols, 0, 0, cu_language,
objfile);
scan += strlen (scan) + 1;
}
switch (dip -> die_tag)
{
case TAG_global_subroutine:
- ADD_PSYMBOL_ADDR_TO_LIST (dip -> at_name, strlen (dip -> at_name),
+ add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
VAR_NAMESPACE, LOC_BLOCK,
- objfile -> global_psymbols,
- dip -> at_low_pc, cu_language, objfile);
+ &objfile -> global_psymbols,
+ 0, dip -> at_low_pc, cu_language, objfile);
break;
case TAG_global_variable:
- ADD_PSYMBOL_TO_LIST (dip -> at_name, strlen (dip -> at_name),
+ add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
VAR_NAMESPACE, LOC_STATIC,
- objfile -> global_psymbols,
- 0, cu_language, objfile);
+ &objfile -> global_psymbols,
+ 0, 0, cu_language, objfile);
break;
case TAG_subroutine:
- ADD_PSYMBOL_ADDR_TO_LIST (dip -> at_name, strlen (dip -> at_name),
+ add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
VAR_NAMESPACE, LOC_BLOCK,
- objfile -> static_psymbols,
- dip -> at_low_pc, cu_language, objfile);
+ &objfile -> static_psymbols,
+ 0, dip -> at_low_pc, cu_language, objfile);
break;
case TAG_local_variable:
- ADD_PSYMBOL_TO_LIST (dip -> at_name, strlen (dip -> at_name),
+ add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
VAR_NAMESPACE, LOC_STATIC,
- objfile -> static_psymbols,
- 0, cu_language, objfile);
+ &objfile -> static_psymbols,
+ 0, 0, cu_language, objfile);
break;
case TAG_typedef:
- ADD_PSYMBOL_TO_LIST (dip -> at_name, strlen (dip -> at_name),
+ add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile -> static_psymbols,
- 0, cu_language, objfile);
+ &objfile -> static_psymbols,
+ 0, 0, cu_language, objfile);
break;
case TAG_class_type:
case TAG_structure_type:
/* Do not add opaque aggregate definitions to the psymtab. */
if (!dip -> has_at_byte_size)
break;
- ADD_PSYMBOL_TO_LIST (dip -> at_name, strlen (dip -> at_name),
+ add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
STRUCT_NAMESPACE, LOC_TYPEDEF,
- objfile -> static_psymbols,
- 0, cu_language, objfile);
+ &objfile -> static_psymbols,
+ 0, 0, cu_language, objfile);
if (cu_language == language_cplus)
{
/* For C++, these implicitly act as typedefs as well. */
- ADD_PSYMBOL_TO_LIST (dip -> at_name, strlen (dip -> at_name),
+ add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile -> static_psymbols,
- 0, cu_language, objfile);
+ &objfile -> static_psymbols,
+ 0, 0, cu_language, objfile);
}
break;
}
#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. */
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:
}
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;
#include "buildsym.h"
#include "stabsread.h"
#include "complaints.h"
+#include "demangle.h"
/* These are needed if the tm.h file does not contain the necessary
mips specific definitions. */
symbol table, and the MAIN__ symbol via the minimal
symbol table. */
if (sh.st == stProc)
- ADD_PSYMBOL_TO_LIST (name, strlen (name),
+ add_psymbol_to_list (name, strlen (name),
VAR_NAMESPACE, LOC_BLOCK,
- objfile->global_psymbols,
- sh.value, psymtab_language, objfile);
+ &objfile->global_psymbols,
+ sh.value, 0, psymtab_language, objfile);
else
- ADD_PSYMBOL_TO_LIST (name, strlen (name),
+ add_psymbol_to_list (name, strlen (name),
VAR_NAMESPACE, LOC_BLOCK,
- objfile->static_psymbols,
- sh.value, psymtab_language, objfile);
+ &objfile->static_psymbols,
+ sh.value, 0, psymtab_language, objfile);
/* Skip over procedure to next one. */
if (sh.index >= hdr->iauxMax)
&& sh.iss != 0
&& sh.index != cur_sdx + 2)
{
- ADD_PSYMBOL_TO_LIST (name, strlen (name),
+ add_psymbol_to_list (name, strlen (name),
STRUCT_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- sh.value,
+ &objfile->static_psymbols,
+ sh.value, 0,
psymtab_language, objfile);
}
handle_psymbol_enumerators (objfile, fh, sh.st, sh.value);
continue;
}
/* Use this gdb symbol */
- ADD_PSYMBOL_TO_LIST (name, strlen (name),
+ add_psymbol_to_list (name, strlen (name),
VAR_NAMESPACE, class,
- objfile->static_psymbols, sh.value,
- psymtab_language, objfile);
+ &objfile->static_psymbols, sh.value,
+ 0, psymtab_language, objfile);
skip:
cur_sdx++; /* Go to next file symbol */
}
break;
}
name = debug_info->ssext + psh->iss;
- ADD_PSYMBOL_ADDR_TO_LIST (name, strlen (name),
- VAR_NAMESPACE, class,
- objfile->global_psymbols,
- svalue,
- psymtab_language, objfile);
+ add_psymbol_to_list (name, strlen (name),
+ VAR_NAMESPACE, class,
+ &objfile->global_psymbols,
+ 0, svalue,
+ psymtab_language, objfile);
}
}
/* Note that the value doesn't matter for enum constants
in psymtabs, just in symtabs. */
- ADD_PSYMBOL_TO_LIST (name, strlen (name),
+ add_psymbol_to_list (name, strlen (name),
VAR_NAMESPACE, LOC_CONST,
- objfile->static_psymbols, 0,
- psymtab_language, objfile);
+ &objfile->static_psymbols, 0,
+ 0, psymtab_language, objfile);
ext_sym += external_sym_size;
}
}
}
case 'v':
- ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ add_psymbol_to_list (namestring, p - namestring,
+ VAR_NAMESPACE, LOC_STATIC,
+ &objfile->static_psymbols,
+ 0, CUR_SYMBOL_VALUE,
+ psymtab_language, objfile);
continue;
case 'V':
- ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- objfile->global_psymbols,
- CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ add_psymbol_to_list (namestring, p - namestring,
+ VAR_NAMESPACE, LOC_STATIC,
+ &objfile->global_psymbols,
+ 0, CUR_SYMBOL_VALUE,
+ psymtab_language, objfile);
continue;
case 'T':
if (p != namestring) /* a name is there, not just :T... */
{
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
STRUCT_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE,
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0,
psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE, psymtab_language,
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0, psymtab_language,
objfile);
p += 1;
}
else if (psymtab_language == language_cplus)
{
/* Also a typedef with the same name. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE, psymtab_language,
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0, psymtab_language,
objfile);
}
}
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE,
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0,
psymtab_language, objfile);
}
check_enum:
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
- ADD_PSYMBOL_TO_LIST (p, q - p,
+ add_psymbol_to_list (p, q - p,
VAR_NAMESPACE, LOC_CONST,
- objfile->static_psymbols, 0,
- psymtab_language, objfile);
+ &objfile->static_psymbols, 0,
+ 0, psymtab_language, objfile);
/* Point past the name. */
p = q;
/* Skip over the value. */
continue;
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_CONST,
- objfile->static_psymbols, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ &objfile->static_psymbols, CUR_SYMBOL_VALUE,
+ 0, psymtab_language, objfile);
continue;
case 'f':
if (pst && pst->textlow == 0)
pst->textlow = CUR_SYMBOL_VALUE;
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_BLOCK,
- objfile->static_psymbols, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ &objfile->static_psymbols, CUR_SYMBOL_VALUE,
+ 0, psymtab_language, objfile);
continue;
case 'F':
if (pst && pst->textlow == 0)
pst->textlow = CUR_SYMBOL_VALUE;
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_BLOCK,
- objfile->global_psymbols, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ &objfile->global_psymbols, CUR_SYMBOL_VALUE,
+ 0, psymtab_language, objfile);
continue;
case 'p':
#ifdef STATIC_TRANSFORM_NAME
namestring = STATIC_TRANSFORM_NAME (namestring);
#endif
- ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ add_psymbol_to_list (namestring, p - namestring,
+ VAR_NAMESPACE, LOC_STATIC,
+ &objfile->static_psymbols,
+ 0, CUR_SYMBOL_VALUE,
+ psymtab_language, objfile);
continue;
case 'G':
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
- ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- objfile->global_psymbols,
- CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ add_psymbol_to_list (namestring, p - namestring,
+ VAR_NAMESPACE, LOC_STATIC,
+ &objfile->global_psymbols,
+ 0, CUR_SYMBOL_VALUE,
+ psymtab_language, objfile);
continue;
case 'T':
if (p != namestring) /* a name is there, not just :T... */
{
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
STRUCT_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE,
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0,
psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE, psymtab_language,
- objfile);
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0,
+ psymtab_language, objfile);
p += 1;
}
/* The semantics of C++ state that "struct foo { ... }"
else if (psymtab_language == language_cplus)
{
/* Also a typedef with the same name. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE, psymtab_language,
- objfile);
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0,
+ psymtab_language, objfile);
}
}
goto check_enum;
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols,
- CUR_SYMBOL_VALUE,
+ &objfile->static_psymbols,
+ CUR_SYMBOL_VALUE, 0,
psymtab_language, objfile);
}
check_enum:
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
- ADD_PSYMBOL_TO_LIST (p, q - p,
+ add_psymbol_to_list (p, q - p,
VAR_NAMESPACE, LOC_CONST,
- objfile->static_psymbols, 0,
- psymtab_language, objfile);
+ &objfile->static_psymbols, 0,
+ 0, psymtab_language, objfile);
/* Point past the name. */
p = q;
/* Skip over the value. */
continue;
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_CONST,
- objfile->static_psymbols, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ &objfile->static_psymbols, CUR_SYMBOL_VALUE,
+ 0, psymtab_language, objfile);
continue;
case 'f':
!= ANOFFSET (section_offsets, SECT_OFF_TEXT)))
pst->textlow = CUR_SYMBOL_VALUE;
#endif /* DBXREAD_ONLY */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_BLOCK,
- objfile->static_psymbols, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ &objfile->static_psymbols, CUR_SYMBOL_VALUE,
+ 0, psymtab_language, objfile);
continue;
/* Global functions were ignored here, but now they
!= ANOFFSET (section_offsets, SECT_OFF_TEXT)))
pst->textlow = CUR_SYMBOL_VALUE;
#endif /* DBXREAD_ONLY */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
+ add_psymbol_to_list (namestring, p - namestring,
VAR_NAMESPACE, LOC_BLOCK,
- objfile->global_psymbols, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
+ &objfile->global_psymbols, CUR_SYMBOL_VALUE,
+ 0, psymtab_language, objfile);
continue;
/* Two things show up here (hopefully); static symbols of