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
4806320b
Commit
4806320b
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: In find_nearest, now return the symbol instead of its index in module->sorttable.
parent
08712bc3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
36 deletions
+30
-36
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+2
-1
dwarf.c
dlls/dbghelp/dwarf.c
+4
-4
elf_module.c
dlls/dbghelp/elf_module.c
+10
-11
symbol.c
dlls/dbghelp/symbol.c
+14
-20
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
4806320b
...
...
@@ -485,7 +485,8 @@ extern BOOL dwarf2_parse(struct module* module, unsigned long load_offse
/* symbol.c */
extern
const
char
*
symt_get_name
(
const
struct
symt
*
sym
);
extern
int
symt_cmp_addr
(
const
void
*
p1
,
const
void
*
p2
);
extern
int
symt_find_nearest
(
struct
module
*
module
,
DWORD
addr
);
extern
struct
symt_ht
*
symt_find_nearest
(
struct
module
*
module
,
DWORD
addr
);
extern
struct
symt_compiland
*
symt_new_compiland
(
struct
module
*
module
,
unsigned
long
address
,
unsigned
src_idx
);
...
...
dlls/dbghelp/dwarf.c
View file @
4806320b
...
...
@@ -1700,15 +1700,15 @@ static void dwarf2_set_line_number(struct module* module, unsigned long address,
struct
vector
*
v
,
unsigned
file
,
unsigned
line
)
{
struct
symt_function
*
func
;
int
idx
;
struct
symt_ht
*
symt
;
unsigned
*
psrc
;
if
(
!
file
||
!
(
psrc
=
vector_at
(
v
,
file
-
1
)))
return
;
TRACE
(
"%s %lx %s %u
\n
"
,
module
->
module
.
ModuleName
,
address
,
source_get
(
module
,
*
psrc
),
line
);
if
(
(
idx
=
symt_find_nearest
(
module
,
address
))
==
-
1
||
module
->
addr_sorttab
[
idx
]
->
symt
.
tag
!=
SymTagFunction
)
return
;
func
=
(
struct
symt_function
*
)
module
->
addr_sorttab
[
idx
]
;
if
(
!
(
symt
=
symt_find_nearest
(
module
,
address
))
||
symt
->
symt
.
tag
!=
SymTagFunction
)
return
;
func
=
(
struct
symt_function
*
)
symt
;
symt_add_func_line
(
module
,
func
,
*
psrc
,
line
,
address
-
func
->
address
);
}
...
...
dlls/dbghelp/elf_module.c
View file @
4806320b
...
...
@@ -543,7 +543,7 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt
struct
hash_table_iter
hti
;
struct
symtab_elt
*
ste
;
DWORD
addr
;
int
idx
;
struct
symt_ht
*
symt
;
hash_table_iter_init
(
ht_symtab
,
&
hti
,
NULL
);
while
((
ste
=
hash_table_iter_up
(
&
hti
)))
...
...
@@ -562,11 +562,10 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt
{
ULONG64
ref_addr
;
idx
=
symt_find_nearest
(
module
,
addr
);
if
(
idx
!=
-
1
)
symt_get_info
(
&
module
->
addr_sorttab
[
idx
]
->
symt
,
TI_GET_ADDRESS
,
&
ref_addr
);
if
(
idx
==
-
1
||
addr
!=
ref_addr
)
symt
=
symt_find_nearest
(
module
,
addr
);
if
(
symt
)
symt_get_info
(
&
symt
->
symt
,
TI_GET_ADDRESS
,
&
ref_addr
);
if
(
!
symt
||
addr
!=
ref_addr
)
{
/* creating public symbols for all the ELF symbols which haven't been
* used yet (ie we have no debug information on them)
...
...
@@ -596,14 +595,14 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt
*/
module
->
sortlist_valid
=
TRUE
;
}
else
if
(
strcmp
(
ste
->
ht_elt
.
name
,
module
->
addr_sorttab
[
idx
]
->
hash_elt
.
name
))
else
if
(
strcmp
(
ste
->
ht_elt
.
name
,
symt
->
hash_elt
.
name
))
{
ULONG64
xaddr
=
0
,
xsize
=
0
;
DWORD
kind
=
-
1
;
symt_get_info
(
&
module
->
addr_sorttab
[
idx
]
->
symt
,
TI_GET_ADDRESS
,
&
xaddr
);
symt_get_info
(
&
module
->
addr_sorttab
[
idx
]
->
symt
,
TI_GET_LENGTH
,
&
xsize
);
symt_get_info
(
&
module
->
addr_sorttab
[
idx
]
->
symt
,
TI_GET_DATAKIND
,
&
kind
);
symt_get_info
(
&
symt
->
symt
,
TI_GET_ADDRESS
,
&
xaddr
);
symt_get_info
(
&
symt
->
symt
,
TI_GET_LENGTH
,
&
xsize
);
symt_get_info
(
&
symt
->
symt
,
TI_GET_DATAKIND
,
&
kind
);
/* If none of symbols has a correct size, we consider they are both markers
* Hence, we can silence this warning
...
...
@@ -615,7 +614,7 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt
FIXME
(
"Duplicate in %s: %s<%08x-%08x> %s<%s-%s>
\n
"
,
module
->
module
.
ModuleName
,
ste
->
ht_elt
.
name
,
addr
,
ste
->
symp
->
st_size
,
module
->
addr_sorttab
[
idx
]
->
hash_elt
.
name
,
symt
->
hash_elt
.
name
,
wine_dbgstr_longlong
(
xaddr
),
wine_dbgstr_longlong
(
xsize
));
}
}
...
...
dlls/dbghelp/symbol.c
View file @
4806320b
...
...
@@ -154,7 +154,7 @@ struct symt_public* symt_new_public(struct module* module,
TRACE_
(
dbghelp_symt
)(
"Adding public symbol %s:%s @%lx
\n
"
,
module
->
module
.
ModuleName
,
name
,
address
);
if
((
dbghelp_options
&
SYMOPT_AUTO_PUBLICS
)
&&
symt_find_nearest
(
module
,
address
)
!=
-
1
)
symt_find_nearest
(
module
,
address
)
!=
NULL
)
return
NULL
;
if
((
sym
=
pool_alloc
(
&
module
->
pool
,
sizeof
(
*
sym
))))
{
...
...
@@ -648,14 +648,14 @@ static BOOL resort_symbols(struct module* module)
}
/* assume addr is in module */
int
symt_find_nearest
(
struct
module
*
module
,
DWORD
addr
)
struct
symt_ht
*
symt_find_nearest
(
struct
module
*
module
,
DWORD
addr
)
{
int
mid
,
high
,
low
;
ULONG64
ref_addr
,
ref_size
;
if
(
!
module
->
sortlist_valid
||
!
module
->
addr_sorttab
)
{
if
(
!
resort_symbols
(
module
))
return
-
1
;
if
(
!
resort_symbols
(
module
))
return
NULL
;
}
/*
...
...
@@ -665,13 +665,13 @@ int symt_find_nearest(struct module* module, DWORD addr)
high
=
module
->
module
.
NumSyms
;
symt_get_info
(
&
module
->
addr_sorttab
[
0
]
->
symt
,
TI_GET_ADDRESS
,
&
ref_addr
);
if
(
addr
<
ref_addr
)
return
-
1
;
if
(
addr
<
ref_addr
)
return
NULL
;
if
(
high
)
{
symt_get_info
(
&
module
->
addr_sorttab
[
high
-
1
]
->
symt
,
TI_GET_ADDRESS
,
&
ref_addr
);
if
(
!
symt_get_info
(
&
module
->
addr_sorttab
[
high
-
1
]
->
symt
,
TI_GET_LENGTH
,
&
ref_size
)
||
!
ref_size
)
ref_size
=
0x1000
;
/* arbitrary value */
if
(
addr
>=
ref_addr
+
ref_size
)
return
-
1
;
if
(
addr
>=
ref_addr
+
ref_size
)
return
NULL
;
}
while
(
high
>
low
+
1
)
...
...
@@ -703,12 +703,12 @@ int symt_find_nearest(struct module* module, DWORD addr)
}
/* finally check that we fit into the found symbol */
symt_get_info
(
&
module
->
addr_sorttab
[
low
]
->
symt
,
TI_GET_ADDRESS
,
&
ref_addr
);
if
(
addr
<
ref_addr
)
return
-
1
;
if
(
addr
<
ref_addr
)
return
NULL
;
if
(
!
symt_get_info
(
&
module
->
addr_sorttab
[
high
-
1
]
->
symt
,
TI_GET_LENGTH
,
&
ref_size
)
||
!
ref_size
)
ref_size
=
0x1000
;
/* arbitrary value */
if
(
addr
>=
ref_addr
+
ref_size
)
return
-
1
;
if
(
addr
>=
ref_addr
+
ref_size
)
return
NULL
;
return
low
;
return
module
->
addr_sorttab
[
low
]
;
}
static
BOOL
symt_enum_locals_helper
(
struct
module_pair
*
pair
,
...
...
@@ -758,7 +758,6 @@ static BOOL symt_enum_locals(struct process* pcs, const char* mask,
struct
module_pair
pair
;
struct
symt_ht
*
sym
;
DWORD
pc
=
pcs
->
ctx_frame
.
InstructionOffset
;
int
idx
;
se
->
sym_info
->
SizeOfStruct
=
sizeof
(
*
se
->
sym_info
);
se
->
sym_info
->
MaxNameLen
=
sizeof
(
se
->
buffer
)
-
sizeof
(
SYMBOL_INFO
);
...
...
@@ -766,9 +765,8 @@ static BOOL symt_enum_locals(struct process* pcs, const char* mask,
pair
.
pcs
=
pcs
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
pc
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
((
idx
=
symt_find_nearest
(
pair
.
effective
,
pc
))
==
-
1
)
return
FALSE
;
if
((
sym
=
symt_find_nearest
(
pair
.
effective
,
pc
))
==
NULL
)
return
FALSE
;
sym
=
pair
.
effective
->
addr_sorttab
[
idx
];
if
(
sym
->
symt
.
tag
==
SymTagFunction
)
{
BOOL
ret
;
...
...
@@ -998,15 +996,12 @@ BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address,
{
struct
module_pair
pair
;
struct
symt_ht
*
sym
;
int
idx
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
Address
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
((
idx
=
symt_find_nearest
(
pair
.
effective
,
Address
))
==
-
1
)
return
FALSE
;
sym
=
pair
.
effective
->
addr_sorttab
[
idx
];
if
((
sym
=
symt_find_nearest
(
pair
.
effective
,
Address
))
==
NULL
)
return
FALSE
;
symt_fill_sym_info
(
&
pair
,
NULL
,
&
sym
->
symt
,
Symbol
);
*
Displacement
=
Address
-
Symbol
->
Address
;
...
...
@@ -1252,7 +1247,7 @@ BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr,
PDWORD
pdwDisplacement
,
PIMAGEHLP_LINE
Line
)
{
struct
module_pair
pair
;
int
idx
;
struct
symt_ht
*
symt
;
TRACE
(
"%p %08x %p %p
\n
"
,
hProcess
,
dwAddr
,
pdwDisplacement
,
Line
);
...
...
@@ -1262,11 +1257,10 @@ BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr,
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
dwAddr
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
((
idx
=
symt_find_nearest
(
pair
.
effective
,
dwAddr
))
==
-
1
)
return
FALSE
;
if
((
symt
=
symt_find_nearest
(
pair
.
effective
,
dwAddr
))
==
NULL
)
return
FALSE
;
if
(
pair
.
effective
->
addr_sorttab
[
idx
]
->
symt
.
tag
!=
SymTagFunction
)
return
FALSE
;
if
(
!
symt_fill_func_line_info
(
pair
.
effective
,
(
struct
symt_function
*
)
pair
.
effective
->
addr_sorttab
[
idx
],
if
(
symt
->
symt
.
tag
!=
SymTagFunction
)
return
FALSE
;
if
(
!
symt_fill_func_line_info
(
pair
.
effective
,
(
struct
symt_function
*
)
symt
,
dwAddr
,
Line
))
return
FALSE
;
*
pdwDisplacement
=
dwAddr
-
Line
->
Address
;
return
TRUE
;
...
...
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