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
cda616d8
Commit
cda616d8
authored
Feb 01, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Properly dump segment map information from PDB/DBI stream.
Changing field names to match better their content. Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
cf71edaa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
11 deletions
+42
-11
msc.c
dlls/dbghelp/msc.c
+3
-3
mscvpdb.h
include/wine/mscvpdb.h
+2
-2
pdb.c
tools/winedump/pdb.c
+37
-6
No files found.
dlls/dbghelp/msc.c
View file @
cda616d8
...
...
@@ -3271,7 +3271,7 @@ static void pdb_convert_symbols_header(PDB_SYMBOLS* symbols,
symbols
->
version
=
0
;
symbols
->
module_size
=
old
->
module_size
;
symbols
->
sectcontrib_size
=
old
->
sectcontrib_size
;
symbols
->
hash_size
=
old
->
hash
_size
;
symbols
->
segmap_size
=
old
->
segmap
_size
;
symbols
->
srcmodule_size
=
old
->
srcmodule_size
;
symbols
->
pdbimport_size
=
0
;
symbols
->
global_hash_stream
=
old
->
global_hash_stream
;
...
...
@@ -3635,7 +3635,7 @@ static void pdb_process_symbol_imports(const struct process* pcs,
imp
=
(
const
PDB_SYMBOL_IMPORT
*
)((
const
char
*
)
symbols_image
+
sizeof
(
PDB_SYMBOLS
)
+
symbols
->
module_size
+
symbols
->
sectcontrib_size
+
symbols
->
hash
_size
+
symbols
->
srcmodule_size
);
symbols
->
segmap
_size
+
symbols
->
srcmodule_size
);
first
=
imp
;
last
=
(
const
char
*
)
imp
+
symbols
->
pdbimport_size
;
while
(
imp
<
(
const
PDB_SYMBOL_IMPORT
*
)
last
)
...
...
@@ -3746,7 +3746,7 @@ static BOOL pdb_process_internal(const struct process* pcs,
case
sizeof
(
PDB_STREAM_INDEXES
):
psi
=
(
PDB_STREAM_INDEXES
*
)((
const
char
*
)
symbols_image
+
sizeof
(
PDB_SYMBOLS
)
+
symbols
.
module_size
+
symbols
.
sectcontrib_size
+
symbols
.
hash
_size
+
symbols
.
srcmodule_size
+
symbols
.
segmap
_size
+
symbols
.
srcmodule_size
+
symbols
.
pdbimport_size
+
symbols
.
unknown2_size
);
pdb_file
->
fpoext_stream
=
psi
->
FPO_EXT
;
break
;
...
...
include/wine/mscvpdb.h
View file @
cda616d8
...
...
@@ -2540,7 +2540,7 @@ typedef struct _PDB_SYMBOLS_OLD
unsigned
short
pad
;
unsigned
int
module_size
;
unsigned
int
sectcontrib_size
;
unsigned
int
hash
_size
;
unsigned
int
segmap
_size
;
unsigned
int
srcmodule_size
;
}
PDB_SYMBOLS_OLD
,
*
PPDB_SYMBOLS_OLD
;
...
...
@@ -2557,7 +2557,7 @@ typedef struct _PDB_SYMBOLS
unsigned
short
rbldVer
;
unsigned
int
module_size
;
unsigned
int
sectcontrib_size
;
unsigned
int
hash
_size
;
unsigned
int
segmap
_size
;
unsigned
int
srcmodule_size
;
unsigned
int
pdbimport_size
;
unsigned
int
resvd0
;
...
...
tools/winedump/pdb.c
View file @
cda616d8
...
...
@@ -371,7 +371,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
"
\t
rbldVer: %u
\n
"
"
\t
module_size: %08x
\n
"
"
\t
sectcontrib_size: %08x
\n
"
"
\t
hash_size:
%08x
\n
"
"
\t
segmap_size:
%08x
\n
"
"
\t
src_module_size: %08x
\n
"
"
\t
pdbimport_size: %08x
\n
"
"
\t
resvd0: %08x
\n
"
...
...
@@ -391,7 +391,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
symbols
->
rbldVer
,
symbols
->
module_size
,
symbols
->
sectcontrib_size
,
symbols
->
hash
_size
,
symbols
->
segmap
_size
,
symbols
->
srcmodule_size
,
symbols
->
pdbimport_size
,
symbols
->
resvd0
,
...
...
@@ -474,7 +474,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
printf
(
"
\t
----------src module------------
\n
"
);
src
=
(
const
PDB_SYMBOL_SOURCE
*
)((
const
char
*
)
symbols
+
sizeof
(
PDB_SYMBOLS
)
+
symbols
->
module_size
+
symbols
->
sectcontrib_size
+
symbols
->
hash
_size
);
symbols
->
module_size
+
symbols
->
sectcontrib_size
+
symbols
->
segmap
_size
);
printf
(
"
\t
Source Modules
\n
"
"
\t\t
nModules: %u
\n
"
"
\t\t
nSrcFiles: %u
\n
"
,
...
...
@@ -521,7 +521,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
printf
(
"
\t
------------import--------------
\n
"
);
imp
=
(
const
PDB_SYMBOL_IMPORT
*
)((
const
char
*
)
symbols
+
sizeof
(
PDB_SYMBOLS
)
+
symbols
->
module_size
+
symbols
->
sectcontrib_size
+
symbols
->
hash
_size
+
symbols
->
srcmodule_size
);
symbols
->
segmap
_size
+
symbols
->
srcmodule_size
);
first
=
(
const
char
*
)
imp
;
last
=
(
const
char
*
)
imp
+
symbols
->
pdbimport_size
;
while
(
imp
<
(
const
PDB_SYMBOL_IMPORT
*
)
last
)
...
...
@@ -544,6 +544,37 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
imp
=
(
const
PDB_SYMBOL_IMPORT
*
)(
first
+
((
ptr
-
first
+
strlen
(
ptr
)
+
1
+
3
)
&
~
3
));
}
}
if
(
symbols
->
segmap_size
)
{
const
struct
OMFSegMap
*
segmap
=
(
const
struct
OMFSegMap
*
)((
const
BYTE
*
)
symbols
+
sizeof
(
PDB_SYMBOLS
)
+
symbols
->
module_size
+
symbols
->
sectcontrib_size
);
const
struct
OMFSegMapDesc
*
desc
=
(
const
struct
OMFSegMapDesc
*
)(
segmap
+
1
);
printf
(
"
\t
--------------segment map----------------
\n
"
);
printf
(
"
\t
Number of segments: %x
\n
"
,
segmap
->
cSeg
);
printf
(
"
\t
Number of logical segments: %x
\n
"
,
segmap
->
cSegLog
);
/* FIXME check mapping old symbols */
for
(;
(
const
BYTE
*
)(
desc
+
1
)
<=
((
const
BYTE
*
)(
segmap
+
1
)
+
symbols
->
segmap_size
);
desc
++
)
{
printf
(
"
\t\t
Segment descriptor #%tu
\n
"
,
desc
-
(
const
struct
OMFSegMapDesc
*
)(
segmap
+
1
));
printf
(
"
\t\t\t
Flags: %04x (%c%c%c%s%s%s%s)
\n
"
,
desc
->
flags
,
(
desc
->
flags
&
0x01
)
?
'R'
:
'-'
,
(
desc
->
flags
&
0x02
)
?
'W'
:
'-'
,
(
desc
->
flags
&
0x04
)
?
'X'
:
'-'
,
(
desc
->
flags
&
0x08
)
?
" 32bit-linear"
:
""
,
(
desc
->
flags
&
0x100
)
?
" selector"
:
""
,
(
desc
->
flags
&
0x200
)
?
" absolute"
:
""
,
(
desc
->
flags
&
0x400
)
?
" group"
:
""
);
printf
(
"
\t\t\t
Overlay: %04x
\n
"
,
desc
->
ovl
);
printf
(
"
\t\t\t
Group: %04x
\n
"
,
desc
->
group
);
printf
(
"
\t\t\t
Frame: %04x
\n
"
,
desc
->
frame
);
printf
(
"
\t\t\t
Segment name: %s
\n
"
,
desc
->
iSegName
==
0xffff
?
"none"
:
pdb_get_string_table_entry
(
filesimage
,
desc
->
iSegName
));
printf
(
"
\t\t\t
Class name: %s
\n
"
,
desc
->
iClassName
==
0xffff
?
"none"
:
pdb_get_string_table_entry
(
filesimage
,
desc
->
iClassName
));
printf
(
"
\t\t\t
Offset: %08x
\n
"
,
desc
->
offset
);
printf
(
"
\t\t\t
Size: %04x
\n
"
,
desc
->
cbSeg
);
}
}
if
(
symbols
->
stream_index_size
)
{
printf
(
"
\t
------------stream indexes--------------
\n
"
);
...
...
@@ -555,7 +586,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
*/
memcpy
(
sidx
,
(
const
char
*
)
symbols
+
sizeof
(
PDB_SYMBOLS
)
+
symbols
->
module_size
+
symbols
->
sectcontrib_size
+
symbols
->
hash
_size
+
symbols
->
srcmodule_size
+
symbols
->
sectcontrib_size
+
symbols
->
segmap
_size
+
symbols
->
srcmodule_size
+
symbols
->
pdbimport_size
+
symbols
->
unknown2_size
,
sizeof
(
PDB_STREAM_INDEXES_OLD
));
printf
(
"
\t
FPO: %04x
\n
"
...
...
@@ -570,7 +601,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
case
sizeof
(
PDB_STREAM_INDEXES
):
memcpy
(
sidx
,
(
const
char
*
)
symbols
+
sizeof
(
PDB_SYMBOLS
)
+
symbols
->
module_size
+
symbols
->
sectcontrib_size
+
symbols
->
hash
_size
+
symbols
->
srcmodule_size
+
symbols
->
sectcontrib_size
+
symbols
->
segmap
_size
+
symbols
->
srcmodule_size
+
symbols
->
pdbimport_size
+
symbols
->
unknown2_size
,
sizeof
(
*
sidx
));
printf
(
"
\t
FPO: %04x
\n
"
...
...
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