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
diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c
index f5907678..3952f7e 100644
--- a/dlls/dbghelp/dbghelp.c
+++ b/dlls/dbghelp/dbghelp.c
@@ -30,8 +30,6 @@
/* 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
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 01a6b41..eb86e50 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -222,6 +222,13 @@
struct vector vchildren;
};
+struct symt_function_arg_type
+{
+ struct symt symt;
+ struct symt* arg_type;
+ struct symt* container;
+};
+
struct symt_pointer
{
struct symt symt;
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c
index f076529..7617be8 100644
--- a/dlls/dbghelp/type.c
+++ b/dlls/dbghelp/type.c
@@ -316,12 +316,18 @@
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 @@
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 @@
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));
diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index 45712df..523855a 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -136,7 +136,7 @@
| 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);}
diff --git a/programs/winedbg/types.c b/programs/winedbg/types.c
index 424bca3..53a133d 100644
--- a/programs/winedbg/types.c
+++ b/programs/winedbg/types.c
@@ -627,6 +627,7 @@
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(", ");
}