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
416d29e2
Commit
416d29e2
authored
Nov 16, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Remove DMT_ entries for .DBG and .PDB files.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
79b6d8d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
64 deletions
+14
-64
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-3
msc.c
dlls/dbghelp/msc.c
+2
-2
path.c
dlls/dbghelp/path.c
+10
-58
pe_module.c
dlls/dbghelp/pe_module.c
+1
-1
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
416d29e2
...
...
@@ -401,8 +401,6 @@ enum module_type
DMT_ELF
,
/* a real ELF shared module */
DMT_PE
,
/* a native or builtin PE module */
DMT_MACHO
,
/* a real Mach-O shared module */
DMT_PDB
,
/* .PDB file */
DMT_DBG
,
/* .DBG file */
};
struct
process
;
...
...
@@ -775,7 +773,7 @@ extern DWORD pdb_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW*
/* path.c */
extern
BOOL
path_find_symbol_file
(
const
struct
process
*
pcs
,
const
struct
module
*
module
,
PCSTR
full_path
,
enum
module_type
type
,
const
GUID
*
guid
,
DWORD
dw1
,
DWORD
dw2
,
PCSTR
full_path
,
BOOL
is_pdb
,
const
GUID
*
guid
,
DWORD
dw1
,
DWORD
dw2
,
WCHAR
*
buffer
,
BOOL
*
is_unmatched
);
extern
WCHAR
*
get_dos_file_name
(
const
WCHAR
*
filename
)
__WINE_DEALLOC
(
HeapFree
,
3
)
__WINE_MALLOC
;
extern
BOOL
search_dll_path
(
const
struct
process
*
process
,
const
WCHAR
*
name
,
WORD
machine
,
...
...
dlls/dbghelp/msc.c
View file @
416d29e2
...
...
@@ -3317,11 +3317,11 @@ static HANDLE map_pdb_file(const struct process* pcs,
switch
(
lookup
->
kind
)
{
case
PDB_JG
:
ret
=
path_find_symbol_file
(
pcs
,
module
,
lookup
->
filename
,
DMT_PDB
,
NULL
,
lookup
->
timestamp
,
ret
=
path_find_symbol_file
(
pcs
,
module
,
lookup
->
filename
,
TRUE
,
NULL
,
lookup
->
timestamp
,
lookup
->
age
,
dbg_file_path
,
&
module
->
module
.
PdbUnmatched
);
break
;
case
PDB_DS
:
ret
=
path_find_symbol_file
(
pcs
,
module
,
lookup
->
filename
,
DMT_PDB
,
&
lookup
->
guid
,
0
,
ret
=
path_find_symbol_file
(
pcs
,
module
,
lookup
->
filename
,
TRUE
,
&
lookup
->
guid
,
0
,
lookup
->
age
,
dbg_file_path
,
&
module
->
module
.
PdbUnmatched
);
break
;
}
...
...
dlls/dbghelp/path.c
View file @
416d29e2
...
...
@@ -461,13 +461,12 @@ BOOL WINAPI SymFindFileInPath(HANDLE hProcess, PCSTR searchPath, PCSTR full_path
struct
module_find
{
enum
module_type
kind
;
/* pe: dw1 DWORD:timestamp
* dw2 size of image (from PE header)
* pdb: guid PDB guid (if DS PDB file)
BOOL
is_pdb
;
/* pdb: guid PDB guid (if DS PDB file)
* or dw1 PDB timestamp (if JG PDB file)
* dw2 PDB age
* elf: dw1 DWORD:CRC 32 of ELF image (Wine only)
* dbg: dw1 DWORD:timestamp
* dw2 size of image (from PE header)
*/
const
GUID
*
guid
;
DWORD
dw1
;
...
...
@@ -484,7 +483,7 @@ struct module_find
static
BOOL
CALLBACK
module_find_cb
(
PCWSTR
buffer
,
PVOID
user
)
{
struct
module_find
*
mf
=
user
;
DWORD
size
,
timestamp
;
DWORD
timestamp
;
unsigned
matched
=
0
;
/* the matching weights:
...
...
@@ -492,49 +491,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
* +1 if first parameter and second parameter match
*/
/* FIXME: should check that id/two match the file pointed
* by buffer
*/
switch
(
mf
->
kind
)
{
case
DMT_PE
:
{
HANDLE
hFile
,
hMap
;
void
*
mapping
;
timestamp
=
~
mf
->
dw1
;
size
=
~
mf
->
dw2
;
hFile
=
CreateFileW
(
buffer
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
if
((
hMap
=
CreateFileMappingW
(
hFile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
))
!=
NULL
)
{
if
((
mapping
=
MapViewOfFile
(
hMap
,
FILE_MAP_READ
,
0
,
0
,
0
))
!=
NULL
)
{
IMAGE_NT_HEADERS
*
nth
=
RtlImageNtHeader
(
mapping
);
if
(
!
nth
)
{
UnmapViewOfFile
(
mapping
);
CloseHandle
(
hMap
);
CloseHandle
(
hFile
);
return
FALSE
;
}
matched
++
;
timestamp
=
nth
->
FileHeader
.
TimeDateStamp
;
size
=
nth
->
OptionalHeader
.
SizeOfImage
;
UnmapViewOfFile
(
mapping
);
}
CloseHandle
(
hMap
);
}
CloseHandle
(
hFile
);
if
(
timestamp
!=
mf
->
dw1
)
WARN
(
"Found %s, but wrong timestamp
\n
"
,
debugstr_w
(
buffer
));
if
(
size
!=
mf
->
dw2
)
WARN
(
"Found %s, but wrong size
\n
"
,
debugstr_w
(
buffer
));
if
(
timestamp
==
mf
->
dw1
&&
size
==
mf
->
dw2
)
matched
++
;
}
break
;
case
DMT_PDB
:
if
(
mf
->
is_pdb
)
{
struct
pdb_lookup
pdb_lookup
;
char
fn
[
MAX_PATH
];
...
...
@@ -558,8 +515,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
if
(
!
pdb_fetch_file_info
(
&
pdb_lookup
,
&
matched
))
return
FALSE
;
}
break
;
case
DMT_DBG
:
else
{
HANDLE
hFile
,
hMap
;
void
*
mapping
;
...
...
@@ -588,11 +544,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
if
(
timestamp
==
mf
->
dw1
)
matched
++
;
else
WARN
(
"Found %s, but wrong timestamp
\n
"
,
debugstr_w
(
buffer
));
}
break
;
default:
FIXME
(
"What the heck??
\n
"
);
return
FALSE
;
}
if
(
matched
>
mf
->
matched
)
{
lstrcpyW
(
mf
->
filename
,
buffer
);
...
...
@@ -605,7 +557,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
}
BOOL
path_find_symbol_file
(
const
struct
process
*
pcs
,
const
struct
module
*
module
,
PCSTR
full_path
,
enum
module_type
type
,
const
GUID
*
guid
,
DWORD
dw1
,
DWORD
dw2
,
PCSTR
full_path
,
BOOL
is_pdb
,
const
GUID
*
guid
,
DWORD
dw1
,
DWORD
dw2
,
WCHAR
*
buffer
,
BOOL
*
is_unmatched
)
{
struct
module_find
mf
;
...
...
@@ -624,7 +576,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul
MultiByteToWideChar
(
CP_ACP
,
0
,
full_path
,
-
1
,
full_pathW
,
MAX_PATH
);
filename
=
file_name
(
full_pathW
);
mf
.
kind
=
type
;
mf
.
is_pdb
=
is_pdb
;
*
is_unmatched
=
FALSE
;
/* first check full path to file */
...
...
dlls/dbghelp/pe_module.c
View file @
416d29e2
...
...
@@ -550,7 +550,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
TRACE
(
"Processing DBG file %s
\n
"
,
debugstr_a
(
dbg_name
));
if
(
path_find_symbol_file
(
pcs
,
module
,
dbg_name
,
DMT_DBG
,
NULL
,
timestamp
,
0
,
tmp
,
&
module
->
module
.
DbgUnmatched
)
&&
if
(
path_find_symbol_file
(
pcs
,
module
,
dbg_name
,
FALSE
,
NULL
,
timestamp
,
0
,
tmp
,
&
module
->
module
.
DbgUnmatched
)
&&
(
hFile
=
CreateFileW
(
tmp
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
))
!=
INVALID_HANDLE_VALUE
&&
((
hMap
=
CreateFileMappingW
(
hFile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
))
!=
0
)
&&
...
...
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