+Mon Jun 15 07:21:00 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (decode_modified_type): Change type of first arg.
+ Change 'modifier' to char from unsigned char. Cast single use
+ that needs to be unsigned char.
+ * symtab.h (SYMBOL_BASEREG_VALID): Explain disabling.
+ * utils.c (strdup_demangled): Add function.
+ * defs.h (strdup_demangled): Add prototype.
+ * stack.c (return_command): Demangle C++ function names for query.
+ * infcmd.c (jump_command): Demangle C++ function names for query.
+ * cplus-dem.c (consume_count): New function and prototype.
+ * cplus-dem.c (demangle_class, gnu_special, demangle_func_type,
+ do_type): Replace conversion code with consume_count().
+ * cplus-dem.c (gnu_special): Fix demangled of static members.
+ * source.c (list_command): Print demangled function names
+ when appropriate. Fix supplied by Peter Schauer.
+
+Mon Jun 15 01:45:48 1992 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c (define_symbol): Nameless types are now on several
+ platforms; generalize them and un-ifdef them to make Solaris 2
+ work.
+
Sun Jun 14 10:55:51 1992 John Gilmore (gnu at cygnus.com)
* infcmd.c: Fix typo (reported by Rob Savoye).
static int
get_count PARAMS ((const char **, int *));
+static int
+consume_count PARAMS ((const char **));
+
static int
demangle_args PARAMS ((string *, const char **, struct work_stuff *));
string_prepends PARAMS ((string *, string *));
#endif
+/* Translate count to integer, consuming tokens in the process.
+ Conversion terminates on the first non-digit character. */
+
+static int
+consume_count (type)
+ const char **type;
+{
+ int count = 0;
+
+ do
+ {
+ count *= 10;
+ count += **type - '0';
+ (*type)++;
+ } while (isdigit (**type));
+ return (count);
+}
/* Takes operator name as e.g. "++" and returns mangled
operator name (e.g. "postincrement_expr"), or NULL if not found.
int n;
int success = 0;
- n = 0;
- do
- {
- n *= 10;
- n += **mangled - '0';
- (*mangled)++;
- }
- while (isdigit (**mangled));
+ n = consume_count (mangled);
if (strlen (*mangled) >= n)
{
if (work -> constructor || work -> destructor)
return (success);
}
+/*
+
+LOCAL FUNCTION
+
+ gnu_special -- special handling of gnu mangled strings
+
+SYNOPSIS
+
+ static int
+ gnu_special (string *declp, const char **mangled,
+ struct work_stuff *work)
+
+
+DESCRIPTION
+
+ Process some special GNU style mangling forms that don't fit
+ the normal pattern. For example:
+
+ _$_3foo (destructor for class foo)
+ _vt$foo (virtual table)
+ _3foo$varname (static data member)
+ */
+
static int
gnu_special (declp, mangled, work)
string *declp;
(*mangled) += 3;
work -> destructor = 1;
}
- else if (**mangled != '_' && (p = strchr (*mangled, CPLUS_MARKER)) != NULL)
- {
-#if 0
- /* static data member */
- n = strlen (*mangled) + 2;
- tem = (char *) xmalloc (n);
- memcpy (tem, *mangled, p - *mangled);
- strcpy (tem + (p - *mangled), "::");
- strcpy (tem + (p - *mangled) + 2, p + 1);
-#endif
- }
else if ((*mangled)[0] == '_'
&& (*mangled)[1] == 'v'
&& (*mangled)[2] == 't'
string_append (declp, " virtual table");
(*mangled) += n;
}
+ else if ((*mangled)[0] == '_'
+ && isdigit ((*mangled)[1])
+ && (p = strchr (*mangled, CPLUS_MARKER)) != NULL)
+ {
+ /* static data member, "_3foo$varname" for example */
+ (*mangled)++;
+ p++;
+ n = consume_count (mangled);
+ string_appendn (declp, *mangled, n);
+ string_append (declp, "::");
+ n = strlen (p);
+ string_appendn (declp, p, n);
+ (*mangled) = p + n;
+ }
else
{
success = 0;
return (success);
}
+/*
+
+LOCAL FUNCTION
+
+ get_count -- convert an ascii count to integer, consuming tokens
+
+SYNOPSIS
+
+ static int
+ get_count (const char **type, int *count)
+
+DESCRIPTION
+
+ Return 0 if no conversion is performed, 1 if a string is converted.
+*/
+
static int
get_count (type, count)
const char **type;
{
return (0);
}
- *count = **type - '0';
- (*type)++;
- /* see flush_repeats in cplus-method.c */
- if (isdigit (**type))
+ else
{
- p = *type;
- n = *count;
- do
- {
- n *= 10;
- n += *p - '0';
- p++;
- }
- while (isdigit (*p));
- if (*p == '_')
+ *count = **type - '0';
+ (*type)++;
+ if (isdigit (**type))
{
- *type = p + 1;
- *count = n;
+ p = *type;
+ n = *count;
+ do
+ {
+ n *= 10;
+ n += *p - '0';
+ p++;
+ }
+ while (isdigit (*p));
+ if (*p == '_')
+ {
+ *type = p + 1;
+ *count = n;
+ }
}
}
return (1);
success = 0;
break;
}
- n = 0;
- do
- {
- n *= 10;
- n += **type - '0';
- (*type)++;
- }
- while (isdigit (**type));
+ n = consume_count (type);
if (strlen (*type) < n)
{
success = 0;
case '7':
case '8':
case '9':
- n = 0;
- do
- {
- n *= 10;
- n += **type - '0';
- (*type)++;
- }
- while (isdigit (**type));
+ n = consume_count (type);
if (strlen (*type) < n)
{
success = 0;
decode_mod_u_d_type PARAMS ((char *));
static struct type *
-decode_modified_type PARAMS ((unsigned char *, unsigned int, int));
+decode_modified_type PARAMS ((char *, unsigned int, int));
static struct type *
decode_fund_type PARAMS ((unsigned int));
SYNOPSIS
- static struct type *decode_modified_type (unsigned char *modifiers,
+ static struct type *decode_modified_type (char *modifiers,
unsigned short modcount, int mtype)
DESCRIPTION
static struct type *
decode_modified_type (modifiers, modcount, mtype)
- unsigned char *modifiers;
+ char *modifiers;
unsigned int modcount;
int mtype;
{
struct type *typep = NULL;
unsigned short fundtype;
DIE_REF die_ref;
- unsigned char modifier;
+ char modifier;
int nbytes;
if (modcount == 0)
SQUAWK (("type modifier 'volatile' ignored")); /* FIXME */
break;
default:
- if (!(MOD_lo_user <= modifier && modifier <= MOD_hi_user))
+ if (!(MOD_lo_user <= (unsigned char) modifier
+ && (unsigned char) modifier <= MOD_hi_user))
{
- SQUAWK (("unknown type modifier %u", modifier));
+ SQUAWK (("unknown type modifier %u",
+ (unsigned char) modifier));
}
break;
}