Commit in reactos/lib/dbghelp on MAIN
msc.c+291-2911.1 -> 1.2
KJK::Hyperion has PSEH'ifyed msc.c

reactos/lib/dbghelp
msc.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- msc.c	16 Dec 2004 17:42:10 -0000	1.1
+++ msc.c	16 Dec 2004 17:50:36 -0000	1.2
@@ -20,7 +20,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-
+ 
 /*
  * Note - this handles reading debug information for 32 bit applications
  * that run under Windows-NT for example.  I doubt that this would work well
@@ -31,14 +31,14 @@
  *	Get 16 bit CV stuff working.
  *	Add symbol size to internal symbol table.
  */
-
+ 
 #include "config.h"
 #include "wine/port.h"
-
+ 
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
-
+ 
 #include <string.h>
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
@@ -51,35 +51,35 @@
 #include "winbase.h"
 #include "winreg.h"
 #include "winternl.h"
-
-#include "wine/exception.h"
+ 
+#include <pseh.h>
+ 
 #include "wine/debug.h"
-#include "excpt.h"
 #include "dbghelp_private.h"
 #include "mscvpdb.h"
-
+ 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc);
-
+ 
 #define MAX_PATHNAME_LEN 1024
-
+ 
 /*========================================================================
  * Debug file access helper routines
  */
-
-static WINE_EXCEPTION_FILTER(page_fault)
+ 
+static _SEH_FILTER(page_fault)
 {
-    if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
-        return EXCEPTION_EXECUTE_HANDLER;
-    return EXCEPTION_CONTINUE_SEARCH;
+    if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
+        return _SEH_EXECUTE_HANDLER;
+    return _SEH_CONTINUE_SEARCH;
 }
-
+ 
 static void dump(const void* ptr, unsigned len)
 {
     int         i, j;
     BYTE        msg[128];
     const char* hexof = "0123456789abcdef";
     const BYTE* x = (const BYTE*)ptr;
-
+ 
     for (i = 0; i < len; i += 16)
     {
         sprintf(msg, "%08x: ", i);
@@ -97,16 +97,16 @@
         FIXME("%s\n", msg);
     }
 }
-
+ 
 /*========================================================================
  * Process CodeView type information.
  */
-
+ 
 #define MAX_BUILTIN_TYPES	0x0480
 #define FIRST_DEFINABLE_TYPE    0x1000
-
+ 
 static struct symt*     cv_basic_types[MAX_BUILTIN_TYPES];
-
+ 
 #define SymTagCVBitField        (SymTagMax + 0x100)
 struct codeview_bitfield
 {
@@ -115,13 +115,13 @@
     unsigned            bitposition;
     unsigned            bitlength;
 };
-
+ 
 struct cv_defined_module
 {
     BOOL                allowed;
     unsigned int        num_defined_types;
     struct symt**       defined_types;
-
+ 
     struct codeview_bitfield* bitfields;
     unsigned            num_bitfields;
     unsigned            used_bitfields;
@@ -130,7 +130,7 @@
 #define CV_MAX_MODULES          32
 static struct cv_defined_module cv_zmodules[CV_MAX_MODULES];
 static struct cv_defined_module*cv_current_module;
-
+ 
 static void codeview_init_basic_types(struct module* module)
 {
     /*
@@ -153,7 +153,7 @@
     cv_basic_types[T_WCHAR]  = &symt_new_basic(module, btWChar, "wchar_t", 2)->symt;
     cv_basic_types[T_INT4]   = &symt_new_basic(module, btInt,   "INT4", 4)->symt;
     cv_basic_types[T_UINT4]  = &symt_new_basic(module, btUInt,  "UINT4", 4)->symt;
-
+ 
     cv_basic_types[T_32PVOID]   = &symt_new_pointer(module, cv_basic_types[T_VOID])->symt;
     cv_basic_types[T_32PCHAR]   = &symt_new_pointer(module, cv_basic_types[T_CHAR])->symt;
     cv_basic_types[T_32PSHORT]  = &symt_new_pointer(module, cv_basic_types[T_SHORT])->symt;
@@ -170,12 +170,12 @@
     cv_basic_types[T_32PINT4]   = &symt_new_pointer(module, cv_basic_types[T_INT4])->symt;
     cv_basic_types[T_32PUINT4]  = &symt_new_pointer(module, cv_basic_types[T_UINT4])->symt;
 }
-
+ 
 static int numeric_leaf(int* value, const unsigned short int* leaf)
 {
     unsigned short int type = *leaf++;
     int length = 2;
-
+ 
     if (type < LF_NUMERIC)
     {
         *value = type;
@@ -188,121 +188,121 @@
             length += 1;
             *value = *(const char*)leaf;
             break;
-
+ 
         case LF_SHORT:
             length += 2;
             *value = *(const short*)leaf;
             break;
-
+ 
         case LF_USHORT:
             length += 2;
             *value = *(const unsigned short*)leaf;
             break;
-
+ 
         case LF_LONG:
             length += 4;
             *value = *(const int*)leaf;
             break;
-
+ 
         case LF_ULONG:
             length += 4;
             *value = *(const unsigned int*)leaf;
             break;
-
+ 
         case LF_QUADWORD:
         case LF_UQUADWORD:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 8;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_REAL32:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 4;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_REAL48:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 6;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_REAL64:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 8;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_REAL80:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 10;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_REAL128:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 16;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_COMPLEX32:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 4;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_COMPLEX64:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 8;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_COMPLEX80:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 10;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_COMPLEX128:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 16;
             *value = 0;    /* FIXME */
             break;
-
+ 
         case LF_VARSTRING:
 	    FIXME("Unsupported numeric leaf type %04x\n", type);
             length += 2 + *leaf;
             *value = 0;    /* FIXME */
             break;
-
+ 
         default:
 	    FIXME("Unknown numeric leaf type %04x\n", type);
             *value = 0;
             break;
         }
     }
-
+ 
     return length;
 }
-
+ 
 /* convert a pascal string (as stored in debug information) into
  * a C string (null terminated).
  */
 static const char* terminate_string(const struct p_string* p_name)
 {
     static char symname[256];
-
+ 
     memcpy(symname, p_name->name, p_name->namelen);
     symname[p_name->namelen] = '\0';
-
+ 
     return (!*symname || strcmp(symname, "__unnamed") == 0) ? NULL : symname;
 }
-
+ 
 static struct symt*  codeview_get_type(unsigned int typeno, BOOL allow_special)
 {
     struct symt*        symt = NULL;
-
+ 
     /*
      * Convert Codeview type numbers into something we can grok internally.
      * Numbers < FIRST_DEFINABLE_TYPE are all fixed builtin types.
@@ -318,9 +318,9 @@
         unsigned        mod_index = typeno >> 24;
         unsigned        mod_typeno = typeno & 0x00FFFFFF;
         struct cv_defined_module*       mod;
-
+ 
         mod = (mod_index == 0) ? cv_current_module : &cv_zmodules[mod_index];
-
+ 
         if (mod_index >= CV_MAX_MODULES || !mod->allowed) 
             FIXME("Module of index %d isn't loaded yet (%x)\n", mod_index, typeno);
         else
@@ -334,7 +334,7 @@
     if (!symt && typeno) FIXME("Returning NULL symt for type-id %x\n", typeno);
     return symt;
 }
-
+ 
 static int codeview_add_type(unsigned int typeno, struct symt* dt)
 {
     if (typeno < FIRST_DEFINABLE_TYPE)
@@ -359,18 +359,18 @@
             cv_current_module->defined_types = (struct symt**)
                 HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
                           cv_current_module->num_defined_types * sizeof(struct symt*));
-
+ 
         if (cv_current_module->defined_types == NULL) return FALSE;
     }
-
+ 
     cv_current_module->defined_types[typeno - FIRST_DEFINABLE_TYPE] = dt;
     return TRUE;
 }
-
+ 
 static void codeview_clear_type_table(void)
 {
     int i;
-
+ 
     for (i = 0; i < CV_MAX_MODULES; i++)
     {
         if (cv_zmodules[i].allowed && cv_zmodules[i].defined_types)
@@ -385,7 +385,7 @@
     }
     cv_current_module = NULL;
 }
-
+ 
 static int codeview_add_type_pointer(struct module* module, unsigned int typeno, 
                                      unsigned int datatype)
 {
@@ -393,7 +393,7 @@
                                           codeview_get_type(datatype, FALSE))->symt;
     return codeview_add_type(typeno, symt);
 }
-
+ 
 static int codeview_add_type_array(struct module* module, 
                                    unsigned int typeno, const char* name,
                                    unsigned int elemtype, unsigned int arr_len)
@@ -401,7 +401,7 @@
     struct symt*        symt;
     struct symt*        elem = codeview_get_type(elemtype, FALSE);
     DWORD               arr_max = 0;
-
+ 
     if (elem)
     {
         DWORD elem_size;
@@ -411,7 +411,7 @@
     symt = &symt_new_array(module, 0, arr_max, elem)->symt;
     return codeview_add_type(typeno, symt);
 }
-
+ 
 static int codeview_add_type_bitfield(unsigned int typeno, unsigned int bitoff,
                                       unsigned int nbits, unsigned int basetype)
 {
@@ -434,40 +434,40 @@
         }
         if (!cv_current_module->bitfields) return 0;
     }
-    
+ 
     cv_current_module->bitfields[cv_current_module->used_bitfields].symt.tag    = SymTagCVBitField;
     cv_current_module->bitfields[cv_current_module->used_bitfields].subtype     = basetype;
     cv_current_module->bitfields[cv_current_module->used_bitfields].bitposition = bitoff;
     cv_current_module->bitfields[cv_current_module->used_bitfields].bitlength   = nbits;
-
+ 
     return codeview_add_type(typeno, &cv_current_module->bitfields[cv_current_module->used_bitfields++].symt);
 }
-
+ 
 static int codeview_add_type_enum_field_list(struct module* module, 
                                              unsigned int typeno, 
                                              const unsigned char* list, int len)
 {
     struct symt_enum*           symt;
     const unsigned char*        ptr = list;
-
+ 
     symt = symt_new_enum(module, NULL);
     while (ptr - list < len)
     {
         const union codeview_fieldtype* type = (const union codeview_fieldtype*)ptr;
-
+ 
         if (*ptr >= 0xf0)       /* LF_PAD... */
         {
             ptr += *ptr & 0x0f;
             continue;
         }
-
+ 
         switch (type->generic.id)
         {
         case LF_ENUMERATE_V1:
         {
             int value, vlen = numeric_leaf(&value, &type->enumerate_v1.value);
             const struct p_string* p_name = (const struct p_string*)((const unsigned char*)&type->enumerate_v1.value + vlen);
-
+ 
             symt_add_enum_element(module, symt, terminate_string(p_name), value);
             ptr += 2 + 2 + vlen + (1 + p_name->namelen);
             break;
@@ -476,21 +476,21 @@
         {
             int value, vlen = numeric_leaf(&value, &type->enumerate_v3.value);
             const char* name = (const char*)&type->enumerate_v3.value + vlen;
-
+ 
             symt_add_enum_element(module, symt, name, value);
             ptr += 2 + 2 + vlen + (1 + strlen(name));
             break;
         }
-
+ 
         default:
             FIXME("Unsupported type %04x in ENUM field list\n", type->generic.id);
             return FALSE;
         }
     }
-
+ 
     return codeview_add_type(typeno, &symt->symt);
 }
-
+ 
 static int codeview_add_type_struct_field_list(struct module* module, 
                                                unsigned int typeno, 
                                                const unsigned char* list, int len)
@@ -502,67 +502,67 @@
     const char*                 c_name;
     struct symt*                subtype;
     const unsigned short int* p_vboff;
-
+ 
     symt = symt_new_udt(module, NULL, 0, UdtStruct /* don't care */);
     while (ptr - list < len)
     {
         const union codeview_fieldtype* type = (const union codeview_fieldtype*)ptr;
-
+ 
         if (*ptr >= 0xf0)       /* LF_PAD... */
         {
             ptr +=* ptr & 0x0f;
             continue;
         }
-
+ 
         switch (type->generic.id)
         {
         case LF_BCLASS_V1:
             leaf_len = numeric_leaf(&value, &type->bclass_v1.offset);
-
+ 
             /* FIXME: ignored for now */
-
+ 
             ptr += 2 + 2 + 2 + leaf_len;
             break;
-
+ 
         case LF_BCLASS_V2:
             leaf_len = numeric_leaf(&value, &type->bclass_v2.offset);
-
+ 
             /* FIXME: ignored for now */
-
+ 
             ptr += 2 + 2 + 4 + leaf_len;
             break;
-
+ 
         case LF_VBCLASS_V1:
         case LF_IVBCLASS_V1:
             {
                 leaf_len = numeric_leaf(&value, &type->vbclass_v1.vbpoff);
                 p_vboff = (const unsigned short int*)((const char*)&type->vbclass_v1.vbpoff + leaf_len);
                 vplen = numeric_leaf(&vpoff, p_vboff);
-
+ 
                 /* FIXME: ignored for now */
-
+ 
                 ptr += 2 + 2 + 2 + 2 + leaf_len + vplen;
             }
             break;
-
+ 
         case LF_VBCLASS_V2:
         case LF_IVBCLASS_V2:
             {
                 leaf_len = numeric_leaf(&value, &type->vbclass_v2.vbpoff);
                 p_vboff = (const unsigned short int*)((const char*)&type->vbclass_v2.vbpoff + leaf_len);
                 vplen = numeric_leaf(&vpoff, p_vboff);
-
+ 
                 /* FIXME: ignored for now */
-
+ 
                 ptr += 2 + 2 + 4 + 4 + leaf_len + vplen;
             }
             break;
-
+ 
         case LF_MEMBER_V1:
             leaf_len = numeric_leaf(&value, &type->member_v1.offset);
             p_name = (const struct p_string*)((const char*)&type->member_v1.offset + leaf_len);
             subtype = codeview_get_type(type->member_v1.type, TRUE);
-
+ 
             if (!subtype || subtype->tag != SymTagCVBitField)
             {
                 DWORD elem_size = 0;
@@ -578,15 +578,15 @@
                                      codeview_get_type(cvbf->subtype, FALSE),
                                      cvbf->bitposition, cvbf->bitlength);
             }
-
+ 
             ptr += 2 + 2 + 2 + leaf_len + (1 + p_name->namelen);
             break;
-
+ 
         case LF_MEMBER_V2:
             leaf_len = numeric_leaf(&value, &type->member_v2.offset);
             p_name = (const struct p_string*)((const unsigned char*)&type->member_v2.offset + leaf_len);
             subtype = codeview_get_type(type->member_v2.type, TRUE);
-
+ 
             if (!subtype || subtype->tag != SymTagCVBitField)
             {
                 DWORD elem_size = 0;
@@ -601,15 +601,15 @@
                                      codeview_get_type(cvbf->subtype, FALSE),
                                      cvbf->bitposition, cvbf->bitlength);
             }
-
+ 
             ptr += 2 + 2 + 4 + leaf_len + (1 + p_name->namelen);
             break;
-
+ 
         case LF_MEMBER_V3:
             leaf_len = numeric_leaf(&value, &type->member_v3.offset);
             c_name = (const char*)&type->member_v3.offset + leaf_len;
             subtype = codeview_get_type(type->member_v3.type, TRUE);
-
+ 
             if (!subtype || subtype->tag != SymTagCVBitField)
             {
                 DWORD elem_size = 0;
@@ -624,50 +624,50 @@
                                      codeview_get_type(cvbf->subtype, FALSE),
                                      cvbf->bitposition, cvbf->bitlength);
             }
-
+ 
             ptr += 2 + 2 + 4 + leaf_len + (strlen(c_name) + 1);
             break;
-
+ 
         case LF_STMEMBER_V1:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + 2 + (1 + type->stmember_v1.p_name.namelen);
             break;
-
+ 
         case LF_STMEMBER_V2:
             /* FIXME: ignored for now */
             ptr += 2 + 4 + 2 + (1 + type->stmember_v2.p_name.namelen);
             break;
-
+ 
         case LF_METHOD_V1:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + 2 + (1 + type->method_v1.p_name.namelen);
             break;
-
+ 
         case LF_METHOD_V2:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + 4 + (1 + type->method_v2.p_name.namelen);
             break;
-
+ 
         case LF_NESTTYPE_V1:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + (1 + type->nesttype_v1.p_name.namelen);
             break;
-
+ 
         case LF_NESTTYPE_V2:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + 4 + (1 + type->nesttype_v2.p_name.namelen);
             break;
-
+ 
         case LF_VFUNCTAB_V1:
             /* FIXME: ignored for now */
             ptr += 2 + 2;
             break;
-
+ 
         case LF_VFUNCTAB_V2:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + 4;
             break;
-
+ 
         case LF_ONEMETHOD_V1:
             /* FIXME: ignored for now */
             switch ((type->onemethod_v1.attribute >> 2) & 7)
@@ -675,13 +675,13 @@
             case 4: case 6: /* (pure) introducing virtual method */
                 ptr += 2 + 2 + 2 + 4 + (1 + type->onemethod_virt_v1.p_name.namelen);
                 break;
-
+ 
             default:
                 ptr += 2 + 2 + 2 + (1 + type->onemethod_v1.p_name.namelen);
                 break;
             }
             break;
-
+ 
         case LF_ONEMETHOD_V2:
             /* FIXME: ignored for now */
             switch ((type->onemethod_v2.attribute >> 2) & 7)
@@ -689,47 +689,47 @@
             case 4: case 6: /* (pure) introducing virtual method */
                 ptr += 2 + 2 + 4 + 4 + (1 + type->onemethod_virt_v2.p_name.namelen);
                 break;
-
+ 
             default:
                 ptr += 2 + 2 + 4 + (1 + type->onemethod_v2.p_name.namelen);
                 break;
             }
             break;
-
+ 
         default:
             FIXME("Unsupported type %04x in STRUCT field list\n", type->generic.id);
             return FALSE;
         }
     }
-
+ 
     return codeview_add_type(typeno, &symt->symt);
 }
-
+ 
 static int codeview_add_type_enum(struct module* module, unsigned int typeno, 
                                   const char* name, unsigned int fieldlist)
 {
     struct symt_enum*   symt = symt_new_enum(module, name);
     struct symt*        list = codeview_get_type(fieldlist, FALSE);
-
+ 
     /* FIXME: this is rather ugly !!! */
     if (list) symt->vchildren = ((struct symt_enum*)list)->vchildren;
-
+ 
     return codeview_add_type(typeno, &symt->symt);
 }
-
+ 
 static int codeview_add_type_struct(struct module* module, unsigned int typeno, 
                                     const char* name, int structlen, 
                                     unsigned int fieldlist, enum UdtKind kind)
 {
     struct symt_udt*    symt = symt_new_udt(module, name, structlen, kind);
     struct symt*        list = codeview_get_type(fieldlist, FALSE);
-
+ 
     /* FIXME: this is rather ugly !!! */
     if (list) symt->vchildren = ((struct symt_udt*)list)->vchildren;
-
+ 
     return codeview_add_type(typeno, &symt->symt);
 }
-
+ 
 static int codeview_new_func_signature(struct module* module, unsigned typeno,
                                            unsigned ret_type)
 {
@@ -738,7 +738,7 @@
                                         codeview_get_type(ret_type, FALSE))->symt;
     return codeview_add_type(typeno, symt);
 }
-
+ 
 static int codeview_parse_type_table(struct module* module, const char* table,
                                      int len)
 {
@@ -749,12 +749,12 @@
     int                         value, leaf_len;
     const struct p_string*      p_name;
     const char*                 c_name;
-
+ 
     while (ptr - table < len)
     {
         retv = TRUE;
         type = (const union codeview_type*)ptr;
-
+ 
         switch (type->generic.id)
         {
         case LF_MODIFIER_V1:
@@ -781,7 +781,7 @@
             codeview_add_type(curr_type, 
                               codeview_get_type(type->modifier_v2.type, FALSE));
             break;
-
+ 
         case LF_POINTER_V1:
             retv = codeview_add_type_pointer(module, curr_type, 
                                              type->pointer_v1.datatype);
@@ -790,29 +790,29 @@
             retv = codeview_add_type_pointer(module, curr_type, 
                                              type->pointer_v2.datatype);
             break;
-
+ 
         case LF_ARRAY_V1:
             leaf_len = numeric_leaf(&value, &type->array_v1.arrlen);
             p_name = (const struct p_string*)((const unsigned char*)&type->array_v1.arrlen + leaf_len);
-
+ 
             retv = codeview_add_type_array(module, curr_type, terminate_string(p_name),
                                            type->array_v1.elemtype, value);
             break;
         case LF_ARRAY_V2:
             leaf_len = numeric_leaf(&value, &type->array_v2.arrlen);
             p_name = (const struct p_string*)((const unsigned char*)&type->array_v2.arrlen + leaf_len);
-
+ 
             retv = codeview_add_type_array(module, curr_type, terminate_string(p_name),
                                            type->array_v2.elemtype, value);
             break;
         case LF_ARRAY_V3:
             leaf_len = numeric_leaf(&value, &type->array_v3.arrlen);
             c_name = (const char*)&type->array_v3.arrlen + leaf_len;
-
+ 
             retv = codeview_add_type_array(module, curr_type, c_name,
                                            type->array_v3.elemtype, value);
             break;
-
+ 
         case LF_BITFIELD_V1:
             /* a bitfield is a CodeView specific data type which represent a bitfield
              * in a structure or a class. For now, we store it in a SymTag-like type
@@ -846,7 +846,7 @@
                 */
                const char* list = type->fieldlist.list;
                int   len  = (ptr + type->generic.len + 2) - list;
-
+ 
                if (((const union codeview_fieldtype*)list)->generic.id == LF_ENUMERATE_V1 ||
                    ((const union codeview_fieldtype*)list)->generic.id == LF_ENUMERATE_V3)
                    retv = codeview_add_type_enum_field_list(module, curr_type, list, len);
@@ -854,63 +854,63 @@
                    retv = codeview_add_type_struct_field_list(module, curr_type, list, len);
            }
            break;
-
+ 
         case LF_STRUCTURE_V1:
         case LF_CLASS_V1:
             leaf_len = numeric_leaf(&value, &type->struct_v1.structlen);
             p_name = (const struct p_string*)((const unsigned char*)&type->struct_v1.structlen + leaf_len);
-
+ 
             retv = codeview_add_type_struct(module, curr_type, terminate_string(p_name),
                                             value, type->struct_v1.fieldlist,
                                             type->generic.id == LF_CLASS_V1 ? UdtClass : UdtStruct);
             break;
-
+ 
         case LF_STRUCTURE_V2:
         case LF_CLASS_V2:
             leaf_len = numeric_leaf(&value, &type->struct_v2.structlen);
             p_name = (const struct p_string*)((const unsigned char*)&type->struct_v2.structlen + leaf_len);
-
+ 
             retv = codeview_add_type_struct(module, curr_type, terminate_string(p_name),
                                             value, type->struct_v2.fieldlist,
                                             type->generic.id == LF_CLASS_V2 ? UdtClass : UdtStruct);
             break;
-
+ 
         case LF_STRUCTURE_V3:
         case LF_CLASS_V3:
             leaf_len = numeric_leaf(&value, &type->struct_v3.structlen);
             c_name = (const char*)&type->struct_v3.structlen + leaf_len;
-
+ 
             retv = codeview_add_type_struct(module, curr_type, c_name,
                                             value, type->struct_v3.fieldlist,
                                             type->generic.id == LF_CLASS_V3 ? UdtClass : UdtStruct);
             break;
-
+ 
         case LF_UNION_V1:
             leaf_len = numeric_leaf(&value, &type->union_v1.un_len);
             p_name = (const struct p_string*)((const unsigned char*)&type->union_v1.un_len + leaf_len);
-
+ 
             retv = codeview_add_type_struct(module, curr_type, terminate_string(p_name),
                                             value, type->union_v1.fieldlist, UdtUnion);
             break;
         case LF_UNION_V2:
             leaf_len = numeric_leaf(&value, &type->union_v2.un_len);
             p_name = (const struct p_string*)((const unsigned char*)&type->union_v2.un_len + leaf_len);
-
+ 
             retv = codeview_add_type_struct(module, curr_type, terminate_string(p_name),
                                             value, type->union_v2.fieldlist, UdtUnion);
             break;
         case LF_UNION_V3:
             leaf_len = numeric_leaf(&value, &type->union_v3.un_len);
             c_name = (const char*)&type->union_v3.un_len + leaf_len;
-
+ 
             retv = codeview_add_type_struct(module, curr_type, c_name,
                                             value, type->union_v3.fieldlist, UdtUnion);
-
+ 
         case LF_ENUM_V1:
             retv = codeview_add_type_enum(module, curr_type, terminate_string(&type->enumeration_v1.p_name),
                                           type->enumeration_v1.field);
             break;
-
+ 
         case LF_ENUM_V2:
             retv = codeview_add_type_enum(module, curr_type, terminate_string(&type->enumeration_v2.p_name),
                                           type->enumeration_v2.field);
@@ -949,7 +949,7 @@
                     FIXME("Not adding parameters' types to function signature\n");
             }
             break;
-
+ 
         default:
             FIXME("Unsupported type-id leaf %x\n", type->generic.id);
             dump(type, 2 + type->generic.len);
@@ -959,14 +959,14 @@
         curr_type++;
         ptr += type->generic.len + 2;
     }
-
+ 
     return TRUE;
 }
-
+ 
 /*========================================================================
  * Process CodeView line number information.
  */
-
+ 
 static struct codeview_linetab* codeview_snarf_linetab(struct module* module, 
                                                        const char* linetab, int size,
                                                        BOOL pascal_str)
@@ -986,16 +986,16 @@
     const struct startend*      start;
     int				this_seg;
     struct symt_compiland*      compiland;
-
+ 
     /*
      * Now get the important bits.
      */
     pnt.c = linetab;
     nfile = *pnt.s++;
     nseg = *pnt.s++;
-
+ 
     filetab = (const unsigned int*) pnt.c;
-
+ 
     /*
      * Now count up the number of segments in the file.
      */
@@ -1005,7 +1005,7 @@
         pnt2.c = linetab + filetab[i];
         nseg += *pnt2.s;
     }
-
+ 
     /*
      * Next allocate the header we will be returning.
      * There is one header for each segment, so that we can reach in
@@ -1017,14 +1017,14 @@
     {
         goto leave;
     }
-
+ 
     /*
      * Now fill the header we will be returning, one for each segment.
      * Note that this will basically just contain pointers into the existing
      * line table, and we do not actually copy any additional information
      * or allocate any additional memory.
      */
-
+ 
     this_seg = 0;
     for (i = 0; i < nfile; i++)
     {
@@ -1033,11 +1033,11 @@
          */
         pnt2.c = linetab + filetab[i];
         file_segcount = *pnt2.s;
-
+ 
         pnt2.ui++;
         lt_ptr = (const unsigned int*) pnt2.c;
         start = (const struct startend*)(lt_ptr + file_segcount);
-
+ 
         /*
          * Now snarf the filename for all of the segments for this file.
          */
@@ -1050,7 +1050,7 @@
         }
         else
             compiland = symt_new_compiland(module, (const char*)(start + file_segcount));
-        
+ 
         for (k = 0; k < file_segcount; k++, this_seg++)
 	{
             pnt2.c = linetab + lt_ptr[k];
@@ -1063,34 +1063,34 @@
             lt_hdr[this_seg].linetab    = (const unsigned short*)(pnt2.ui + lt_hdr[this_seg].nline);
 	}
     }
-
+ 
 leave:
-
+ 
   return lt_hdr;
-
+ 
 }
-
+ 
 /*========================================================================
  * Process CodeView symbol information.
  */
-
+ 
 static unsigned int codeview_map_offset(const struct msc_debug_info* msc_dbg,
                                         unsigned int offset)
 {
     int                 nomap = msc_dbg->nomap;
     const OMAP_DATA*    omapp = msc_dbg->omapp;
     int                 i;
-
+ 
     if (!nomap || !omapp) return offset;
-
+ 
     /* FIXME: use binary search */
     for (i = 0; i < nomap - 1; i++)
         if (omapp[i].from <= offset && omapp[i+1].from > offset)
             return !omapp[i].to ? 0 : omapp[i].to + (offset - omapp[i].from);
-
+ 
     return 0;
 }
-
+ 
 static const struct codeview_linetab*
 codeview_get_linetab(const struct codeview_linetab* linetab,
                      unsigned seg, unsigned offset)
@@ -1108,25 +1108,25 @@
     }
     return linetab;
[truncated at 1000 lines; 925 more skipped]
CVSspam 0.2.8