Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
2ce0e940
Commit
2ce0e940
authored
13 years ago
by
eric pouech
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
winedbg, winedump: Embed wine build-id information info minidump, and display it.
parent
2505dfcc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/dbghelp/minidump.c
+41
-1
41 additions, 1 deletion
dlls/dbghelp/minidump.c
programs/winedbg/tgt_minidump.c
+17
-1
17 additions, 1 deletion
programs/winedbg/tgt_minidump.c
tools/winedump/minidump.c
+15
-0
15 additions, 0 deletions
tools/winedump/minidump.c
with
73 additions
and
2 deletions
dlls/dbghelp/minidump.c
+
41
−
1
View file @
2ce0e940
...
...
@@ -615,11 +615,29 @@ static unsigned dump_system_info(struct dump_context* dc)
OSVERSIONINFOW
osInfo
;
DWORD
written
;
ULONG
slen
;
DWORD
wine_extra
=
0
;
const
char
*
(
CDECL
*
wine_get_build_id
)(
void
);
void
(
CDECL
*
wine_get_host_version
)(
const
char
**
sysname
,
const
char
**
release
);
const
char
*
build_id
=
NULL
;
const
char
*
sys_name
=
NULL
;
const
char
*
release_name
=
NULL
;
GetSystemInfo
(
&
sysInfo
);
osInfo
.
dwOSVersionInfoSize
=
sizeof
(
osInfo
);
GetVersionExW
(
&
osInfo
);
wine_get_build_id
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ntdll.dll"
),
"wine_get_build_id"
);
wine_get_host_version
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ntdll.dll"
),
"wine_get_host_version"
);
if
(
wine_get_build_id
&&
wine_get_host_version
)
{
/* cheat minidump system information by adding specific wine information */
wine_extra
=
4
+
4
*
sizeof
(
slen
);
build_id
=
wine_get_build_id
();
wine_get_host_version
(
&
sys_name
,
&
release_name
);
wine_extra
+=
strlen
(
build_id
)
+
1
+
strlen
(
sys_name
)
+
1
+
strlen
(
release_name
)
+
1
;
}
mdSysInfo
.
ProcessorArchitecture
=
sysInfo
.
u
.
s
.
wProcessorArchitecture
;
mdSysInfo
.
ProcessorLevel
=
sysInfo
.
wProcessorLevel
;
mdSysInfo
.
ProcessorRevision
=
sysInfo
.
wProcessorRevision
;
...
...
@@ -630,7 +648,7 @@ static unsigned dump_system_info(struct dump_context* dc)
mdSysInfo
.
BuildNumber
=
osInfo
.
dwBuildNumber
;
mdSysInfo
.
PlatformId
=
osInfo
.
dwPlatformId
;
mdSysInfo
.
CSDVersionRva
=
dc
->
rva
+
sizeof
(
mdSysInfo
);
mdSysInfo
.
CSDVersionRva
=
dc
->
rva
+
sizeof
(
mdSysInfo
)
+
wine_extra
;
mdSysInfo
.
u1
.
Reserved1
=
0
;
mdSysInfo
.
u1
.
s
.
SuiteMask
=
VER_SUITE_TERMINAL
;
...
...
@@ -672,6 +690,28 @@ static unsigned dump_system_info(struct dump_context* dc)
}
append
(
dc
,
&
mdSysInfo
,
sizeof
(
mdSysInfo
));
/* write Wine specific system information just behind the structure, and before any string */
if
(
wine_extra
)
{
char
code
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
};
WriteFile
(
dc
->
hFile
,
code
,
4
,
&
written
,
NULL
);
/* number of sub-info, so that we can extend structure if needed */
slen
=
3
;
WriteFile
(
dc
->
hFile
,
&
slen
,
sizeof
(
slen
),
&
written
,
NULL
);
/* we store offsets from just after the WINE marker */
slen
=
4
*
sizeof
(
DWORD
);
WriteFile
(
dc
->
hFile
,
&
slen
,
sizeof
(
slen
),
&
written
,
NULL
);
slen
+=
strlen
(
build_id
)
+
1
;
WriteFile
(
dc
->
hFile
,
&
slen
,
sizeof
(
slen
),
&
written
,
NULL
);
slen
+=
strlen
(
sys_name
)
+
1
;
WriteFile
(
dc
->
hFile
,
&
slen
,
sizeof
(
slen
),
&
written
,
NULL
);
WriteFile
(
dc
->
hFile
,
build_id
,
strlen
(
build_id
)
+
1
,
&
written
,
NULL
);
WriteFile
(
dc
->
hFile
,
sys_name
,
strlen
(
sys_name
)
+
1
,
&
written
,
NULL
);
WriteFile
(
dc
->
hFile
,
release_name
,
strlen
(
release_name
)
+
1
,
&
written
,
NULL
);
dc
->
rva
+=
wine_extra
;
}
/* write the service pack version string after this stream. It is referenced within the
stream by its RVA in the file. */
slen
=
lstrlenW
(
osInfo
.
szCSDVersion
)
*
sizeof
(
WCHAR
);
...
...
This diff is collapsed.
Click to expand it.
programs/winedbg/tgt_minidump.c
+
17
−
1
View file @
2ce0e940
...
...
@@ -174,6 +174,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data)
MINIDUMP_MODULE_LIST
*
mml
;
MINIDUMP_MODULE
*
mm
;
MINIDUMP_STRING
*
mds
;
MINIDUMP_DIRECTORY
*
dir
;
WCHAR
exec_name
[
1024
];
WCHAR
nameW
[
1024
];
unsigned
len
;
...
...
@@ -212,7 +213,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data)
}
}
if
(
MiniDumpReadDumpStream
(
data
->
mapping
,
SystemInfoStream
,
NULL
,
&
stream
,
NULL
))
if
(
MiniDumpReadDumpStream
(
data
->
mapping
,
SystemInfoStream
,
&
dir
,
&
stream
,
NULL
))
{
MINIDUMP_SYSTEM_INFO
*
msi
=
stream
;
const
char
*
str
;
...
...
@@ -305,6 +306,21 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data)
}
dbg_printf
(
" on Windows %s (%u)
\n
"
,
str
,
msi
->
BuildNumber
);
/* FIXME CSD: msi->CSDVersionRva */
if
(
sizeof
(
MINIDUMP_SYSTEM_INFO
)
+
4
>
dir
->
Location
.
DataSize
&&
msi
->
CSDVersionRva
>=
dir
->
Location
.
Rva
+
sizeof
(
MINIDUMP_SYSTEM_INFO
)
+
4
)
{
const
char
*
code
=
(
const
char
*
)
stream
+
sizeof
(
MINIDUMP_SYSTEM_INFO
);
const
DWORD
*
wes
;
if
(
code
[
0
]
==
'W'
&&
code
[
1
]
==
'I'
&&
code
[
2
]
==
'N'
&&
code
[
3
]
==
'E'
&&
*
(
wes
=
(
const
DWORD
*
)(
code
+=
4
))
>=
3
)
{
/* assume we have wine extensions */
dbg_printf
(
" [on %s, on top of %s (%s)]
\n
"
,
code
+
wes
[
1
],
code
+
wes
[
2
],
code
+
wes
[
3
]);
}
}
}
dbg_curr_process
=
dbg_add_process
(
&
be_process_minidump_io
,
pid
,
hProc
);
...
...
This diff is collapsed.
Click to expand it.
tools/winedump/minidump.c
+
15
−
0
View file @
2ce0e940
...
...
@@ -341,6 +341,21 @@ void mdmp_dump(void)
printf
(
" x86.AMDExtendedCpuFeatures: %x
\n
"
,
msi
->
Cpu
.
X86CpuInfo
.
AMDExtendedCpuFeatures
);
}
if
(
sizeof
(
MINIDUMP_SYSTEM_INFO
)
+
4
>
dir
->
Location
.
DataSize
&&
msi
->
CSDVersionRva
>=
dir
->
Location
.
Rva
+
4
)
{
const
char
*
code
=
PRD
(
dir
->
Location
.
Rva
+
sizeof
(
MINIDUMP_SYSTEM_INFO
),
4
);
const
DWORD
*
wes
;
if
(
code
&&
code
[
0
]
==
'W'
&&
code
[
1
]
==
'I'
&&
code
[
2
]
==
'N'
&&
code
[
3
]
==
'E'
&&
*
(
wes
=
(
const
DWORD
*
)(
code
+=
4
))
>=
3
)
{
/* assume we have wine extensions */
printf
(
" Wine details:
\n
"
);
printf
(
" build-id: %s
\n
"
,
code
+
wes
[
1
]);
printf
(
" system: %s
\n
"
,
code
+
wes
[
2
]);
printf
(
" release: %s
\n
"
,
code
+
wes
[
3
]);
}
}
}
break
;
case
MiscInfoStream
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment