/* Support routines for manipulating internal types for GDB.
- Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
+ Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
{
char str[128];
int len;
- }; /* maximum extention is 128! FIXME */
+ }; /* maximum extension is 128! FIXME */
static void add_name (struct extra *, char *);
static void add_mangled_type (struct extra *, struct type *);
}
/* New code added to support parsing of Cfront stabs strings */
-#include <ctype.h>
#define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
#define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
}
ADD_EXTRA ('\0')
printf ("add_mangled_type: %s\n", extras.str); /* FIXME */
- arm_mangled_name = malloc (strlen (mangled_name) + extras.len);
- sprintf (arm_mangled_name, "%s%s", mangled_name, extras.str);
- free (mangled_name);
+ xasprintf (&arm_mangled_name, "%s%s", mangled_name, extras.str);
+ xfree (mangled_name);
mangled_name = arm_mangled_name;
}
}
argtypes[argcount] = NULL; /* Ellist terminator */
}
- free (demangled_name);
+ xfree (demangled_name);
f = TYPE_FN_FIELDLIST1 (type, method_id);
while (tmp_vbase)
{
tmp_vbase = tmp_vbase->next;
- free (tmp_vbase_2);
+ xfree (tmp_vbase_2);
tmp_vbase_2 = tmp_vbase;
}
struct type *pbc = primary_base_class (dclass);
if (pbc)
vfuncs = count_virtual_fns (pbc);
+ else
+ vfuncs = 0;
for (fn = 0; fn < TYPE_NFN_FIELDS (dclass); fn++)
for (oi = 0; oi < TYPE_FN_FIELDLIST_LENGTH (dclass, fn); oi++)