dbghelp: Be a bit more strict on where we do actually expect default names to be generated

(removed this feature for UDTs, structures' fields, enums, typedefs, compilands)
This commit is contained in:
Eric Pouech 2006-11-24 22:18:16 +01:00 committed by Alexandre Julliard
parent 96bfe9d056
commit 497b2e4ea5
2 changed files with 25 additions and 20 deletions

View File

@ -565,11 +565,15 @@ static void dwarf2_find_name(dwarf2_parse_context_t* ctx,
static int index;
if (!dwarf2_find_attribute(ctx, di, DW_AT_name, attr))
{
if (pfx)
{
char* tmp = pool_alloc(&ctx->pool, strlen(pfx) + 16);
if (tmp) sprintf(tmp, "%s_%d", pfx, index++);
attr->u.string = tmp;
}
else attr->u.string = NULL;
}
}
static void dwarf2_load_one_entry(dwarf2_parse_context_t*, dwarf2_debug_info_t*,
@ -915,7 +919,7 @@ static struct symt* dwarf2_parse_base_type(dwarf2_parse_context_t* ctx,
TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
dwarf2_find_name(ctx, di, &name, "base_type");
dwarf2_find_name(ctx, di, &name, NULL);
if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 0;
if (!dwarf2_find_attribute(ctx, di, DW_AT_encoding, &encoding)) encoding.u.uvalue = DW_ATE_void;
@ -947,13 +951,11 @@ static struct symt* dwarf2_parse_typedef(dwarf2_parse_context_t* ctx,
TRACE("%s, for %lu\n", dwarf2_debug_ctx(ctx), di->abbrev->entry_code);
dwarf2_find_name(ctx, di, &name, "typedef");
dwarf2_find_name(ctx, di, &name, NULL);
ref_type = dwarf2_lookup_type(ctx, di);
if (name.u.string)
{
di->symt = &symt_new_typedef(ctx->module, ref_type, name.u.string)->symt;
}
if (di->abbrev->have_child) FIXME("Unsupported children\n");
return di->symt;
}
@ -1084,7 +1086,7 @@ static void dwarf2_parse_udt_member(dwarf2_parse_context_t* ctx,
TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
dwarf2_find_name(ctx, di, &name, "udt_member");
dwarf2_find_name(ctx, di, &name, NULL);
elt_type = dwarf2_lookup_type(ctx, di);
if (dwarf2_compute_location_attr(ctx, di, DW_AT_data_member_location, &loc, NULL))
{
@ -1132,7 +1134,7 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx,
TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
dwarf2_find_name(ctx, di, &name, "udt");
dwarf2_find_name(ctx, di, &name, NULL);
if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 0;
di->symt = &symt_new_udt(ctx->module, name.u.string, size.u.uvalue, udt)->symt;
@ -1180,7 +1182,7 @@ static void dwarf2_parse_enumerator(dwarf2_parse_context_t* ctx,
TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
dwarf2_find_name(ctx, di, &name, "enum_value");
dwarf2_find_name(ctx, di, &name, NULL);
if (!dwarf2_find_attribute(ctx, di, DW_AT_const_value, &value)) value.u.svalue = 0;
symt_add_enum_element(ctx->module, parent, name.u.string, value.u.svalue);
@ -1197,7 +1199,7 @@ static struct symt* dwarf2_parse_enumeration_type(dwarf2_parse_context_t* ctx,
TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
dwarf2_find_name(ctx, di, &name, "enum");
dwarf2_find_name(ctx, di, &name, NULL);
if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 0;
di->symt = &symt_new_enum(ctx->module, name.u.string)->symt;
@ -1904,7 +1906,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
struct attribute stmt_list, low_pc;
struct attribute comp_dir;
dwarf2_find_name(&ctx, di, &name, "compiland");
dwarf2_find_name(&ctx, di, &name, NULL);
/* get working directory of current compilation unit */
if (!dwarf2_find_attribute(&ctx, di, DW_AT_comp_dir, &comp_dir))

View File

@ -213,20 +213,23 @@ 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);
if (name)
{
p = NULL;
while ((p = vector_iter_up(&udt_type->vchildren, p)))
{
m = (struct symt_data*)*p;
assert(m);
assert(m->symt.tag == SymTagData);
if (m->hash_elt.name[0] == name[0] && strcmp(m->hash_elt.name, name) == 0)
if (strcmp(m->hash_elt.name, name) == 0)
return TRUE;
}
}
if ((m = pool_alloc(&module->pool, sizeof(*m))) == NULL) return FALSE;
memset(m, 0, sizeof(*m));
m->symt.tag = SymTagData;
m->hash_elt.name = pool_strdup(&module->pool, name);
m->hash_elt.name = name ? pool_strdup(&module->pool, name) : "";
m->hash_elt.next = NULL;
m->kind = DataIsMember;