ChangeSet ID: 21317 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@winehq.org 2005/11/17 06:53:41
Modified files: programs/winedbg: types.c dbg.y dlls/dbghelp : type.c dbghelp_private.h dbghelp.c
Log message: Eric Pouech eric.pouech@wanadoo.fr 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
Patch: http://cvs.winehq.org/patch.py?id=21317
Old revision New revision Changes Path 1.15 1.16 +1 -0 wine/programs/winedbg/types.c 1.29 1.30 +1 -1 wine/programs/winedbg/dbg.y 1.13 1.14 +16 -4 wine/dlls/dbghelp/type.c 1.17 1.18 +7 -0 wine/dlls/dbghelp/dbghelp_private.h 1.12 1.13 +0 -2 wine/dlls/dbghelp/dbghelp.c
Index: wine/programs/winedbg/types.c diff -u -p wine/programs/winedbg/types.c:1.15 wine/programs/winedbg/types.c:1.16 --- wine/programs/winedbg/types.c:1.15 17 Nov 2005 12:53:41 -0000 +++ wine/programs/winedbg/types.c 17 Nov 2005 12:53:41 -0000 @@ -627,6 +627,7 @@ int types_print_type(const struct dbg_ty 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(", "); } Index: wine/programs/winedbg/dbg.y diff -u -p wine/programs/winedbg/dbg.y:1.29 wine/programs/winedbg/dbg.y:1.30 --- wine/programs/winedbg/dbg.y:1.29 17 Nov 2005 12:53:41 -0000 +++ wine/programs/winedbg/dbg.y 17 Nov 2005 12:53:41 -0000 @@ -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);} Index: wine/dlls/dbghelp/type.c diff -u -p wine/dlls/dbghelp/type.c:1.13 wine/dlls/dbghelp/type.c:1.14 --- wine/dlls/dbghelp/type.c:1.13 17 Nov 2005 12:53:41 -0000 +++ wine/dlls/dbghelp/type.c 17 Nov 2005 12:53:41 -0000 @@ -316,12 +316,18 @@ BOOL symt_add_function_signature_paramet 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* ty 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* ty 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)); Index: wine/dlls/dbghelp/dbghelp_private.h diff -u -p wine/dlls/dbghelp/dbghelp_private.h:1.17 wine/dlls/dbghelp/dbghelp_private.h:1.18 --- wine/dlls/dbghelp/dbghelp_private.h:1.17 17 Nov 2005 12:53:41 -0000 +++ wine/dlls/dbghelp/dbghelp_private.h 17 Nov 2005 12:53:41 -0000 @@ -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; Index: wine/dlls/dbghelp/dbghelp.c diff -u -p wine/dlls/dbghelp/dbghelp.c:1.12 wine/dlls/dbghelp/dbghelp.c:1.13 --- wine/dlls/dbghelp/dbghelp.c:1.12 17 Nov 2005 12:53:41 -0000 +++ wine/dlls/dbghelp/dbghelp.c 17 Nov 2005 12:53:41 -0000 @@ -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