aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-07-21 04:14:34 +0000
committerFred Fish <fnf@specifix.com>1992-07-21 04:14:34 +0000
commitc0f1085b5a94342421f2623a0c743b089195d734 (patch)
tree668e7fb091fad0a68d51104bc57b032c67ac5ad8 /gdb/buildsym.c
parent4a2d5d0ef6f3e2e34260663fc9e321821db6dd2f (diff)
downloadfsf-binutils-gdb-c0f1085b5a94342421f2623a0c743b089195d734.zip
fsf-binutils-gdb-c0f1085b5a94342421f2623a0c743b089195d734.tar.gz
fsf-binutils-gdb-c0f1085b5a94342421f2623a0c743b089195d734.tar.bz2
* 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.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 5e472b5..9636cd2 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -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. */