mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[WINESYNC] dbghelp: Pass process struct to elf_enum_modules and macho_enum_modules.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 724f433f39f71e8869c49a5960364c5669759b08 by Jacek Caban <jacek@codeweavers.com>
This commit is contained in:
parent
ca7d01b33f
commit
58c50e916e
5 changed files with 16 additions and 22 deletions
|
@ -625,7 +625,7 @@ extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN;
|
||||||
typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
|
typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
|
||||||
|
|
||||||
/* elf_module.c */
|
/* elf_module.c */
|
||||||
extern BOOL elf_enum_modules(HANDLE hProc, enum_modules_cb, void*) DECLSPEC_HIDDEN;
|
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;
|
extern BOOL elf_fetch_file_info(const WCHAR* name, DWORD_PTR* base, DWORD* size, DWORD* checksum) DECLSPEC_HIDDEN;
|
||||||
struct image_file_map;
|
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;
|
||||||
|
@ -637,7 +637,7 @@ 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(HANDLE hProc, enum_modules_cb, void*) DECLSPEC_HIDDEN;
|
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_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 BOOL macho_load_debug_info(struct process *pcs, struct module* module) DECLSPEC_HIDDEN;
|
||||||
extern struct module*
|
extern struct module*
|
||||||
|
|
|
@ -1561,21 +1561,17 @@ 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(HANDLE hProc, enum_modules_cb cb, void* user)
|
BOOL elf_enum_modules(struct process* process, enum_modules_cb cb, void* user)
|
||||||
{
|
{
|
||||||
struct process pcs;
|
|
||||||
struct elf_info elf_info;
|
struct elf_info elf_info;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
struct elf_enum_user eeu;
|
struct elf_enum_user eeu;
|
||||||
|
|
||||||
memset(&pcs, 0, sizeof(pcs));
|
|
||||||
pcs.handle = hProc;
|
|
||||||
elf_info.flags = ELF_INFO_DEBUG_HEADER | ELF_INFO_NAME;
|
elf_info.flags = ELF_INFO_DEBUG_HEADER | ELF_INFO_NAME;
|
||||||
if (!elf_search_loader(&pcs, &elf_info)) return FALSE;
|
elf_info.module_name = NULL;
|
||||||
pcs.dbg_hdr_addr = elf_info.dbg_hdr_addr;
|
|
||||||
eeu.cb = cb;
|
eeu.cb = cb;
|
||||||
eeu.user = user;
|
eeu.user = user;
|
||||||
ret = elf_enum_modules_internal(&pcs, elf_info.module_name, elf_enum_modules_translate, &eeu);
|
ret = elf_enum_modules_internal(process, elf_info.module_name, elf_enum_modules_translate, &eeu);
|
||||||
HeapFree(GetProcessHeap(), 0, (char*)elf_info.module_name);
|
HeapFree(GetProcessHeap(), 0, (char*)elf_info.module_name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1747,7 +1743,7 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL elf_enum_modules(HANDLE hProc, enum_modules_cb cb, void* user)
|
BOOL elf_enum_modules(struct process *process, enum_modules_cb cb, void* user)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1843,19 +1843,14 @@ BOOL macho_read_wine_loader_dbg_info(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(HANDLE hProc, enum_modules_cb cb, void* user)
|
BOOL macho_enum_modules(struct process* process, enum_modules_cb cb, void* user)
|
||||||
{
|
{
|
||||||
struct process pcs;
|
|
||||||
struct macho_info macho_info;
|
struct macho_info macho_info;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
TRACE("(%p, %p, %p)\n", hProc, cb, user);
|
TRACE("(%p, %p, %p)\n", process->handle, cb, user);
|
||||||
memset(&pcs, 0, sizeof(pcs));
|
|
||||||
pcs.handle = hProc;
|
|
||||||
macho_info.flags = MACHO_INFO_DEBUG_HEADER | MACHO_INFO_NAME;
|
macho_info.flags = MACHO_INFO_DEBUG_HEADER | MACHO_INFO_NAME;
|
||||||
if (!macho_search_loader(&pcs, &macho_info)) return FALSE;
|
ret = macho_enum_modules_internal(process, macho_info.module_name, cb, user);
|
||||||
pcs.dbg_hdr_addr = macho_info.dbg_hdr_addr;
|
|
||||||
ret = macho_enum_modules_internal(&pcs, macho_info.module_name, cb, user);
|
|
||||||
HeapFree(GetProcessHeap(), 0, (char*)macho_info.module_name);
|
HeapFree(GetProcessHeap(), 0, (char*)macho_info.module_name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1949,7 +1944,7 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL macho_enum_modules(HANDLE hProc, enum_modules_cb cb, void* user)
|
BOOL macho_enum_modules(struct process *process, enum_modules_cb cb, void* user)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -346,8 +346,11 @@ 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.
|
||||||
*/
|
*/
|
||||||
elf_enum_modules(dc->process->handle, fetch_elf_module_info_cb, dc);
|
if (dc->process->dbg_hdr_addr)
|
||||||
macho_enum_modules(dc->process->handle, fetch_macho_module_info_cb, dc);
|
{
|
||||||
|
elf_enum_modules(dc->process, fetch_elf_module_info_cb, dc);
|
||||||
|
macho_enum_modules(dc->process, fetch_macho_module_info_cb, dc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi)
|
static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi)
|
||||||
|
|
|
@ -4,4 +4,4 @@ files:
|
||||||
include/dbghelp.h: sdk/include/psdk/dbghelp.h
|
include/dbghelp.h: sdk/include/psdk/dbghelp.h
|
||||||
include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
|
include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
|
||||||
tags:
|
tags:
|
||||||
wine: 6b3018d03da983050516821caa2aada2f4814678
|
wine: 724f433f39f71e8869c49a5960364c5669759b08
|
||||||
|
|
Loading…
Reference in a new issue