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
a1a87936
Commit
a1a87936
authored
Dec 05, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Added a field to the hash table to store the number of elements in the hash table.
Make use of it to get rid to module_compute_num_syms.
parent
4806320b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
20 deletions
+10
-20
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-1
module.c
dlls/dbghelp/module.c
+2
-14
storage.c
dlls/dbghelp/storage.c
+5
-4
symbol.c
dlls/dbghelp/symbol.c
+2
-1
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
a1a87936
...
...
@@ -82,6 +82,7 @@ struct hash_table_elt
struct
hash_table
{
unsigned
num_elts
;
unsigned
num_buckets
;
struct
hash_table_elt
**
buckets
;
};
...
...
@@ -422,7 +423,6 @@ extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_th
extern
DWORD
WINAPI
addr_to_linear
(
HANDLE
hProcess
,
HANDLE
hThread
,
ADDRESS
*
addr
);
/* module.c */
extern
int
module_compute_num_syms
(
struct
module
*
module
);
extern
struct
module
*
module_find_by_addr
(
const
struct
process
*
pcs
,
unsigned
long
addr
,
enum
module_type
type
);
...
...
dlls/dbghelp/module.c
View file @
a1a87936
...
...
@@ -284,7 +284,7 @@ BOOL module_get_debug(struct module_pair* pair)
}
if
(
!
ret
)
pair
->
effective
->
module
.
SymType
=
SymNone
;
assert
(
pair
->
effective
->
module
.
SymType
!=
SymDeferred
);
module_compute_num_syms
(
pair
->
effective
)
;
pair
->
effective
->
module
.
NumSyms
=
pair
->
effective
->
ht_symbols
.
num_elts
;
}
return
pair
->
effective
->
module
.
SymType
!=
SymNone
;
}
...
...
@@ -372,18 +372,6 @@ enum module_type module_get_type_by_name(const char* name)
return
DMT_PE
;
}
int
module_compute_num_syms
(
struct
module
*
module
)
{
struct
hash_table_iter
hti
;
void
*
ptr
;
module
->
module
.
NumSyms
=
0
;
hash_table_iter_init
(
&
module
->
ht_symbols
,
&
hti
,
NULL
);
while
((
ptr
=
hash_table_iter_up
(
&
hti
)))
module
->
module
.
NumSyms
++
;
return
module
->
module
.
NumSyms
;
}
/***********************************************************************
* SymLoadModule (DBGHELP.@)
*/
...
...
@@ -429,7 +417,7 @@ DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, const char* ImageName,
WARN
(
"Couldn't locate %s
\n
"
,
ImageName
);
return
0
;
}
module
_compute_num_syms
(
module
)
;
module
->
module
.
NumSyms
=
module
->
ht_symbols
.
num_elts
;
done:
/* by default pe_load_module fills module.ModuleName from a derivation
* of ImageName. Overwrite it, if we have better information
...
...
dlls/dbghelp/storage.c
View file @
a1a87936
...
...
@@ -327,6 +327,7 @@ unsigned hash_table_hash(const char* name, unsigned num_buckets)
void
hash_table_init
(
struct
pool
*
pool
,
struct
hash_table
*
ht
,
unsigned
num_buckets
)
{
ht
->
num_elts
=
0
;
ht
->
buckets
=
pool_alloc
(
pool
,
num_buckets
*
sizeof
(
struct
hash_table_elt
*
));
assert
(
ht
->
buckets
);
ht
->
num_buckets
=
num_buckets
;
...
...
@@ -338,7 +339,7 @@ void hash_table_destroy(struct hash_table* ht)
#if defined(USE_STATS)
int
i
;
unsigned
len
;
unsigned
num
=
0
,
min
=
0xffffffff
,
max
=
0
,
sq
=
0
;
unsigned
min
=
0xffffffff
,
max
=
0
,
sq
=
0
;
struct
hash_table_elt
*
elt
;
double
mean
,
variance
;
...
...
@@ -347,13 +348,12 @@ void hash_table_destroy(struct hash_table* ht)
for
(
len
=
0
,
elt
=
ht
->
buckets
[
i
];
elt
;
elt
=
elt
->
next
)
len
++
;
if
(
len
<
min
)
min
=
len
;
if
(
len
>
max
)
max
=
len
;
num
+=
len
;
sq
+=
len
*
len
;
}
mean
=
(
double
)
num
/
ht
->
num_buckets
;
mean
=
(
double
)
ht
->
num_elts
/
ht
->
num_buckets
;
variance
=
(
double
)
sq
/
ht
->
num_buckets
-
mean
*
mean
;
FIXME
(
"STATS: elts[num:%-4u size:%u mean:%f] buckets[min:%-4u variance:%+f max:%-4u]
\n
"
,
num
,
ht
->
num_buckets
,
mean
,
min
,
variance
,
max
);
ht
->
num_elts
,
ht
->
num_buckets
,
mean
,
min
,
variance
,
max
);
#if 1
for
(
i
=
0
;
i
<
ht
->
num_buckets
;
i
++
)
{
...
...
@@ -382,6 +382,7 @@ void hash_table_add(struct hash_table* ht, struct hash_table_elt* elt)
for
(
p
=
&
ht
->
buckets
[
hash
];
*
p
;
p
=
&
((
*
p
)
->
next
));
*
p
=
elt
;
elt
->
next
=
NULL
;
ht
->
num_elts
++
;
}
void
*
hash_table_find
(
const
struct
hash_table
*
ht
,
const
char
*
name
)
...
...
dlls/dbghelp/symbol.c
View file @
a1a87936
...
...
@@ -623,7 +623,8 @@ static BOOL resort_symbols(struct module* module)
struct
symt_ht
*
sym
;
struct
hash_table_iter
hti
;
if
(
!
module_compute_num_syms
(
module
))
return
FALSE
;
if
(
!
(
module
->
module
.
NumSyms
=
module
->
ht_symbols
.
num_elts
))
return
FALSE
;
if
(
module
->
addr_sorttab
)
module
->
addr_sorttab
=
HeapReAlloc
(
GetProcessHeap
(),
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