Dbghelp describes the types of function arguments with a specific
symbol-type (symt) which links both to arguments' type and to function prototype - added this new type to dbghelp - implemented its use in winedbg
This commit is contained in:
parent
6b7bebfbf9
commit
f7dd869ebf
|
@ -30,8 +30,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
|
|||
/* TODO
|
||||
* - support for symbols' types is still partly missing
|
||||
* + C++ support
|
||||
* + funcargtype:s are (partly) wrong: they should be a specific struct (like
|
||||
* typedef) pointing to the actual type (and not a direct access)
|
||||
* + we should store the underlying type for an enum in the symt_enum struct
|
||||
* + for enums, we store the names & values (associated to the enum type),
|
||||
* but those values are not directly usable from a debugger (that's why, I
|
||||
|
|
|
@ -222,6 +222,13 @@ struct symt_function_signature
|
|||
struct vector vchildren;
|
||||
};
|
||||
|
||||
struct symt_function_arg_type
|
||||
{
|
||||
struct symt symt;
|
||||
struct symt* arg_type;
|
||||
struct symt* container;
|
||||
};
|
||||
|
||||
struct symt_pointer
|
||||
{
|
||||
struct symt symt;
|
||||
|
|
|
@ -316,12 +316,18 @@ BOOL symt_add_function_signature_parameter(struct module* module,
|
|||
struct symt_function_signature* sig_type,
|
||||
struct symt* param)
|
||||
{
|
||||
struct symt** p;
|
||||
struct symt** p;
|
||||
struct symt_function_arg_type* arg;
|
||||
|
||||
assert(sig_type->symt.tag == SymTagFunctionType);
|
||||
arg = pool_alloc(&module->pool, sizeof(*arg));
|
||||
if (!arg) return FALSE;
|
||||
arg->symt.tag = SymTagFunctionArgType;
|
||||
arg->arg_type = param;
|
||||
arg->container = &sig_type->symt;
|
||||
p = vector_add(&sig_type->vchildren, &module->pool);
|
||||
if (!p) return FALSE; /* FIXME we leak e */
|
||||
*p = param;
|
||||
if (!p) return FALSE; /* FIXME we leak arg */
|
||||
*p = &arg->symt;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -620,6 +626,9 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
|
|||
case SymTagThunk:
|
||||
X(DWORD) = (DWORD)((const struct symt_thunk*)type)->container;
|
||||
break;
|
||||
case SymTagFunctionArgType:
|
||||
X(DWORD) = (DWORD)((const struct symt_function_arg_type*)type)->container;
|
||||
break;
|
||||
default:
|
||||
FIXME("Unsupported sym-tag %s for get-lexical-parent\n",
|
||||
symt_get_tag_str(type->tag));
|
||||
|
@ -702,7 +711,10 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
|
|||
case SymTagFunction:
|
||||
X(DWORD) = (DWORD)((const struct symt_function*)type)->type;
|
||||
break;
|
||||
/* FIXME: should also work for enums and FunctionArgType */
|
||||
/* FIXME: should also work for enums */
|
||||
case SymTagFunctionArgType:
|
||||
X(DWORD) = (DWORD)((const struct symt_function_arg_type*)type)->arg_type;
|
||||
break;
|
||||
default:
|
||||
FIXME("Unsupported sym-tag %s for get-type\n",
|
||||
symt_get_tag_str(type->tag));
|
||||
|
|
|
@ -136,7 +136,7 @@ command:
|
|||
| tSOURCE pathname { parser($2); }
|
||||
| tSYMBOLFILE pathname { symbol_read_symtable($2, 0); }
|
||||
| tSYMBOLFILE pathname expr_rvalue { symbol_read_symtable($2, $3); }
|
||||
| tWHATIS expr_lvalue { types_print_type(&$2.type, FALSE); dbg_printf("\n"); }
|
||||
| tWHATIS expr_lvalue { dbg_printf("type = "); types_print_type(&$2.type, FALSE); dbg_printf("\n"); }
|
||||
| tATTACH tNUM { dbg_attach_debuggee($2, FALSE, TRUE); }
|
||||
| tDETACH { dbg_detach_debuggee(); }
|
||||
| tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);}
|
||||
|
|
|
@ -627,6 +627,7 @@ int types_print_type(const struct dbg_type* type, BOOL details)
|
|||
for (i = 0; i < min(fcp->Count, count); i++)
|
||||
{
|
||||
subtype.id = fcp->ChildId[i];
|
||||
types_get_info(&subtype, TI_GET_TYPE, &subtype.id);
|
||||
types_print_type(&subtype, FALSE);
|
||||
if (i < min(fcp->Count, count) - 1 || count > 256) dbg_printf(", ");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue