Commit 16a3481b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

dbghelp: Use loader_ops for enum_modules.

parent 093616ee
...@@ -387,9 +387,12 @@ struct module ...@@ -387,9 +387,12 @@ struct module
struct wine_rb_tree sources_offsets_tree; struct wine_rb_tree sources_offsets_tree;
}; };
typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
struct loader_ops struct loader_ops
{ {
BOOL (*synchronize_module_list)(struct process* process); 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); BOOL (*fetch_file_info)(struct process* process, const WCHAR* name, ULONG_PTR load_addr, DWORD_PTR* base, DWORD* size, DWORD* checksum);
}; };
...@@ -598,11 +601,7 @@ extern const char* wine_dbgstr_addr(const ADDRESS64* addr) DECLSPEC_HIDDEN; ...@@ -598,11 +601,7 @@ extern const char* wine_dbgstr_addr(const ADDRESS64* addr) DECLSPEC_HIDDEN;
extern struct cpu* cpu_find(DWORD) DECLSPEC_HIDDEN; extern struct cpu* cpu_find(DWORD) DECLSPEC_HIDDEN;
extern DWORD calc_crc32(HANDLE handle) 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 */ /* 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 BOOL elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN;
extern struct module* extern struct module*
elf_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN; elf_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN;
...@@ -611,7 +610,6 @@ struct elf_thunk_area; ...@@ -611,7 +610,6 @@ struct elf_thunk_area;
extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN;
/* macho_module.c */ /* 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 BOOL macho_load_debug_info(struct process *pcs, struct module* module) DECLSPEC_HIDDEN;
extern struct module* extern struct module*
macho_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN; macho_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN;
...@@ -707,6 +705,7 @@ extern BOOL stabs_parse(struct module* module, unsigned long load_offset ...@@ -707,6 +705,7 @@ extern BOOL stabs_parse(struct module* module, unsigned long load_offset
stabs_def_cb callback, void* user) DECLSPEC_HIDDEN; stabs_def_cb callback, void* user) DECLSPEC_HIDDEN;
/* dwarf.c */ /* dwarf.c */
struct image_file_map;
extern BOOL dwarf2_parse(struct module* module, unsigned long load_offset, extern BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
const struct elf_thunk_area* thunks, const struct elf_thunk_area* thunks,
struct image_file_map* fmap) DECLSPEC_HIDDEN; struct image_file_map* fmap) DECLSPEC_HIDDEN;
......
...@@ -1502,7 +1502,7 @@ static BOOL elf_enum_modules_translate(const WCHAR* name, unsigned long load_add ...@@ -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 * This function doesn't require that someone has called SymInitialize
* on this very process. * 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; struct elf_info elf_info;
BOOL ret; BOOL ret;
...@@ -1706,6 +1706,7 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info) ...@@ -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 = static const struct loader_ops elf_loader_ops =
{ {
elf_synchronize_module_list, elf_synchronize_module_list,
elf_enum_modules,
elf_fetch_file_info, elf_fetch_file_info,
}; };
...@@ -1739,11 +1740,6 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs) ...@@ -1739,11 +1740,6 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs)
return FALSE; 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) struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long addr)
{ {
return NULL; return NULL;
......
...@@ -1730,7 +1730,7 @@ static BOOL macho_synchronize_module_list(struct process* pcs) ...@@ -1730,7 +1730,7 @@ static BOOL macho_synchronize_module_list(struct process* pcs)
* This function doesn't require that someone has called SymInitialize * This function doesn't require that someone has called SymInitialize
* on this very process. * 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; struct macho_info macho_info;
BOOL ret; BOOL ret;
...@@ -1906,6 +1906,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in ...@@ -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 = static const struct loader_ops macho_loader_ops =
{ {
macho_synchronize_module_list, macho_synchronize_module_list,
macho_enum_modules,
macho_fetch_file_info, macho_fetch_file_info,
}; };
...@@ -1935,11 +1936,6 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs) ...@@ -1935,11 +1936,6 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs)
return FALSE; 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) struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long addr)
{ {
return NULL; return NULL;
......
...@@ -320,11 +320,7 @@ static void fetch_modules_info(struct dump_context* dc) ...@@ -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 * 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. * a given application in a post mortem debugging condition.
*/ */
if (dc->process->dbg_hdr_addr) dc->process->loader->enum_modules(dc->process, fetch_host_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);
}
} }
static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi) static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi)
......
...@@ -1431,6 +1431,11 @@ static BOOL native_synchronize_module_list(struct process* pcs) ...@@ -1431,6 +1431,11 @@ static BOOL native_synchronize_module_list(struct process* pcs)
return FALSE; 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, static BOOL native_fetch_file_info(struct process* process, const WCHAR* name, ULONG_PTR load_addr, DWORD_PTR* base,
DWORD* size, DWORD* checksum) DWORD* size, DWORD* checksum)
{ {
...@@ -1440,5 +1445,6 @@ static BOOL native_fetch_file_info(struct process* process, const WCHAR* name, U ...@@ -1440,5 +1445,6 @@ static BOOL native_fetch_file_info(struct process* process, const WCHAR* name, U
const struct loader_ops no_loader_ops = const struct loader_ops no_loader_ops =
{ {
native_synchronize_module_list, native_synchronize_module_list,
native_enum_modules,
native_fetch_file_info, native_fetch_file_info,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment