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

dbghelp: Introduce internal type (symt_module) to match SymTagExe.

parent 3ed209e0
......@@ -161,6 +161,12 @@ struct symt_block
struct vector vchildren; /* sub-blocks & local variables */
};
struct symt_module /* in fact any of .exe, .dll... */
{
struct symt symt; /* module */
struct module* module;
};
struct symt_compiland
{
struct symt symt;
......@@ -375,6 +381,7 @@ struct module
unsigned sorttab_size;
struct symt_ht** addr_sorttab;
struct hash_table ht_symbols;
struct symt_module* top;
/* types */
struct hash_table ht_types;
......@@ -708,6 +715,8 @@ extern void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si) DECLS
extern void symbol_setname(SYMBOL_INFO* si, const char* name) DECLSPEC_HIDDEN;
extern struct symt_ht*
symt_find_nearest(struct module* module, DWORD_PTR addr) DECLSPEC_HIDDEN;
extern struct symt_module*
symt_new_module(struct module* module) DECLSPEC_HIDDEN;
extern struct symt_compiland*
symt_new_compiland(struct module* module, ULONG_PTR address,
unsigned src_idx) DECLSPEC_HIDDEN;
......
......@@ -233,6 +233,9 @@ struct module* module_new(struct process* pcs, const WCHAR* name,
module->sources = 0;
wine_rb_init(&module->sources_offsets_tree, source_rb_compare);
/* add top level symbol */
module->top = symt_new_module(module);
return module;
}
......
......@@ -183,6 +183,19 @@ static WCHAR* file_regex(const char* srcfile)
return mask;
}
struct symt_module* symt_new_module(struct module* module)
{
struct symt_module* sym;
TRACE_(dbghelp_symt)("Adding toplevel exe symbol %s\n", debugstr_w(module->module.ModuleName));
if ((sym = pool_alloc(&module->pool, sizeof(*sym))))
{
sym->symt.tag = SymTagExe;
sym->module = module;
}
return sym;
}
struct symt_compiland* symt_new_compiland(struct module* module,
ULONG_PTR address, unsigned src_idx)
{
......
......@@ -752,6 +752,15 @@ BOOL symt_get_info(struct module* module, const struct symt* type,
break;
case TI_GET_SYMNAME:
if (type->tag == SymTagExe)
{
DWORD len = (lstrlenW(module->modulename) + 1) * sizeof(WCHAR);
WCHAR* wname = HeapAlloc(GetProcessHeap(), 0, len);
if (!wname) return FALSE;
memcpy(wname, module->modulename, len);
X(WCHAR*) = wname;
}
else
{
const char* name = symt_get_name(type);
if (!name) return FALSE;
......
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