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
767fc14e
Commit
767fc14e
authored
Jan 31, 2024
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Implement SymSrvGetFileIndexInfo() for .dbg files.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
34128f1a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
3 deletions
+37
-3
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-0
msc.c
dlls/dbghelp/msc.c
+33
-0
path.c
dlls/dbghelp/path.c
+2
-0
path.c
dlls/dbghelp/tests/path.c
+1
-3
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
767fc14e
...
...
@@ -767,6 +767,7 @@ struct pdb_cmd_pair {
extern
BOOL
pdb_virtual_unwind
(
struct
cpu_stack_walk
*
csw
,
DWORD_PTR
ip
,
union
ctx
*
context
,
struct
pdb_cmd_pair
*
cpair
);
extern
DWORD
pdb_get_file_indexinfo
(
void
*
image
,
DWORD
size
,
SYMSRV_INDEX_INFOW
*
info
);
extern
DWORD
dbg_get_file_indexinfo
(
void
*
image
,
DWORD
size
,
SYMSRV_INDEX_INFOW
*
info
);
/* path.c */
extern
BOOL
path_find_symbol_file
(
const
struct
process
*
pcs
,
const
struct
module
*
module
,
...
...
dlls/dbghelp/msc.c
View file @
767fc14e
...
...
@@ -4573,3 +4573,36 @@ DWORD msc_get_file_indexinfo(void* image, const IMAGE_DEBUG_DIRECTORY* debug_dir
}
return
info
->
stripped
&&
!
num_misc_records
?
ERROR_BAD_EXE_FORMAT
:
ERROR_SUCCESS
;
}
DWORD
dbg_get_file_indexinfo
(
void
*
image
,
DWORD
size
,
SYMSRV_INDEX_INFOW
*
info
)
{
const
IMAGE_SEPARATE_DEBUG_HEADER
*
header
;
DWORD
num_directories
;
if
(
size
<
sizeof
(
*
header
))
return
ERROR_BAD_EXE_FORMAT
;
header
=
image
;
if
(
header
->
Signature
!=
0x4944
/* DI */
||
size
<
sizeof
(
*
header
)
+
header
->
NumberOfSections
*
sizeof
(
IMAGE_SECTION_HEADER
)
+
header
->
ExportedNamesSize
+
header
->
DebugDirectorySize
)
return
ERROR_BAD_EXE_FORMAT
;
/* header is followed by:
* - header->NumberOfSections of IMAGE_SECTION_HEADER
* - header->ExportedNameSize
* - then num_directories of IMAGE_DEBUG_DIRECTORY
*/
num_directories
=
header
->
DebugDirectorySize
/
sizeof
(
IMAGE_DEBUG_DIRECTORY
);
if
(
!
num_directories
)
return
ERROR_BAD_EXE_FORMAT
;
info
->
age
=
0
;
memset
(
&
info
->
guid
,
0
,
sizeof
(
info
->
guid
));
info
->
sig
=
0
;
info
->
dbgfile
[
0
]
=
L'\0'
;
info
->
pdbfile
[
0
]
=
L'\0'
;
info
->
size
=
header
->
SizeOfImage
;
/* seems to use header's timestamp, not debug_directory one */
info
->
timestamp
=
header
->
TimeDateStamp
;
info
->
stripped
=
FALSE
;
/* FIXME */
return
ERROR_SUCCESS
;
}
dlls/dbghelp/path.c
View file @
767fc14e
...
...
@@ -860,6 +860,8 @@ BOOL WINAPI SymSrvGetFileIndexInfoW(const WCHAR *file, SYMSRV_INDEX_INFOW* info,
ret
=
pe_get_file_indexinfo
(
image
,
fsize
,
info
);
if
(
ret
==
ERROR_BAD_FORMAT
)
ret
=
pdb_get_file_indexinfo
(
image
,
fsize
,
info
);
if
(
ret
==
ERROR_BAD_FORMAT
)
ret
=
dbg_get_file_indexinfo
(
image
,
fsize
,
info
);
}
else
ret
=
ERROR_FILE_NOT_FOUND
;
...
...
dlls/dbghelp/tests/path.c
View file @
767fc14e
...
...
@@ -907,10 +907,8 @@ static void test_srvgetindexes_dbg(void)
memset
(
&
ssii
,
0x45
,
sizeof
(
ssii
));
ssii
.
sizeofstruct
=
sizeof
(
ssii
);
ret
=
SymSrvGetFileIndexInfoW
(
filename
,
&
ssii
,
0
);
todo_wine
ok
(
ret
,
"SymSrvGetFileIndexInfo failed: %lu
\n
"
,
GetLastError
());
if
(
ret
){
ok
(
ssii
.
age
==
0
,
"Mismatch in age: %lx
\n
"
,
ssii
.
age
);
ok
(
!
memcmp
(
&
ssii
.
guid
,
&
null_guid
,
sizeof
(
GUID
)),
"Mismatch in guid: guid=%s
\n
"
,
wine_dbgstr_guid
(
&
ssii
.
guid
));
...
...
@@ -922,7 +920,7 @@ static void test_srvgetindexes_dbg(void)
ok
(
!
wcscmp
(
ssii
.
file
,
filename
),
"Mismatch in file: %ls
\n
"
,
ssii
.
file
);
ok
(
!
ssii
.
pdbfile
[
0
],
"Mismatch in pdbfile: %ls
\n
"
,
ssii
.
pdbfile
);
ok
(
!
ssii
.
dbgfile
[
0
],
"Mismatch in dbgfile: %ls
\n
"
,
ssii
.
dbgfile
);
}
DeleteFileW
(
filename
);
winetest_pop_context
();
}
...
...
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