This MR contains a couple of changes linked to debugging issues when loading PDB C++ information. It contains: - protection of most of a bunch of strings against Wine internal trace buffer overflow (C++ symbol and type names can be very long) - a couple of additional TRACE - a couple of fixed for typos
From: Eric Pouech epouech@codeweavers.com
This can be impacting with C++ type or symbol names (mangled or not).
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/dwarf.c | 12 ++++----- dlls/dbghelp/elf_module.c | 20 +++++++------- dlls/dbghelp/image.c | 2 +- dlls/dbghelp/macho_module.c | 12 ++++----- dlls/dbghelp/module.c | 11 ++++---- dlls/dbghelp/msc.c | 31 +++++++++++---------- dlls/dbghelp/pe_module.c | 2 +- dlls/dbghelp/stabs.c | 8 +++--- dlls/dbghelp/storage.c | 2 +- dlls/dbghelp/symbol.c | 54 ++++++++++++++++++------------------- dlls/dbghelp/type.c | 14 +++++----- 11 files changed, 87 insertions(+), 81 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 34c924f3cda..84e861890d5 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -1197,7 +1197,7 @@ static const char* dwarf2_get_cpp_name(dwarf2_debug_info_t* di, const char* name last -= 2 + len; if (last < di->unit_ctx->cpp_name) { - WARN("Too long C++ qualified identifier for %s... using unqualified identifier\n", name); + WARN("Too long C++ qualified identifier for %s... using unqualified identifier\n", debugstr_a(name)); return name; } memcpy(last, diname.u.string, len); @@ -1533,7 +1533,7 @@ static struct symt* dwarf2_parse_subrange_type(dwarf2_debug_info_t* di)
TRACE("%s\n", dwarf2_debug_di(di));
- if (dwarf2_find_attribute(di, DW_AT_name, &name)) FIXME("Found name for subrange %s\n", name.u.string); + if (dwarf2_find_attribute(di, DW_AT_name, &name)) FIXME("Found name for subrange %s\n", debugstr_a(name.u.string)); if (dwarf2_find_attribute(di, DW_AT_byte_size, &dummy)) FIXME("Found byte_size %Iu\n", dummy.u.uvalue); if (dwarf2_find_attribute(di, DW_AT_bit_size, &dummy)) FIXME("Found bit_size %Iu\n", dummy.u.uvalue); /* for now, we don't support the byte_size nor bit_size about the subrange, and pretend the two @@ -1719,7 +1719,7 @@ static void dwarf2_parse_udt_member(dwarf2_debug_info_t* di, if (loc.kind != loc_absolute) { FIXME("Unexpected offset computation for member %s in %ls!%s\n", - name.u.string, di->unit_ctx->module_ctx->module->modulename, parent->hash_elt.name); + debugstr_a(name.u.string), di->unit_ctx->module_ctx->module->modulename, debugstr_a(parent->hash_elt.name)); loc.offset = 0; } else @@ -2047,7 +2047,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm, if (subpgm->current_func) { if (is_pmt) WARN("Constant parameter %s reported as local variable in function '%s'\n", - debugstr_a(name.u.string), subpgm->current_func->hash_elt.name); + debugstr_a(name.u.string), debugstr_a(subpgm->current_func->hash_elt.name)); di->symt = &symt_add_func_constant(subpgm->ctx->module_ctx->module, subpgm->current_func, subpgm->current_block, param_type, name.u.string, &v)->symt; @@ -2104,7 +2104,7 @@ static void dwarf2_parse_subprogram_label(dwarf2_subprogram_t* subpgm, } else WARN("Label %s inside function %s doesn't have an address... don't register it\n", - name.u.string, subpgm->top_func->hash_elt.name); + debugstr_a(name.u.string), debugstr_a(subpgm->top_func->hash_elt.name)); }
static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, @@ -2360,7 +2360,7 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_debug_info_t* di) dwarf2_get_cpp_name(di, name.u.string), addr_ranges[0].low, addr_ranges[0].high - addr_ranges[0].low, &sig_type->symt); if (num_addr_ranges > 1) - WARN("Function %s has multiple address ranges, only using the first one\n", name.u.string); + WARN("Function %s has multiple address ranges, only using the first one\n", debugstr_a(name.u.string)); free(addr_ranges);
subpgm.current_func = subpgm.top_func; diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 00e69d290e2..da4486a00c8 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -804,9 +804,11 @@ static const struct elf_sym *elf_lookup_symtab(const struct module* module, if (result) { FIXME("Already found symbol %s (%s) in symtab %s @%08x and %s @%08x\n", - name, compiland_name, - source_get(module, result->compiland->source), (unsigned int)result->sym.st_value, - source_get(module, ste->compiland->source), (unsigned int)ste->sym.st_value); + debugstr_a(name), debugstr_a(compiland_name), + debugstr_a(source_get(module, result->compiland->source)), + (unsigned int)result->sym.st_value, + debugstr_a(source_get(module, ste->compiland->source)), + (unsigned int)ste->sym.st_value); } else { @@ -817,7 +819,7 @@ static const struct elf_sym *elf_lookup_symtab(const struct module* module, if (!result && !(result = weak_result)) { FIXME("Couldn't find symbol %s!%s in symtab\n", - debugstr_w(module->modulename), name); + debugstr_w(module->modulename), debugstr_a(name)); return NULL; } return &result->sym; @@ -862,19 +864,19 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table if (((struct symt_function*)sym)->ranges[0].low != elf_info->elf_addr && ((struct symt_function*)sym)->ranges[0].low != elf_info->elf_addr + symp->st_value) FIXME("Changing address for %p/%s!%s from %I64x to %I64x\n", - sym, debugstr_w(module->modulename), sym->hash_elt.name, + sym, debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name), ((struct symt_function*)sym)->ranges[0].low, elf_info->elf_addr + symp->st_value); if (size && size != symp->st_size) FIXME("Changing size for %p/%s!%s from %I64x to %I64x\n", - sym, debugstr_w(module->modulename), sym->hash_elt.name, + sym, debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name), size, symp->st_size);
((struct symt_function*)sym)->ranges[0].low = elf_info->elf_addr + symp->st_value; ((struct symt_function*)sym)->ranges[0].high = elf_info->elf_addr + symp->st_value + symp->st_size; } else FIXME("Couldn't find %s!%s\n", - debugstr_w(module->modulename), sym->hash_elt.name); + debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name)); break; case SymTagData: switch (((struct symt_data*)sym)->kind) @@ -891,7 +893,7 @@ 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 %I64x to %I64x\n", - sym, debugstr_w(module->modulename), sym->hash_elt.name, + sym, debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name), ((struct symt_function*)sym)->ranges[0].low, elf_info->elf_addr + symp->st_value); ((struct symt_data*)sym)->u.var.offset = elf_info->elf_addr + symp->st_value; @@ -899,7 +901,7 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table DataIsFileStatic : DataIsGlobal; } else FIXME("Couldn't find %s!%s\n", - debugstr_w(module->modulename), sym->hash_elt.name); + debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name)); break; default:; } diff --git a/dlls/dbghelp/image.c b/dlls/dbghelp/image.c index a9c83849311..4ba71ebf912 100644 --- a/dlls/dbghelp/image.c +++ b/dlls/dbghelp/image.c @@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE FileHandle, PCSTR FileName, PCSTR SymbolPath, ULONG ImageBase) { - FIXME("(%p, %s, %s, 0x%08lx): stub\n", FileHandle, FileName, SymbolPath, ImageBase); + FIXME("(%p, %s, %s, 0x%08lx): stub\n", FileHandle, debugstr_a(FileName), debugstr_a(SymbolPath), ImageBase); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return NULL; } diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index a2f32b5ed4c..b1f457d122d 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -679,7 +679,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct mach else if (!strncmp(segname, "__PAGEZERO", 10)) TRACE("Ignoring __PAGEZERO segment\n"); else if (ignore) - TRACE("Ignoring %s segment because image has split segments\n", segname); + TRACE("Ignoring %s segment because image has split segments\n", debugstr_a(segname)); else { /* If this segment starts before previously-known earliest, record new earliest. */ @@ -1082,7 +1082,7 @@ static void macho_finish_stabs(struct module* module, struct hash_table* ht_symt if (func->ranges[0].low == module->format_info[DFI_MACHO]->u.macho_info->load_addr) { TRACE("Adjusting function %p/%s!%s from %#I64x to %#Ix\n", func, - debugstr_w(module->modulename), sym->hash_elt.name, + debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name), func->ranges[0].low, ste->addr); func->ranges[0].high += ste->addr - func->ranges[0].low; func->ranges[0].low = ste->addr; @@ -1100,7 +1100,7 @@ static void macho_finish_stabs(struct module* module, struct hash_table* ht_symt if (data->u.var.offset == module->format_info[DFI_MACHO]->u.macho_info->load_addr) { TRACE("Adjusting data symbol %p/%s!%s from 0x%08Ix to 0x%08Ix\n", - data, debugstr_w(module->modulename), sym->hash_elt.name, + data, debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name), data->u.var.offset, ste->addr); data->u.var.offset = ste->addr; adjusted = TRUE; @@ -1113,7 +1113,7 @@ static void macho_finish_stabs(struct module* module, struct hash_table* ht_symt if (data->kind != new_kind) { WARN("Changing kind for %p/%s!%s from %d to %d\n", sym, - debugstr_w(module->modulename), sym->hash_elt.name, + debugstr_w(module->modulename), debugstr_a(sym->hash_elt.name), (int)data->kind, (int)new_kind); data->kind = new_kind; adjusted = TRUE; @@ -1173,8 +1173,8 @@ static void macho_finish_stabs(struct module* module, struct hash_table* ht_symt if (size && kind == (ste->is_global ? DataIsGlobal : DataIsFileStatic)) FIXME("Duplicate in %s: %s<%08Ix> %s<%I64x-%I64x>\n", debugstr_w(module->modulename), - ste->ht_elt.name, ste->addr, - sym->hash_elt.name, + debugstr_a(ste->ht_elt.name), ste->addr, + debugstr_a(sym->hash_elt.name), addr, size); } } diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index d06c4417be6..0ade470961b 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -555,7 +555,7 @@ static BOOL image_check_debug_link_gnu_id(const WCHAR* file, struct image_file_m { if (note[1] == idlen && !memcmp(note + 3 + ((note[0] + 3) >> 2), id, idlen)) return TRUE; - WARN("mismatch in buildid information for %s\n", wine_dbgstr_w(file)); + WARN("mismatch in buildid information for %s\n", debugstr_w(file)); } } image_unmap_section(&buildid_sect); @@ -640,13 +640,13 @@ static struct image_file_map* image_locate_debug_link(const struct module* modul if (image_check_debug_link_crc(slash, fmap_link, crc)) goto found;
- WARN("Couldn't locate or map %s\n", filename); + WARN("Couldn't locate or map %s\n", debugstr_a(filename)); HeapFree(GetProcessHeap(), 0, p); HeapFree(GetProcessHeap(), 0, fmap_link); return NULL;
found: - TRACE("Located debug information file %s at %s\n", filename, debugstr_w(p)); + TRACE("Located debug information file %s at %s\n", debugstr_a(filename), debugstr_w(p)); HeapFree(GetProcessHeap(), 0, p); return fmap_link; } @@ -692,7 +692,7 @@ static struct image_file_map* image_locate_build_id_target(const BYTE* id, unsig } } wcscpy(z, L".debug"); - TRACE("checking %s\n", wine_dbgstr_w(p)); + TRACE("checking %s\n", debugstr_w(p));
if (image_check_debug_link_gnu_id(p, fmap_link, id, idlen)) { @@ -813,7 +813,8 @@ struct image_file_map* image_load_debugaltlink(struct image_file_map* fmap, stru HeapFree(GetProcessHeap(), 0, fmap_link); /* didn't work out with filename, try file lookup based on build-id */ if (!(fmap_link = image_locate_build_id_target(id, idlen))) - WARN("Couldn't find a match for .gnu_debugaltlink section %s for %s\n", data, debugstr_w(module->modulename)); + WARN("Couldn't find a match for .gnu_debugaltlink section %s for %s\n", + debugstr_a(data), debugstr_w(module->modulename)); } } } diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 22e88e5e7db..41bfcf95957 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -823,12 +823,13 @@ static BOOL codeview_resolve_forward_type(struct codeview_type_parse* ctp, const ((decoratedref && decorateddecl && !strcmp(decoratedref, decorateddecl)) || (!decoratedref && !decorateddecl && lenref == lendecl && !memcmp(nameref, namedecl, lenref)))) { - TRACE("mapping forward type %.*s (%s) %x into %x\n", lenref, nameref, debugstr_a(decoratedref), reftype, hl->id); + TRACE("mapping forward type %s (%s) %x into %x\n", debugstr_an(nameref, lenref), debugstr_a(decoratedref), reftype, hl->id); *impl_type = hl->id; return TRUE; } } } + WARN("Couldn't resolve forward declaration for %s\n", debugstr_an(nameref, lenref)); return FALSE; }
@@ -2242,8 +2243,8 @@ static struct symt_function* codeview_create_inline_site(const struct msc_debug_ { struct addr_range* range = &inlined->ranges[inlined->num_ranges - 1]; if (range->low == range->high) WARN("pending empty range at end of %s inside %s\n", - inlined->hash_elt.name, - top_func->hash_elt.name); + debugstr_a(inlined->hash_elt.name), + debugstr_a(top_func->hash_elt.name)); } return inlined; } @@ -2532,18 +2533,20 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, break;
case S_COMPILE2: - TRACE("S-Compile-V3 machine:%x language:%x %s\n", sym->compile2_v3.machine, sym->compile2_v3.flags.iLanguage, sym->compile2_v3.name); + TRACE("S-Compile-V3 machine:%x language:%x %s\n", + sym->compile2_v3.machine, sym->compile2_v3.flags.iLanguage, debugstr_a(sym->compile2_v3.name)); break;
case S_COMPILE3: - TRACE("S-Compile3-V3 machine:%x language:%x %s\n", sym->compile3_v3.machine, sym->compile3_v3.flags.iLanguage, sym->compile3_v3.name); + TRACE("S-Compile3-V3 machine:%x language:%x %s\n", + sym->compile3_v3.machine, sym->compile3_v3.flags.iLanguage, debugstr_a(sym->compile3_v3.name)); break;
case S_ENVBLOCK: break;
case S_OBJNAME: - TRACE("S-ObjName-V3 %s\n", sym->objname_v3.name); + TRACE("S-ObjName-V3 %s\n", debugstr_a(sym->objname_v3.name)); if (!compiland) compiland = codeview_new_compiland(msc_dbg, sym->objname_v3.name); break; @@ -2621,7 +2624,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, name = (const char*)&sym->constant_v3.data[vlen]; se = codeview_get_type(sym->constant_v3.type, FALSE);
- TRACE("S-Constant-V3 %u %s %x\n", V_INT(&v), name, sym->constant_v3.type); + TRACE("S-Constant-V3 %u %s %x\n", V_INT(&v), debugstr_a(name), sym->constant_v3.type); /* FIXME: we should add this as a constant value */ symt_new_constant(msc_dbg->module, compiland, name, se, &v); } @@ -2656,7 +2659,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, symt_new_typedef(msc_dbg->module, symt, sym->udt_v3.name); else FIXME("S-Udt %s: couldn't find type 0x%x\n", - sym->udt_v3.name, sym->udt_v3.type); + debugstr_a(sym->udt_v3.name), sym->udt_v3.type); } break; case S_LOCAL: @@ -2773,7 +2776,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, sym->sepcode_v3.sectParent, sym->sepcode_v3.offParent); } else - FIXME("S_SEPCODE inside top-level function %s\n", top_func->hash_elt.name); + FIXME("S_SEPCODE inside top-level function %s\n", debugstr_a(top_func->hash_elt.name)); break;
case S_FRAMEPROC: @@ -2957,7 +2960,7 @@ static BOOL pdb_global_feed_types(const struct msc_debug_info* msc_dbg, const un symt_new_typedef(msc_dbg->module, symt, sym->udt_v3.name); else FIXME("S-Udt %s: couldn't find type 0x%x\n", - sym->udt_v3.name, sym->udt_v3.type); + debugstr_a(sym->udt_v3.name), sym->udt_v3.type); } break; default: return FALSE; @@ -3713,7 +3716,7 @@ static void pdb_process_symbol_imports(const struct process *pcs, ptr = (const char*)imp + sizeof(*imp) + strlen(imp->filename); if (i >= CV_MAX_MODULES) FIXME("Out of bounds!!!\n"); TRACE("got for %s: age=%u ts=%x\n", - imp->filename, imp->Age, imp->TimeDateStamp); + debugstr_a(imp->filename), imp->Age, imp->TimeDateStamp); if (path_find_symbol_file(pcs, msc_dbg->module, imp->filename, TRUE, NULL, imp->TimeDateStamp, imp->Age, &info, &msc_dbg->module->module.PdbUnmatched)) pdb_process_internal(pcs, msc_dbg, info.pdbfile, pdb_module_info, i); @@ -4214,7 +4217,7 @@ static BOOL pdb_parse_cmd_string(struct cpu_stack_walk* csw, PDB_FPO_DATA* fpoe pev_free(&pev, cpair); return TRUE; done: - FIXME("Couldn't evaluate %s => %s\n", wine_dbgstr_a(cmd), pev.error); + FIXME("Couldn't evaluate %s => %s\n", debugstr_a(cmd), pev.error); pev_free(&pev, NULL); return FALSE; } @@ -4250,7 +4253,7 @@ BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip, fpoext[i].start, fpoext[i].func_size, fpoext[i].locals_size, fpoext[i].params_size, fpoext[i].maxstack_size, fpoext[i].prolog_size, fpoext[i].savedregs_size, fpoext[i].flags, - wine_dbgstr_a(pdb_get_string_table_entry(strbase, fpoext[i].str_offset))); + debugstr_a(pdb_get_string_table_entry(strbase, fpoext[i].str_offset))); ret = pdb_parse_cmd_string(csw, &fpoext[i], pdb_get_string_table_entry(strbase, fpoext[i].str_offset), cpair); @@ -4375,7 +4378,7 @@ static BOOL codeview_process_info(const struct process *pcs, const OMFSignatureRSDS* rsds = (const OMFSignatureRSDS*)msc_dbg->root;
TRACE("Got RSDS type of PDB file: guid=%s age=%08x name=%s\n", - wine_dbgstr_guid(&rsds->guid), rsds->age, rsds->name); + wine_dbgstr_guid(&rsds->guid), rsds->age, debugstr_a(rsds->name)); ret = pdb_process_file(pcs, msc_dbg, rsds->name, &rsds->guid, 0, rsds->age); break; } diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index ebb4cf38db3..8071b8987e3 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -441,7 +441,7 @@ static BOOL pe_locate_with_coff_symbol_table(struct module* module) !strcmp(sym->hash_elt.name, name)) { TRACE("Changing absolute address for %d.%s: %Ix -> %I64x\n", - isym->SectionNumber, name, sym->u.var.offset, + isym->SectionNumber, debugstr_a(name), sym->u.var.offset, module->module.BaseOfImage + fmap->u.pe.sect[isym->SectionNumber - 1].shdr.VirtualAddress + isym->Value); diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index 20d5623f391..2f3ee9fff4e 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -859,7 +859,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ if (udt->symt.tag != SymTagUDT) { ERR("Forward declaration (%p/%s) is not an aggregate (%u)\n", - udt, symt_get_name(&udt->symt), udt->symt.tag); + udt, debugstr_a(symt_get_name(&udt->symt)), udt->symt.tag); return -1; } /* FIXME: we currently don't correctly construct nested C++ @@ -876,7 +876,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ l2 = strlen(typename); if (l1 > l2 || strcmp(udt->hash_elt.name, typename + l2 - l1)) ERR("Forward declaration name mismatch %s <> %s\n", - udt->hash_elt.name, typename); + debugstr_a(udt->hash_elt.name), debugstr_a(typename)); new_dt = &udt->symt; } PTS_ABORTIF(ptd, stabs_pts_read_aggregate(ptd, udt) == -1); @@ -1597,7 +1597,7 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, /* I'm not sure this is needed, so trace it before we obsolete it */ if (curr_func) { - FIXME("UNDF: curr_func %s\n", curr_func->hash_elt.name); + FIXME("UNDF: curr_func %s\n", debugstr_a(curr_func->hash_elt.name)); stabs_finalize_function(module, curr_func, 0); /* FIXME */ curr_func = NULL; } @@ -1618,7 +1618,7 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, case N_EXCL: if (stabs_add_include(stabs_find_include(ptr, n_value)) < 0) { - ERR("Excluded header not found (%s,%Id)\n", ptr, (ULONG_PTR)n_value); + ERR("Excluded header not found (%s,%Id)\n", debugstr_a(ptr), (ULONG_PTR)n_value); module_reset_debug_info(module); ret = FALSE; goto done; diff --git a/dlls/dbghelp/storage.c b/dlls/dbghelp/storage.c index 038b625cf1c..f7c08adab8a 100644 --- a/dlls/dbghelp/storage.c +++ b/dlls/dbghelp/storage.c @@ -292,7 +292,7 @@ void hash_table_destroy(struct hash_table* ht) { FIXME("Longest bucket:\n"); for (elt = ht->buckets[i]; elt; elt = elt->next) - FIXME("\t%s\n", elt->name); + FIXME("\t%s\n", debugstr_a(elt->name)); break; }
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 8ddbc0b1f24..c48d9df24cb 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -237,7 +237,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, unsigned src_id struct symt_compiland** p;
TRACE_(dbghelp_symt)("Adding compiland symbol %s:%s\n", - debugstr_w(module->modulename), source_get(module, src_idx)); + debugstr_w(module->modulename), debugstr_a(source_get(module, src_idx))); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { sym->symt.tag = SymTagCompiland; @@ -262,7 +262,7 @@ struct symt_public* symt_new_public(struct module* module, struct symt** p;
TRACE_(dbghelp_symt)("Adding public symbol %s:%s @%Ix\n", - debugstr_w(module->modulename), name, address); + debugstr_w(module->modulename), debugstr_a(name), address); if ((dbghelp_options & SYMOPT_AUTO_PUBLICS) && symt_find_nearest(module, address) != NULL) return NULL; @@ -295,7 +295,7 @@ struct symt_data* symt_new_global_variable(struct module* module, DWORD64 tsz;
TRACE_(dbghelp_symt)("Adding global symbol %s:%s %d@%Ix %p\n", - debugstr_w(module->modulename), name, loc.kind, loc.offset, type); + debugstr_w(module->modulename), debugstr_a(name), loc.kind, loc.offset, type); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { sym->symt.tag = SymTagData; @@ -308,7 +308,7 @@ struct symt_data* symt_new_global_variable(struct module* module, { if (tsz != size) FIXME("Size mismatch for %s.%s between type (%I64u) and src (%Iu)\n", - debugstr_w(module->modulename), name, tsz, size); + debugstr_w(module->modulename), debugstr_a(name), tsz, size); } symt_add_module_ht(module, (struct symt_ht*)sym); p = vector_add(compiland ? &compiland->vchildren : &module->top->vchildren, &module->pool); @@ -349,7 +349,7 @@ struct symt_function* symt_new_function(struct module* module, struct symt_function* sym;
TRACE_(dbghelp_symt)("Adding global function %s:%s @%Ix-%Ix\n", - debugstr_w(module->modulename), name, addr, addr + size - 1); + debugstr_w(module->modulename), debugstr_a(name), addr, addr + size - 1); if ((sym = init_function_or_inlinesite(module, SymTagFunction, &compiland->symt, name, sig_type, 1))) { struct symt** p; @@ -375,7 +375,7 @@ struct symt_function* symt_new_inlinesite(struct module* module, { struct symt_function* sym;
- TRACE_(dbghelp_symt)("Adding inline site %s\n", name); + TRACE_(dbghelp_symt)("Adding inline site %s\n", debugstr_a(name)); if ((sym = init_function_or_inlinesite(module, SymTagInlineSite, container, name, sig_type, num_ranges))) { struct symt** p; @@ -408,8 +408,8 @@ void symt_add_func_line(struct module* module, struct symt_function* func, if (func == NULL || !(dbghelp_options & SYMOPT_LOAD_LINES)) return;
TRACE_(dbghelp_symt)("(%p)%s:%Ix %s:%u\n", - func, func->hash_elt.name, addr, - source_get(module, source_idx), line_num); + func, debugstr_a(func->hash_elt.name), addr, + debugstr_a(source_get(module, source_idx)), line_num);
assert(func->symt.tag == SymTagFunction || func->symt.tag == SymTagInlineSite);
@@ -426,7 +426,7 @@ void symt_add_func_line(struct module* module, struct symt_function* func, prev = vlen ? vector_at(&func->vlines, vlen - 1) : NULL; if (last_matches && prev && addr == prev->u.address) { - WARN("Duplicate addition of line number in %s\n", func->hash_elt.name); + WARN("Duplicate addition of line number in %s\n", debugstr_a(func->hash_elt.name)); return; } if (!last_matches) @@ -472,8 +472,8 @@ struct symt_data* symt_add_func_local(struct module* module, struct symt** p;
TRACE_(dbghelp_symt)("Adding local symbol (%s:%s): %s %p\n", - debugstr_w(module->modulename), func->hash_elt.name, - name, type); + debugstr_w(module->modulename), debugstr_a(func->hash_elt.name), + debugstr_a(name), type);
assert(symt_check_tag(&func->symt, SymTagFunction) || symt_check_tag(&func->symt, SymTagInlineSite)); assert(dt == DataIsParam || dt == DataIsLocal || dt == DataIsStaticLocal); @@ -511,8 +511,8 @@ struct symt_data* symt_add_func_constant(struct module* module, struct symt** p;
TRACE_(dbghelp_symt)("Adding local constant (%s:%s): %s %p\n", - debugstr_w(module->modulename), func->hash_elt.name, - name, type); + debugstr_w(module->modulename), debugstr_a(func->hash_elt.name), + debugstr_a(name), type);
assert(symt_check_tag(&func->symt, SymTagFunction) || symt_check_tag(&func->symt, SymTagInlineSite));
@@ -597,7 +597,7 @@ struct symt_thunk* symt_new_thunk(struct module* module, struct symt_thunk* sym;
TRACE_(dbghelp_symt)("Adding global thunk %s:%s @%Ix-%Ix\n", - debugstr_w(module->modulename), name, addr, addr + size - 1); + debugstr_w(module->modulename), debugstr_a(name), addr, addr + size - 1);
if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { @@ -626,7 +626,7 @@ struct symt_data* symt_new_constant(struct module* module, struct symt_data* sym;
TRACE_(dbghelp_symt)("Adding constant value %s:%s\n", - debugstr_w(module->modulename), name); + debugstr_w(module->modulename), debugstr_a(name));
if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { @@ -654,7 +654,7 @@ struct symt_hierarchy_point* symt_new_label(struct module* module, struct symt_hierarchy_point* sym;
TRACE_(dbghelp_symt)("Adding global label value %s:%s\n", - debugstr_w(module->modulename), name); + debugstr_w(module->modulename), debugstr_a(name));
if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { @@ -680,7 +680,7 @@ struct symt_custom* symt_new_custom(struct module* module, const char* name, struct symt_custom* sym;
TRACE_(dbghelp_symt)("Adding custom symbol %s:%s\n", - debugstr_w(module->modulename), name); + debugstr_w(module->modulename), debugstr_a(name));
if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { @@ -860,7 +860,7 @@ static void symt_fill_sym_info(struct module_pair* pair, symbol_setname(sym_info, name);
TRACE_(dbghelp_symt)("%p => %s %lu %I64x\n", - sym, sym_info->Name, sym_info->Size, sym_info->Address); + sym, debugstr_a(sym_info->Name), sym_info->Size, sym_info->Address); }
struct sym_enum @@ -1608,7 +1608,7 @@ BOOL WINAPI SymFromName(HANDLE hProcess, PCSTR Name, PSYMBOL_INFO Symbol) struct module* module; const char* name;
- TRACE("(%p, %s, %p)\n", hProcess, Name, Symbol); + TRACE("(%p, %s, %p)\n", hProcess, debugstr_a(Name), Symbol); if (!pcs) return FALSE; if (Symbol->SizeOfStruct < sizeof(*Symbol)) return FALSE; name = strchr(Name, '!'); @@ -2375,7 +2375,7 @@ BOOL WINAPI SymMatchStringA(PCSTR string, PCSTR re, BOOL _case) SetLastError(ERROR_INVALID_HANDLE); return FALSE; } - TRACE("%s %s %c\n", string, re, _case ? 'Y' : 'N'); + TRACE("%s %s %c\n", debugstr_a(string), debugstr_a(re), _case ? 'Y' : 'N');
sz = MultiByteToWideChar(CP_ACP, 0, string, -1, NULL, 0); if ((strW = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR)))) @@ -2443,7 +2443,7 @@ BOOL WINAPI SymSearch(HANDLE hProcess, ULONG64 BaseOfDll, DWORD Index, BOOLEAN ret;
TRACE("(%p %I64x %lu %lu %s %I64x %p %p %lx)\n", - hProcess, BaseOfDll, Index, SymTag, Mask, + hProcess, BaseOfDll, Index, SymTag, debugstr_a(Mask), Address, EnumSymbolsCallback, UserContext, Options);
if (Mask) @@ -2491,7 +2491,7 @@ BOOL WINAPI SymAddSymbol(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR name, { struct module_pair pair;
- TRACE("(%p %s %I64x %lu)\n", hProcess, wine_dbgstr_a(name), addr, size); + TRACE("(%p %s %I64x %lu)\n", hProcess, debugstr_a(name), addr, size);
if (!module_init_pair(&pair, hProcess, BaseOfDll)) return FALSE;
@@ -2507,7 +2507,7 @@ BOOL WINAPI SymAddSymbolW(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR nameW, { char name[MAX_SYM_NAME];
- TRACE("(%p %s %I64x %lu)\n", hProcess, wine_dbgstr_w(nameW), addr, size); + TRACE("(%p %s %I64x %lu)\n", hProcess, debugstr_w(nameW), addr, size);
WideCharToMultiByte(CP_ACP, 0, nameW, -1, name, ARRAY_SIZE(name), NULL, NULL);
@@ -2534,7 +2534,7 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland, if (!(dbghelp_options & SYMOPT_LOAD_LINES)) return TRUE;
if (!module_init_pair(&pair, hProcess, base)) return FALSE; - if (compiland) FIXME("Unsupported yet (filtering on compiland %s)\n", compiland); + if (compiland) FIXME("Unsupported yet (filtering on compiland %s)\n", debugstr_a(compiland)); if (!(srcmask = file_regex(srcfile))) return FALSE;
sci.SizeOfStruct = sizeof(sci); @@ -2587,7 +2587,7 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland, BOOL WINAPI SymGetLineFromName(HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG plDisplacement, PIMAGEHLP_LINE Line) { - FIXME("(%p) (%s, %s, %ld %p %p): stub\n", hProcess, ModuleName, FileName, + FIXME("(%p) (%s, %s, %ld %p %p): stub\n", hProcess, debugstr_a(ModuleName), debugstr_a(FileName), dwLineNumber, plDisplacement, Line); return FALSE; } @@ -2595,7 +2595,7 @@ BOOL WINAPI SymGetLineFromName(HANDLE hProcess, PCSTR ModuleName, PCSTR FileName BOOL WINAPI SymGetLineFromName64(HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG lpDisplacement, PIMAGEHLP_LINE64 Line) { - FIXME("(%p) (%s, %s, %ld %p %p): stub\n", hProcess, ModuleName, FileName, + FIXME("(%p) (%s, %s, %ld %p %p): stub\n", hProcess, debugstr_a(ModuleName), debugstr_a(FileName), dwLineNumber, lpDisplacement, Line); return FALSE; } @@ -2655,7 +2655,7 @@ BOOL WINAPI SymFromIndexW(HANDLE hProcess, ULONG64 BaseOfDll, DWORD index, PSYMB */ PCHAR WINAPI SymSetHomeDirectory(HANDLE hProcess, PCSTR dir) { - FIXME("(%p, %s): stub\n", hProcess, dir); + FIXME("(%p, %s): stub\n", hProcess, debugstr_a(dir));
return NULL; } diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 703555a1ba0..b89c63c5b3d 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -249,7 +249,7 @@ struct symt_udt* symt_new_udt(struct module* module, const char* typename, struct symt_udt* sym;
TRACE_(dbghelp_symt)("Adding udt %s:%s\n", - debugstr_w(module->modulename), typename); + debugstr_w(module->modulename), debugstr_a(typename)); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { sym->symt.tag = SymTagUDT; @@ -272,8 +272,8 @@ BOOL symt_set_udt_size(struct module* module, struct symt_udt* udt, unsigned siz if (vector_length(&udt->vchildren) != 0) { if (udt->size != size) - FIXME_(dbghelp_symt)("Changing size for %s from %u to %u\n", - udt->hash_elt.name, udt->size, size); + FIXME_(dbghelp_symt)("Changing size for %s from %u to %u\n", + debugstr_a(udt->hash_elt.name), udt->size, size); return TRUE; } udt->size = size; @@ -297,7 +297,7 @@ BOOL symt_add_udt_element(struct module* module, struct symt_udt* udt_type,
assert(udt_type->symt.tag == SymTagUDT);
- TRACE_(dbghelp_symt)("Adding %s to UDT %s\n", name, udt_type->hash_elt.name); + TRACE_(dbghelp_symt)("Adding %s to UDT %s\n", debugstr_a(name), debugstr_a(udt_type->hash_elt.name)); if (name) { unsigned int i; @@ -335,7 +335,7 @@ struct symt_enum* symt_new_enum(struct module* module, const char* typename, struct symt_enum* sym;
TRACE_(dbghelp_symt)("Adding enum %s:%s\n", - debugstr_w(module->modulename), typename); + debugstr_w(module->modulename), debugstr_a(typename)); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { sym->symt.tag = SymTagEnum; @@ -595,7 +595,7 @@ BOOL WINAPI SymEnumTypesByName(HANDLE proc, ULONG64 base, PCSTR name, PSYM_ENUME struct module_pair pair; const char* bang;
- TRACE("(%p %I64x %s %p %p)\n", proc, base, wine_dbgstr_a(name), cb, user); + TRACE("(%p %I64x %s %p %p)\n", proc, base, debugstr_a(name), cb, user);
if (!name) return SymEnumTypes(proc, base, cb, user); bang = strchr(name, '!'); @@ -633,7 +633,7 @@ BOOL WINAPI SymEnumTypesByNameW(HANDLE proc, ULONG64 base, PCWSTR nameW, PSYM_EN char* name; BOOL ret;
- TRACE("(%p %I64x %s %p %p)\n", proc, base, wine_dbgstr_w(nameW), cb, user); + TRACE("(%p %I64x %s %p %p)\n", proc, base, debugstr_w(nameW), cb, user);
if (len) {
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/dbghelp.c | 2 ++ dlls/dbghelp/minidump.c | 3 +++ 2 files changed, 5 insertions(+)
diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index 4e6938cb557..cc1b91d5e77 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -556,6 +556,8 @@ BOOL WINAPI SymCleanup(HANDLE hProcess) struct process** ppcs; struct process* next;
+ TRACE("(%p)\n", hProcess); + for (ppcs = &process_first; *ppcs; ppcs = &(*ppcs)->next) { if ((*ppcs)->handle == hProcess) diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 054aaee22a9..1692bdb93cf 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -1078,6 +1078,9 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile, BOOL sym_initialized = FALSE; BOOL ret = FALSE;
+ TRACE("MiniDumpWriteDump(%p, %lu, %p, %u, %p, %p, %p)\n", + hProcess, pid, hFile, DumpType, ExceptionParam, UserStreamParam, CallbackParam); + if (!(dc.process = process_find_by_handle(hProcess))) { if (!(sym_initialized = SymInitializeW(hProcess, NULL, TRUE)))
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/msc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 41bfcf95957..d9b37509a9b 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -299,7 +299,7 @@ static int leaf_as_variant(VARIANT *v, const unsigned char *leaf) case LF_USHORT: length += 2; V_VT(v) = VT_UI2; - V_UI2(v) = *leaf; + V_UI2(v) = *(const unsigned short*)leaf; break;
case LF_LONG: @@ -421,7 +421,7 @@ static int numeric_leaf(int *value, const unsigned char *leaf)
case LF_USHORT: length += 2; - *value = *leaf; + *value = *(const unsigned short*)leaf; break;
case LF_LONG: @@ -759,7 +759,7 @@ static BOOL codeview_type_extract_name(const union codeview_type* cvtype, break; case LF_ENUM_V3: c_name = cvtype->enumeration_v3.name; - decorated = cvtype->union_v3.property.has_decorated_name; + decorated = cvtype->enumeration_v3.property.has_decorated_name; break; default: return FALSE;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148944
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000013F00E4, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
winmm: mci: Timeout
Report validation errors: d3d11:d3d11 has no test summary line (early exit of the main process?) d3d11:d3d11 has unaccounted for todo messages d3d11:d3d11 returned a non-zero exit code despite reporting no failures