Commit 34db4856 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp,winedbg: SYMBOL_INFO fix.

- native dbghelp returns in SYMBOL_INFO.TypeIndex the index of the type of the symbol (we were returning the symbol index instead) - fixed winedbg accordingly
parent 8ec39067
......@@ -443,8 +443,9 @@ static void symt_fill_sym_info(const struct module* module,
const char* name;
DWORD64 size;
sym_info->TypeIndex = (DWORD)sym;
sym_info->info = 0; /* TBD */
if (!symt_get_info(sym, TI_GET_TYPE, &sym_info->TypeIndex))
sym_info->TypeIndex = 0;
sym_info->info = (DWORD)sym;
symt_get_info(sym, TI_GET_LENGTH, &size);
sym_info->Size = (DWORD)size;
sym_info->ModBase = module->module.BaseOfImage;
......
......@@ -718,6 +718,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
default:
FIXME("Unsupported sym-tag %s for get-type\n",
symt_get_tag_str(type->tag));
case SymTagPublicSymbol:
case SymTagThunk:
return FALSE;
}
......
......@@ -461,10 +461,8 @@ struct dbg_lvalue expr_eval(struct expr* exp)
exp->un.call.result = 0;
#endif
rtn.cookie = DLV_HOST;
/* get function signature type */
types_get_info(&rtn.type, TI_GET_TYPE, &rtn.type);
/* and now, return type */
types_get_info(&rtn.type, TI_GET_TYPE, &rtn.type);
/* get return type from function signature tupe */
types_get_info(&rtn.type, TI_GET_TYPE, &rtn.type.id);
rtn.addr.Offset = (unsigned int)&exp->un.call.result;
break;
case EXPR_TYPE_INTVAR:
......
......@@ -40,6 +40,7 @@ static BOOL symbol_get_debug_start(DWORD mod_base, DWORD typeid, ULONG64* start)
int i;
struct dbg_type type;
if (!typeid) return FALSE; /* native dbghelp not always fills the info field */
type.module = mod_base;
type.id = typeid;
......@@ -134,7 +135,7 @@ static BOOL CALLBACK sgv_cb(SYMBOL_INFO* sym, ULONG size, void* ctx)
if (sgv->lineno == -1)
{
if (!sgv->bp_disp ||
!symbol_get_debug_start(sym->ModBase, sym->TypeIndex, &addr))
!symbol_get_debug_start(sym->ModBase, sym->info, &addr))
addr = sym->Address;
}
else
......@@ -185,9 +186,7 @@ static BOOL CALLBACK sgv_cb(SYMBOL_INFO* sym, ULONG size, void* ctx)
sgv->syms[insp].lvalue.addr.Mode = AddrModeFlat;
sgv->syms[insp].lvalue.addr.Offset = addr;
sgv->syms[insp].lvalue.type.module = sym->ModBase;
sgv->syms[insp].lvalue.type.id = sym->TypeIndex;
types_get_info(&sgv->syms[insp].lvalue.type, TI_GET_TYPE,
&sgv->syms[insp].lvalue.type.id);
sgv->syms[insp].lvalue.type.id = sym->TypeIndex;
sgv->syms[insp].flags = sym->Flags;
sgv->num++;
......@@ -463,7 +462,7 @@ enum dbg_line_status symbol_get_function_line_status(const ADDRESS* addr)
if (!SymGetLineFromAddr(dbg_curr_process->handle, lin, &disp, &il))
return dbg_no_line_info;
if (symbol_get_debug_start(sym->ModBase, sym->TypeIndex, &start) && lin < start)
if (symbol_get_debug_start(sym->ModBase, sym->info, &start) && lin < start)
return dbg_not_on_a_line_number;
if (!sym->Size) sym->Size = 0x100000;
if (il.FileName && il.FileName[0] && disp < sym->Size)
......@@ -545,7 +544,6 @@ static BOOL CALLBACK info_locals_cb(SYMBOL_INFO* sym, ULONG size, void* ctx)
dbg_printf("\t");
type.module = sym->ModBase;
type.id = sym->TypeIndex;
types_get_info(&type, TI_GET_TYPE, &type.id);
types_print_type(&type, FALSE);
if (sym->Flags & SYMFLAG_PARAMETER) explain = "parameter";
......@@ -624,8 +622,7 @@ static BOOL CALLBACK symbols_info_cb(SYMBOL_INFO* sym, ULONG size, void* ctx)
type.id = sym->TypeIndex;
type.module = sym->ModBase;
if (sym->TypeIndex != dbg_itype_none && sym->TypeIndex != 0 &&
types_get_info(&type, TI_GET_TYPE, &type.id))
if (sym->TypeIndex != dbg_itype_none && sym->TypeIndex != 0)
{
dbg_printf(" ");
types_print_type(&type, 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