https://git.reactos.org/?p=reactos.git;a=commitdiff;h=afc1e47291569c6f51595d...
commit afc1e47291569c6f51595d68449504e36e61851b Author: winesync ros-dev@reactos.org AuthorDate: Fri Sep 11 17:15:28 2020 +0200 Commit: Jérôme Gardou jerome.gardou@reactos.org CommitDate: Wed Sep 16 10:35:49 2020 +0200
[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 --- dll/win32/dbghelp/dbghelp_private.h | 9 ++++----- dll/win32/dbghelp/elf_module.c | 8 ++------ dll/win32/dbghelp/macho_module.c | 8 ++------ dll/win32/dbghelp/minidump.c | 6 +----- dll/win32/dbghelp/module.c | 6 ++++++ sdk/tools/winesync/dbghelp.cfg | 2 +- 6 files changed, 16 insertions(+), 23 deletions(-)
diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 80add9ef9c9..472b05a1b9d 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -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; diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index dba4573afee..64c550a67bd 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -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; diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 73d0575a4b0..df38129e12c 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -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; diff --git a/dll/win32/dbghelp/minidump.c b/dll/win32/dbghelp/minidump.c index 27e3a8708ed..4730dedec94 100644 --- a/dll/win32/dbghelp/minidump.c +++ b/dll/win32/dbghelp/minidump.c @@ -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) diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c index 7d7b101ac1c..61a069ec75b 100644 --- a/dll/win32/dbghelp/module.c +++ b/dll/win32/dbghelp/module.c @@ -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, }; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 95aa66e766f..06702ac9f61 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -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