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
1bbd5440
Commit
1bbd5440
authored
Mar 24, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use loader_ops for fetch_file_info.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
adecdb1d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
55 deletions
+20
-55
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-2
elf_module.c
dlls/dbghelp/elf_module.c
+2
-8
macho_module.c
dlls/dbghelp/macho_module.c
+5
-14
minidump.c
dlls/dbghelp/minidump.c
+5
-31
module.c
dlls/dbghelp/module.c
+7
-0
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
1bbd5440
...
...
@@ -390,6 +390,7 @@ struct module
struct
loader_ops
{
BOOL
(
*
synchronize_module_list
)(
struct
process
*
process
);
BOOL
(
*
fetch_file_info
)(
struct
process
*
process
,
const
WCHAR
*
name
,
ULONG_PTR
load_addr
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
);
};
struct
process
...
...
@@ -601,7 +602,6 @@ typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
/* elf_module.c */
extern
BOOL
elf_enum_modules
(
struct
process
*
,
enum_modules_cb
,
void
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
elf_fetch_file_info
(
const
WCHAR
*
name
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
DECLSPEC_HIDDEN
;
struct
image_file_map
;
extern
BOOL
elf_load_debug_info
(
struct
module
*
module
)
DECLSPEC_HIDDEN
;
extern
struct
module
*
...
...
@@ -612,7 +612,6 @@ extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_th
/* macho_module.c */
extern
BOOL
macho_enum_modules
(
struct
process
*
,
enum_modules_cb
,
void
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
macho_fetch_file_info
(
HANDLE
process
,
const
WCHAR
*
name
,
unsigned
long
load_addr
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
DECLSPEC_HIDDEN
;
extern
BOOL
macho_load_debug_info
(
struct
process
*
pcs
,
struct
module
*
module
)
DECLSPEC_HIDDEN
;
extern
struct
module
*
macho_load_module
(
struct
process
*
pcs
,
const
WCHAR
*
name
,
unsigned
long
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/elf_module.c
View file @
1bbd5440
...
...
@@ -1068,8 +1068,7 @@ BOOL elf_load_debug_info(struct module* module)
*
* Gathers some more information for an ELF module from a given file
*/
BOOL
elf_fetch_file_info
(
const
WCHAR
*
name
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
static
BOOL
elf_fetch_file_info
(
struct
process
*
process
,
const
WCHAR
*
name
,
ULONG_PTR
load_addr
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
{
struct
image_file_map
fmap
;
...
...
@@ -1707,6 +1706,7 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info)
static
const
struct
loader_ops
elf_loader_ops
=
{
elf_synchronize_module_list
,
elf_fetch_file_info
,
};
/******************************************************************
...
...
@@ -1734,12 +1734,6 @@ BOOL elf_map_handle(HANDLE handle, struct image_file_map* fmap)
return
FALSE
;
}
BOOL
elf_fetch_file_info
(
const
WCHAR
*
name
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
{
return
FALSE
;
}
BOOL
elf_read_wine_loader_dbg_info
(
struct
process
*
pcs
)
{
return
FALSE
;
...
...
dlls/dbghelp/macho_module.c
View file @
1bbd5440
...
...
@@ -1343,20 +1343,16 @@ BOOL macho_load_debug_info(struct process *pcs, struct module* module)
*
* Gathers some more information for a Mach-O module from a given file
*/
BOOL
macho_fetch_file_info
(
HANDLE
process
,
const
WCHAR
*
name
,
unsigned
long
load_addr
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
static
BOOL
macho_fetch_file_info
(
struct
process
*
process
,
const
WCHAR
*
name
,
ULONG_PTR
load_addr
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
{
struct
image_file_map
fmap
;
struct
process
*
pcs
;
BOOL
split_segs
;
TRACE
(
"(%s, %p, %p, %p)
\n
"
,
debugstr_w
(
name
),
base
,
size
,
checksum
);
pcs
=
process_find_by_handle
(
process
);
if
(
!
pcs
)
return
FALSE
;
split_segs
=
image_uses_split_segs
(
process
,
load_addr
);
if
(
!
macho_map_file
(
pcs
,
name
,
split_segs
,
&
fmap
))
return
FALSE
;
split_segs
=
image_uses_split_segs
(
process
->
handle
,
load_addr
);
if
(
!
macho_map_file
(
process
,
name
,
split_segs
,
&
fmap
))
return
FALSE
;
if
(
base
)
*
base
=
fmap
.
u
.
macho
.
segs_start
;
*
size
=
fmap
.
u
.
macho
.
segs_size
;
*
checksum
=
calc_crc32
(
fmap
.
u
.
macho
.
handle
);
...
...
@@ -1911,6 +1907,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in
static
const
struct
loader_ops
macho_loader_ops
=
{
macho_synchronize_module_list
,
macho_fetch_file_info
,
};
/******************************************************************
...
...
@@ -1934,12 +1931,6 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs)
#else
/* HAVE_MACH_O_LOADER_H */
BOOL
macho_fetch_file_info
(
HANDLE
process
,
const
WCHAR
*
name
,
unsigned
long
load_addr
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
{
return
FALSE
;
}
BOOL
macho_read_wine_loader_dbg_info
(
struct
process
*
pcs
)
{
return
FALSE
;
...
...
dlls/dbghelp/minidump.c
View file @
1bbd5440
...
...
@@ -253,9 +253,9 @@ static BOOL WINAPI fetch_pe_module_info_cb(PCWSTR name, DWORD64 base, ULONG size
/******************************************************************
* fetch_elf_module_info_cb
*
* Callback for accumulating in dump_context an
ELF
modules set
* Callback for accumulating in dump_context an
host
modules set
*/
static
BOOL
fetch_
elf
_module_info_cb
(
const
WCHAR
*
name
,
unsigned
long
base
,
static
BOOL
fetch_
host
_module_info_cb
(
const
WCHAR
*
name
,
unsigned
long
base
,
void
*
user
)
{
struct
dump_context
*
dc
=
user
;
...
...
@@ -263,33 +263,7 @@ static BOOL fetch_elf_module_info_cb(const WCHAR* name, unsigned long base,
DWORD
size
,
checksum
;
/* FIXME: there's no relevant timestamp on ELF modules */
/* NB: if we have a non-null base from the live-target use it (whenever
* the ELF module is relocatable or not). If we have a null base (ELF
* module isn't relocatable) then grab its base address from ELF file
*/
if
(
!
elf_fetch_file_info
(
name
,
&
rbase
,
&
size
,
&
checksum
))
size
=
checksum
=
0
;
add_module
(
dc
,
name
,
base
?
base
:
rbase
,
size
,
0
/* FIXME */
,
checksum
,
TRUE
);
return
TRUE
;
}
/******************************************************************
* fetch_macho_module_info_cb
*
* Callback for accumulating in dump_context a Mach-O modules set
*/
static
BOOL
fetch_macho_module_info_cb
(
const
WCHAR
*
name
,
unsigned
long
base
,
void
*
user
)
{
struct
dump_context
*
dc
=
(
struct
dump_context
*
)
user
;
DWORD_PTR
rbase
;
DWORD
size
,
checksum
;
/* FIXME: there's no relevant timestamp on Mach-O modules */
/* NB: if we have a non-null base from the live-target use it. If we have
* a null base, then grab its base address from Mach-O file.
*/
if
(
!
macho_fetch_file_info
(
dc
->
process
->
handle
,
name
,
base
,
&
rbase
,
&
size
,
&
checksum
))
if
(
!
dc
->
process
->
loader
->
fetch_file_info
(
dc
->
process
,
name
,
base
,
&
rbase
,
&
size
,
&
checksum
))
size
=
checksum
=
0
;
add_module
(
dc
,
name
,
base
?
base
:
rbase
,
size
,
0
/* FIXME */
,
checksum
,
TRUE
);
return
TRUE
;
...
...
@@ -348,8 +322,8 @@ static void fetch_modules_info(struct dump_context* dc)
*/
if
(
dc
->
process
->
dbg_hdr_addr
)
{
elf_enum_modules
(
dc
->
process
,
fetch_
elf
_module_info_cb
,
dc
);
macho_enum_modules
(
dc
->
process
,
fetch_
macho
_module_info_cb
,
dc
);
elf_enum_modules
(
dc
->
process
,
fetch_
host
_module_info_cb
,
dc
);
macho_enum_modules
(
dc
->
process
,
fetch_
host
_module_info_cb
,
dc
);
}
}
...
...
dlls/dbghelp/module.c
View file @
1bbd5440
...
...
@@ -1431,7 +1431,14 @@ static BOOL native_synchronize_module_list(struct process* pcs)
return
FALSE
;
}
static
BOOL
native_fetch_file_info
(
struct
process
*
process
,
const
WCHAR
*
name
,
ULONG_PTR
load_addr
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
{
return
FALSE
;
}
const
struct
loader_ops
no_loader_ops
=
{
native_synchronize_module_list
,
native_fetch_file_info
,
};
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