[WINESYNC] dbghelp: Use loader_ops for enum_modules.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 16a3481bd22243183281c60ff375d4e61d5c4198 by Jacek Caban <jacek@codeweavers.com>
This commit is contained in:
winesync 2020-09-11 17:15:28 +02:00 committed by Jérôme Gardou
parent df9fadccb3
commit afc1e47291
6 changed files with 16 additions and 23 deletions

View File

@ -418,9 +418,12 @@ struct module
struct wine_rb_tree sources_offsets_tree;
};
typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
struct loader_ops
{
BOOL (*synchronize_module_list)(struct process* process);
BOOL (*enum_modules)(struct process* process, enum_modules_cb callback, void* user);
BOOL (*fetch_file_info)(struct process* process, const WCHAR* name, ULONG_PTR load_addr, DWORD_PTR* base, DWORD* size, DWORD* checksum);
};
@ -629,11 +632,7 @@ extern const char* wine_dbgstr_addr(const ADDRESS64* addr) DECLSPEC_HIDDEN;
extern struct cpu* cpu_find(DWORD) DECLSPEC_HIDDEN;
extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN;
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;
struct image_file_map;
extern BOOL elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN;
extern struct module*
elf_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN;
@ -642,7 +641,6 @@ struct elf_thunk_area;
extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN;
/* macho_module.c */
extern BOOL macho_enum_modules(struct process*, enum_modules_cb, void*) 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;
@ -740,6 +738,7 @@ extern BOOL stabs_parse(struct module* module, unsigned long load_offset
stabs_def_cb callback, void* user) DECLSPEC_HIDDEN;
/* dwarf.c */
struct image_file_map;
extern BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
const struct elf_thunk_area* thunks,
struct image_file_map* fmap) DECLSPEC_HIDDEN;

View File

@ -1502,7 +1502,7 @@ static BOOL elf_enum_modules_translate(const WCHAR* name, unsigned long load_add
* This function doesn't require that someone has called SymInitialize
* on this very process.
*/
BOOL elf_enum_modules(struct process* process, enum_modules_cb cb, void* user)
static BOOL elf_enum_modules(struct process* process, enum_modules_cb cb, void* user)
{
struct elf_info elf_info;
BOOL ret;
@ -1706,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_enum_modules,
elf_fetch_file_info,
};
@ -1739,11 +1740,6 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs)
return FALSE;
}
BOOL elf_enum_modules(struct process *process, enum_modules_cb cb, void* user)
{
return FALSE;
}
struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long addr)
{
return NULL;

View File

@ -1730,7 +1730,7 @@ static BOOL macho_synchronize_module_list(struct process* pcs)
* This function doesn't require that someone has called SymInitialize
* on this very process.
*/
BOOL macho_enum_modules(struct process* process, enum_modules_cb cb, void* user)
static BOOL macho_enum_modules(struct process* process, enum_modules_cb cb, void* user)
{
struct macho_info macho_info;
BOOL ret;
@ -1906,6 +1906,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_enum_modules,
macho_fetch_file_info,
};
@ -1935,11 +1936,6 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs)
return FALSE;
}
BOOL macho_enum_modules(struct process *process, enum_modules_cb cb, void* user)
{
return FALSE;
}
struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long addr)
{
return NULL;

View File

@ -320,11 +320,7 @@ static void fetch_modules_info(struct dump_context* dc)
* And it's always a good idea to have a trace of the loaded ELF modules for
* a given application in a post mortem debugging condition.
*/
if (dc->process->dbg_hdr_addr)
{
elf_enum_modules(dc->process, fetch_host_module_info_cb, dc);
macho_enum_modules(dc->process, fetch_host_module_info_cb, dc);
}
dc->process->loader->enum_modules(dc->process, fetch_host_module_info_cb, dc);
}
static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi)

View File

@ -1465,6 +1465,11 @@ static BOOL native_synchronize_module_list(struct process* pcs)
return FALSE;
}
static BOOL native_enum_modules(struct process *process, enum_modules_cb cb, void* user)
{
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)
{
@ -1474,5 +1479,6 @@ static BOOL native_fetch_file_info(struct process* process, const WCHAR* name, U
const struct loader_ops no_loader_ops =
{
native_synchronize_module_list,
native_enum_modules,
native_fetch_file_info,
};

View File

@ -4,4 +4,4 @@ files:
include/dbghelp.h: sdk/include/psdk/dbghelp.h
include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
tags:
wine: 2a5160c4f2eb80dcc8770cd10d702a5d8233314f
wine: 16a3481bd22243183281c60ff375d4e61d5c4198