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
|
/* TODO
|
||||||
* - support for symbols' types is still partly missing
|
* - support for symbols' types is still partly missing
|
||||||
* + C++ support
|
* + 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
|
* + 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),
|
* + 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
|
* 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 vector vchildren;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct symt_function_arg_type
|
||||||
|
{
|
||||||
|
struct symt symt;
|
||||||
|
struct symt* arg_type;
|
||||||
|
struct symt* container;
|
||||||
|
};
|
||||||
|
|
||||||
struct symt_pointer
|
struct symt_pointer
|
||||||
{
|
{
|
||||||
struct symt symt;
|
struct symt symt;
|
||||||
|
@ -316,12 +316,18 @@ BOOL symt_add_function_signature_parameter(struct module* module,
|
|||||||
struct symt_function_signature* sig_type,
|
struct symt_function_signature* sig_type,
|
||||||
struct symt* param)
|
struct symt* param)
|
||||||
{
|
{
|
||||||
struct symt** p;
|
struct symt** p;
|
||||||
|
struct symt_function_arg_type* arg;
|
||||||
|
|
||||||
assert(sig_type->symt.tag == SymTagFunctionType);
|
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);
|
p = vector_add(&sig_type->vchildren, &module->pool);
|
||||||
if (!p) return FALSE; /* FIXME we leak e */
|
if (!p) return FALSE; /* FIXME we leak arg */
|
||||||
*p = param;
|
*p = &arg->symt;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -620,6 +626,9 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
|
|||||||
case SymTagThunk:
|
case SymTagThunk:
|
||||||
X(DWORD) = (DWORD)((const struct symt_thunk*)type)->container;
|
X(DWORD) = (DWORD)((const struct symt_thunk*)type)->container;
|
||||||
break;
|
break;
|
||||||
|
case SymTagFunctionArgType:
|
||||||
|
X(DWORD) = (DWORD)((const struct symt_function_arg_type*)type)->container;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
FIXME("Unsupported sym-tag %s for get-lexical-parent\n",
|
FIXME("Unsupported sym-tag %s for get-lexical-parent\n",
|
||||||
symt_get_tag_str(type->tag));
|
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:
|
case SymTagFunction:
|
||||||
X(DWORD) = (DWORD)((const struct symt_function*)type)->type;
|
X(DWORD) = (DWORD)((const struct symt_function*)type)->type;
|
||||||
break;
|
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:
|
default:
|
||||||
FIXME("Unsupported sym-tag %s for get-type\n",
|
FIXME("Unsupported sym-tag %s for get-type\n",
|
||||||
symt_get_tag_str(type->tag));
|
symt_get_tag_str(type->tag));
|
||||||
|
@ -136,7 +136,7 @@ command:
|
|||||||
| tSOURCE pathname { parser($2); }
|
| tSOURCE pathname { parser($2); }
|
||||||
| tSYMBOLFILE pathname { symbol_read_symtable($2, 0); }
|
| tSYMBOLFILE pathname { symbol_read_symtable($2, 0); }
|
||||||
| tSYMBOLFILE pathname expr_rvalue { symbol_read_symtable($2, $3); }
|
| 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); }
|
| tATTACH tNUM { dbg_attach_debuggee($2, FALSE, TRUE); }
|
||||||
| tDETACH { dbg_detach_debuggee(); }
|
| tDETACH { dbg_detach_debuggee(); }
|
||||||
| tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);}
|
| 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++)
|
for (i = 0; i < min(fcp->Count, count); i++)
|
||||||
{
|
{
|
||||||
subtype.id = fcp->ChildId[i];
|
subtype.id = fcp->ChildId[i];
|
||||||
|
types_get_info(&subtype, TI_GET_TYPE, &subtype.id);
|
||||||
types_print_type(&subtype, FALSE);
|
types_print_type(&subtype, FALSE);
|
||||||
if (i < min(fcp->Count, count) - 1 || count > 256) dbg_printf(", ");
|
if (i < min(fcp->Count, count) - 1 || count > 256) dbg_printf(", ");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user