binutils/binutils-2.21.53.0.1-demangle.patch
2011-08-02 14:14:01 +01:00

1063 lines
35 KiB
Diff

diff -rup /usr/src/debug/binutils-2.21.53.0.1/libiberty//cp-demangle.c /usr/src/debug/gcc-4.6.1-20110715/libiberty/cp-demangle.c
--- binutils-2.21.53.0.1/libiberty//cp-demangle.c 2011-07-17 22:38:06.000000000 +0200
+++ gcc-4.6.1-20110715/libiberty/cp-demangle.c 2011-03-15 15:32:36.000000000 +0100
@@ -278,6 +278,8 @@ struct d_growable_string
enum { D_PRINT_BUFFER_LENGTH = 256 };
struct d_print_info
{
+ /* The options passed to the demangler. */
+ int options;
/* Fixed-length allocated buffer for demangled data, flushed to the
callback with a NUL termination once full. */
char buf[D_PRINT_BUFFER_LENGTH];
@@ -434,7 +436,7 @@ static void
d_growable_string_callback_adapter (const char *, size_t, void *);
static void
-d_print_init (struct d_print_info *, demangle_callbackref, void *);
+d_print_init (struct d_print_info *, int, demangle_callbackref, void *);
static inline void d_print_error (struct d_print_info *);
@@ -452,32 +454,32 @@ static inline void d_append_string (stru
static inline char d_last_char (struct d_print_info *);
static void
-d_print_comp (struct d_print_info *, int, const struct demangle_component *);
+d_print_comp (struct d_print_info *, const struct demangle_component *);
static void
d_print_java_identifier (struct d_print_info *, const char *, int);
static void
-d_print_mod_list (struct d_print_info *, int, struct d_print_mod *, int);
+d_print_mod_list (struct d_print_info *, struct d_print_mod *, int);
static void
-d_print_mod (struct d_print_info *, int, const struct demangle_component *);
+d_print_mod (struct d_print_info *, const struct demangle_component *);
static void
-d_print_function_type (struct d_print_info *, int,
+d_print_function_type (struct d_print_info *,
const struct demangle_component *,
struct d_print_mod *);
static void
-d_print_array_type (struct d_print_info *, int,
+d_print_array_type (struct d_print_info *,
const struct demangle_component *,
struct d_print_mod *);
static void
-d_print_expr_op (struct d_print_info *, int, const struct demangle_component *);
+d_print_expr_op (struct d_print_info *, const struct demangle_component *);
static void
-d_print_cast (struct d_print_info *, int, const struct demangle_component *);
+d_print_cast (struct d_print_info *, const struct demangle_component *);
static int d_demangle_callback (const char *, int,
demangle_callbackref, void *);
@@ -2738,18 +2740,10 @@ d_expression (struct d_info *di)
/* Function parameter used in a late-specified return type. */
int index;
d_advance (di, 2);
- if (d_peek_char (di) == 'T')
- {
- /* 'this' parameter. */
- d_advance (di, 1);
- index = 0;
- }
- else
- {
- index = d_compact_number (di) + 1;
- if (index == 0)
- return NULL;
- }
+ index = d_compact_number (di);
+ if (index < 0)
+ return NULL;
+
return d_make_function_param (di, index);
}
else if (IS_DIGIT (peek)
@@ -3299,9 +3293,10 @@ d_growable_string_callback_adapter (cons
/* Initialize a print information structure. */
static void
-d_print_init (struct d_print_info *dpi, demangle_callbackref callback,
- void *opaque)
+d_print_init (struct d_print_info *dpi, int options,
+ demangle_callbackref callback, void *opaque)
{
+ dpi->options = options;
dpi->len = 0;
dpi->last_char = '\0';
dpi->templates = NULL;
@@ -3397,9 +3392,9 @@ cplus_demangle_print_callback (int optio
{
struct d_print_info dpi;
- d_print_init (&dpi, callback, opaque);
+ d_print_init (&dpi, options, callback, opaque);
- d_print_comp (&dpi, options, dc);
+ d_print_comp (&dpi, dc);
d_print_flush (&dpi);
@@ -3542,7 +3537,7 @@ d_pack_length (const struct demangle_com
if needed. */
static void
-d_print_subexpr (struct d_print_info *dpi, int options,
+d_print_subexpr (struct d_print_info *dpi,
const struct demangle_component *dc)
{
int simple = 0;
@@ -3551,7 +3546,7 @@ d_print_subexpr (struct d_print_info *dp
simple = 1;
if (!simple)
d_append_char (dpi, '(');
- d_print_comp (dpi, options, dc);
+ d_print_comp (dpi, dc);
if (!simple)
d_append_char (dpi, ')');
}
@@ -3559,13 +3554,9 @@ d_print_subexpr (struct d_print_info *dp
/* Subroutine to handle components. */
static void
-d_print_comp (struct d_print_info *dpi, int options,
+d_print_comp (struct d_print_info *dpi,
const struct demangle_component *dc)
{
- /* Magic variable to let reference smashing skip over the next modifier
- without needing to modify *dc. */
- const struct demangle_component *mod_inner = NULL;
-
if (dc == NULL)
{
d_print_error (dpi);
@@ -3577,7 +3568,7 @@ d_print_comp (struct d_print_info *dpi,
switch (dc->type)
{
case DEMANGLE_COMPONENT_NAME:
- if ((options & DMGL_JAVA) == 0)
+ if ((dpi->options & DMGL_JAVA) == 0)
d_append_buffer (dpi, dc->u.s_name.s, dc->u.s_name.len);
else
d_print_java_identifier (dpi, dc->u.s_name.s, dc->u.s_name.len);
@@ -3585,12 +3576,12 @@ d_print_comp (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_QUAL_NAME:
case DEMANGLE_COMPONENT_LOCAL_NAME:
- d_print_comp (dpi, options, d_left (dc));
- if ((options & DMGL_JAVA) == 0)
+ d_print_comp (dpi, d_left (dc));
+ if ((dpi->options & DMGL_JAVA) == 0)
d_append_string (dpi, "::");
else
d_append_char (dpi, '.');
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
return;
case DEMANGLE_COMPONENT_TYPED_NAME:
@@ -3680,7 +3671,7 @@ d_print_comp (struct d_print_info *dpi,
}
}
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
if (typed_name->type == DEMANGLE_COMPONENT_TEMPLATE)
dpi->templates = dpt.next;
@@ -3693,7 +3684,7 @@ d_print_comp (struct d_print_info *dpi,
if (! adpm[i].printed)
{
d_append_char (dpi, ' ');
- d_print_mod (dpi, options, adpm[i].mod);
+ d_print_mod (dpi, adpm[i].mod);
}
}
@@ -3716,7 +3707,7 @@ d_print_comp (struct d_print_info *dpi,
dcl = d_left (dc);
- if ((options & DMGL_JAVA) != 0
+ if ((dpi->options & DMGL_JAVA) != 0
&& dcl->type == DEMANGLE_COMPONENT_NAME
&& dcl->u.s_name.len == 6
&& strncmp (dcl->u.s_name.s, "JArray", 6) == 0)
@@ -3724,16 +3715,16 @@ d_print_comp (struct d_print_info *dpi,
/* Special-case Java arrays, so that JArray<TYPE> appears
instead as TYPE[]. */
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
d_append_string (dpi, "[]");
}
else
{
- d_print_comp (dpi, options, dcl);
+ d_print_comp (dpi, dcl);
if (d_last_char (dpi) == '<')
d_append_char (dpi, ' ');
d_append_char (dpi, '<');
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
/* Avoid generating two consecutive '>' characters, to avoid
the C++ syntactic ambiguity. */
if (d_last_char (dpi) == '>')
@@ -3768,7 +3759,7 @@ d_print_comp (struct d_print_info *dpi,
hold_dpt = dpi->templates;
dpi->templates = hold_dpt->next;
- d_print_comp (dpi, options, a);
+ d_print_comp (dpi, a);
dpi->templates = hold_dpt;
@@ -3776,79 +3767,79 @@ d_print_comp (struct d_print_info *dpi,
}
case DEMANGLE_COMPONENT_CTOR:
- d_print_comp (dpi, options, dc->u.s_ctor.name);
+ d_print_comp (dpi, dc->u.s_ctor.name);
return;
case DEMANGLE_COMPONENT_DTOR:
d_append_char (dpi, '~');
- d_print_comp (dpi, options, dc->u.s_dtor.name);
+ d_print_comp (dpi, dc->u.s_dtor.name);
return;
case DEMANGLE_COMPONENT_VTABLE:
d_append_string (dpi, "vtable for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_VTT:
d_append_string (dpi, "VTT for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE:
d_append_string (dpi, "construction vtable for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
d_append_string (dpi, "-in-");
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
return;
case DEMANGLE_COMPONENT_TYPEINFO:
d_append_string (dpi, "typeinfo for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_TYPEINFO_NAME:
d_append_string (dpi, "typeinfo name for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_TYPEINFO_FN:
d_append_string (dpi, "typeinfo fn for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_THUNK:
d_append_string (dpi, "non-virtual thunk to ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_VIRTUAL_THUNK:
d_append_string (dpi, "virtual thunk to ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_COVARIANT_THUNK:
d_append_string (dpi, "covariant return thunk to ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_JAVA_CLASS:
d_append_string (dpi, "java Class for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_GUARD:
d_append_string (dpi, "guard variable for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_REFTEMP:
d_append_string (dpi, "reference temporary for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_HIDDEN_ALIAS:
d_append_string (dpi, "hidden alias for ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_SUB_STD:
@@ -3875,43 +3866,22 @@ d_print_comp (struct d_print_info *dpi,
break;
if (pdpm->mod->type == dc->type)
{
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
}
}
}
}
- goto modifier;
-
- case DEMANGLE_COMPONENT_REFERENCE:
- case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
- {
- /* Handle reference smashing: & + && = &. */
- const struct demangle_component *sub = d_left (dc);
- if (sub->type == DEMANGLE_COMPONENT_TEMPLATE_PARAM)
- {
- struct demangle_component *a = d_lookup_template_argument (dpi, sub);
- if (a && a->type == DEMANGLE_COMPONENT_TEMPLATE_ARGLIST)
- a = d_index_template_argument (a, dpi->pack_index);
- sub = a;
- }
-
- if (sub->type == DEMANGLE_COMPONENT_REFERENCE
- || sub->type == dc->type)
- dc = sub;
- else if (sub->type == DEMANGLE_COMPONENT_RVALUE_REFERENCE)
- mod_inner = d_left (sub);
- }
/* Fall through. */
-
case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_CONST_THIS:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
case DEMANGLE_COMPONENT_POINTER:
+ case DEMANGLE_COMPONENT_REFERENCE:
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
case DEMANGLE_COMPONENT_COMPLEX:
case DEMANGLE_COMPONENT_IMAGINARY:
- modifier:
{
/* We keep a list of modifiers on the stack. */
struct d_print_mod dpm;
@@ -3922,15 +3892,12 @@ d_print_comp (struct d_print_info *dpi,
dpm.printed = 0;
dpm.templates = dpi->templates;
- if (!mod_inner)
- mod_inner = d_left (dc);
-
- d_print_comp (dpi, options, mod_inner);
+ d_print_comp (dpi, d_left (dc));
/* If the modifier didn't get printed by the type, print it
now. */
if (! dpm.printed)
- d_print_mod (dpi, options, dc);
+ d_print_mod (dpi, dc);
dpi->modifiers = dpm.next;
@@ -3938,7 +3905,7 @@ d_print_comp (struct d_print_info *dpi,
}
case DEMANGLE_COMPONENT_BUILTIN_TYPE:
- if ((options & DMGL_JAVA) == 0)
+ if ((dpi->options & DMGL_JAVA) == 0)
d_append_buffer (dpi, dc->u.s_builtin.type->name,
dc->u.s_builtin.type->len);
else
@@ -3947,21 +3914,16 @@ d_print_comp (struct d_print_info *dpi,
return;
case DEMANGLE_COMPONENT_VENDOR_TYPE:
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_FUNCTION_TYPE:
{
- if ((options & DMGL_RET_POSTFIX) != 0)
- d_print_function_type (dpi,
- options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP),
- dc, dpi->modifiers);
+ if ((dpi->options & DMGL_RET_POSTFIX) != 0)
+ d_print_function_type (dpi, dc, dpi->modifiers);
/* Print return type if present */
- if (d_left (dc) != NULL && (options & DMGL_RET_POSTFIX) != 0)
- d_print_comp (dpi, options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP),
- d_left (dc));
- else if (d_left (dc) != NULL && (options & DMGL_RET_DROP) == 0)
+ if (d_left (dc) != NULL)
{
struct d_print_mod dpm;
@@ -3973,8 +3935,7 @@ d_print_comp (struct d_print_info *dpi,
dpm.printed = 0;
dpm.templates = dpi->templates;
- d_print_comp (dpi, options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP),
- d_left (dc));
+ d_print_comp (dpi, d_left (dc));
dpi->modifiers = dpm.next;
@@ -3983,14 +3944,12 @@ d_print_comp (struct d_print_info *dpi,
/* In standard prefix notation, there is a space between the
return type and the function signature. */
- if ((options & DMGL_RET_POSTFIX) == 0)
+ if ((dpi->options & DMGL_RET_POSTFIX) == 0)
d_append_char (dpi, ' ');
}
- if ((options & DMGL_RET_POSTFIX) == 0)
- d_print_function_type (dpi,
- options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP),
- dc, dpi->modifiers);
+ if ((dpi->options & DMGL_RET_POSTFIX) == 0)
+ d_print_function_type (dpi, dc, dpi->modifiers);
return;
}
@@ -4043,7 +4002,7 @@ d_print_comp (struct d_print_info *dpi,
pdpm = pdpm->next;
}
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
dpi->modifiers = hold_modifiers;
@@ -4053,10 +4012,10 @@ d_print_comp (struct d_print_info *dpi,
while (i > 1)
{
--i;
- d_print_mod (dpi, options, adpm[i].mod);
+ d_print_mod (dpi, adpm[i].mod);
}
- d_print_array_type (dpi, options, dc, dpi->modifiers);
+ d_print_array_type (dpi, dc, dpi->modifiers);
return;
}
@@ -4072,12 +4031,12 @@ d_print_comp (struct d_print_info *dpi,
dpm.printed = 0;
dpm.templates = dpi->templates;
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
/* If the modifier didn't get printed by the type, print it
now. */
if (! dpm.printed)
- d_print_mod (dpi, options, dc);
+ d_print_mod (dpi, dc);
dpi->modifiers = dpm.next;
@@ -4091,7 +4050,7 @@ d_print_comp (struct d_print_info *dpi,
if (dc->u.s_fixed.length->u.s_builtin.type
!= &cplus_demangle_builtin_types['i'-'a'])
{
- d_print_comp (dpi, options, dc->u.s_fixed.length);
+ d_print_comp (dpi, dc->u.s_fixed.length);
d_append_char (dpi, ' ');
}
if (dc->u.s_fixed.accum)
@@ -4103,7 +4062,7 @@ d_print_comp (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_ARGLIST:
case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
if (d_left (dc) != NULL)
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
if (d_right (dc) != NULL)
{
size_t len;
@@ -4115,7 +4074,7 @@ d_print_comp (struct d_print_info *dpi,
d_append_string (dpi, ", ");
len = dpi->len;
flush_count = dpi->flush_count;
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
/* If that didn't print anything (which can happen with empty
template argument packs), remove the comma and space. */
if (dpi->flush_count == flush_count && dpi->len == len)
@@ -4138,63 +4097,24 @@ d_print_comp (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_EXTENDED_OPERATOR:
d_append_string (dpi, "operator ");
- d_print_comp (dpi, options, dc->u.s_extended_operator.name);
+ d_print_comp (dpi, dc->u.s_extended_operator.name);
return;
case DEMANGLE_COMPONENT_CAST:
d_append_string (dpi, "operator ");
- d_print_cast (dpi, options, dc);
+ d_print_cast (dpi, dc);
return;
case DEMANGLE_COMPONENT_UNARY:
- if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR
- && d_left (dc)->u.s_operator.op->len == 1
- && d_left (dc)->u.s_operator.op->name[0] == '&'
- && d_right (dc)->type == DEMANGLE_COMPONENT_TYPED_NAME
- && d_left (d_right (dc))->type == DEMANGLE_COMPONENT_QUAL_NAME
- && d_right (d_right (dc))->type == DEMANGLE_COMPONENT_FUNCTION_TYPE)
- {
- /* Address of a function (therefore in an expression context) must
- have its argument list suppressed.
-
- unary operator ... dc
- operator & ... d_left (dc)
- typed name ... d_right (dc)
- qualified name ... d_left (d_right (dc))
- <names>
- function type ... d_right (d_right (dc))
- argument list
- <arguments> */
-
- d_print_expr_op (dpi, options, d_left (dc));
- d_print_comp (dpi, options, d_left (d_right (dc)));
- return;
- }
- else if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR
- && d_left (dc)->u.s_operator.op->len == 1
- && d_left (dc)->u.s_operator.op->name[0] == '&'
- && d_right (dc)->type == DEMANGLE_COMPONENT_QUAL_NAME)
- {
- /* Keep also already processed variant without the argument list.
-
- unary operator ... dc
- operator & ... d_left (dc)
- qualified name ... d_right (dc)
- <names> */
-
- d_print_expr_op (dpi, options, d_left (dc));
- d_print_comp (dpi, options, d_right (dc));
- return;
- }
- else if (d_left (dc)->type != DEMANGLE_COMPONENT_CAST)
- d_print_expr_op (dpi, options, d_left (dc));
+ if (d_left (dc)->type != DEMANGLE_COMPONENT_CAST)
+ d_print_expr_op (dpi, d_left (dc));
else
{
d_append_char (dpi, '(');
- d_print_cast (dpi, options, d_left (dc));
+ d_print_cast (dpi, d_left (dc));
d_append_char (dpi, ')');
}
- d_print_subexpr (dpi, options, d_right (dc));
+ d_print_subexpr (dpi, d_right (dc));
return;
case DEMANGLE_COMPONENT_BINARY:
@@ -4212,32 +4132,18 @@ d_print_comp (struct d_print_info *dpi,
&& d_left (dc)->u.s_operator.op->name[0] == '>')
d_append_char (dpi, '(');
- if (strcmp (d_left (dc)->u.s_operator.op->code, "cl") == 0
- && d_left (d_right (dc))->type == DEMANGLE_COMPONENT_TYPED_NAME)
- {
- /* Function call used in an expression should not have printed types
- of the function arguments. Values of the function arguments still
- get printed below. */
-
- const struct demangle_component *func = d_left (d_right (dc));
-
- if (d_right (func)->type != DEMANGLE_COMPONENT_FUNCTION_TYPE)
- d_print_error (dpi);
- d_print_subexpr (dpi, options, d_left (func));
- }
- else
- d_print_subexpr (dpi, options, d_left (d_right (dc)));
+ d_print_subexpr (dpi, d_left (d_right (dc)));
if (strcmp (d_left (dc)->u.s_operator.op->code, "ix") == 0)
{
d_append_char (dpi, '[');
- d_print_comp (dpi, options, d_right (d_right (dc)));
+ d_print_comp (dpi, d_right (d_right (dc)));
d_append_char (dpi, ']');
}
else
{
if (strcmp (d_left (dc)->u.s_operator.op->code, "cl") != 0)
- d_print_expr_op (dpi, options, d_left (dc));
- d_print_subexpr (dpi, options, d_right (d_right (dc)));
+ d_print_expr_op (dpi, d_left (dc));
+ d_print_subexpr (dpi, d_right (d_right (dc)));
}
if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR
@@ -4259,11 +4165,11 @@ d_print_comp (struct d_print_info *dpi,
d_print_error (dpi);
return;
}
- d_print_subexpr (dpi, options, d_left (d_right (dc)));
- d_print_expr_op (dpi, options, d_left (dc));
- d_print_subexpr (dpi, options, d_left (d_right (d_right (dc))));
+ d_print_subexpr (dpi, d_left (d_right (dc)));
+ d_print_expr_op (dpi, d_left (dc));
+ d_print_subexpr (dpi, d_left (d_right (d_right (dc))));
d_append_string (dpi, " : ");
- d_print_subexpr (dpi, options, d_right (d_right (d_right (dc))));
+ d_print_subexpr (dpi, d_right (d_right (d_right (dc))));
return;
case DEMANGLE_COMPONENT_TRINARY_ARG1:
@@ -4294,7 +4200,7 @@ d_print_comp (struct d_print_info *dpi,
{
if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG)
d_append_char (dpi, '-');
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
switch (tp)
{
default:
@@ -4344,13 +4250,13 @@ d_print_comp (struct d_print_info *dpi,
}
d_append_char (dpi, '(');
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
d_append_char (dpi, ')');
if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG)
d_append_char (dpi, '-');
if (tp == D_PRINT_FLOAT)
d_append_char (dpi, '[');
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
if (tp == D_PRINT_FLOAT)
d_append_char (dpi, ']');
}
@@ -4362,12 +4268,12 @@ d_print_comp (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_JAVA_RESOURCE:
d_append_string (dpi, "java resource ");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
return;
case DEMANGLE_COMPONENT_COMPOUND_NAME:
- d_print_comp (dpi, options, d_left (dc));
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_left (dc));
+ d_print_comp (dpi, d_right (dc));
return;
case DEMANGLE_COMPONENT_CHARACTER:
@@ -4376,7 +4282,7 @@ d_print_comp (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_DECLTYPE:
d_append_string (dpi, "decltype (");
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
d_append_char (dpi, ')');
return;
@@ -4390,7 +4296,7 @@ d_print_comp (struct d_print_info *dpi,
/* d_find_pack won't find anything if the only packs involved
in this expansion are function parameter packs; in that
case, just print the pattern and "...". */
- d_print_subexpr (dpi, options, d_left (dc));
+ d_print_subexpr (dpi, d_left (dc));
d_append_string (dpi, "...");
return;
}
@@ -4400,7 +4306,7 @@ d_print_comp (struct d_print_info *dpi,
for (i = 0; i < len; ++i)
{
dpi->pack_index = i;
- d_print_comp (dpi, options, dc);
+ d_print_comp (dpi, dc);
if (i < len-1)
d_append_string (dpi, ", ");
}
@@ -4408,32 +4314,24 @@ d_print_comp (struct d_print_info *dpi,
return;
case DEMANGLE_COMPONENT_FUNCTION_PARAM:
- {
- long num = dc->u.s_number.number;
- if (num == 0)
- d_append_string (dpi, "this");
- else
- {
- d_append_string (dpi, "{parm#");
- d_append_num (dpi, num);
- d_append_char (dpi, '}');
- }
- }
+ d_append_string (dpi, "{parm#");
+ d_append_num (dpi, dc->u.s_number.number + 1);
+ d_append_char (dpi, '}');
return;
case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS:
d_append_string (dpi, "global constructors keyed to ");
- d_print_comp (dpi, options, dc->u.s_binary.left);
+ d_print_comp (dpi, dc->u.s_binary.left);
return;
case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS:
d_append_string (dpi, "global destructors keyed to ");
- d_print_comp (dpi, options, dc->u.s_binary.left);
+ d_print_comp (dpi, dc->u.s_binary.left);
return;
case DEMANGLE_COMPONENT_LAMBDA:
d_append_string (dpi, "{lambda(");
- d_print_comp (dpi, options, dc->u.s_unary_num.sub);
+ d_print_comp (dpi, dc->u.s_unary_num.sub);
d_append_string (dpi, ")#");
d_append_num (dpi, dc->u.s_unary_num.num + 1);
d_append_char (dpi, '}');
@@ -4507,7 +4405,7 @@ d_print_java_identifier (struct d_print_
qualifiers on this after printing a function. */
static void
-d_print_mod_list (struct d_print_info *dpi, int options,
+d_print_mod_list (struct d_print_info *dpi,
struct d_print_mod *mods, int suffix)
{
struct d_print_template *hold_dpt;
@@ -4521,7 +4419,7 @@ d_print_mod_list (struct d_print_info *d
|| mods->mod->type == DEMANGLE_COMPONENT_VOLATILE_THIS
|| mods->mod->type == DEMANGLE_COMPONENT_CONST_THIS)))
{
- d_print_mod_list (dpi, options, mods->next, suffix);
+ d_print_mod_list (dpi, mods->next, suffix);
return;
}
@@ -4532,13 +4430,13 @@ d_print_mod_list (struct d_print_info *d
if (mods->mod->type == DEMANGLE_COMPONENT_FUNCTION_TYPE)
{
- d_print_function_type (dpi, options, mods->mod, mods->next);
+ d_print_function_type (dpi, mods->mod, mods->next);
dpi->templates = hold_dpt;
return;
}
else if (mods->mod->type == DEMANGLE_COMPONENT_ARRAY_TYPE)
{
- d_print_array_type (dpi, options, mods->mod, mods->next);
+ d_print_array_type (dpi, mods->mod, mods->next);
dpi->templates = hold_dpt;
return;
}
@@ -4554,10 +4452,10 @@ d_print_mod_list (struct d_print_info *d
hold_modifiers = dpi->modifiers;
dpi->modifiers = NULL;
- d_print_comp (dpi, options, d_left (mods->mod));
+ d_print_comp (dpi, d_left (mods->mod));
dpi->modifiers = hold_modifiers;
- if ((options & DMGL_JAVA) == 0)
+ if ((dpi->options & DMGL_JAVA) == 0)
d_append_string (dpi, "::");
else
d_append_char (dpi, '.');
@@ -4577,23 +4475,23 @@ d_print_mod_list (struct d_print_info *d
|| dc->type == DEMANGLE_COMPONENT_CONST_THIS)
dc = d_left (dc);
- d_print_comp (dpi, options, dc);
+ d_print_comp (dpi, dc);
dpi->templates = hold_dpt;
return;
}
- d_print_mod (dpi, options, mods->mod);
+ d_print_mod (dpi, mods->mod);
dpi->templates = hold_dpt;
- d_print_mod_list (dpi, options, mods->next, suffix);
+ d_print_mod_list (dpi, mods->next, suffix);
}
/* Print a modifier. */
static void
-d_print_mod (struct d_print_info *dpi, int options,
+d_print_mod (struct d_print_info *dpi,
const struct demangle_component *mod)
{
switch (mod->type)
@@ -4612,11 +4510,11 @@ d_print_mod (struct d_print_info *dpi, i
return;
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
d_append_char (dpi, ' ');
- d_print_comp (dpi, options, d_right (mod));
+ d_print_comp (dpi, d_right (mod));
return;
case DEMANGLE_COMPONENT_POINTER:
/* There is no pointer symbol in Java. */
- if ((options & DMGL_JAVA) == 0)
+ if ((dpi->options & DMGL_JAVA) == 0)
d_append_char (dpi, '*');
return;
case DEMANGLE_COMPONENT_REFERENCE:
@@ -4634,22 +4532,22 @@ d_print_mod (struct d_print_info *dpi, i
case DEMANGLE_COMPONENT_PTRMEM_TYPE:
if (d_last_char (dpi) != '(')
d_append_char (dpi, ' ');
- d_print_comp (dpi, options, d_left (mod));
+ d_print_comp (dpi, d_left (mod));
d_append_string (dpi, "::*");
return;
case DEMANGLE_COMPONENT_TYPED_NAME:
- d_print_comp (dpi, options, d_left (mod));
+ d_print_comp (dpi, d_left (mod));
return;
case DEMANGLE_COMPONENT_VECTOR_TYPE:
d_append_string (dpi, " __vector(");
- d_print_comp (dpi, options, d_left (mod));
+ d_print_comp (dpi, d_left (mod));
d_append_char (dpi, ')');
return;
default:
/* Otherwise, we have something that won't go back on the
modifier stack, so we can just print it. */
- d_print_comp (dpi, options, mod);
+ d_print_comp (dpi, mod);
return;
}
}
@@ -4657,7 +4555,7 @@ d_print_mod (struct d_print_info *dpi, i
/* Print a function type, except for the return type. */
static void
-d_print_function_type (struct d_print_info *dpi, int options,
+d_print_function_type (struct d_print_info *dpi,
const struct demangle_component *dc,
struct d_print_mod *mods)
{
@@ -4717,7 +4615,7 @@ d_print_function_type (struct d_print_in
hold_modifiers = dpi->modifiers;
dpi->modifiers = NULL;
- d_print_mod_list (dpi, options, mods, 0);
+ d_print_mod_list (dpi, mods, 0);
if (need_paren)
d_append_char (dpi, ')');
@@ -4725,11 +4623,11 @@ d_print_function_type (struct d_print_in
d_append_char (dpi, '(');
if (d_right (dc) != NULL)
- d_print_comp (dpi, options, d_right (dc));
+ d_print_comp (dpi, d_right (dc));
d_append_char (dpi, ')');
- d_print_mod_list (dpi, options, mods, 1);
+ d_print_mod_list (dpi, mods, 1);
dpi->modifiers = hold_modifiers;
}
@@ -4737,7 +4635,7 @@ d_print_function_type (struct d_print_in
/* Print an array type, except for the element type. */
static void
-d_print_array_type (struct d_print_info *dpi, int options,
+d_print_array_type (struct d_print_info *dpi,
const struct demangle_component *dc,
struct d_print_mod *mods)
{
@@ -4771,7 +4669,7 @@ d_print_array_type (struct d_print_info
if (need_paren)
d_append_string (dpi, " (");
- d_print_mod_list (dpi, options, mods, 0);
+ d_print_mod_list (dpi, mods, 0);
if (need_paren)
d_append_char (dpi, ')');
@@ -4783,7 +4681,7 @@ d_print_array_type (struct d_print_info
d_append_char (dpi, '[');
if (d_left (dc) != NULL)
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
d_append_char (dpi, ']');
}
@@ -4791,24 +4689,24 @@ d_print_array_type (struct d_print_info
/* Print an operator in an expression. */
static void
-d_print_expr_op (struct d_print_info *dpi, int options,
+d_print_expr_op (struct d_print_info *dpi,
const struct demangle_component *dc)
{
if (dc->type == DEMANGLE_COMPONENT_OPERATOR)
d_append_buffer (dpi, dc->u.s_operator.op->name,
dc->u.s_operator.op->len);
else
- d_print_comp (dpi, options, dc);
+ d_print_comp (dpi, dc);
}
/* Print a cast. */
static void
-d_print_cast (struct d_print_info *dpi, int options,
+d_print_cast (struct d_print_info *dpi,
const struct demangle_component *dc)
{
if (d_left (dc)->type != DEMANGLE_COMPONENT_TEMPLATE)
- d_print_comp (dpi, options, d_left (dc));
+ d_print_comp (dpi, d_left (dc));
else
{
struct d_print_mod *hold_dpm;
@@ -4826,14 +4724,14 @@ d_print_cast (struct d_print_info *dpi,
dpi->templates = &dpt;
dpt.template_decl = d_left (dc);
- d_print_comp (dpi, options, d_left (d_left (dc)));
+ d_print_comp (dpi, d_left (d_left (dc)));
dpi->templates = dpt.next;
if (d_last_char (dpi) == '<')
d_append_char (dpi, ' ');
d_append_char (dpi, '<');
- d_print_comp (dpi, options, d_right (d_left (dc)));
+ d_print_comp (dpi, d_right (d_left (dc)));
/* Avoid generating two consecutive '>' characters, to avoid
the C++ syntactic ambiguity. */
if (d_last_char (dpi) == '>')
Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: cp-demint.c
diff -rup /usr/src/debug/binutils-2.21.53.0.1/libiberty//cplus-dem.c /usr/src/debug/gcc-4.6.1-20110715/libiberty/cplus-dem.c
--- binutils-2.21.53.0.1/libiberty//cplus-dem.c 2011-05-08 16:17:47.000000000 +0200
+++ gcc-4.6.1-20110715/libiberty/cplus-dem.c 2011-03-15 15:32:36.000000000 +0100
@@ -1311,7 +1311,8 @@ delete_non_B_K_work_stuff (struct work_s
int i;
for (i = 0; i < work->ntmpl_args; i++)
- free ((char*) work->tmpl_argvec[i]);
+ if (work->tmpl_argvec[i])
+ free ((char*) work->tmpl_argvec[i]);
free ((char*) work->tmpl_argvec);
work->tmpl_argvec = NULL;
Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: crc32.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: fibheap.c
diff -rup /usr/src/debug/binutils-2.21.53.0.1/libiberty//filename_cmp.c /usr/src/debug/gcc-4.6.1-20110715/libiberty/filename_cmp.c
--- binutils-2.21.53.0.1/libiberty//filename_cmp.c 2011-07-17 22:38:06.000000000 +0200
+++ gcc-4.6.1-20110715/libiberty/filename_cmp.c 2011-03-15 15:32:36.000000000 +0100
@@ -50,27 +50,19 @@ and backward slashes are equal.
int
filename_cmp (const char *s1, const char *s2)
{
-#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
- && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
+#ifndef HAVE_DOS_BASED_FILE_SYSTEM
return strcmp(s1, s2);
#else
for (;;)
{
- int c1 = *s1;
- int c2 = *s2;
+ int c1 = TOLOWER (*s1);
+ int c2 = TOLOWER (*s2);
-#if defined (HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
- c1 = TOLOWER (c1);
- c2 = TOLOWER (c2);
-#endif
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* On DOS-based file systems, the '/' and the '\' are equivalent. */
if (c1 == '/')
c1 = '\\';
if (c2 == '/')
c2 = '\\';
-#endif
if (c1 != c2)
return (c1 - c2);
@@ -108,29 +100,21 @@ and backward slashes are equal.
int
filename_ncmp (const char *s1, const char *s2, size_t n)
{
-#if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
- && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
+#ifndef HAVE_DOS_BASED_FILE_SYSTEM
return strncmp(s1, s2, n);
#else
if (!n)
return 0;
for (; n > 0; --n)
{
- int c1 = *s1;
- int c2 = *s2;
+ int c1 = TOLOWER (*s1);
+ int c2 = TOLOWER (*s2);
-#if defined (HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
- c1 = TOLOWER (c1);
- c2 = TOLOWER (c2);
-#endif
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* On DOS-based file systems, the '/' and the '\' are equivalent. */
if (c1 == '/')
c1 = '\\';
if (c2 == '/')
c2 = '\\';
-#endif
if (c1 == '\0' || c1 != c2)
return (c1 - c2);
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: fopen_unlocked.c
Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: objalloc.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: partition.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: pex-common.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: pex-common.h
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: pex-unix.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: physmem.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: regex.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: setproctitle.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-coff.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-common.h
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-elf.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: simple-object-mach-o.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: splay-tree.c
Only in /usr/src/debug/binutils-2.21.53.0.1/libiberty/: xatexit.c
Only in /usr/src/debug/gcc-4.6.1-20110715/libiberty: xmemdup.c