clean up of code: - remove usage of wine_dbgstr_longlong() - remove some FIXME - remove stabs's only stuff clean up of mistake: - partially revert one of previous commits (messed up with the tests)
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/dbghelp/coff.c | 10 ++++----- dlls/dbghelp/cpu_arm.c | 8 ++++---- dlls/dbghelp/cpu_arm64.c | 8 ++++---- dlls/dbghelp/cpu_i386.c | 12 +++++------ dlls/dbghelp/cpu_x86_64.c | 10 ++++----- dlls/dbghelp/dbghelp.c | 14 ++++++------- dlls/dbghelp/dwarf.c | 10 ++++----- dlls/dbghelp/elf_module.c | 8 ++++---- dlls/dbghelp/macho_module.c | 6 +++--- dlls/dbghelp/module.c | 16 +++++++-------- dlls/dbghelp/pe_module.c | 8 ++++---- dlls/dbghelp/source.c | 16 +++++++-------- dlls/dbghelp/stack.c | 6 +++--- dlls/dbghelp/symbol.c | 41 ++++++++++++++++--------------------- dlls/dbghelp/type.c | 4 +--- 15 files changed, 82 insertions(+), 95 deletions(-)
diff --git a/dlls/dbghelp/coff.c b/dlls/dbghelp/coff.c index efba167081e..57d0175c5c2 100644 --- a/dlls/dbghelp/coff.c +++ b/dlls/dbghelp/coff.c @@ -297,9 +297,8 @@ DECLSPEC_HIDDEN BOOL coff_process_info(const struct msc_debug_info* msc_dbg) DWORD base = msc_dbg->sectp[coff_sym->SectionNumber - 1].VirtualAddress; nampnt = coff_get_name(coff_sym, coff_strtab);
- TRACE("%d: %s %s\n", - i, wine_dbgstr_longlong(msc_dbg->module->module.BaseOfImage + base + coff_sym->Value), - nampnt); + TRACE("%d: %I64x %s\n", + i, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, nampnt); TRACE("\tAdding global symbol %s (sect=%s)\n", nampnt, msc_dbg->sectp[coff_sym->SectionNumber - 1].Name);
@@ -344,9 +343,8 @@ DECLSPEC_HIDDEN BOOL coff_process_info(const struct msc_debug_info* msc_dbg) */ nampnt = coff_get_name(coff_sym, coff_strtab);
- TRACE("%d: %s %s\n", - i, wine_dbgstr_longlong(msc_dbg->module->module.BaseOfImage + base + coff_sym->Value), - nampnt); + TRACE("%d: %I64x %s\n", + i, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, nampnt); TRACE("\tAdding global data symbol %s\n", nampnt);
/* diff --git a/dlls/dbghelp/cpu_arm.c b/dlls/dbghelp/cpu_arm.c index 51c7fc9c9c0..6da7f4b3c03 100644 --- a/dlls/dbghelp/cpu_arm.c +++ b/dlls/dbghelp/cpu_arm.c @@ -91,13 +91,13 @@ static BOOL arm_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, /* sanity check */ if (curr_mode >= stm_done) return FALSE;
- TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s\n", + TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : "ARM", - wine_dbgstr_longlong(curr_count)); + curr_count);
if (curr_mode == stm_start) { @@ -131,13 +131,13 @@ static BOOL arm_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, frame->Virtual = TRUE; inc_curr_count();
- TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s FuncTable=%p\n", + TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u FuncTable=%p\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : "ARM", - wine_dbgstr_longlong(curr_count), + curr_count, frame->FuncTableEntry);
return TRUE; diff --git a/dlls/dbghelp/cpu_arm64.c b/dlls/dbghelp/cpu_arm64.c index 2c767e78de4..ff9c4c0b47d 100644 --- a/dlls/dbghelp/cpu_arm64.c +++ b/dlls/dbghelp/cpu_arm64.c @@ -93,13 +93,13 @@ static BOOL arm64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, /* sanity check */ if (curr_mode >= stm_done) return FALSE;
- TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s\n", + TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : "ARM64", - wine_dbgstr_longlong(curr_count)); + curr_count);
if (curr_mode == stm_start) { @@ -133,13 +133,13 @@ static BOOL arm64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, frame->Virtual = TRUE; inc_curr_count();
- TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s FuncTable=%p\n", + TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u FuncTable=%p\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : "ARM64", - wine_dbgstr_longlong(curr_count), + curr_count, frame->FuncTableEntry);
return TRUE; diff --git a/dlls/dbghelp/cpu_i386.c b/dlls/dbghelp/cpu_i386.c index bd860e0cdd8..c45c45f434c 100644 --- a/dlls/dbghelp/cpu_i386.c +++ b/dlls/dbghelp/cpu_i386.c @@ -163,13 +163,13 @@ static BOOL i386_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, /* sanity check */ if (curr_mode >= stm_done) return FALSE;
- TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s cSwitch=%p nSwitch=%p\n", + TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u cSwitch=%p nSwitch=%p\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : (curr_mode == stm_16bit ? "16bit" : "32bit"), - wine_dbgstr_longlong(curr_count), + curr_count, (void*)(DWORD_PTR)curr_switch, (void*)(DWORD_PTR)next_switch);
/* if we're at first call (which doesn't actually unwind, it just computes ReturnPC, @@ -403,8 +403,8 @@ static BOOL i386_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, frame->AddrStack.Offset = context->x86.Esp; frame->AddrFrame.Offset = context->x86.Ebp; if (frame->AddrReturn.Offset != context->x86.Eip) - FIXME("new PC=%s different from Eip=%lx\n", - wine_dbgstr_longlong(frame->AddrReturn.Offset), context->x86.Eip); + FIXME("new PC=%I64x different from Eip=%lx\n", + frame->AddrReturn.Offset, context->x86.Eip); frame->AddrPC.Offset = context->x86.Eip; } } @@ -493,13 +493,13 @@ static BOOL i386_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, frame->FuncTableEntry = NULL;
inc_curr_count(); - TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s cSwitch=%p nSwitch=%p FuncTable=%p\n", + TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u cSwitch=%p nSwitch=%p FuncTable=%p\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : (curr_mode == stm_16bit ? "16bit" : "32bit"), - wine_dbgstr_longlong(curr_count), + curr_count, (void*)(DWORD_PTR)curr_switch, (void*)(DWORD_PTR)next_switch, frame->FuncTableEntry);
return TRUE; diff --git a/dlls/dbghelp/cpu_x86_64.c b/dlls/dbghelp/cpu_x86_64.c index 1ad9aa41395..38c30ab6fa3 100644 --- a/dlls/dbghelp/cpu_x86_64.c +++ b/dlls/dbghelp/cpu_x86_64.c @@ -471,7 +471,7 @@ static BOOL default_unwind(struct cpu_stack_walk* csw, CONTEXT* context) { if (!sw_read_mem(csw, context->Rsp, &context->Rip, sizeof(DWORD64))) { - WARN("Cannot read new frame offset %s\n", wine_dbgstr_longlong(context->Rsp)); + WARN("Cannot read new frame offset %I64x\n", context->Rsp); return FALSE; } context->Rsp += sizeof(DWORD64); @@ -649,13 +649,13 @@ static BOOL x86_64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, if (curr_mode >= stm_done) return FALSE; assert(!csw->is32);
- TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s\n", + TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : "64bit", - wine_dbgstr_longlong(curr_count)); + curr_count);
if (curr_mode == stm_start) { @@ -705,13 +705,13 @@ static BOOL x86_64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, frame->Virtual = TRUE; curr_count++;
- TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s FuncTable=%p\n", + TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%I64u FuncTable=%p\n", wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : "64bit", - wine_dbgstr_longlong(curr_count), + curr_count, frame->FuncTableEntry);
return TRUE; diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index df257bb4639..3ad8d179c65 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -104,7 +104,7 @@ BOOL validate_addr64(DWORD64 addr) { if (sizeof(void*) == sizeof(int) && (addr >> 32)) { - FIXME("Unsupported address %s\n", wine_dbgstr_longlong(addr)); + FIXME("Unsupported address %I64x\n", addr); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } @@ -135,7 +135,7 @@ const char* wine_dbgstr_addr(const ADDRESS64* addr) switch (addr->Mode) { case AddrModeFlat: - return wine_dbg_sprintf("flat<%s>", wine_dbgstr_longlong(addr->Offset)); + return wine_dbg_sprintf("flat<%I64x>", addr->Offset); case AddrMode1616: return wine_dbg_sprintf("1616<%04x:%04lx>", addr->Segment, (DWORD)addr->Offset); case AddrMode1632: @@ -858,24 +858,22 @@ BOOL WINAPI SymRegisterCallback(HANDLE hProcess, /*********************************************************************** * SymRegisterCallback64 (DBGHELP.@) */ -BOOL WINAPI SymRegisterCallback64(HANDLE hProcess, +BOOL WINAPI SymRegisterCallback64(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction, ULONG64 UserContext) { - TRACE("(%p, %p, %s)\n", - hProcess, CallbackFunction, wine_dbgstr_longlong(UserContext)); + TRACE("(%p, %p, %I64x)\n", hProcess, CallbackFunction, UserContext); return sym_register_cb(hProcess, CallbackFunction, NULL, UserContext, FALSE); }
/*********************************************************************** * SymRegisterCallbackW64 (DBGHELP.@) */ -BOOL WINAPI SymRegisterCallbackW64(HANDLE hProcess, +BOOL WINAPI SymRegisterCallbackW64(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction, ULONG64 UserContext) { - TRACE("(%p, %p, %s)\n", - hProcess, CallbackFunction, wine_dbgstr_longlong(UserContext)); + TRACE("(%p, %p, %I64x)\n", hProcess, CallbackFunction, UserContext); return sym_register_cb(hProcess, CallbackFunction, NULL, UserContext, TRUE); }
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 30cd35076d3..af703c90f9e 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -588,7 +588,7 @@ static BOOL dwarf2_fill_attr(const dwarf2_parse_context_t* ctx,
case DW_FORM_data8: attr->u.lluvalue = dwarf2_get_u8(data); - TRACE("data8<%s>\n", wine_dbgstr_longlong(attr->u.uvalue)); + TRACE("data8<%Ix>\n", attr->u.uvalue); break;
case DW_FORM_ref1: @@ -671,7 +671,7 @@ static BOOL dwarf2_fill_attr(const dwarf2_parse_context_t* ctx,
case DW_FORM_sec_offset: attr->u.lluvalue = dwarf2_get_addr(data, ctx->head.offset_size); - TRACE("sec_offset<%s>\n", wine_dbgstr_longlong(attr->u.lluvalue)); + TRACE("sec_offset<%I64x>\n", attr->u.lluvalue); break;
case DW_FORM_GNU_ref_alt: @@ -3685,7 +3685,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w tmp = 0; if (!sw_read_mem(csw, stack[sp], &tmp, module->format_info[DFI_DWARF]->u.dwarf2_info->word_size)) { - ERR("Couldn't read memory at %s\n", wine_dbgstr_longlong(stack[sp])); + ERR("Couldn't read memory at %I64x\n", stack[sp]); tmp = 0; } stack[sp] = tmp; @@ -3735,7 +3735,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w sz = dwarf2_parse_byte(&ctx); if (!sw_read_mem(csw, stack[sp], &tmp, sz)) { - ERR("Couldn't read memory at %s\n", wine_dbgstr_longlong(stack[sp])); + ERR("Couldn't read memory at %I64x\n", stack[sp]); tmp = 0; } /* do integral promotion */ @@ -3769,7 +3769,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk *cfa = eval_expression(module, csw, (const unsigned char*)state->cfa_offset, context); if (!sw_read_mem(csw, *cfa, cfa, csw->cpu->word_size)) { - WARN("Couldn't read memory at %s\n", wine_dbgstr_longlong(*cfa)); + WARN("Couldn't read memory at %I64x\n", *cfa); return; } break; diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 4d96b5c60a7..306fecc1272 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -860,10 +860,10 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table { if (((struct symt_function*)sym)->address != elf_info->elf_addr && ((struct symt_function*)sym)->address != elf_info->elf_addr + symp->st_value) - FIXME("Changing address for %p/%s!%s from %08Ix to %s\n", + FIXME("Changing address for %p/%s!%s from %08Ix to %I64x\n", sym, debugstr_w(module->modulename), sym->hash_elt.name, ((struct symt_function*)sym)->address, - wine_dbgstr_longlong(elf_info->elf_addr + symp->st_value)); + elf_info->elf_addr + symp->st_value); if (((struct symt_function*)sym)->size && ((struct symt_function*)sym)->size != symp->st_size) FIXME("Changing size for %p/%s!%s from %08Ix to %08x\n", sym, debugstr_w(module->modulename), sym->hash_elt.name, @@ -889,10 +889,10 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table { if (((struct symt_data*)sym)->u.var.offset != elf_info->elf_addr && ((struct symt_data*)sym)->u.var.offset != elf_info->elf_addr + symp->st_value) - FIXME("Changing address for %p/%s!%s from %08Ix to %s\n", + FIXME("Changing address for %p/%s!%s from %08Ix to %I64x\n", sym, debugstr_w(module->modulename), sym->hash_elt.name, ((struct symt_function*)sym)->address, - wine_dbgstr_longlong(elf_info->elf_addr + symp->st_value)); + elf_info->elf_addr + symp->st_value); ((struct symt_data*)sym)->u.var.offset = elf_info->elf_addr + symp->st_value; ((struct symt_data*)sym)->kind = elf_is_local_symbol(symp->st_info) ? DataIsFileStatic : DataIsGlobal; diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index b90f248b15d..16fa0f815a9 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -1154,11 +1154,11 @@ static void macho_finish_stabs(struct module* module, struct hash_table* ht_symt symt_get_info(module, &sym->symt, TI_GET_LENGTH, &size); symt_get_info(module, &sym->symt, TI_GET_DATAKIND, &kind); if (size && kind == (ste->is_global ? DataIsGlobal : DataIsFileStatic)) - FIXME("Duplicate in %s: %s<%08Ix> %s<%s-%s>\n", + FIXME("Duplicate in %s: %s<%08Ix> %s<%I64x-%I64x>\n", debugstr_w(module->modulename), ste->ht_elt.name, ste->addr, sym->hash_elt.name, - wine_dbgstr_longlong(addr), wine_dbgstr_longlong(size)); + addr, size); } } } @@ -1622,7 +1622,7 @@ static BOOL macho_enum_modules_internal(const struct process* pcs, } if (!image_infos.infos64.infoArray) goto done; - TRACE("Process has %u image infos at %s\n", image_infos.infos64.infoArrayCount, wine_dbgstr_longlong(image_infos.infos64.infoArray)); + TRACE("Process has %u image infos at %I64x\n", image_infos.infos64.infoArrayCount, image_infos.infos64.infoArray);
if (pcs->is_64bit) len = sizeof(info_array->info64); diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 5a0769f25a4..6a204349b73 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -186,10 +186,8 @@ struct module* module_new(struct process* pcs, const WCHAR* name, module->next = pcs->lmodules; pcs->lmodules = module;
- TRACE("=> %s %s-%s %s\n", - get_module_type(type, virtual), - wine_dbgstr_longlong(mod_addr), wine_dbgstr_longlong(mod_addr + size), - debugstr_w(name)); + TRACE("=> %s %I64x-%I64x %s\n", + get_module_type(type, virtual), mod_addr, mod_addr + size, debugstr_w(name));
pool_init(&module->pool, 65536);
@@ -858,9 +856,9 @@ DWORD64 WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, unsigned len; DWORD64 ret;
- TRACE("(%p %p %s %s %s %08lx %p %08lx)\n", + TRACE("(%p %p %s %s %I64x %08lx %p %08lx)\n", hProcess, hFile, debugstr_a(ImageName), debugstr_a(ModuleName), - wine_dbgstr_longlong(BaseOfDll), DllSize, Data, Flags); + BaseOfDll, DllSize, Data, Flags);
if (ImageName) { @@ -895,9 +893,9 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam struct module* module = NULL; struct module* altmodule;
- TRACE("(%p %p %s %s %s %08lx %p %08lx)\n", + TRACE("(%p %p %s %s %I64x %08lx %p %08lx)\n", hProcess, hFile, debugstr_w(wImageName), debugstr_w(wModuleName), - wine_dbgstr_longlong(BaseOfDll), SizeOfDll, Data, Flags); + BaseOfDll, SizeOfDll, Data, Flags);
if (Data) FIXME("Unsupported load data parameter %p for %s\n", @@ -1402,7 +1400,7 @@ BOOL WINAPI SymGetModuleInfoW64(HANDLE hProcess, DWORD64 dwAddr, struct module* module; IMAGEHLP_MODULEW64 miw64;
- TRACE("%p %s %p\n", hProcess, wine_dbgstr_longlong(dwAddr), ModuleInfo); + TRACE("%p %I64x %p\n", hProcess, dwAddr, ModuleInfo);
if (!pcs) return FALSE; if (ModuleInfo->SizeOfStruct > sizeof(*ModuleInfo)) return FALSE; diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 6b61c1de6e5..4a7e68d5483 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -407,11 +407,11 @@ static BOOL pe_locate_with_coff_symbol_table(struct module* module) sym->u.var.kind == loc_absolute && !strcmp(sym->hash_elt.name, name)) { - TRACE("Changing absolute address for %d.%s: %Ix -> %s\n", + TRACE("Changing absolute address for %d.%s: %Ix -> %I64x\n", isym->SectionNumber, name, sym->u.var.offset, - wine_dbgstr_longlong(module->module.BaseOfImage + - fmap->u.pe.sect[isym->SectionNumber - 1].shdr.VirtualAddress + - isym->Value)); + module->module.BaseOfImage + + fmap->u.pe.sect[isym->SectionNumber - 1].shdr.VirtualAddress + + isym->Value); sym->u.var.offset = module->module.BaseOfImage + fmap->u.pe.sect[isym->SectionNumber - 1].shdr.VirtualAddress + isym->Value; break; diff --git a/dlls/dbghelp/source.c b/dlls/dbghelp/source.c index 380101f66be..3e35c7e62d2 100644 --- a/dlls/dbghelp/source.c +++ b/dlls/dbghelp/source.c @@ -293,8 +293,8 @@ BOOL WINAPI SymEnumSourceLines(HANDLE hProcess, ULONG64 base, PCSTR obj, PSYM_ENUMLINES_CALLBACK EnumLinesCallback, PVOID UserContext) { - FIXME("%p %s %s %s %lu %lu %p %p: stub!\n", - hProcess, wine_dbgstr_longlong(base), debugstr_a(obj), debugstr_a(file), + FIXME("%p %I64x %s %s %lu %lu %p %p: stub!\n", + hProcess, base, debugstr_a(obj), debugstr_a(file), line, flags, EnumLinesCallback, UserContext); SetLastError(ERROR_NOT_SUPPORTED); return FALSE; @@ -309,8 +309,8 @@ BOOL WINAPI SymEnumSourceLinesW(HANDLE hProcess, ULONG64 base, PCWSTR obj, PSYM_ENUMLINES_CALLBACKW EnumLinesCallback, PVOID UserContext) { - FIXME("%p %s %s %s %lu %lu %p %p: stub!\n", - hProcess, wine_dbgstr_longlong(base), debugstr_w(obj), debugstr_w(file), + FIXME("%p %I64x %s %s %lu %lu %p %p: stub!\n", + hProcess, base, debugstr_w(obj), debugstr_w(file), line, flags, EnumLinesCallback, UserContext); SetLastError(ERROR_NOT_SUPPORTED); return FALSE; @@ -323,8 +323,8 @@ BOOL WINAPI SymEnumSourceLinesW(HANDLE hProcess, ULONG64 base, PCWSTR obj, BOOL WINAPI SymGetSourceFileToken(HANDLE hProcess, ULONG64 base, PCSTR src, PVOID* token, DWORD* size) { - FIXME("%p %s %s %p %p: stub!\n", - hProcess, wine_dbgstr_longlong(base), debugstr_a(src), token, size); + FIXME("%p %I64x %s %p %p: stub!\n", + hProcess, base, debugstr_a(src), token, size); SetLastError(ERROR_NOT_SUPPORTED); return FALSE; } @@ -336,8 +336,8 @@ BOOL WINAPI SymGetSourceFileToken(HANDLE hProcess, ULONG64 base, BOOL WINAPI SymGetSourceFileTokenW(HANDLE hProcess, ULONG64 base, PCWSTR src, PVOID* token, DWORD* size) { - FIXME("%p %s %s %p %p: stub!\n", - hProcess, wine_dbgstr_longlong(base), debugstr_w(src), token, size); + FIXME("%p %I64x %s %p %p: stub!\n", + hProcess, base, debugstr_w(src), token, size); SetLastError(ERROR_NOT_SUPPORTED); return FALSE; } diff --git a/dlls/dbghelp/stack.c b/dlls/dbghelp/stack.c index 6c4047376b7..97bd885dcc7 100644 --- a/dlls/dbghelp/stack.c +++ b/dlls/dbghelp/stack.c @@ -55,8 +55,8 @@ static DWORD64 WINAPI addr_to_linear(HANDLE hProcess, HANDLE hThread, ADDRESS64* FIXME("Unsupported (yet) mode (%x)\n", addr->Mode); return 0; } - FIXME("Failed to linearize address %04x:%s (mode %x)\n", - addr->Segment, wine_dbgstr_longlong(addr->Offset), addr->Mode); + FIXME("Failed to linearize address %04x:%I64x (mode %x)\n", + addr->Segment, addr->Offset, addr->Mode); return 0; }
@@ -362,7 +362,7 @@ BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE hProc, PSYMBOL_FUNCENTRY_CALLBACK64 cb, ULONG64 user) { - FIXME("(%p %p %s): stub!\n", hProc, cb, wine_dbgstr_longlong(user)); + FIXME("(%p %p %I64x): stub!\n", hProc, cb, user); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 7d0cc6005f2..a020c0b2a57 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -303,9 +303,8 @@ struct symt_data* symt_new_global_variable(struct module* module, if (type && size && symt_get_info(module, type, TI_GET_LENGTH, &tsz)) { if (tsz != size) - FIXME("Size mismatch for %s.%s between type (%s) and src (%Iu)\n", - debugstr_w(module->modulename), name, - wine_dbgstr_longlong(tsz), size); + FIXME("Size mismatch for %s.%s between type (%I64u) and src (%Iu)\n", + debugstr_w(module->modulename), name, tsz, size); } symt_add_module_ht(module, (struct symt_ht*)sym); p = vector_add(compiland ? &compiland->vchildren : &module->top->vchildren, &module->pool); @@ -887,9 +886,8 @@ static void symt_fill_sym_info(struct module_pair* pair, else symbol_setname(sym_info, name);
- TRACE_(dbghelp_symt)("%p => %s %lu %s\n", - sym, sym_info->Name, sym_info->Size, - wine_dbgstr_longlong(sym_info->Address)); + TRACE_(dbghelp_symt)("%p => %s %lu %I64x\n", + sym, sym_info->Name, sym_info->Size, sym_info->Address); }
struct sym_enum @@ -1414,9 +1412,8 @@ BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask, BOOL ret; PWSTR maskW = NULL;
- TRACE("(%p %s %s %p %p)\n", - hProcess, wine_dbgstr_longlong(BaseOfDll), debugstr_a(Mask), - EnumSymbolsCallback, UserContext); + TRACE("(%p %I64x %s %p %p)\n", + hProcess, BaseOfDll, debugstr_a(Mask), EnumSymbolsCallback, UserContext);
if (Mask) { @@ -2489,10 +2486,9 @@ BOOL WINAPI SymSearch(HANDLE hProcess, ULONG64 BaseOfDll, DWORD Index, LPWSTR maskW = NULL; BOOLEAN ret;
- TRACE("(%p %s %lu %lu %s %s %p %p %lx)\n", - hProcess, wine_dbgstr_longlong(BaseOfDll), Index, SymTag, Mask, - wine_dbgstr_longlong(Address), EnumSymbolsCallback, - UserContext, Options); + TRACE("(%p %I64x %lu %lu %s %I64x %p %p %lx)\n", + hProcess, BaseOfDll, Index, SymTag, Mask, + Address, EnumSymbolsCallback, UserContext, Options);
if (Mask) { @@ -2518,10 +2514,9 @@ BOOL WINAPI SymSearchW(HANDLE hProcess, ULONG64 BaseOfDll, DWORD Index, { struct sym_enumW sew;
- TRACE("(%p %s %lu %lu %s %s %p %p %lx)\n", - hProcess, wine_dbgstr_longlong(BaseOfDll), Index, SymTag, debugstr_w(Mask), - wine_dbgstr_longlong(Address), EnumSymbolsCallback, - UserContext, Options); + TRACE("(%p %I64x %lu %lu %s %I64x %p %p %lx)\n", + hProcess, BaseOfDll, Index, SymTag, debugstr_w(Mask), + Address, EnumSymbolsCallback, UserContext, Options);
sew.ctx = UserContext; sew.cb = EnumSymbolsCallback; @@ -2540,7 +2535,7 @@ BOOL WINAPI SymAddSymbol(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR name, { struct module_pair pair;
- TRACE("(%p %s %s %lu)\n", hProcess, wine_dbgstr_a(name), wine_dbgstr_longlong(addr), size); + TRACE("(%p %s %I64x %lu)\n", hProcess, wine_dbgstr_a(name), addr, size);
if (!module_init_pair(&pair, hProcess, BaseOfDll)) return FALSE;
@@ -2556,7 +2551,7 @@ BOOL WINAPI SymAddSymbolW(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR nameW, { char name[MAX_SYM_NAME];
- TRACE("(%p %s %s %lu)\n", hProcess, wine_dbgstr_w(nameW), wine_dbgstr_longlong(addr), size); + TRACE("(%p %s %I64x %lu)\n", hProcess, wine_dbgstr_w(nameW), addr, size);
WideCharToMultiByte(CP_ACP, 0, nameW, -1, name, ARRAY_SIZE(name), NULL, NULL);
@@ -2663,8 +2658,8 @@ BOOL WINAPI SymGetLineFromNameW64(HANDLE hProcess, PCWSTR ModuleName, PCWSTR Fil */ BOOL WINAPI SymFromIndex(HANDLE hProcess, ULONG64 BaseOfDll, DWORD index, PSYMBOL_INFO symbol) { - FIXME("hProcess = %p, BaseOfDll = %s, index = %ld, symbol = %p\n", - hProcess, wine_dbgstr_longlong(BaseOfDll), index, symbol); + FIXME("hProcess = %p, BaseOfDll = %I64x, index = %ld, symbol = %p\n", + hProcess, BaseOfDll, index, symbol);
return FALSE; } @@ -2675,8 +2670,8 @@ BOOL WINAPI SymFromIndex(HANDLE hProcess, ULONG64 BaseOfDll, DWORD index, PSYMBO */ BOOL WINAPI SymFromIndexW(HANDLE hProcess, ULONG64 BaseOfDll, DWORD index, PSYMBOL_INFOW symbol) { - FIXME("hProcess = %p, BaseOfDll = %s, index = %ld, symbol = %p\n", - hProcess, wine_dbgstr_longlong(BaseOfDll), index, symbol); + FIXME("hProcess = %p, BaseOfDll = %I64x, index = %ld, symbol = %p\n", + hProcess, BaseOfDll, index, symbol);
return FALSE; } diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index cb1c7f7bc0d..a3b9dab0fbb 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -479,9 +479,7 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, DWORD64 size; unsigned int i;
- TRACE("(%p %s %p %p)\n", - hProcess, wine_dbgstr_longlong(BaseOfDll), EnumSymbolsCallback, - UserContext); + TRACE("(%p %I64x %p %p)\n", hProcess, BaseOfDll, EnumSymbolsCallback, UserContext);
if (!module_init_pair(&pair, hProcess, BaseOfDll)) return FALSE;
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/dbghelp/type.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index a3b9dab0fbb..b39cd86248a 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -983,6 +983,8 @@ BOOL symt_get_info(struct module* module, const struct symt* type, case SymTagLabel: case SymTagInlineSite: case SymTagCustom: + case SymTagPublicSymbol: + case SymTagThunk: return FALSE; } break;
From: Eric Pouech eric.pouech@gmail.com
Partly reverting 99eb63bd7a41b87d472bb622a5faf24d1fcd91c5 (it's still needed on Dwarf for blocks with multiple non-contiguous address ranges).
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/dbghelp/dwarf.c | 6 +++++- dlls/dbghelp/symbol.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index af703c90f9e..92229552929 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2970,7 +2970,7 @@ static BOOL dwarf2_parse_compilation_unit(dwarf2_parse_context_t* ctx) struct vector* children; dwarf2_debug_info_t* child = NULL; unsigned int i; - struct attribute stmt_list; + struct attribute stmt_list, low_pc; struct attribute comp_dir; struct attribute language;
@@ -2981,6 +2981,9 @@ static BOOL dwarf2_parse_compilation_unit(dwarf2_parse_context_t* ctx) if (!dwarf2_find_attribute(di, DW_AT_comp_dir, &comp_dir)) comp_dir.u.string = NULL;
+ if (!dwarf2_find_attribute(di, DW_AT_low_pc, &low_pc)) + low_pc.u.uvalue = 0; + if (!dwarf2_find_attribute(di, DW_AT_language, &language)) language.u.uvalue = DW_LANG_C;
@@ -2988,6 +2991,7 @@ static BOOL dwarf2_parse_compilation_unit(dwarf2_parse_context_t* ctx)
ctx->compiland = symt_new_compiland(ctx->module_ctx->module, source_new(ctx->module_ctx->module, comp_dir.u.string, name.u.string)); + ctx->compiland->address = ctx->module_ctx->load_offset + low_pc.u.uvalue; dwarf2_cache_cuhead(ctx->module_ctx->module->format_info[DFI_DWARF]->u.dwarf2_info, ctx->compiland, &ctx->head); di->symt = &ctx->compiland->symt; children = dwarf2_get_di_children(di); diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index a020c0b2a57..98e25a32b30 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -239,6 +239,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, unsigned src_id { sym->symt.tag = SymTagCompiland; sym->container = module->top; + sym->address = 0; sym->source = src_idx; vector_init(&sym->vchildren, sizeof(struct symt*), 32); sym->user = NULL;
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/dbghelp/dbghelp_private.h | 4 ++-- dlls/dbghelp/dwarf.c | 4 +--- dlls/dbghelp/msc.c | 2 +- dlls/dbghelp/stabs.c | 6 ++++-- dlls/dbghelp/symbol.c | 7 +++---- 5 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index fd887718d8c..b6a7df10061 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -862,9 +862,9 @@ extern struct symt_block* struct symt_block* block, unsigned pc, unsigned len) DECLSPEC_HIDDEN; extern struct symt_block* - symt_close_func_block(struct module* module, + symt_close_func_block(struct module* module, const struct symt_function* func, - struct symt_block* block, unsigned pc) DECLSPEC_HIDDEN; + struct symt_block* block) DECLSPEC_HIDDEN; extern struct symt_hierarchy_point* symt_add_function_point(struct module* module, struct symt_function* func, diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 92229552929..8c57c211db4 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2312,9 +2312,7 @@ static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, } }
- symt_close_func_block(subpgm->ctx->module_ctx->module, subpgm->current_func, subpgm->current_block, 0); - subpgm->current_block = symt_check_tag(subpgm->current_block->container, SymTagBlock) ? - (struct symt_block*)subpgm->current_block->container : NULL; + subpgm->current_block = symt_close_func_block(subpgm->ctx->module_ctx->module, subpgm->current_func, subpgm->current_block); }
static struct symt* dwarf2_parse_subprogram(dwarf2_debug_info_t* di) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 0109e4dd255..94f0c6af9ee 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2472,7 +2472,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, case S_END: if (block) { - block = symt_close_func_block(msc_dbg->module, curr_func, block, 0); + block = symt_close_func_block(msc_dbg->module, curr_func, block); } else if (top_func) { diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index badb07e3b5c..e1945b41d66 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -1381,8 +1381,10 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, break; case N_RBRAC: if (curr_func) - block = symt_close_func_block(module, curr_func, block, - n_value); + { + block->size = curr_func->address + n_value - block->address; + block = symt_close_func_block(module, curr_func, block); + } break; case N_PSYM: /* These are function parameters. */ diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 98e25a32b30..9d248630393 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -549,14 +549,13 @@ struct symt_block* symt_open_func_block(struct module* module, return block; }
-struct symt_block* symt_close_func_block(struct module* module, +struct symt_block* symt_close_func_block(struct module* module, const struct symt_function* func, - struct symt_block* block, unsigned pc) + struct symt_block* block) { assert(symt_check_tag(&func->symt, SymTagFunction) || symt_check_tag(&func->symt, SymTagInlineSite));
- if (pc) block->size = func->address + pc - block->address; - return (block->container->tag == SymTagBlock) ? + return (block->container->tag == SymTagBlock) ? CONTAINING_RECORD(block->container, struct symt_block, symt) : NULL; }
Just read the cpu_arm* parts, looks good.
This merge request was approved by André Zwing.