mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 17:14:32 +00:00
[SDK] sync undname.c to wine 1.9.16
svn path=/trunk/; revision=72567
This commit is contained in:
parent
d054078c72
commit
4d464164e8
1 changed files with 77 additions and 3 deletions
|
@ -857,14 +857,55 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
|
||||||
case 'P': /* Pointer */
|
case 'P': /* Pointer */
|
||||||
if (isdigit((unsigned char)*sym->current))
|
if (isdigit((unsigned char)*sym->current))
|
||||||
{
|
{
|
||||||
/* FIXME: P6 = Function pointer, others who knows.. */
|
/* FIXME:
|
||||||
if (*sym->current++ == '6')
|
* P6 = Function pointer
|
||||||
|
* P8 = Member function pointer
|
||||||
|
* others who knows.. */
|
||||||
|
if (*sym->current == '8')
|
||||||
{
|
{
|
||||||
char* args = NULL;
|
char* args = NULL;
|
||||||
const char* call_conv;
|
const char* call_conv;
|
||||||
const char* exported;
|
const char* exported;
|
||||||
struct datatype_t sub_ct;
|
struct datatype_t sub_ct;
|
||||||
unsigned mark = sym->stack.num;
|
unsigned mark = sym->stack.num;
|
||||||
|
const char* class;
|
||||||
|
const char* modifier;
|
||||||
|
const char* ptr_modif;
|
||||||
|
|
||||||
|
sym->current++;
|
||||||
|
|
||||||
|
if (!(class = get_class_name(sym)))
|
||||||
|
goto done;
|
||||||
|
if (!get_modifier(sym, &modifier, &ptr_modif))
|
||||||
|
goto done;
|
||||||
|
if (modifier)
|
||||||
|
modifier = str_printf(sym, "%s %s", modifier, ptr_modif);
|
||||||
|
else if(ptr_modif[0])
|
||||||
|
modifier = str_printf(sym, " %s", ptr_modif);
|
||||||
|
if (!get_calling_convention(*sym->current++,
|
||||||
|
&call_conv, &exported,
|
||||||
|
sym->flags & ~UNDNAME_NO_ALLOCATION_LANGUAGE))
|
||||||
|
goto done;
|
||||||
|
if (!demangle_datatype(sym, &sub_ct, pmt_ref, FALSE))
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
args = get_args(sym, pmt_ref, TRUE, '(', ')');
|
||||||
|
if (!args) goto done;
|
||||||
|
sym->stack.num = mark;
|
||||||
|
|
||||||
|
ct->left = str_printf(sym, "%s%s (%s %s::*",
|
||||||
|
sub_ct.left, sub_ct.right, call_conv, class);
|
||||||
|
ct->right = str_printf(sym, ")%s%s", args, modifier);
|
||||||
|
}
|
||||||
|
else if (*sym->current == '6')
|
||||||
|
{
|
||||||
|
char* args = NULL;
|
||||||
|
const char* call_conv;
|
||||||
|
const char* exported;
|
||||||
|
struct datatype_t sub_ct;
|
||||||
|
unsigned mark = sym->stack.num;
|
||||||
|
|
||||||
|
sym->current++;
|
||||||
|
|
||||||
if (!get_calling_convention(*sym->current++,
|
if (!get_calling_convention(*sym->current++,
|
||||||
&call_conv, &exported,
|
&call_conv, &exported,
|
||||||
|
@ -902,6 +943,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
case '5': case '6': case '7': case '8': case '9':
|
||||||
/* Referring back to previously parsed type */
|
/* Referring back to previously parsed type */
|
||||||
/* left and right are pushed as two separate strings */
|
/* left and right are pushed as two separate strings */
|
||||||
|
if (!pmt_ref) goto done;
|
||||||
ct->left = str_array_get_ref(pmt_ref, (dt - '0') * 2);
|
ct->left = str_array_get_ref(pmt_ref, (dt - '0') * 2);
|
||||||
ct->right = str_array_get_ref(pmt_ref, (dt - '0') * 2 + 1);
|
ct->right = str_array_get_ref(pmt_ref, (dt - '0') * 2 + 1);
|
||||||
if (!ct->left) goto done;
|
if (!ct->left) goto done;
|
||||||
|
@ -948,7 +990,37 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '$':
|
case '$':
|
||||||
if (*sym->current == 'C')
|
if (*sym->current == 'B')
|
||||||
|
{
|
||||||
|
unsigned mark = sym->stack.num;
|
||||||
|
struct datatype_t sub_ct;
|
||||||
|
const char* arr = NULL;
|
||||||
|
sym->current++;
|
||||||
|
|
||||||
|
/* multidimensional arrays */
|
||||||
|
if (*sym->current == 'Y')
|
||||||
|
{
|
||||||
|
const char* n1;
|
||||||
|
int num;
|
||||||
|
|
||||||
|
sym->current++;
|
||||||
|
if (!(n1 = get_number(sym))) goto done;
|
||||||
|
num = atoi(n1);
|
||||||
|
|
||||||
|
while (num--)
|
||||||
|
arr = str_printf(sym, "%s[%s]", arr, get_number(sym));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!demangle_datatype(sym, &sub_ct, pmt_ref, FALSE)) goto done;
|
||||||
|
|
||||||
|
if (arr)
|
||||||
|
ct->left = str_printf(sym, "%s %s", sub_ct.left, arr);
|
||||||
|
else
|
||||||
|
ct->left = sub_ct.left;
|
||||||
|
ct->right = sub_ct.right;
|
||||||
|
sym->stack.num = mark;
|
||||||
|
}
|
||||||
|
else if (*sym->current == 'C')
|
||||||
{
|
{
|
||||||
const char *ptr, *ptr_modif;
|
const char *ptr, *ptr_modif;
|
||||||
|
|
||||||
|
@ -1377,6 +1449,8 @@ static BOOL symbol_demangle(struct parsed_symbol* sym)
|
||||||
sym->current++;
|
sym->current++;
|
||||||
str_array_init(&pmt);
|
str_array_init(&pmt);
|
||||||
demangle_datatype(sym, &ct, &pmt, FALSE);
|
demangle_datatype(sym, &ct, &pmt, FALSE);
|
||||||
|
if (!demangle_datatype(sym, &ct, NULL, FALSE))
|
||||||
|
goto done;
|
||||||
function_name = str_printf(sym, "%s%s `RTTI Type Descriptor'",
|
function_name = str_printf(sym, "%s%s `RTTI Type Descriptor'",
|
||||||
ct.left, ct.right);
|
ct.left, ct.right);
|
||||||
sym->current--;
|
sym->current--;
|
||||||
|
|
Loading…
Reference in a new issue