Commit 1a723f23 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Store compiland's address in internal structures.

parent 4bcca691
......@@ -120,7 +120,8 @@ static int coff_add_file(struct CoffFileSet* coff_files, struct module* module,
file = coff_files->files + coff_files->nfiles;
file->startaddr = 0xffffffff;
file->endaddr = 0;
file->compiland = symt_new_compiland(module, source_new(module, NULL, filename));
file->compiland = symt_new_compiland(module, 0,
source_new(module, NULL, filename));
file->linetab_offset = -1;
file->linecnt = 0;
file->entries = NULL;
......
......@@ -137,6 +137,7 @@ struct symt_block
struct symt_compiland
{
struct symt symt;
unsigned long address;
unsigned source;
struct vector vchildren; /* global variables & functions */
};
......@@ -447,7 +448,8 @@ extern const char* symt_get_name(const struct symt* sym);
extern int symt_cmp_addr(const void* p1, const void* p2);
extern int symt_find_nearest(struct module* module, DWORD addr);
extern struct symt_compiland*
symt_new_compiland(struct module* module, unsigned src_idx);
symt_new_compiland(struct module* module, unsigned long address,
unsigned src_idx);
extern struct symt_public*
symt_new_public(struct module* module,
struct symt_compiland* parent,
......
......@@ -1807,7 +1807,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
{
struct attribute name;
dwarf2_debug_info_t** pdi = NULL;
struct attribute stmt_list;
struct attribute stmt_list, low_pc;
struct attribute comp_dir;
dwarf2_find_name(&ctx, di, &name, "compiland");
......@@ -1816,7 +1816,11 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
if (!dwarf2_find_attribute(&ctx, di, DW_AT_comp_dir, &comp_dir))
comp_dir.u.string = NULL;
di->symt = &symt_new_compiland(module, source_new(module, comp_dir.u.string, name.u.string))->symt;
if (!dwarf2_find_attribute(&ctx, di, DW_AT_low_pc, &low_pc))
low_pc.u.uvalue = 0;
di->symt = &symt_new_compiland(module,
module->module.BaseOfImage + low_pc.u.uvalue,
source_new(module, comp_dir.u.string, name.u.string))->symt;
if (di->abbrev->have_child)
{
......
......@@ -325,7 +325,11 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
switch (ELF32_ST_TYPE(symp->st_info))
{
case STT_FILE:
compiland = symname ? symt_new_compiland(module, source_new(module, NULL, symname)) : NULL;
if (symname)
compiland = symt_new_compiland(module, symp->st_value,
source_new(module, NULL, symname));
else
compiland = NULL;
continue;
case STT_NOTYPE:
/* we are only interested in wine markers inserted by winebuild */
......
......@@ -1465,7 +1465,7 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
case S_OBJNAME_V1:
TRACE("S-ObjName %s\n", terminate_string(&sym->objname_v1.p_name));
compiland = symt_new_compiland(msc_dbg->module,
compiland = symt_new_compiland(msc_dbg->module, 0 /* FIXME */,
source_new(msc_dbg->module, NULL,
terminate_string(&sym->objname_v1.p_name)));
break;
......
......@@ -1451,7 +1451,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
{
stabs_reset_includes();
source_idx = source_new(module, srcpath, ptr);
compiland = symt_new_compiland(module, source_idx);
compiland = symt_new_compiland(module, 0 /* FIXME */, source_idx);
}
else
strcpy(srcpath, ptr);
......
......@@ -125,7 +125,8 @@ static void compile_regex(const char* str, int numchar, regex_t* re, BOOL _case)
HeapFree(GetProcessHeap(), 0, mask);
}
struct symt_compiland* symt_new_compiland(struct module* module, unsigned src_idx)
struct symt_compiland* symt_new_compiland(struct module* module,
unsigned long address, unsigned src_idx)
{
struct symt_compiland* sym;
......@@ -134,6 +135,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, unsigned src_id
if ((sym = pool_alloc(&module->pool, sizeof(*sym))))
{
sym->symt.tag = SymTagCompiland;
sym->address = address;
sym->source = src_idx;
vector_init(&sym->vchildren, sizeof(struct symt*), 32);
}
......
......@@ -490,6 +490,9 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
case SymTagThunk:
X(ULONG64) = ((const struct symt_thunk*)type)->address;
break;
case SymTagCompiland:
X(ULONG64) = ((const struct symt_compiland*)type)->address;
break;
default:
FIXME("Unsupported sym-tag %s for get-address\n",
symt_get_tag_str(type->tag));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment