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
bbc2a9ab
Commit
bbc2a9ab
authored
Jun 23, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Jun 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Implement SymSrvGetFileIndexInfo for PDB files.
Only done for DS format. Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
f4c18604
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
4 deletions
+73
-4
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-0
msc.c
dlls/dbghelp/msc.c
+70
-0
path.c
dlls/dbghelp/path.c
+2
-1
path.c
dlls/dbghelp/tests/path.c
+0
-3
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
bbc2a9ab
...
...
@@ -772,6 +772,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
)
DECLSPEC_HIDDEN
;
extern
DWORD
pdb_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 @
bbc2a9ab
...
...
@@ -3615,6 +3615,76 @@ static BOOL pdb_process_internal(const struct process* pcs,
struct
pdb_module_info
*
pdb_module_info
,
unsigned
module_index
);
DWORD
pdb_get_file_indexinfo
(
void
*
image
,
DWORD
size
,
SYMSRV_INDEX_INFOW
*
info
)
{
/* check the file header, and if ok, load the TOC */
TRACE
(
"PDB: %.40s
\n
"
,
debugstr_an
(
image
,
40
));
if
(
!
memcmp
(
image
,
PDB_JG_IDENT
,
sizeof
(
PDB_JG_IDENT
)))
{
FIXME
(
"Unsupported for PDB files in JG format
\n
"
);
return
ERROR_FILE_CORRUPT
;
}
if
(
!
memcmp
(
image
,
PDB_DS_IDENT
,
sizeof
(
PDB_DS_IDENT
)))
{
const
struct
PDB_DS_HEADER
*
pdb
=
(
const
struct
PDB_DS_HEADER
*
)
image
;
struct
PDB_DS_TOC
*
ds_toc
;
struct
PDB_DS_ROOT
*
root
;
DWORD
ec
=
ERROR_SUCCESS
;
ds_toc
=
pdb_ds_read
(
pdb
,
(
const
UINT
*
)((
const
char
*
)
pdb
+
pdb
->
toc_block
*
pdb
->
block_size
),
pdb
->
toc_size
);
root
=
pdb_read_ds_stream
(
pdb
,
ds_toc
,
1
);
if
(
!
root
)
{
pdb_free
(
ds_toc
);
return
ERROR_FILE_CORRUPT
;
}
switch
(
root
->
Version
)
{
case
20000404
:
break
;
default:
ERR
(
"-Unknown root block version %u
\n
"
,
root
->
Version
);
ec
=
ERROR_FILE_CORRUPT
;
}
/* The age field is present twice (in PDB_ROOT and in PDB_SYMBOLS ),
* It's the one in PDB_SYMBOLS which is reported.
*/
if
(
ec
==
ERROR_SUCCESS
)
{
PDB_SYMBOLS
*
symbols
=
pdb_read_ds_stream
(
pdb
,
ds_toc
,
3
);
if
(
symbols
&&
symbols
->
version
==
19990903
)
{
info
->
age
=
symbols
->
age
;
}
else
{
if
(
symbols
)
ERR
(
"-Unknown symbol info version %u %08x
\n
"
,
symbols
->
version
,
symbols
->
version
);
ec
=
ERROR_FILE_CORRUPT
;
}
pdb_free
(
symbols
);
}
if
(
ec
==
ERROR_SUCCESS
)
{
info
->
dbgfile
[
0
]
=
'\0'
;
info
->
guid
=
root
->
guid
;
info
->
pdbfile
[
0
]
=
'\0'
;
info
->
sig
=
0
;
info
->
size
=
0
;
info
->
stripped
=
FALSE
;
info
->
timestamp
=
0
;
}
pdb_free
(
ds_toc
);
pdb_free
(
root
);
return
ec
;
}
return
ERROR_BAD_FORMAT
;
}
static
void
pdb_process_symbol_imports
(
const
struct
process
*
pcs
,
const
struct
msc_debug_info
*
msc_dbg
,
const
PDB_SYMBOLS
*
symbols
,
...
...
dlls/dbghelp/path.c
View file @
bbc2a9ab
...
...
@@ -906,7 +906,8 @@ BOOL WINAPI SymSrvGetFileIndexInfoW(const WCHAR *file, SYMSRV_INDEX_INFOW* info,
fsize
=
GetFileSize
(
hFile
,
NULL
);
/* try PE module first */
ret
=
pe_get_file_indexinfo
(
image
,
fsize
,
info
);
/* handle (ret == ERROR_BAD_FORMAT) with .dbg and .pdb format */
if
(
ret
==
ERROR_BAD_FORMAT
)
ret
=
pdb_get_file_indexinfo
(
image
,
fsize
,
info
);
}
else
ret
=
ERROR_FILE_NOT_FOUND
;
...
...
dlls/dbghelp/tests/path.c
View file @
bbc2a9ab
...
...
@@ -828,10 +828,8 @@ static void test_srvgetindexes_pdb(void)
memset
(
&
ssii
,
0x45
,
sizeof
(
ssii
));
ssii
.
sizeofstruct
=
sizeof
(
ssii
);
ret
=
SymSrvGetFileIndexInfo
(
filename
,
&
ssii
,
0
);
todo_wine
ok
(
ret
,
"SymSrvGetFileIndexInfo failed: %lu
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
ssii
.
age
==
240
+
i
,
"Mismatch in age: %lx
\n
"
,
ssii
.
age
);
ok
(
!
memcmp
(
&
ssii
.
guid
,
indexes
[
i
].
guid
,
sizeof
(
GUID
)),
"Mismatch in guid: guid=%s
\n
"
,
wine_dbgstr_guid
(
&
ssii
.
guid
));
...
...
@@ -844,7 +842,6 @@ static void test_srvgetindexes_pdb(void)
ok
(
!
strcmp
(
ssii
.
file
,
filename
),
"Mismatch in file: %s
\n
"
,
ssii
.
file
);
ok
(
!
ssii
.
pdbfile
[
0
],
"Mismatch in pdbfile: %s
\n
"
,
ssii
.
pdbfile
);
ok
(
!
ssii
.
dbgfile
[
0
],
"Mismatch in dbgfile: %s
\n
"
,
ssii
.
dbgfile
);
}
DeleteFileA
(
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