Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
766085ed
Commit
766085ed
authored
Aug 31, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Correctly support space generation in pointers.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
4e1b7cec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
24 deletions
+25
-24
cpp.c
dlls/msvcrt/tests/cpp.c
+2
-0
undname.c
dlls/msvcrt/undname.c
+23
-24
No files found.
dlls/msvcrt/tests/cpp.c
View file @
766085ed
...
@@ -1295,6 +1295,8 @@ static void test_demangle(void)
...
@@ -1295,6 +1295,8 @@ static void test_demangle(void)
/* 132 */
{
"??$meth@FD@DD@CC@@QAE_NK@Z"
,
"public: bool __thiscall CC::DD::meth<short,char>(unsigned long)"
},
/* 132 */
{
"??$meth@FD@DD@CC@@QAE_NK@Z"
,
"public: bool __thiscall CC::DD::meth<short,char>(unsigned long)"
},
/* 133 */
{
"?func@@YAXPIFAH@Z"
,
"void __cdecl func(int __unaligned * __restrict)"
},
/* 133 */
{
"?func@@YAXPIFAH@Z"
,
"void __cdecl func(int __unaligned * __restrict)"
},
/* 135 */
{
"?x@@3PAY02HA"
,
"int (* x)[3]"
},
/* 135 */
{
"?x@@3PAY02HA"
,
"int (* x)[3]"
},
/* 136 */
{
"?Qux@Bar@@0PAPAP6AHPAV1@AAH1PAH@ZA"
,
"private: static int (__cdecl** * Bar::Qux)(class Bar *,int &,int &,int *)"
},
/* variation of 105: note white space handling! */
};
};
int
i
,
num_test
=
ARRAY_SIZE
(
test
);
int
i
,
num_test
=
ARRAY_SIZE
(
test
);
char
*
name
;
char
*
name
;
...
...
dlls/msvcrt/undname.c
View file @
766085ed
...
@@ -77,11 +77,17 @@ struct parsed_symbol
...
@@ -77,11 +77,17 @@ struct parsed_symbol
unsigned
avail_in_first
;
/* number of available bytes in head block */
unsigned
avail_in_first
;
/* number of available bytes in head block */
};
};
enum
datatype_e
{
DT_NO_LEADING_WS
=
0x01
,
};
/* Type for parsing mangled types */
/* Type for parsing mangled types */
struct
datatype_t
struct
datatype_t
{
{
const
char
*
left
;
const
char
*
left
;
const
char
*
right
;
const
char
*
right
;
enum
datatype_e
flags
;
};
};
static
BOOL
symbol_demangle
(
struct
parsed_symbol
*
sym
);
static
BOOL
symbol_demangle
(
struct
parsed_symbol
*
sym
);
...
@@ -407,6 +413,7 @@ static void append_extended_modifier(struct parsed_symbol *sym, const char **whe
...
@@ -407,6 +413,7 @@ static void append_extended_modifier(struct parsed_symbol *sym, const char **whe
static
void
get_extended_modifier
(
struct
parsed_symbol
*
sym
,
struct
datatype_t
*
xdt
)
static
void
get_extended_modifier
(
struct
parsed_symbol
*
sym
,
struct
datatype_t
*
xdt
)
{
{
xdt
->
left
=
xdt
->
right
=
NULL
;
xdt
->
left
=
xdt
->
right
=
NULL
;
xdt
->
flags
=
0
;
for
(;;)
for
(;;)
{
{
switch
(
*
sym
->
current
)
switch
(
*
sym
->
current
)
...
@@ -455,25 +462,24 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
...
@@ -455,25 +462,24 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
switch
(
modif
)
switch
(
modif
)
{
{
case
'A'
:
ref
=
"
&"
;
str_modif
=
NULL
;
break
;
case
'A'
:
ref
=
"
&"
;
str_modif
=
NULL
;
break
;
case
'B'
:
ref
=
"
&"
;
str_modif
=
"
volatile"
;
break
;
case
'B'
:
ref
=
"
&"
;
str_modif
=
"
volatile"
;
break
;
case
'P'
:
ref
=
"
*"
;
str_modif
=
NULL
;
break
;
case
'P'
:
ref
=
"
*"
;
str_modif
=
NULL
;
break
;
case
'Q'
:
ref
=
"
*"
;
str_modif
=
"
const"
;
break
;
case
'Q'
:
ref
=
"
*"
;
str_modif
=
"
const"
;
break
;
case
'R'
:
ref
=
"
*"
;
str_modif
=
"
volatile"
;
break
;
case
'R'
:
ref
=
"
*"
;
str_modif
=
"
volatile"
;
break
;
case
'S'
:
ref
=
"
*"
;
str_modif
=
"
const volatile"
;
break
;
case
'S'
:
ref
=
"
*"
;
str_modif
=
"
const volatile"
;
break
;
case
'?'
:
ref
=
NULL
;
str_modif
=
NULL
;
break
;
case
'?'
:
ref
=
NULL
;
str_modif
=
NULL
;
break
;
case
'$'
:
ref
=
"
&&"
;
str_modif
=
NULL
;
break
;
case
'$'
:
ref
=
"
&&"
;
str_modif
=
NULL
;
break
;
default:
return
FALSE
;
default:
return
FALSE
;
}
}
if
(
ref
||
str_modif
||
xdt
.
left
||
xdt
.
right
)
if
(
ref
||
str_modif
||
xdt
.
left
||
xdt
.
right
)
ct
->
left
=
str_printf
(
sym
,
" %s%s%s%s%s%s%s"
,
ct
->
left
=
str_printf
(
sym
,
"%s%s%s%s%s%s"
,
xdt
.
left
,
xdt
.
left
?
" "
:
NULL
,
xdt
.
left
,
ref
,
xdt
.
left
&&
ref
?
" "
:
NULL
,
ref
,
xdt
.
right
?
" "
:
NULL
,
xdt
.
right
,
str_modif
);
(
xdt
.
left
||
ref
)
&&
xdt
.
right
?
" "
:
NULL
,
xdt
.
right
,
(
xdt
.
left
||
ref
||
xdt
.
right
)
&&
str_modif
?
" "
:
NULL
,
str_modif
);
else
else
ct
->
left
=
NULL
;
ct
->
left
=
NULL
;
ct
->
right
=
NULL
;
ct
->
right
=
NULL
;
ct
->
flags
=
0
;
if
(
get_modifier
(
sym
,
&
xdt
))
if
(
get_modifier
(
sym
,
&
xdt
))
{
{
...
@@ -490,10 +496,7 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
...
@@ -490,10 +496,7 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
if
(
!
(
n1
=
get_number
(
sym
)))
return
FALSE
;
if
(
!
(
n1
=
get_number
(
sym
)))
return
FALSE
;
num
=
atoi
(
n1
);
num
=
atoi
(
n1
);
if
(
ct
->
left
&&
ct
->
left
[
0
]
==
' '
&&
!
xdt
.
left
)
ct
->
left
=
str_printf
(
sym
,
" (%s%s"
,
xdt
.
left
,
ct
->
left
&&
!
xdt
.
left
?
ct
->
left
+
1
:
ct
->
left
);
ct
->
left
++
;
ct
->
left
=
str_printf
(
sym
,
" (%s%s"
,
xdt
.
left
,
ct
->
left
);
ct
->
right
=
")"
;
ct
->
right
=
")"
;
xdt
.
left
=
NULL
;
xdt
.
left
=
NULL
;
...
@@ -504,15 +507,9 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
...
@@ -504,15 +507,9 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
/* Recurse to get the referred-to type */
/* Recurse to get the referred-to type */
if
(
!
demangle_datatype
(
sym
,
&
sub_ct
,
pmt_ref
,
FALSE
))
if
(
!
demangle_datatype
(
sym
,
&
sub_ct
,
pmt_ref
,
FALSE
))
return
FALSE
;
return
FALSE
;
if
(
xdt
.
left
)
if
(
sub_ct
.
flags
&
DT_NO_LEADING_WS
)
ct
->
left
=
str_printf
(
sym
,
"%s %s%s"
,
sub_ct
.
left
,
xdt
.
left
,
ct
->
left
);
else
{
/* don't insert a space between duplicate '*' */
if
(
!
in_args
&&
ct
->
left
&&
ct
->
left
[
0
]
&&
ct
->
left
[
1
]
==
'*'
&&
sub_ct
.
left
[
strlen
(
sub_ct
.
left
)
-
1
]
==
'*'
)
ct
->
left
++
;
ct
->
left
++
;
ct
->
left
=
str_printf
(
sym
,
"%s%s"
,
sub_ct
.
left
,
ct
->
left
);
ct
->
left
=
str_printf
(
sym
,
"%s%s%s%s"
,
sub_ct
.
left
,
xdt
.
left
?
" "
:
NULL
,
xdt
.
left
,
ct
->
left
);
}
if
(
sub_ct
.
right
)
ct
->
right
=
str_printf
(
sym
,
"%s%s"
,
ct
->
right
,
sub_ct
.
right
);
if
(
sub_ct
.
right
)
ct
->
right
=
str_printf
(
sym
,
"%s%s"
,
ct
->
right
,
sub_ct
.
right
);
sym
->
stack
.
num
=
mark
;
sym
->
stack
.
num
=
mark
;
}
}
...
@@ -814,6 +811,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
...
@@ -814,6 +811,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
assert
(
ct
);
assert
(
ct
);
ct
->
left
=
ct
->
right
=
NULL
;
ct
->
left
=
ct
->
right
=
NULL
;
ct
->
flags
=
0
;
switch
(
dt
=
*
sym
->
current
++
)
switch
(
dt
=
*
sym
->
current
++
)
{
{
...
@@ -938,6 +936,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
...
@@ -938,6 +936,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
ct
->
left
=
str_printf
(
sym
,
"%s%s (%s*"
,
ct
->
left
=
str_printf
(
sym
,
"%s%s (%s*"
,
sub_ct
.
left
,
sub_ct
.
right
,
call_conv
);
sub_ct
.
left
,
sub_ct
.
right
,
call_conv
);
ct
->
flags
=
DT_NO_LEADING_WS
;
ct
->
right
=
str_printf
(
sym
,
")%s"
,
args
);
ct
->
right
=
str_printf
(
sym
,
")%s"
,
args
);
}
}
else
goto
done
;
else
goto
done
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment