December 01, 2002
Visual C++ Exception-Handling Instrumentation
December 2002/Visual C++ Exception-Handling Instrumentation
Listing 2 Exception-handling internal structures
/* these types are known to compiler without declaration
// this structure is used to calculate
// an offset of a sub-type from the beginning
// of an object. I do not know the exact meaning
// of its members
struct _PMD
{
int mdisp;
int pdisp;
int vdisp;
};
// information of a type that
// can be caught by a catch block
struct _s__CatchableType
{
//type properties bit flags
// 1 - type is a pointer
// 2 - ????
unsigned properties;
// _TypeDescriptor is the same
// as good old type_info.
_TypeDescriptor * pType;
// used to calculate displacement of
// this pointer for the type from
// the beginning of the object
_PMD thisDisplacement;
// size of the type
int sizeOrOffset;
// function used to copy the type around
// if the type has copy ctor it will
// be it. Otherwise 0
void (*)() copyFunction;
};
// a counted array of the types that can
// be caught by a catch block
struct _s__CatchableTypeArray
{
// count of the types
int nCatchableTypes;
// pointer to an array
const _s__CatchableType
(* arrayOfCatchableTypes)[];
};
// this structure holds the information about
// exception object being thrown
struct _s__ThrowInfo
{
//object attributes bitmask
// 1 - object is pointer to const object
// 2 - object is pointer to volatile object
unsigned attributes;
// pointer to function to destroy
// the exception object. Probably always
// the destructor
void * pmfnUnwind;
// pointer to special exception
// handling function
// not relevant to this article
void * pForwardCompat;
// array of sub-types of the object
// or other types to
// which it could be implicitly cast.
// Used to find
// the matching catch block
const _s__CatchableTypeArray *
pCatchableTypeArray;
};
*/
Previous Page |
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
Next Page