Re: SymGetTypeInfo and TI_GET_DATAKIND
From: Oleg Starodumov (oleg_staro_at_hotmail.com)
Date: 04/13/04
- Next message: Chan Kai Shi: "Debugging class library does not work"
- Previous message: Good Enchiladas: "Remote Debugging ASP.NET VS.NET Win2K?"
- In reply to: Nicolas Hognon: "SymGetTypeInfo and TI_GET_DATAKIND"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Apr 2004 15:48:18 +0300
Hi,
> This time I want to know if a symbol is constant or a reference.
> I succeed to manage base type, pointer, array and UDT.
>
> but if i got a function like this
>
> - void function(const char* iStr, const MyStruct& iObject);
>
> when I try to recreate the signature of the function I obtained
>
> - void function(char* iStr, MyStruct* iObject);
>
> because I do not know how to get information about constant and reference.
>
"Reference" property is available in DIA, but it is not exposed via SymGetTypeInfo,
so with DbgHelp it is impossible to distinguish between pointers and references.
I don't know how to determine if a pointer is constant, even with DIA.
It looks like WinDbg debugger also cannot distinguish between constant and non-constant
pointers (it uses DbgHelp as its symbol engine), while VC debugger can (it does not use DbgHelp).
> In the cvconst.h from the DIA SDK there is
>
> enum LocationType
> {
> ...
> LocIsConstant,
> ...
> };
>
This is the "location" of a symbol, which describes where the symbol
(variable, function, block, etc.) is located (e.g. in a PE section, in a register,
this-relative (member of a UDT), constant (no location, only value is available), etc.)
and tells which property (in DIA) or SYMBOL_INFO member (in DbgHelp)
to use to get the location.
In DbgHelp, it is available via SYMBOL_INFO.Flags (SYMFLAG_*).
> enum DataKind
> {
> ....
> DataIsConstant
> };
>
This is the "data kind" of a variable (whether it is local, static local, parameter,
static, global, etc.).
It is available via SymGetTypeInfo() with TI_GET_DATAKIND
(supported for SymTagData symbols).
>
> There is the same problem for local variable which are static ? how to
> know it is static ?
Use TI_GET_DATAKIND for SymTagData symbol that represents
the variable, and check whether it is DataIsLocal or DataIsStaticLocal.
Regards,
Oleg
- Next message: Chan Kai Shi: "Debugging class library does not work"
- Previous message: Good Enchiladas: "Remote Debugging ASP.NET VS.NET Win2K?"
- In reply to: Nicolas Hognon: "SymGetTypeInfo and TI_GET_DATAKIND"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|