From 2fa249cd06624bed16aec029885eed31ef448b27 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 20 Mar 2015 18:27:31 +0000 Subject: [PATCH] [DBGHELP] Sync with Wine Staging 1.7.37. CORE-9246 svn path=/trunk/; revision=66841 --- reactos/dll/win32/dbghelp/cpu_x86_64.c | 15 ---------- reactos/dll/win32/dbghelp/dwarf.c | 35 ++++++++++++++++++++++++ reactos/dll/win32/dbghelp/elf_module.c | 8 ++++-- reactos/dll/win32/dbghelp/macho_module.c | 6 ++-- reactos/dll/win32/dbghelp/pe_module.c | 2 +- reactos/dll/win32/dbghelp/stack.c | 9 ------ reactos/media/doc/README.WINE | 2 +- 7 files changed, 46 insertions(+), 31 deletions(-) diff --git a/reactos/dll/win32/dbghelp/cpu_x86_64.c b/reactos/dll/win32/dbghelp/cpu_x86_64.c index 09adbe3c465..26b5c21ea64 100644 --- a/reactos/dll/win32/dbghelp/cpu_x86_64.c +++ b/reactos/dll/win32/dbghelp/cpu_x86_64.c @@ -68,21 +68,6 @@ typedef struct _UNWIND_INFO */ } UNWIND_INFO, *PUNWIND_INFO; -#define GetUnwindCodeEntry(info, index) \ - ((info)->UnwindCode[index]) - -#define GetLanguageSpecificDataPtr(info) \ - ((PVOID)&GetUnwindCodeEntry((info),((info)->CountOfCodes + 1) & ~1)) - -#define GetExceptionHandler(base, info) \ - ((PEXCEPTION_HANDLER)((base) + *(PULONG)GetLanguageSpecificDataPtr(info))) - -#define GetChainedFunctionEntry(base, info) \ - ((PRUNTIME_FUNCTION)((base) + *(PULONG)GetLanguageSpecificDataPtr(info))) - -#define GetExceptionDataPtr(info) \ - ((PVOID)((PULONG)GetLanguageSpecificData(info) + 1) - static BOOL x86_64_get_addr(HANDLE hThread, const CONTEXT* ctx, enum cpu_addr ca, ADDRESS64* addr) { diff --git a/reactos/dll/win32/dbghelp/dwarf.c b/reactos/dll/win32/dbghelp/dwarf.c index 13262bec951..8a925573cd4 100644 --- a/reactos/dll/win32/dbghelp/dwarf.c +++ b/reactos/dll/win32/dbghelp/dwarf.c @@ -1305,6 +1305,31 @@ static struct symt* dwarf2_parse_volatile_type(dwarf2_parse_context_t* ctx, return ref_type; } +static struct symt* dwarf2_parse_unspecified_type(dwarf2_parse_context_t* ctx, + dwarf2_debug_info_t* di) +{ + struct attribute name; + struct attribute size; + struct symt_basic *basic; + + TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); + + if (di->symt) return di->symt; + + if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) + name.u.string = "void"; + size.u.uvalue = sizeof(void *); + + basic = symt_new_basic(ctx->module, btVoid, name.u.string, size.u.uvalue); + di->symt = &basic->symt; + + if (!ctx->symt_cache[sc_void]) + ctx->symt_cache[sc_void] = di->symt; + + if (dwarf2_get_di_children(ctx, di)) FIXME("Unsupported children\n"); + return di->symt; +} + static struct symt* dwarf2_parse_reference_type(dwarf2_parse_context_t* ctx, dwarf2_debug_info_t* di) { @@ -1421,6 +1446,9 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx, case DW_TAG_subprogram: dwarf2_parse_subprogram(ctx, child); break; + case DW_TAG_const_type: + dwarf2_parse_const_type(ctx, child); + break; case DW_TAG_structure_type: case DW_TAG_class_type: case DW_TAG_union_type: @@ -1432,6 +1460,8 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx, case DW_TAG_variable: case DW_TAG_imported_declaration: case DW_TAG_ptr_to_member_type: + case DW_TAG_GNU_template_parameter_pack: + case DW_TAG_GNU_formal_parameter_pack: /* FIXME: some C++ related stuff */ break; default: @@ -1934,6 +1964,8 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx, case DW_TAG_template_type_param: case DW_TAG_template_value_param: case DW_TAG_GNU_call_site: + case DW_TAG_GNU_template_parameter_pack: + case DW_TAG_GNU_formal_parameter_pack: /* FIXME: no support in dbghelp's internals so far */ break; default: @@ -2047,6 +2079,9 @@ static void dwarf2_load_one_entry(dwarf2_parse_context_t* ctx, case DW_TAG_volatile_type: dwarf2_parse_volatile_type(ctx, di); break; + case DW_TAG_unspecified_type: + dwarf2_parse_unspecified_type(ctx, di); + break; case DW_TAG_reference_type: dwarf2_parse_reference_type(ctx, di); break; diff --git a/reactos/dll/win32/dbghelp/elf_module.c b/reactos/dll/win32/dbghelp/elf_module.c index b0c1c52a5bf..7954ac9cafe 100644 --- a/reactos/dll/win32/dbghelp/elf_module.c +++ b/reactos/dll/win32/dbghelp/elf_module.c @@ -1469,9 +1469,11 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, if (!ret && !strchrW(filename, '/')) { ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr, - getenv("PATH"), elf_info) || - elf_load_file_from_path(pcs, filename, load_offset, dyn_addr, - getenv("LD_LIBRARY_PATH"), elf_info); + getenv("PATH"), elf_info); + if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr, + getenv("LD_LIBRARY_PATH"), elf_info); + if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr, + BINDIR, elf_info); if (!ret) ret = elf_load_file_from_dll_path(pcs, filename, load_offset, dyn_addr, elf_info); } diff --git a/reactos/dll/win32/dbghelp/macho_module.c b/reactos/dll/win32/dbghelp/macho_module.c index e37a199e2d6..bfff27e8f32 100644 --- a/reactos/dll/win32/dbghelp/macho_module.c +++ b/reactos/dll/win32/dbghelp/macho_module.c @@ -966,10 +966,10 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename, &pbi, sizeof(pbi), NULL); if (status == STATUS_SUCCESS) { - ULONG dyld_image_info; + ULONG_PTR dyld_image_info; /* Read dyld image info address from PEB */ - if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved, + if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], &dyld_image_info, sizeof(dyld_image_info), NULL)) { TRACE("got dyld_image_info 0x%08x from PEB %p MacDyldImageInfo %p\n", @@ -979,6 +979,7 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename, } } +#ifndef __LP64__ /* No reading the symtab with nlist(3) in LP64 */ if (!ret) { static void* dyld_all_image_infos_addr; @@ -1002,6 +1003,7 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename, ret = TRUE; } } +#endif } if (macho_info->flags & MACHO_INFO_MODULE) diff --git a/reactos/dll/win32/dbghelp/pe_module.c b/reactos/dll/win32/dbghelp/pe_module.c index b10bec98604..399185c457e 100644 --- a/reactos/dll/win32/dbghelp/pe_module.c +++ b/reactos/dll/win32/dbghelp/pe_module.c @@ -504,7 +504,7 @@ static BOOL pe_load_stabs(const struct process* pcs, struct module* module) static BOOL pe_load_dwarf(struct module* module) { struct image_file_map* fmap = &module->format_info[DFI_PE]->u.pe_info->fmap; - BOOL ret = FALSE; + BOOL ret; ret = dwarf2_parse(module, module->module.BaseOfImage - fmap->u.pe.ntheader.OptionalHeader.ImageBase, diff --git a/reactos/dll/win32/dbghelp/stack.c b/reactos/dll/win32/dbghelp/stack.c index c8dcac1f448..ffb4b318581 100644 --- a/reactos/dll/win32/dbghelp/stack.c +++ b/reactos/dll/win32/dbghelp/stack.c @@ -233,15 +233,6 @@ BOOL WINAPI StackWalk64(DWORD MachineType, HANDLE hProcess, HANDLE hThread, if (!cpu->stack_walk(&csw, frame, ctx)) return FALSE; /* we don't handle KdHelp */ - frame->KdHelp.Thread = 0xC000FADE; - frame->KdHelp.ThCallbackStack = 0x10; - frame->KdHelp.ThCallbackBStore = 0; - frame->KdHelp.NextCallback = 0; - frame->KdHelp.FramePointer = 0; - frame->KdHelp.KiCallUserMode = 0xD000DAFE; - frame->KdHelp.KeUserCallbackDispatcher = 0xE000F000; - frame->KdHelp.SystemRangeStart = 0xC0000000; - frame->KdHelp.Reserved[0] /* KiUserExceptionDispatcher */ = 0xE0005000; return TRUE; } diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 90b6806ff3f..f74369c6758 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -70,7 +70,7 @@ reactos/dll/win32/cryptdlg # Synced to Wine-1.7.27 reactos/dll/win32/cryptdll # Synced to Wine-1.7.27 reactos/dll/win32/cryptnet # Synced to WineStaging-1.7.37 reactos/dll/win32/cryptui # Synced to Wine-1.7.27 -reactos/dll/win32/dbghelp # Synced to Wine-1.7.27 +reactos/dll/win32/dbghelp # Synced to WineStaging-1.7.37 reactos/dll/win32/dciman32 # Synced to Wine-1.7.27 reactos/dll/win32/dwmapi # Synced to Wine-1.7.27 reactos/dll/win32/faultrep # Synced to Wine-1.7.27