Discussion:
why i can not find struct's typedef information from pdb file?
(too old to reply)
hjwdd
2009-04-23 08:56:28 UTC
Permalink
i define a struct's alias name by use keyword "typedef " ;
typedef struct tagTest
{
int a;
int b;
}T_Test

but i can not find "T_Test" information in pdb file. there are only
basictype's typedef information like:

Typedef : CHAR, Type: char
Typedef : PDWORD, Type: unsigned long *
Typedef : LRESULT, Type: long


but DIA SDK say:
"Symbols with SymTagTypedef tags introduce names for other types.
Since a typedef can represent a class, pointer, or user-defined type (UDT),
the symbol for a typedef shares the same properties as one of those other
types of symbols."
http://msdn.microsoft.com/en-us/library/b414x7s3(VS.80).aspx

how to get struct's typedef information ?
thanks!
Scot T Brennecke
2009-04-23 09:10:38 UTC
Permalink
Did you actually use the struct type in your code, or maybe the compiler optimized it away because
it wasn't used?
Post by hjwdd
i define a struct's alias name by use keyword "typedef " ;
typedef struct tagTest
{
int a;
int b;
}T_Test
but i can not find "T_Test" information in pdb file. there are only
Typedef : CHAR, Type: char
Typedef : PDWORD, Type: unsigned long *
Typedef : LRESULT, Type: long
"Symbols with SymTagTypedef tags introduce names for other types.
Since a typedef can represent a class, pointer, or user-defined type (UDT),
the symbol for a typedef shares the same properties as one of those other
types of symbols."
http://msdn.microsoft.com/en-us/library/b414x7s3(VS.80).aspx
how to get struct's typedef information ?
thanks!
hjwdd
2009-04-23 14:01:02 UTC
Permalink
thank you for your reply!
i use T_Test in my code.
by the way ,i find vc6.0 debugger also can not recognize the type T_Test.
i add "(T_Test*)pTest" in watch,debugger reported : CXX0019: Error: bad
type cast.
but if i type "(tagTest*)pTest", it works .
Post by Scot T Brennecke
Did you actually use the struct type in your code, or maybe the compiler optimized it away because
it wasn't used?
Post by hjwdd
i define a struct's alias name by use keyword "typedef " ;
typedef struct tagTest
{
int a;
int b;
}T_Test
but i can not find "T_Test" information in pdb file. there are only
Typedef : CHAR, Type: char
Typedef : PDWORD, Type: unsigned long *
Typedef : LRESULT, Type: long
"Symbols with SymTagTypedef tags introduce names for other types.
Since a typedef can represent a class, pointer, or user-defined type (UDT),
the symbol for a typedef shares the same properties as one of those other
types of symbols."
http://msdn.microsoft.com/en-us/library/b414x7s3(VS.80).aspx
how to get struct's typedef information ?
thanks!
Scot T Brennecke
2009-04-24 07:48:03 UTC
Permalink
Oh, you're still using 6.0? It was "farther from perfect" than the newer compilers. :)

This article may be helpful, if you haven't read it already:
Symbols and Symbol Files:
http://msdn.microsoft.com/en-us/library/cc266463.aspx

Do you have a good reason for continuing to use the archaic "typedef struct" form of struct
declaration? Why not just do this?:
struct T_Test
{
int a;
int b;
};
Post by hjwdd
thank you for your reply!
i use T_Test in my code.
by the way ,i find vc6.0 debugger also can not recognize the type T_Test.
i add "(T_Test*)pTest" in watch,debugger reported : CXX0019: Error: bad
type cast.
but if i type "(tagTest*)pTest", it works .
Post by Scot T Brennecke
Did you actually use the struct type in your code, or maybe the compiler optimized it away
because
it wasn't used?
Post by hjwdd
i define a struct's alias name by use keyword "typedef " ;
typedef struct tagTest
{
int a;
int b;
}T_Test
but i can not find "T_Test" information in pdb file. there are only
Typedef : CHAR, Type: char
Typedef : PDWORD, Type: unsigned long *
Typedef : LRESULT, Type: long
"Symbols with SymTagTypedef tags introduce names for other types.
Since a typedef can represent a class, pointer, or user-defined type (UDT),
the symbol for a typedef shares the same properties as one of those other
types of symbols."
http://msdn.microsoft.com/en-us/library/b414x7s3(VS.80).aspx
how to get struct's typedef information ?
thanks!
Continue reading on narkive:
Loading...