Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
26f89d84
Commit
26f89d84
authored
Jan 31, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Consistenly use _size to name the size of a sub-block.
We were using either _size or _len depending on which one. Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
27f3676c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
47 deletions
+47
-47
msc.c
dlls/dbghelp/msc.c
+9
-9
mscvpdb.h
include/wine/mscvpdb.h
+6
-6
pdb.c
tools/winedump/pdb.c
+32
-32
No files found.
dlls/dbghelp/msc.c
View file @
26f89d84
...
...
@@ -782,8 +782,8 @@ static BOOL codeview_type_extract_name(const union codeview_type* cvtype,
static
unsigned
pdb_read_hash_value
(
const
struct
codeview_type_parse
*
ctp
,
unsigned
idx
)
{
const
void
*
where
=
ctp
->
hash_stream
+
ctp
->
header
.
hash_offset
+
(
idx
-
ctp
->
header
.
first_index
)
*
ctp
->
header
.
hash_size
;
switch
(
ctp
->
header
.
hash_size
)
const
void
*
where
=
ctp
->
hash_stream
+
ctp
->
header
.
hash_offset
+
(
idx
-
ctp
->
header
.
first_index
)
*
ctp
->
header
.
hash_
value_
size
;
switch
(
ctp
->
header
.
hash_
value_
size
)
{
case
2
:
return
*
(
unsigned
short
*
)
where
;
case
4
:
return
*
(
unsigned
*
)
where
;
...
...
@@ -2888,16 +2888,16 @@ static BOOL codeview_snarf_sym_hashtable(const struct msc_debug_info* msc_dbg, c
if
(
hashsize
<
sizeof
(
DBI_HASH_HEADER
)
||
hash_hdr
->
signature
!=
0xFFFFFFFF
||
hash_hdr
->
version
!=
0xeffe0000
+
19990810
||
(
hash_hdr
->
size_hash_records
%
sizeof
(
DBI_HASH_RECORD
))
!=
0
||
sizeof
(
DBI_HASH_HEADER
)
+
hash_hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
>
hashsize
||
(
hashsize
-
(
sizeof
(
DBI_HASH_HEADER
)
+
hash_hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
))
%
sizeof
(
unsigned
))
(
hash_hdr
->
hash_records_size
%
sizeof
(
DBI_HASH_RECORD
))
!=
0
||
sizeof
(
DBI_HASH_HEADER
)
+
hash_hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
>
hashsize
||
(
hashsize
-
(
sizeof
(
DBI_HASH_HEADER
)
+
hash_hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
))
%
sizeof
(
unsigned
))
{
FIXME
(
"Incorrect hash structure
\n
"
);
return
FALSE
;
}
hr
=
(
DBI_HASH_RECORD
*
)(
hash_hdr
+
1
);
num_hash_records
=
hash_hdr
->
size_hash_records
/
sizeof
(
DBI_HASH_RECORD
);
num_hash_records
=
hash_hdr
->
hash_records_size
/
sizeof
(
DBI_HASH_RECORD
);
/* Only iterate over the records listed in the hash table.
* We assume that records present in stream, but not listed in hash table, are
...
...
@@ -3387,9 +3387,9 @@ static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg,
ERR
(
"-Unknown type info version %d
\n
"
,
ctp
->
header
.
version
);
return
FALSE
;
}
if
(
ctp
->
header
.
hash_
size
!=
2
&&
ctp
->
header
.
hash
_size
!=
4
)
if
(
ctp
->
header
.
hash_
value_size
!=
2
&&
ctp
->
header
.
hash_value
_size
!=
4
)
{
ERR
(
"-Unsupported hash of size %u
\n
"
,
ctp
->
header
.
hash_size
);
ERR
(
"-Unsupported hash of size %u
\n
"
,
ctp
->
header
.
hash_
value_
size
);
return
FALSE
;
}
ctp
->
hash_stream
=
pdb_read_file
(
pdb_file
,
ctp
->
header
.
hash_file
);
...
...
@@ -3429,7 +3429,7 @@ static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg,
/* parse the remap table
* => move listed type_id at first position of their hash buckets so that we force remap to them
*/
if
(
ctp
->
header
.
type_remap_
len
)
if
(
ctp
->
header
.
type_remap_
size
)
{
const
unsigned
*
remap
=
(
const
unsigned
*
)((
const
BYTE
*
)
ctp
->
hash_stream
+
ctp
->
header
.
type_remap_offset
);
unsigned
i
,
capa
,
count_present
;
...
...
include/wine/mscvpdb.h
View file @
26f89d84
...
...
@@ -2454,14 +2454,14 @@ typedef struct _PDB_TYPES
unsigned
int
type_size
;
unsigned
short
hash_file
;
unsigned
short
pad
;
unsigned
int
hash_size
;
unsigned
int
hash_
value_
size
;
unsigned
int
hash_num_buckets
;
unsigned
int
hash_offset
;
unsigned
int
hash_
len
;
unsigned
int
hash_
size
;
unsigned
int
search_offset
;
unsigned
int
search_
len
;
unsigned
int
search_
size
;
unsigned
int
type_remap_offset
;
unsigned
int
type_remap_
len
;
unsigned
int
type_remap_
size
;
}
PDB_TYPES
,
*
PPDB_TYPES
;
typedef
struct
_PDB_SYMBOL_RANGE
...
...
@@ -2631,11 +2631,11 @@ typedef struct
{
unsigned
signature
;
unsigned
version
;
unsigned
size_hash_records
;
unsigned
hash_records_size
;
unsigned
unknown
;
}
DBI_HASH_HEADER
;
/* This header is followed by:
* - DBI_HASH_RECORDS (on hdr:
size_hash_records
bytes)
* - DBI_HASH_RECORDS (on hdr:
hash_records_size
bytes)
* - a bitmap of DBI_MAX_HASH + 1 entries (on DBI_BITMAP_HASH_SIZE bytes)
* - a table (one entry per present bit in bitmap) as index into hdr:num_records
*/
...
...
tools/winedump/pdb.c
View file @
26f89d84
...
...
@@ -240,25 +240,25 @@ static void dump_dbi_hash_table(const BYTE* root, unsigned size, const char* nam
printf
(
"%s%s symbols hash:
\n
"
,
pfx
,
name
);
printf
(
"%s
\t
Signature: 0x%x
\n
"
,
pfx
,
hdr
->
signature
);
printf
(
"%s
\t
Version: 0x%x (%u)
\n
"
,
pfx
,
hdr
->
version
,
hdr
->
version
-
0xeffe0000
);
printf
(
"%s
\t
Size of hash records: %u
\n
"
,
pfx
,
hdr
->
size_hash_records
);
printf
(
"%s
\t
Size of hash records: %u
\n
"
,
pfx
,
hdr
->
hash_records_size
);
printf
(
"%s
\t
Unknown: %u
\n
"
,
pfx
,
hdr
->
unknown
);
if
(
hdr
->
signature
!=
0xFFFFFFFF
||
hdr
->
version
!=
0xeffe0000
+
19990810
||
(
hdr
->
size_hash_records
%
sizeof
(
DBI_HASH_RECORD
))
!=
0
||
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
>
size
||
(
size
-
(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
))
%
sizeof
(
unsigned
))
(
hdr
->
hash_records_size
%
sizeof
(
DBI_HASH_RECORD
))
!=
0
||
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
>
size
||
(
size
-
(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
))
%
sizeof
(
unsigned
))
{
printf
(
"%s
\t\t
Incorrect hash structure
\n
"
,
pfx
);
}
else
{
unsigned
i
;
unsigned
num_hash_records
=
hdr
->
size_hash_records
/
sizeof
(
DBI_HASH_RECORD
);
unsigned
num_hash_records
=
hdr
->
hash_records_size
/
sizeof
(
DBI_HASH_RECORD
);
const
DBI_HASH_RECORD
*
hr
=
(
const
DBI_HASH_RECORD
*
)(
hdr
+
1
);
unsigned
*
bitmap
=
(
unsigned
*
)((
char
*
)(
hdr
+
1
)
+
hdr
->
size_hash_records
);
unsigned
*
buckets
=
(
unsigned
*
)((
char
*
)(
hdr
+
1
)
+
hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
);
unsigned
index
,
last_index
=
(
size
-
(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
))
/
sizeof
(
unsigned
);
unsigned
*
bitmap
=
(
unsigned
*
)((
char
*
)(
hdr
+
1
)
+
hdr
->
hash_records_size
);
unsigned
*
buckets
=
(
unsigned
*
)((
char
*
)(
hdr
+
1
)
+
hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
);
unsigned
index
,
last_index
=
(
size
-
(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
))
/
sizeof
(
unsigned
);
/* Yes, offsets for accessiong hr[] are stored as multiple of 12; and not
* as multiple of sizeof(*hr) = 8 as one might expect.
...
...
@@ -279,10 +279,10 @@ static void dump_dbi_hash_table(const BYTE* root, unsigned size, const char* nam
printf
(
"%s
\t
[%u] <<empty>>
\n
"
,
pfx
,
i
);
}
/* shouldn't happen */
if
(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
+
index
*
sizeof
(
unsigned
)
>
size
)
if
(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
+
index
*
sizeof
(
unsigned
)
>
size
)
{
printf
(
"%s-- left over %u bytes
\n
"
,
pfx
,
size
-
(
unsigned
)(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
size_hash_records
+
DBI_BITMAP_HASH_SIZE
+
index
*
sizeof
(
unsigned
)));
size
-
(
unsigned
)(
sizeof
(
DBI_HASH_HEADER
)
+
hdr
->
hash_records_size
+
DBI_BITMAP_HASH_SIZE
+
index
*
sizeof
(
unsigned
)));
}
}
}
...
...
@@ -727,10 +727,10 @@ static void pdb_dump_types_hash(struct pdb_reader* reader, const PDB_TYPES* type
printf
(
"Types (%s) hash:
\n
"
,
strmname
);
strmsize
=
pdb_get_file_size
(
reader
,
types
->
hash_file
);
if
(
types
->
hash_offset
+
types
->
hash_
len
>
strmsize
||
(
types
->
last_index
-
types
->
first_index
)
*
types
->
hash_
size
!=
types
->
hash_len
||
types
->
search_offset
+
types
->
search_
len
>
strmsize
||
types
->
type_remap_offset
+
types
->
type_remap_
len
>
strmsize
)
if
(
types
->
hash_offset
+
types
->
hash_
size
>
strmsize
||
(
types
->
last_index
-
types
->
first_index
)
*
types
->
hash_
value_size
!=
types
->
hash_size
||
types
->
search_offset
+
types
->
search_
size
>
strmsize
||
types
->
type_remap_offset
+
types
->
type_remap_
size
>
strmsize
)
{
printf
(
"
\n
Incoherent sizes... skipping
\n
"
);
return
;
...
...
@@ -739,7 +739,7 @@ static void pdb_dump_types_hash(struct pdb_reader* reader, const PDB_TYPES* type
for
(
i
=
types
->
first_index
;
i
<
types
->
last_index
;
i
++
)
{
printf
(
"
\t\t
%08x => "
,
i
);
pdb_dump_hash_value
((
const
BYTE
*
)
hash
+
types
->
hash_offset
+
(
i
-
types
->
first_index
)
*
types
->
hash_
size
,
types
->
hash
_size
);
pdb_dump_hash_value
((
const
BYTE
*
)
hash
+
types
->
hash_offset
+
(
i
-
types
->
first_index
)
*
types
->
hash_
value_size
,
types
->
hash_value
_size
);
printf
(
"
\n
"
);
}
/* print collisions in hash table (if any) */
...
...
@@ -749,7 +749,7 @@ static void pdb_dump_types_hash(struct pdb_reader* reader, const PDB_TYPES* type
unsigned
head_printed
=
0
;
collision_arg
.
hash
=
(
const
BYTE
*
)
hash
+
types
->
hash_offset
;
collision_arg
.
hash_size
=
types
->
hash_size
;
collision_arg
.
hash_size
=
types
->
hash_
value_
size
;
for
(
i
=
0
;
i
<
types
->
last_index
-
types
->
first_index
;
i
++
)
collision
[
i
]
=
i
;
qsort
(
collision
,
types
->
last_index
-
types
->
first_index
,
sizeof
(
unsigned
),
collision_compar
);
...
...
@@ -757,9 +757,9 @@ static void pdb_dump_types_hash(struct pdb_reader* reader, const PDB_TYPES* type
{
unsigned
j
;
for
(
j
=
i
+
1
;
j
<
types
->
last_index
-
types
->
first_index
;
j
++
)
if
(
memcmp
((
const
BYTE
*
)
hash
+
types
->
hash_offset
+
collision
[
i
]
*
types
->
hash_size
,
(
const
BYTE
*
)
hash
+
types
->
hash_offset
+
collision
[
j
]
*
types
->
hash_size
,
types
->
hash_size
))
if
(
memcmp
((
const
BYTE
*
)
hash
+
types
->
hash_offset
+
collision
[
i
]
*
types
->
hash_
value_
size
,
(
const
BYTE
*
)
hash
+
types
->
hash_offset
+
collision
[
j
]
*
types
->
hash_
value_
size
,
types
->
hash_
value_
size
))
break
;
if
(
j
>
i
+
1
)
{
...
...
@@ -770,7 +770,7 @@ static void pdb_dump_types_hash(struct pdb_reader* reader, const PDB_TYPES* type
head_printed
=
1
;
}
printf
(
"
\t\t\t
Hash "
);
pdb_dump_hash_value
((
const
BYTE
*
)
hash
+
types
->
hash_offset
+
collision
[
i
]
*
types
->
hash_
size
,
types
->
hash
_size
);
pdb_dump_hash_value
((
const
BYTE
*
)
hash
+
types
->
hash_offset
+
collision
[
i
]
*
types
->
hash_
value_size
,
types
->
hash_value
_size
);
printf
(
":"
);
for
(
k
=
i
;
k
<
j
;
k
++
)
printf
(
" %x"
,
types
->
first_index
+
collision
[
k
]);
...
...
@@ -782,11 +782,11 @@ static void pdb_dump_types_hash(struct pdb_reader* reader, const PDB_TYPES* type
}
printf
(
"
\n\t
Indexes => offsets:
\n
"
);
table
=
(
const
unsigned
*
)((
const
BYTE
*
)
hash
+
types
->
search_offset
);
for
(
i
=
0
;
i
<
types
->
search_
len
/
(
2
*
sizeof
(
unsigned
));
i
+=
2
)
for
(
i
=
0
;
i
<
types
->
search_
size
/
(
2
*
sizeof
(
unsigned
));
i
+=
2
)
{
printf
(
"
\t\t
%08x => %08x
\n
"
,
table
[
2
*
i
+
0
],
table
[
2
*
i
+
1
]);
}
if
(
types
->
type_remap_
len
&&
(
strbase
=
read_string_table
(
reader
)))
if
(
types
->
type_remap_
size
&&
(
strbase
=
read_string_table
(
reader
)))
{
unsigned
num
,
capa
,
count_present
,
count_deleted
;
const
unsigned
*
present_bitset
;
...
...
@@ -823,8 +823,8 @@ static void pdb_dump_types_hash(struct pdb_reader* reader, const PDB_TYPES* type
if
(
is_bit_set
(
present_bitset
,
count_present
,
i
))
{
printf
(
" %s => "
,
pdb_get_string_table_entry
(
strbase
,
*
table
++
));
pdb_dump_hash_value
((
const
BYTE
*
)
table
,
types
->
hash_size
);
table
=
(
const
unsigned
*
)((
const
BYTE
*
)
table
+
types
->
hash_size
);
pdb_dump_hash_value
((
const
BYTE
*
)
table
,
types
->
hash_
value_
size
);
table
=
(
const
unsigned
*
)((
const
BYTE
*
)
table
+
types
->
hash_
value_
size
);
}
printf
(
"
\n
"
);
}
...
...
@@ -875,14 +875,14 @@ static void pdb_dump_types(struct pdb_reader* reader, unsigned strmidx, const ch
"
\t
type_size: %x
\n
"
"
\t
hash_file: %x
\n
"
"
\t
pad: %x
\n
"
"
\t
hash_
size:
%x
\n
"
"
\t
hash_
value_size:
%x
\n
"
"
\t
hash_buckets %x
\n
"
"
\t
hash_offset: %x
\n
"
"
\t
hash_
len:
%x
\n
"
"
\t
hash_
size:
%x
\n
"
"
\t
search_offset: %x
\n
"
"
\t
search_
len:
%x
\n
"
"
\t
search_
size:
%x
\n
"
"
\t
type_remap_offset: %x
\n
"
"
\t
type_remap_
len:
%x
\n
"
,
"
\t
type_remap_
size:
%x
\n
"
,
strmname
,
types
->
version
,
types
->
type_offset
,
...
...
@@ -891,14 +891,14 @@ static void pdb_dump_types(struct pdb_reader* reader, unsigned strmidx, const ch
types
->
type_size
,
types
->
hash_file
,
types
->
pad
,
types
->
hash_size
,
types
->
hash_
value_
size
,
types
->
hash_num_buckets
,
types
->
hash_offset
,
types
->
hash_
len
,
types
->
hash_
size
,
types
->
search_offset
,
types
->
search_
len
,
types
->
search_
size
,
types
->
type_remap_offset
,
types
->
type_remap_
len
);
types
->
type_remap_
size
);
codeview_dump_types_from_block
((
const
char
*
)
types
+
types
->
type_offset
,
types
->
type_size
);
pdb_dump_types_hash
(
reader
,
types
,
strmname
);
free
(
types
);
...
...
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