aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2011-07-05 15:40:17 +0000
committerDJ Delorie <dj@redhat.com>2011-07-05 15:40:17 +0000
commitf2917a30d09fe5ab9c5bcd6b5ba47c7d292328cd (patch)
treeb70397878833573106786a5ce316befce80d219f /libiberty/cp-demangle.c
parenteb2a6f420b324bc81207c7606ebef9db3a9bb984 (diff)
downloadgdb-f2917a30d09fe5ab9c5bcd6b5ba47c7d292328cd.zip
gdb-f2917a30d09fe5ab9c5bcd6b5ba47c7d292328cd.tar.gz
gdb-f2917a30d09fe5ab9c5bcd6b5ba47c7d292328cd.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index f136322..29badbb 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2738,10 +2738,18 @@ d_expression (struct d_info *di)
/* Function parameter used in a late-specified return type. */
int index;
d_advance (di, 2);
- index = d_compact_number (di);
- if (index < 0)
- return NULL;
-
+ 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;
+ }
return d_make_function_param (di, index);
}
else if (IS_DIGIT (peek)
@@ -4400,9 +4408,17 @@ d_print_comp (struct d_print_info *dpi, int options,
return;
case DEMANGLE_COMPONENT_FUNCTION_PARAM:
- d_append_string (dpi, "{parm#");
- d_append_num (dpi, dc->u.s_number.number + 1);
- d_append_char (dpi, '}');
+ {
+ 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, '}');
+ }
+ }
return;
case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS: