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