dbghelp/dwarf: Use debugstr_a() to trace external strings.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-09-21 17:44:23 -05:00 committed by Alexandre Julliard
parent 42929b75fc
commit 86805c3d4b
1 changed files with 18 additions and 18 deletions

View File

@ -568,7 +568,7 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx,
case DW_FORM_string: case DW_FORM_string:
attr->u.string = (const char *)data; attr->u.string = (const char *)data;
TRACE("string<%s>\n", attr->u.string); TRACE("string<%s>\n", debugstr_a(attr->u.string));
break; break;
case DW_FORM_strp: case DW_FORM_strp:
@ -576,7 +576,7 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx,
unsigned long offset = dwarf2_get_u4(data); unsigned long offset = dwarf2_get_u4(data);
attr->u.string = (const char*)ctx->sections[section_string].address + offset; attr->u.string = (const char*)ctx->sections[section_string].address + offset;
} }
TRACE("strp<%s>\n", attr->u.string); TRACE("strp<%s>\n", debugstr_a(attr->u.string));
break; break;
case DW_FORM_block: case DW_FORM_block:
@ -1613,7 +1613,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm,
struct attribute ext; struct attribute ext;
TRACE("found parameter %s (kind=%d, offset=%ld, reg=%d) at %s\n", TRACE("found parameter %s (kind=%d, offset=%ld, reg=%d) at %s\n",
name.u.string, loc.kind, loc.offset, loc.reg, debugstr_a(name.u.string), loc.kind, loc.offset, loc.reg,
dwarf2_debug_ctx(subpgm->ctx)); dwarf2_debug_ctx(subpgm->ctx));
switch (loc.kind) switch (loc.kind)
@ -1648,8 +1648,8 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm,
else if (dwarf2_find_attribute(subpgm->ctx, di, DW_AT_const_value, &value)) else if (dwarf2_find_attribute(subpgm->ctx, di, DW_AT_const_value, &value))
{ {
VARIANT v; VARIANT v;
if (subpgm->func) WARN("Unsupported constant %s in function\n", name.u.string); if (subpgm->func) WARN("Unsupported constant %s in function\n", debugstr_a(name.u.string));
if (is_pmt) FIXME("Unsupported constant (parameter) %s in function\n", name.u.string); if (is_pmt) FIXME("Unsupported constant (parameter) %s in function\n", debugstr_a(name.u.string));
switch (value.form) switch (value.form)
{ {
case DW_FORM_data1: case DW_FORM_data1:
@ -1699,7 +1699,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm,
default: default:
FIXME("Unsupported form for const value %s (%lx)\n", FIXME("Unsupported form for const value %s (%lx)\n",
name.u.string, value.form); debugstr_a(name.u.string), value.form);
v.n1.n2.vt = VT_EMPTY; v.n1.n2.vt = VT_EMPTY;
} }
di->symt = &symt_new_constant(subpgm->ctx->module, subpgm->ctx->compiland, di->symt = &symt_new_constant(subpgm->ctx->module, subpgm->ctx->compiland,
@ -1718,7 +1718,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm,
} }
else else
{ {
WARN("dropping global variable %s which has been optimized away\n", name.u.string); WARN("dropping global variable %s which has been optimized away\n", debugstr_a(name.u.string));
} }
} }
if (is_pmt && subpgm->func && subpgm->func->type) if (is_pmt && subpgm->func && subpgm->func->type)
@ -1933,7 +1933,7 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
} }
if (!dwarf2_read_range(ctx, di, &low_pc, &high_pc)) if (!dwarf2_read_range(ctx, di, &low_pc, &high_pc))
{ {
WARN("cannot get range for %s\n", name.u.string); WARN("cannot get range for %s\n", debugstr_a(name.u.string));
return NULL; return NULL;
} }
/* As functions (defined as inline assembly) get debug info with dwarf /* As functions (defined as inline assembly) get debug info with dwarf
@ -2173,7 +2173,7 @@ static void dwarf2_set_line_number(struct module* module, unsigned long address,
if (!file || !(psrc = vector_at(v, file - 1))) return; if (!file || !(psrc = vector_at(v, file - 1))) return;
TRACE("%s %lx %s %u\n", TRACE("%s %lx %s %u\n",
debugstr_w(module->module.ModuleName), address, source_get(module, *psrc), line); debugstr_w(module->module.ModuleName), address, debugstr_a(source_get(module, *psrc)), line);
if (!(symt = symt_find_nearest(module, address)) || if (!(symt = symt_find_nearest(module, address)) ||
symt->symt.tag != SymTagFunction) return; symt->symt.tag != SymTagFunction) return;
func = (struct symt_function*)symt; func = (struct symt_function*)symt;
@ -2234,7 +2234,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
{ {
const char* rel = (const char*)traverse.data; const char* rel = (const char*)traverse.data;
unsigned rellen = strlen(rel); unsigned rellen = strlen(rel);
TRACE("Got include %s\n", rel); TRACE("Got include %s\n", debugstr_a(rel));
traverse.data += rellen + 1; traverse.data += rellen + 1;
p = vector_add(&dirs, &ctx->pool); p = vector_add(&dirs, &ctx->pool);
@ -2268,7 +2268,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
mod_time = dwarf2_leb128_as_unsigned(&traverse); mod_time = dwarf2_leb128_as_unsigned(&traverse);
length = dwarf2_leb128_as_unsigned(&traverse); length = dwarf2_leb128_as_unsigned(&traverse);
dir = *(const char**)vector_at(&dirs, dir_index); dir = *(const char**)vector_at(&dirs, dir_index);
TRACE("Got file %s/%s (%u,%lu)\n", dir, name, mod_time, length); TRACE("Got file %s/%s (%u,%lu)\n", debugstr_a(dir), debugstr_a(name), mod_time, length);
psrc = vector_add(&files, &ctx->pool); psrc = vector_add(&files, &ctx->pool);
*psrc = source_new(ctx->module, dir, name); *psrc = source_new(ctx->module, dir, name);
} }
@ -2339,7 +2339,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
address = ctx->load_offset + dwarf2_parse_addr(&traverse); address = ctx->load_offset + dwarf2_parse_addr(&traverse);
break; break;
case DW_LNE_define_file: case DW_LNE_define_file:
FIXME("not handled define file %s\n", traverse.data); FIXME("not handled define file %s\n", debugstr_a((char *)traverse.data));
traverse.data += strlen((const char *)traverse.data) + 1; traverse.data += strlen((const char *)traverse.data) + 1;
dwarf2_leb128_as_unsigned(&traverse); dwarf2_leb128_as_unsigned(&traverse);
dwarf2_leb128_as_unsigned(&traverse); dwarf2_leb128_as_unsigned(&traverse);
@ -2522,7 +2522,7 @@ static enum location_error loc_compute_frame(struct process* pcs,
*frame = *pframe; *frame = *pframe;
break; break;
case loc_dwarf2_location_list: case loc_dwarf2_location_list:
WARN("Searching loclist for %s\n", func->hash_elt.name); WARN("Searching loclist for %s\n", debugstr_a(func->hash_elt.name));
if (!dwarf2_lookup_loclist(modfmt, if (!dwarf2_lookup_loclist(modfmt,
modfmt->u.dwarf2_info->debug_loc.address + pframe->offset, modfmt->u.dwarf2_info->debug_loc.address + pframe->offset,
ip, &lctx)) ip, &lctx))
@ -2668,7 +2668,7 @@ static BOOL parse_cie_details(dwarf2_traverse_context_t* ctx, struct frame_info*
info->state.cfa_rule = RULE_CFA_OFFSET; info->state.cfa_rule = RULE_CFA_OFFSET;
end = NULL; end = NULL;
TRACE("\tparsing augmentation %s\n", augmentation); TRACE("\tparsing augmentation %s\n", debugstr_a(augmentation));
if (*augmentation) do if (*augmentation) do
{ {
switch (*augmentation) switch (*augmentation)
@ -3325,7 +3325,7 @@ static void dwarf2_location_compute(struct process* pcs,
if (!func->container || func->container->tag != SymTagCompiland) if (!func->container || func->container->tag != SymTagCompiland)
{ {
WARN("We'd expect function %s's container to exist and be a compiland\n", func->hash_elt.name); WARN("We'd expect function %s's container to exist and be a compiland\n", debugstr_a(func->hash_elt.name));
err = loc_err_internal; err = loc_err_internal;
} }
else else
@ -3400,7 +3400,7 @@ static inline BOOL dwarf2_init_zsection(dwarf2_section_t* section,
if (sz <= 12 || memcmp(sect, "ZLIB", 4)) if (sz <= 12 || memcmp(sect, "ZLIB", 4))
{ {
ERR("invalid compressed section %s\n", zsectname); ERR("invalid compressed section %s\n", debugstr_a(zsectname));
goto out; goto out;
} }
@ -3425,7 +3425,7 @@ static inline BOOL dwarf2_init_zsection(dwarf2_section_t* section,
res = inflateInit(&z); res = inflateInit(&z);
if (res != Z_OK) if (res != Z_OK)
{ {
FIXME("inflateInit failed with %i / %s\n", res, z.msg); FIXME("inflateInit failed with %i / %s\n", res, debugstr_a(z.msg));
goto out_free; goto out_free;
} }
@ -3437,7 +3437,7 @@ static inline BOOL dwarf2_init_zsection(dwarf2_section_t* section,
if (res != Z_STREAM_END) if (res != Z_STREAM_END)
{ {
FIXME("Decompression failed with %i / %s\n", res, z.msg); FIXME("Decompression failed with %i / %s\n", res, debugstr_a(z.msg));
goto out_end; goto out_end;
} }