Commit faf2880f authored by Dave Hawkes's avatar Dave Hawkes Committed by Alexandre Julliard

Fix for some types of C++ debug info that can cause winedbg to crash.

parent 5446abe8
...@@ -540,153 +540,153 @@ union codeview_type ...@@ -540,153 +540,153 @@ union codeview_type
{ {
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
} generic; } generic;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int attribute; short int attribute;
short int datatype; short int datatype;
unsigned char variant[1]; unsigned char variant[1];
} pointer; } pointer;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
unsigned int datatype; unsigned int datatype;
unsigned int attribute; unsigned int attribute;
unsigned char variant[1]; unsigned char variant[1];
} pointer32; } pointer32;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
unsigned char nbits; unsigned char nbits;
unsigned char bitoff; unsigned char bitoff;
unsigned short type; unsigned short type;
} bitfield; } bitfield;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
unsigned int type; unsigned int type;
unsigned char nbits; unsigned char nbits;
unsigned char bitoff; unsigned char bitoff;
} bitfield32; } bitfield32;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int elemtype; short int elemtype;
short int idxtype; short int idxtype;
unsigned short int arrlen; /* numeric leaf */ unsigned short int arrlen; /* numeric leaf */
#if 0 #if 0
unsigned char name[1]; unsigned char name[1];
#endif #endif
} array; } array;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
unsigned int elemtype; unsigned int elemtype;
unsigned int idxtype; unsigned int idxtype;
unsigned short int arrlen; /* numeric leaf */ unsigned short int arrlen; /* numeric leaf */
#if 0 #if 0
unsigned char name[1]; unsigned char name[1];
#endif #endif
} array32; } array32;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int n_element; short int n_element;
short int fieldlist; short int fieldlist;
short int property; short int property;
short int derived; short int derived;
short int vshape; short int vshape;
unsigned short int structlen; /* numeric leaf */ unsigned short int structlen; /* numeric leaf */
#if 0 #if 0
unsigned char name[1]; unsigned char name[1];
#endif #endif
} structure; } structure;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int n_element; short int n_element;
short int property; short int property;
unsigned int fieldlist; unsigned int fieldlist;
unsigned int derived; unsigned int derived;
unsigned int vshape; unsigned int vshape;
unsigned short int structlen; /* numeric leaf */ unsigned short int structlen; /* numeric leaf */
#if 0 #if 0
unsigned char name[1]; unsigned char name[1];
#endif #endif
} structure32; } structure32;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int count; short int count;
short int fieldlist; short int fieldlist;
short int property; short int property;
unsigned short int un_len; /* numeric leaf */ unsigned short int un_len; /* numeric leaf */
#if 0 #if 0
unsigned char name[1]; unsigned char name[1];
#endif #endif
} t_union; } t_union;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int count; short int count;
short int property; short int property;
unsigned int fieldlist; unsigned int fieldlist;
unsigned short int un_len; /* numeric leaf */ unsigned short int un_len; /* numeric leaf */
#if 0 #if 0
unsigned char name[1]; unsigned char name[1];
#endif #endif
} t_union32; } t_union32;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int count; short int count;
short int type; short int type;
short int field; short int field;
short int property; short int property;
unsigned char name[1]; unsigned char name[1];
} enumeration; } enumeration;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
short int count; short int count;
short int property; short int property;
unsigned int type; unsigned int type;
unsigned int field; unsigned int field;
unsigned char name[1]; unsigned char name[1];
} enumeration32; } enumeration32;
struct struct
{ {
short int len; unsigned short int len;
short int id; short int id;
unsigned char list[1]; unsigned char list[1];
} fieldlist; } fieldlist;
}; };
...@@ -1569,7 +1569,8 @@ DEBUG_AddCVType_Enum( unsigned int typeno, char *name, unsigned int fieldlist ) ...@@ -1569,7 +1569,8 @@ DEBUG_AddCVType_Enum( unsigned int typeno, char *name, unsigned int fieldlist )
struct datatype *list = DEBUG_GetCVType( fieldlist ); struct datatype *list = DEBUG_GetCVType( fieldlist );
if ( list ) if ( list )
DEBUG_CopyFieldlist( dt, list ); if(DEBUG_CopyFieldlist( dt, list ) == FALSE)
return FALSE;
return DEBUG_AddCVType( typeno, dt ); return DEBUG_AddCVType( typeno, dt );
} }
...@@ -1583,7 +1584,8 @@ DEBUG_AddCVType_Struct( unsigned int typeno, char *name, int structlen, unsigned ...@@ -1583,7 +1584,8 @@ DEBUG_AddCVType_Struct( unsigned int typeno, char *name, int structlen, unsigned
if ( list ) if ( list )
{ {
DEBUG_SetStructSize( dt, structlen ); DEBUG_SetStructSize( dt, structlen );
DEBUG_CopyFieldlist( dt, list ); if(DEBUG_CopyFieldlist( dt, list ) == FALSE)
return FALSE;
} }
return DEBUG_AddCVType( typeno, dt ); return DEBUG_AddCVType( typeno, dt );
......
...@@ -569,8 +569,14 @@ DEBUG_SetStructSize(struct datatype * dt, int size) ...@@ -569,8 +569,14 @@ DEBUG_SetStructSize(struct datatype * dt, int size)
int int
DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2) DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2)
{ {
if (!(dt->type == dt2->type && ((dt->type == DT_STRUCT) || (dt->type == DT_ENUM)))) {
assert( dt->type == dt2->type && ((dt->type == DT_STRUCT) || (dt->type == DT_ENUM))); DEBUG_Printf(DBG_CHN_MESG, "Error: Copyfield list mismatch (%d<>%d): ", dt->type, dt2->type);
DEBUG_PrintTypeCast(dt);
DEBUG_Printf(DBG_CHN_MESG, " ");
DEBUG_PrintTypeCast(dt2);
DEBUG_Printf(DBG_CHN_MESG, "\n");
return FALSE;
}
if( dt->type == DT_STRUCT ) if( dt->type == DT_STRUCT )
{ {
...@@ -1024,6 +1030,12 @@ DEBUG_PrintTypeCast(const struct datatype * dt) ...@@ -1024,6 +1030,12 @@ DEBUG_PrintTypeCast(const struct datatype * dt)
{ {
const char* name = "none"; const char* name = "none";
if(dt == NULL)
{
DEBUG_Printf(DBG_CHN_MESG, "--invalid--");
return FALSE;
}
if( dt->name != NULL ) if( dt->name != NULL )
{ {
name = dt->name; name = dt->name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment