* buildsym.c (read_struct_type): Initialize structs allocated

with alloca, to avoid using random values from stack later on.
	* defs.h (fprintf_filtered):  Add prototype.
	* gdbtypes.c (check_stub_method):  Fix misleading comments.
	* gdbtypes.c (print_arg_types, dump_fn_fieldlists):  New maint
	support functions.
	* gdbtypes.c (print_cplus_stuff, recursive_dump_type):  Many
	small changes to maint support functions.
	* gdbtypes.h (cplus_struct_type):  Reorganize member ordering
	for some fields and expand comments.
	* objfiles.c (allocate_objfile):  Use new obstack_alloc_arg
	macro and track change to obstack_full_begin macro.
	* utils.c (fprintfi_filtered):  New function.
	* valprint.c (type_print_base):  Fixup field printing to not
	print extraneous lines and not print bogus "no data fields"
	messages for C++ classes with no data members.  Also use new
	fprintfi_filtered function.
This commit is contained in:
Fred Fish
1992-07-21 04:14:34 +00:00
parent 4a2d5d0ef6
commit c0f1085b5a
5 changed files with 211 additions and 94 deletions

View File

@@ -2208,6 +2208,7 @@ read_struct_type (pp, type, objfile)
/* Make this baseclass visible for structure-printing purposes. */
new = (struct nextfield *) alloca (sizeof (struct nextfield));
memset (new, 0, sizeof (struct nextfield));
new->next = list;
list = new;
list->visibility = via_public;
@@ -2240,6 +2241,7 @@ read_struct_type (pp, type, objfile)
/* Get space to record the next field's data. */
new = (struct nextfield *) alloca (sizeof (struct nextfield));
memset (new, 0, sizeof (struct nextfield));
new->next = list;
list = new;
@@ -2477,10 +2479,13 @@ read_struct_type (pp, type, objfile)
struct next_fnfield *sublist = 0;
struct type *look_ahead_type = NULL;
int length = 0;
struct next_fnfieldlist *new_mainlist =
(struct next_fnfieldlist *)alloca (sizeof (struct next_fnfieldlist));
struct next_fnfieldlist *new_mainlist;
char *main_fn_name;
new_mainlist = (struct next_fnfieldlist *)
alloca (sizeof (struct next_fnfieldlist));
memset (new_mainlist, 0, sizeof (struct next_fnfieldlist));
p = *pp;
/* read in the name. */
@@ -2520,7 +2525,8 @@ read_struct_type (pp, type, objfile)
do
{
struct next_fnfield *new_sublist =
(struct next_fnfield *)alloca (sizeof (struct next_fnfield));
(struct next_fnfield *) alloca (sizeof (struct next_fnfield));
memset (new_sublist, 0, sizeof (struct next_fnfield));
/* Check for and handle cretinous dbx symbol name continuation! */
if (look_ahead_type == NULL) /* Normal case. */