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
facae70c
Commit
facae70c
authored
Mar 21, 2024
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Add helpers to print DWORD64 integers.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
4baada41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
43 deletions
+43
-43
dump.c
tools/winedump/dump.c
+23
-0
minidump.c
tools/winedump/minidump.c
+18
-43
winedump.h
tools/winedump/winedump.h
+2
-0
No files found.
tools/winedump/dump.c
View file @
facae70c
...
...
@@ -133,6 +133,29 @@ void dump_unicode_str( const WCHAR *str, int len )
printf
(
"
\"
"
);
}
const
char
*
get_hexint64_str
(
DWORD64
l
)
{
char
*
buf
=
dump_want_n
(
2
+
16
+
1
);
if
(
sizeof
(
l
)
>
sizeof
(
unsigned
long
)
&&
l
>>
32
)
sprintf
(
buf
,
"%#lx%08lx"
,
(
unsigned
long
)(
l
>>
32
),
(
unsigned
long
)
l
);
else
sprintf
(
buf
,
"%#lx"
,
(
unsigned
long
)
l
);
assert
(
strlen
(
buf
)
<=
18
);
return
buf
;
}
const
char
*
get_uint64_str
(
DWORD64
l
)
{
char
*
buf
=
dump_want_n
(
32
);
char
*
ptr
=
buf
+
31
;
*
ptr
=
'\0'
;
for
(
;
l
;
l
/=
10
)
*--
ptr
=
'0'
+
(
l
%
10
);
if
(
ptr
==
buf
+
31
)
*--
ptr
=
'0'
;
assert
(
ptr
>=
buf
);
return
ptr
;
}
const
char
*
get_symbol_str
(
const
char
*
symname
)
{
const
char
*
ret
=
NULL
;
...
...
tools/winedump/minidump.c
View file @
facae70c
...
...
@@ -53,30 +53,6 @@ enum FileSig get_kind_mdmp(void)
return
SIG_UNKNOWN
;
}
static
inline
void
print_longlong
(
const
char
*
title
,
ULONG64
value
)
{
printf
(
"%s: 0x"
,
title
);
if
(
sizeof
(
value
)
>
sizeof
(
unsigned
long
)
&&
value
>>
32
)
printf
(
"%lx%08lx
\n
"
,
(
unsigned
long
)(
value
>>
32
),
(
unsigned
long
)
value
);
else
printf
(
"%lx
\n
"
,
(
unsigned
long
)
value
);
}
static
inline
void
print_longlong_range
(
const
char
*
title
,
ULONG64
start
,
ULONG64
length
)
{
ULONG64
value
=
start
;
printf
(
"%s: 0x"
,
title
);
if
(
sizeof
(
value
)
>
sizeof
(
unsigned
long
)
&&
value
>>
32
)
printf
(
"%lx%08lx-"
,
(
unsigned
long
)(
value
>>
32
),
(
unsigned
long
)
value
);
else
printf
(
"%lx-"
,
(
unsigned
long
)
value
);
value
=
start
+
length
;
if
(
sizeof
(
value
)
>
sizeof
(
unsigned
long
)
&&
value
>>
32
)
printf
(
"0x%lx%08lx
\n
"
,
(
unsigned
long
)(
value
>>
32
),
(
unsigned
long
)
value
);
else
printf
(
"0x%lx
\n
"
,
(
unsigned
long
)
value
);
}
void
mdmp_dump
(
void
)
{
const
MINIDUMP_HEADER
*
hdr
=
PRD
(
0
,
sizeof
(
MINIDUMP_HEADER
));
...
...
@@ -97,7 +73,7 @@ void mdmp_dump(void)
printf
(
"StreamDirectoryRva: %u
\n
"
,
(
UINT
)
hdr
->
StreamDirectoryRva
);
printf
(
"CheckSum: %#x (%u)
\n
"
,
hdr
->
CheckSum
,
hdr
->
CheckSum
);
printf
(
"TimeDateStamp: %s
\n
"
,
get_time_str
(
hdr
->
TimeDateStamp
));
print
_longlong
(
"Flags"
,
hdr
->
Flags
);
print
f
(
"Flags: %s
\n
"
,
get_hexint64_str
(
hdr
->
Flags
)
);
for
(
idx
=
0
;
idx
<
hdr
->
NumberOfStreams
;
++
idx
)
{
...
...
@@ -122,8 +98,8 @@ void mdmp_dump(void)
printf
(
" SuspendCount: %u
\n
"
,
mt
->
SuspendCount
);
printf
(
" PriorityClass: %u
\n
"
,
mt
->
PriorityClass
);
printf
(
" Priority: %u
\n
"
,
mt
->
Priority
);
print
_longlong
(
" Teb"
,
mt
->
Teb
);
print
_longlong_range
(
" Stack"
,
mt
->
Stack
.
StartOfMemoryRange
,
mt
->
Stack
.
Memory
.
DataSize
);
print
f
(
" Teb: %s
\n
"
,
get_hexint64_str
(
mt
->
Teb
)
);
print
f
(
" Stack: %s +%#x
\n
"
,
get_hexint64_str
(
mt
->
Stack
.
StartOfMemoryRange
)
,
mt
->
Stack
.
Memory
.
DataSize
);
dump_mdmp_data
(
&
mt
->
Stack
.
Memory
,
" "
);
printf
(
" ThreadContext:
\n
"
);
dump_mdmp_data
(
&
mt
->
ThreadContext
,
" "
);
...
...
@@ -144,7 +120,7 @@ void mdmp_dump(void)
for
(
i
=
0
;
i
<
mml
->
NumberOfModules
;
i
++
,
mm
++
)
{
printf
(
" Module #%d:
\n
"
,
i
);
print
_longlong
(
" BaseOfImage"
,
mm
->
BaseOfImage
);
print
f
(
" BaseOfImage: %s
\n
"
,
get_hexint64_str
(
mm
->
BaseOfImage
)
);
printf
(
" SizeOfImage: %#x (%u)
\n
"
,
mm
->
SizeOfImage
,
mm
->
SizeOfImage
);
printf
(
" CheckSum: %#x (%u)
\n
"
,
mm
->
CheckSum
,
mm
->
CheckSum
);
printf
(
" TimeDateStamp: %s
\n
"
,
get_time_str
(
mm
->
TimeDateStamp
));
...
...
@@ -214,8 +190,8 @@ void mdmp_dump(void)
dump_mdmp_data
(
&
mm
->
CvRecord
,
" "
);
printf
(
" MiscRecord: <%u>
\n
"
,
(
UINT
)
mm
->
MiscRecord
.
DataSize
);
dump_mdmp_data
(
&
mm
->
MiscRecord
,
" "
);
print
_longlong
(
" Reserved0"
,
mm
->
Reserved0
);
print
_longlong
(
" Reserved1"
,
mm
->
Reserved1
);
print
f
(
" Reserved0: %s
\n
"
,
get_hexint64_str
(
mm
->
Reserved0
)
);
print
f
(
" Reserved1: %s
\n
"
,
get_hexint64_str
(
mm
->
Reserved1
)
);
}
}
break
;
...
...
@@ -228,7 +204,7 @@ void mdmp_dump(void)
for
(
i
=
0
;
i
<
mml
->
NumberOfMemoryRanges
;
i
++
,
mmd
++
)
{
printf
(
" Memory Range #%d:
\n
"
,
i
);
print
_longlong_range
(
" Range"
,
mmd
->
StartOfMemoryRange
,
mmd
->
Memory
.
DataSize
);
print
f
(
" Range: %s +%#x
\n
"
,
get_hexint64_str
(
mmd
->
StartOfMemoryRange
)
,
mmd
->
Memory
.
DataSize
);
dump_mdmp_data
(
&
mmd
->
Memory
,
" "
);
}
}
...
...
@@ -423,13 +399,12 @@ void mdmp_dump(void)
printf
(
" ExceptionRecord:
\n
"
);
printf
(
" ExceptionCode: %#x
\n
"
,
mes
->
ExceptionRecord
.
ExceptionCode
);
printf
(
" ExceptionFlags: %#x
\n
"
,
mes
->
ExceptionRecord
.
ExceptionFlags
);
print
_longlong
(
" ExceptionRecord"
,
mes
->
ExceptionRecord
.
ExceptionRecord
);
print
_longlong
(
" ExceptionAddress"
,
mes
->
ExceptionRecord
.
ExceptionAddress
);
print
f
(
" ExceptionRecord: %s
\n
"
,
get_hexint64_str
(
mes
->
ExceptionRecord
.
ExceptionRecord
)
);
print
f
(
" ExceptionAddress: %s
\n
"
,
get_hexint64_str
(
mes
->
ExceptionRecord
.
ExceptionAddress
)
);
printf
(
" ExceptionNumberParameters: %u
\n
"
,
mes
->
ExceptionRecord
.
NumberParameters
);
for
(
i
=
0
;
i
<
mes
->
ExceptionRecord
.
NumberParameters
;
i
++
)
{
printf
(
" [%d]"
,
i
);
print_longlong
(
" "
,
mes
->
ExceptionRecord
.
ExceptionInformation
[
i
]);
printf
(
" [%d] %s
\n
"
,
i
,
get_hexint64_str
(
mes
->
ExceptionRecord
.
ExceptionInformation
[
i
]));
}
printf
(
" ThreadContext:
\n
"
);
dump_mdmp_data
(
&
mes
->
ThreadContext
,
" "
);
...
...
@@ -450,7 +425,7 @@ void mdmp_dump(void)
const
MINIDUMP_HANDLE_DESCRIPTOR_2
*
hd
=
(
void
*
)
ptr
;
printf
(
" Handle [%u]:
\n
"
,
i
);
print
_longlong
(
" Handle"
,
hd
->
Handle
);
print
f
(
" Handle: %s
\n
"
,
get_hexint64_str
(
hd
->
Handle
)
);
printf
(
" TypeName: "
);
dump_mdmp_string
(
hd
->
TypeNameRva
);
printf
(
"
\n
"
);
...
...
@@ -493,12 +468,12 @@ void mdmp_dump(void)
printf
(
" DumpFlags: %#x
\n
"
,
ti
->
DumpFlags
);
printf
(
" DumpError: %u
\n
"
,
ti
->
DumpError
);
printf
(
" ExitStatus: %u
\n
"
,
ti
->
ExitStatus
);
print
_longlong
(
" CreateTime"
,
ti
->
CreateTime
);
print
_longlong
(
" ExitTime"
,
ti
->
ExitTime
);
print
_longlong
(
" KernelTime"
,
ti
->
KernelTime
);
print
_longlong
(
" UserTime"
,
ti
->
UserTime
);
print
_longlong
(
" StartAddress"
,
ti
->
StartAddress
);
print
_longlong
(
" Affinity"
,
ti
->
Affinity
);
print
f
(
" CreateTime: %s
\n
"
,
get_uint64_str
(
ti
->
CreateTime
)
);
print
f
(
" ExitTime: %s
\n
"
,
get_hexint64_str
(
ti
->
ExitTime
)
);
print
f
(
" KernelTime: %s
\n
"
,
get_uint64_str
(
ti
->
KernelTime
)
);
print
f
(
" UserTime: %s
\n
"
,
get_uint64_str
(
ti
->
UserTime
)
);
print
f
(
" StartAddress: %s
\n
"
,
get_hexint64_str
(
ti
->
StartAddress
)
);
print
f
(
" Affinity: %s
\n
"
,
get_uint64_str
(
ti
->
Affinity
)
);
ptr
+=
til
->
SizeOfEntry
;
}
...
...
@@ -520,7 +495,7 @@ void mdmp_dump(void)
const
MINIDUMP_UNLOADED_MODULE
*
mod
=
(
void
*
)
ptr
;
printf
(
" Module [%u]:
\n
"
,
i
);
print
_longlong
(
" BaseOfImage"
,
mod
->
BaseOfImage
);
print
f
(
" BaseOfImage: %s
\n
"
,
get_hexint64_str
(
mod
->
BaseOfImage
)
);
printf
(
" SizeOfImage: %u
\n
"
,
mod
->
SizeOfImage
);
printf
(
" CheckSum: %#x
\n
"
,
mod
->
CheckSum
);
printf
(
" TimeDateStamp: %s
\n
"
,
get_time_str
(
mod
->
TimeDateStamp
));
...
...
tools/winedump/winedump.h
View file @
facae70c
...
...
@@ -229,6 +229,8 @@ void dump_data( const unsigned char *ptr, unsigned int size, const ch
const
char
*
get_time_str
(
unsigned
long
);
unsigned
int
strlenW
(
const
unsigned
short
*
str
);
void
dump_unicode_str
(
const
unsigned
short
*
str
,
int
len
);
const
char
*
get_hexint64_str
(
DWORD64
l
);
const
char
*
get_uint64_str
(
DWORD64
l
);
const
char
*
get_guid_str
(
const
GUID
*
guid
);
const
char
*
get_unicode_str
(
const
WCHAR
*
str
,
int
len
);
const
char
*
get_symbol_str
(
const
char
*
symname
);
...
...
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