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
d81e7570
Commit
d81e7570
authored
Dec 01, 2021
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Use %ls to print wide character strings.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8dec81fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
50 deletions
+29
-50
memory.c
programs/winedbg/memory.c
+2
-7
symbol.c
programs/winedbg/symbol.c
+1
-2
types.c
programs/winedbg/types.c
+26
-41
No files found.
programs/winedbg/memory.c
View file @
d81e7570
...
...
@@ -447,7 +447,6 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
char
buffer
[
sizeof
(
TI_FINDCHILDREN_PARAMS
)
+
256
*
sizeof
(
DWORD
)];
TI_FINDCHILDREN_PARAMS
*
fcp
=
(
TI_FINDCHILDREN_PARAMS
*
)
buffer
;
WCHAR
*
ptr
;
char
tmp
[
256
];
VARIANT
variant
;
int
i
;
...
...
@@ -471,14 +470,10 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
case
VT_I8
:
ok
=
(
val_int
==
V_I8
(
&
variant
));
break
;
default:
WINE_FIXME
(
"Unsupported variant type (%u)
\n
"
,
V_VT
(
&
variant
));
}
if
(
ok
)
if
(
ok
&&
types_get_info
(
&
sub_type
,
TI_GET_SYMNAME
,
&
ptr
)
&&
ptr
)
{
ptr
=
NULL
;
types_get_info
(
&
sub_type
,
TI_GET_SYMNAME
,
&
ptr
);
if
(
!
ptr
)
continue
;
WideCharToMultiByte
(
CP_ACP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
),
NULL
,
NULL
);
dbg_printf
(
"%ls"
,
ptr
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
dbg_printf
(
"%s"
,
tmp
);
count
=
0
;
/* so that we'll get away from outer loop */
break
;
}
...
...
programs/winedbg/symbol.c
View file @
d81e7570
...
...
@@ -756,11 +756,10 @@ BOOL symbol_info_locals(void)
addr
.
Mode
=
AddrModeFlat
;
addr
.
Offset
=
frm
->
linear_pc
;
print_address
(
&
addr
,
FALSE
);
dbg_printf
(
": (%0*
lx)
\n
"
,
ADDRWIDTH
,
(
DWORD_PTR
)
frm
->
linear_frame
);
dbg_printf
(
": (%0*
Ix)
\n
"
,
ADDRWIDTH
,
frm
->
linear_frame
);
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
NULL
,
info_locals_cb
,
(
void
*
)
frm
->
linear_frame
);
return
TRUE
;
}
static
BOOL
CALLBACK
symbols_info_cb
(
PSYMBOL_INFO
sym
,
ULONG
size
,
PVOID
ctx
)
...
...
programs/winedbg/types.c
View file @
d81e7570
...
...
@@ -261,15 +261,14 @@ BOOL types_udt_find_element(struct dbg_lvalue* lvalue, const char* name, ULONG *
type
.
module
=
lvalue
->
type
.
module
;
for
(
i
=
0
;
i
<
min
(
fcp
->
Count
,
count
);
i
++
)
{
ptr
=
NULL
;
type
.
id
=
fcp
->
ChildId
[
i
];
types_get_info
(
&
type
,
TI_GET_SYMNAME
,
&
ptr
);
if
(
!
ptr
)
continue
;
WideCharToMultiByte
(
CP_ACP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
),
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
if
(
strcmp
(
tmp
,
name
))
continue
;
return
types_get_udt_element_lvalue
(
lvalue
,
&
type
,
tmpbuf
);
if
(
types_get_info
(
&
type
,
TI_GET_SYMNAME
,
&
ptr
)
&&
ptr
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
),
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
if
(
!
strcmp
(
tmp
,
name
))
return
types_get_udt_element_lvalue
(
lvalue
,
&
type
,
tmpbuf
);
}
}
}
count
-=
min
(
count
,
256
);
...
...
@@ -477,7 +476,6 @@ void print_value(const struct dbg_lvalue* lvalue, char format, int level)
char
buffer
[
sizeof
(
TI_FINDCHILDREN_PARAMS
)
+
256
*
sizeof
(
DWORD
)];
TI_FINDCHILDREN_PARAMS
*
fcp
=
(
TI_FINDCHILDREN_PARAMS
*
)
buffer
;
WCHAR
*
ptr
;
char
tmp
[
256
];
ULONG
tmpbuf
;
struct
dbg_type
sub_type
;
...
...
@@ -490,13 +488,10 @@ void print_value(const struct dbg_lvalue* lvalue, char format, int level)
{
for
(
i
=
0
;
i
<
min
(
fcp
->
Count
,
count
);
i
++
)
{
ptr
=
NULL
;
sub_type
.
module
=
type
.
module
;
sub_type
.
id
=
fcp
->
ChildId
[
i
];
types_get_info
(
&
sub_type
,
TI_GET_SYMNAME
,
&
ptr
);
if
(
!
ptr
)
continue
;
WideCharToMultiByte
(
CP_ACP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
),
NULL
,
NULL
);
dbg_printf
(
"%s="
,
tmp
);
if
(
!
types_get_info
(
&
sub_type
,
TI_GET_SYMNAME
,
&
ptr
)
||
!
ptr
)
continue
;
dbg_printf
(
"%ls="
,
ptr
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
lvalue_field
=
*
lvalue
;
if
(
types_get_udt_element_lvalue
(
&
lvalue_field
,
&
sub_type
,
&
tmpbuf
))
...
...
@@ -602,8 +597,7 @@ BOOL print_types(void)
BOOL
types_print_type
(
const
struct
dbg_type
*
type
,
BOOL
details
)
{
WCHAR
*
ptr
;
char
tmp
[
256
];
const
char
*
name
;
const
WCHAR
*
name
;
DWORD
tag
,
udt
,
count
;
struct
dbg_type
subtype
;
...
...
@@ -613,18 +607,12 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
return
FALSE
;
}
if
(
types_get_info
(
type
,
TI_GET_SYMNAME
,
&
ptr
)
&&
ptr
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
),
NULL
,
NULL
);
name
=
tmp
;
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
else
name
=
"--none--"
;
name
=
(
types_get_info
(
type
,
TI_GET_SYMNAME
,
&
ptr
)
&&
ptr
)
?
ptr
:
L"--none--"
;
switch
(
tag
)
{
case
SymTagBaseType
:
if
(
details
)
dbg_printf
(
"Basic<%
s>"
,
name
);
else
dbg_printf
(
"%
s"
,
name
);
if
(
details
)
dbg_printf
(
"Basic<%
ls>"
,
name
);
else
dbg_printf
(
"%l
s"
,
name
);
break
;
case
SymTagPointerType
:
types_get_info
(
type
,
TI_GET_TYPE
,
&
subtype
.
id
);
...
...
@@ -636,10 +624,10 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
types_get_info
(
type
,
TI_GET_UDTKIND
,
&
udt
);
switch
(
udt
)
{
case
UdtStruct
:
dbg_printf
(
"struct %s"
,
name
);
break
;
case
UdtUnion
:
dbg_printf
(
"union %s"
,
name
);
break
;
case
UdtClass
:
dbg_printf
(
"class %s"
,
name
);
break
;
default:
WINE_ERR
(
"Unsupported UDT type (%d) for %s
\n
"
,
udt
,
name
);
break
;
case
UdtStruct
:
dbg_printf
(
"struct %
l
s"
,
name
);
break
;
case
UdtUnion
:
dbg_printf
(
"union %
l
s"
,
name
);
break
;
case
UdtClass
:
dbg_printf
(
"class %
l
s"
,
name
);
break
;
default:
WINE_ERR
(
"Unsupported UDT type (%d) for %
l
s
\n
"
,
udt
,
name
);
break
;
}
if
(
details
&&
types_get_info
(
type
,
TI_GET_CHILDRENCOUNT
,
&
count
))
...
...
@@ -647,7 +635,6 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
char
buffer
[
sizeof
(
TI_FINDCHILDREN_PARAMS
)
+
256
*
sizeof
(
DWORD
)];
TI_FINDCHILDREN_PARAMS
*
fcp
=
(
TI_FINDCHILDREN_PARAMS
*
)
buffer
;
WCHAR
*
ptr
;
char
tmp
[
256
];
int
i
;
struct
dbg_type
type_elt
;
dbg_printf
(
" {"
);
...
...
@@ -660,14 +647,11 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
{
for
(
i
=
0
;
i
<
min
(
fcp
->
Count
,
count
);
i
++
)
{
ptr
=
NULL
;
type_elt
.
module
=
type
->
module
;
type_elt
.
id
=
fcp
->
ChildId
[
i
];
types_get_info
(
&
type_elt
,
TI_GET_SYMNAME
,
&
ptr
);
if
(
!
ptr
)
continue
;
WideCharToMultiByte
(
CP_ACP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
),
NULL
,
NULL
);
if
(
!
types_get_info
(
&
type_elt
,
TI_GET_SYMNAME
,
&
ptr
)
||
!
ptr
)
continue
;
dbg_printf
(
"%ls"
,
ptr
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
dbg_printf
(
"%s"
,
tmp
);
if
(
types_get_info
(
&
type_elt
,
TI_GET_TYPE
,
&
type_elt
.
id
))
{
dbg_printf
(
":"
);
...
...
@@ -687,12 +671,12 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
subtype
.
module
=
type
->
module
;
types_print_type
(
&
subtype
,
details
);
if
(
types_get_info
(
type
,
TI_GET_COUNT
,
&
count
))
dbg_printf
(
" %s[%d]"
,
name
,
count
);
dbg_printf
(
" %
l
s[%d]"
,
name
,
count
);
else
dbg_printf
(
" %s[]"
,
name
);
dbg_printf
(
" %
l
s[]"
,
name
);
break
;
case
SymTagEnum
:
dbg_printf
(
"enum %s"
,
name
);
dbg_printf
(
"enum %
l
s"
,
name
);
break
;
case
SymTagFunctionType
:
types_get_info
(
type
,
TI_GET_TYPE
,
&
subtype
.
id
);
...
...
@@ -707,7 +691,7 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
subtype
.
module
=
0
;
dbg_printf
(
"<ret_type=self>"
);
}
dbg_printf
(
" (*%s)("
,
name
);
dbg_printf
(
" (*%
l
s)("
,
name
);
if
(
types_get_info
(
type
,
TI_GET_CHILDRENCOUNT
,
&
count
))
{
char
buffer
[
sizeof
(
TI_FINDCHILDREN_PARAMS
)
+
256
*
sizeof
(
DWORD
)];
...
...
@@ -736,13 +720,14 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details)
dbg_printf
(
")"
);
break
;
case
SymTagTypedef
:
dbg_printf
(
"%s"
,
name
);
dbg_printf
(
"%
l
s"
,
name
);
break
;
default:
WINE_ERR
(
"Unknown type %u for %s
\n
"
,
tag
,
name
);
WINE_ERR
(
"Unknown type %u for %
l
s
\n
"
,
tag
,
name
);
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
return
TRUE
;
}
...
...
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