Synced dbghelp.dll with Wine HEAD.
authorPierre Schweitzer <pierre@reactos.org>
Sat, 2 Aug 2008 18:30:38 +0000 (18:30 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 2 Aug 2008 18:30:38 +0000 (18:30 +0000)
svn path=/trunk/; revision=35043

24 files changed:
reactos/dll/win32/dbghelp/Makefile.in [deleted file]
reactos/dll/win32/dbghelp/dbghelp.c
reactos/dll/win32/dbghelp/dbghelp.def [deleted file]
reactos/dll/win32/dbghelp/dbghelp.rbuild
reactos/dll/win32/dbghelp/dbghelp.rc [deleted file]
reactos/dll/win32/dbghelp/dbghelp.spec
reactos/dll/win32/dbghelp/dbghelp_private.h
reactos/dll/win32/dbghelp/dwarf.c
reactos/dll/win32/dbghelp/dwarf.h
reactos/dll/win32/dbghelp/minidump.c
reactos/dll/win32/dbghelp/module.c
reactos/dll/win32/dbghelp/msc.c
reactos/dll/win32/dbghelp/path.c
reactos/dll/win32/dbghelp/pe_module.c
reactos/dll/win32/dbghelp/stabs.c
reactos/dll/win32/dbghelp/stackframe.h [deleted file]
reactos/dll/win32/dbghelp/stubs.c [deleted file]
reactos/dll/win32/dbghelp/symbol.c
reactos/dll/win32/dbghelp/thread.h [deleted file]
reactos/dll/win32/dbghelp/type.c
reactos/dll/win32/shell32/fprop.c
reactos/include/psdk/dbghelp.h
reactos/include/reactos/wine/mscvpdb.h
reactos/media/doc/README.WINE

diff --git a/reactos/dll/win32/dbghelp/Makefile.in b/reactos/dll/win32/dbghelp/Makefile.in
deleted file mode 100644 (file)
index 280e199..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-TOPSRCDIR = @top_srcdir@
-TOPOBJDIR = ../..
-SRCDIR    = @srcdir@
-VPATH     = @srcdir@
-MODULE    = dbghelp.dll
-IMPORTLIB = libdbghelp.$(IMPLIBEXT)
-IMPORTS   = psapi kernel32 ntdll
-
-C_SRCS = \
-       coff.c \
-       dbghelp.c \
-       dwarf.c \
-       elf_module.c \
-       image.c \
-       memory.c \
-       minidump.c \
-       module.c \
-       msc.c \
-       path.c \
-       pe_module.c \
-       source.c \
-       stabs.c \
-       stack.c \
-       storage.c \
-       symbol.c \
-       type.c
-
-@MAKE_DLL_RULES@
-
-@DEPENDENCIES@  # everything below this line is overwritten by make depend
index dc3b86a..fba22d0 100644 (file)
@@ -268,8 +268,14 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP
 
     TRACE("(%p %s %u)\n", hProcess, debugstr_w(UserSearchPath), fInvadeProcess);
 
-    if (process_find_by_handle(hProcess))
-        FIXME("what to do ??\n");
+    if (process_find_by_handle(hProcess)){
+        WARN("the symbols for this process have already been initialized!\n");
+
+        /* MSDN says to only call this function once unless SymCleanup() has been called since the last call.
+           It also says to call SymRefreshModuleList() instead if you just want the module list refreshed.
+           Native still returns TRUE even if the process has already been initialized. */
+        return TRUE;
+    }
 
     pcs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pcs));
     if (!pcs) return FALSE;
@@ -379,6 +385,8 @@ BOOL WINAPI SymCleanup(HANDLE hProcess)
             return TRUE;
         }
     }
+
+    ERR("this process has not had SymInitialize() called for it!\n");
     return FALSE;
 }
 
diff --git a/reactos/dll/win32/dbghelp/dbghelp.def b/reactos/dll/win32/dbghelp/dbghelp.def
deleted file mode 100644 (file)
index 18e369a..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-; $Id: dbghelp.def 27344 2007-08-01 14:12:10Z tkreuzer $
-;
-; ReactOS Operating System
-;
-; This file contains all dbghelp.dll exports
-;
-LIBRARY dbghelp.dll
-
-EXPORTS
-;SymGetOmapBlockBase
-DbgHelpCreateUserDump@12
-DbgHelpCreateUserDumpW@12
-EnumDirTree@24
-EnumDirTreeW@24
-EnumerateLoadedModules64@12
-EnumerateLoadedModules@12
-EnumerateLoadedModulesW64@12
-ExtensionApiVersion@0
-FindDebugInfoFile@12
-FindDebugInfoFileEx@20
-;FindDebugInfoFileExW;   not existent on windows, stubbed in wine spec
-FindExecutableImage@12
-FindExecutableImageEx@20
-FindExecutableImageExW@20
-FindFileInPath@32
-FindFileInSearchPath@28
-GetTimestampForLoadedLibrary@4
-ImageDirectoryEntryToData@16=ntdll.RtlImageDirectoryEntryToData
-ImageDirectoryEntryToDataEx@20
-ImageNtHeader@4=ntdll.RtlImageNtHeader
-ImageRvaToSection@12=ntdll.RtlImageRvaToSection
-ImageRvaToVa@16=ntdll.RtlImageRvaToVa
-ImagehlpApiVersion@0
-ImagehlpApiVersionEx@4
-MakeSureDirectoryPathExists@4
-MapDebugInformation@16
-MiniDumpReadDumpStream@20
-MiniDumpWriteDump@28
-SearchTreeForFile@12
-SearchTreeForFileW@12
-StackWalk64@36
-StackWalk@36
-SymAddSymbol@32
-SymAddSymbolW@32
-SymCleanup@4
-SymDeleteSymbol@28
-SymDeleteSymbolW@28
-SymEnumLines@28
-SymEnumLinesW@28
-SymEnumProcesses@8
-SymEnumSourceFiles@24
-SymEnumSourceFilesW@24
-SymEnumSourceLines@36
-SymEnumSourceLinesW@36
-SymEnumSym@20
-SymEnumSymbols@24
-SymEnumSymbolsForAddr@20
-SymEnumSymbolsForAddrW@20
-SymEnumSymbolsW@24
-SymEnumTypes@20
-SymEnumTypesW@20
-SymEnumerateModules64@12
-SymEnumerateModules@12
-SymEnumerateModulesW64@12
-SymEnumerateSymbols64@20
-SymEnumerateSymbols@16
-SymEnumerateSymbolsW64@20
-SymEnumerateSymbolsW@16
-;SymFindDebugInfoFile;   not existent on windows, stubbed in wine spec
-;SymFindDebugInfoFileW;   not existent on windows, stubbed in wine spec
-SymFindFileInPath@40
-SymFindFileInPathW@40
-SymFromAddr@20
-SymFromAddrW@20
-SymFromIndex@20
-SymFromIndexW@20
-SymFromName@12
-SymFromNameW@12
-SymFromToken@20
-SymFromTokenW@20
-SymFunctionTableAccess64@12
-SymFunctionTableAccess@8
-SymGetFileLineOffsets64@20
-SymGetHomeDirectory@12
-SymGetHomeDirectoryW@12
-SymGetLineFromAddr64@20
-SymGetLineFromAddr@16
-SymGetLineFromAddrW64@20
-SymGetLineFromName64@24
-SymGetLineFromName@24
-SymGetLineFromNameW64@24
-SymGetLineNext64@8
-SymGetLineNext@8
-SymGetLineNextW64@8
-SymGetLinePrev64@8
-SymGetLinePrev@8
-SymGetLinePrevW64@8
-SymGetModuleBase64@12
-SymGetModuleBase@8
-SymGetModuleInfo64@16
-SymGetModuleInfo@12
-SymGetModuleInfoW64@16
-SymGetModuleInfoW@12
-SymGetOptions@0
-SymGetScope@20
-SymGetScopeW@20
-SymGetSearchPath@12
-SymGetSearchPathW@12
-SymGetSourceFile@28
-SymGetSourceFileFromToken@20
-SymGetSourceFileFromTokenW@20
-SymGetSourceFileToken@24
-SymGetSourceFileTokenW@24
-;SymGetSourceFileW
-;SymGetSourceVarFromToken
-;SymGetSourceVarFromTokenW
-SymGetSymFromAddr64@20
-SymGetSymFromAddr@16
-SymGetSymFromName64@12
-SymGetSymFromName@12
-SymGetSymNext64@8
-SymGetSymNext@8
-SymGetSymPrev64@8
-SymGetSymPrev@8
-SymGetSymbolFile@32
-SymGetSymbolFileW@32
-SymGetTypeFromName@20
-SymGetTypeFromNameW@20
-SymGetTypeInfo@24
-SymGetTypeInfoEx@16
-SymInitialize@12
-SymInitializeW@12
-SymLoadModule64@28
-SymLoadModule@24
-SymLoadModuleEx@36
-SymLoadModuleExW@36
-SymMatchFileName@16
-SymMatchFileNameW@16
-SymMatchString@12
-SymMatchStringA@12
-SymMatchStringW@12
-SymNext@8
-SymNextW@8
-SymPrev@8
-SymPrevW@8
-;SymRefreshModuleList
-SymRegisterCallback64@16
-SymRegisterCallback@12
-SymRegisterCallbackW64@16
-SymRegisterFunctionEntryCallback64@16
-SymRegisterFunctionEntryCallback@12
-SymSearch@44
-SymSearchW@44
-SymSetContext@12
-SymSetHomeDirectory@8
-SymSetHomeDirectoryW@8
-SymSetOptions@4
-SymSetParentWindow@4
-SymSetSearchPath@8
-SymSetSearchPathW@8
-;SymSetSymWithAddr64
-SymSrvDeltaName@20
-SymSrvDeltaNameW@20
-;SymSrvGetFileIndexInfo;   not existent on windows, stubbed in wine spec
-;SymSrvGetFileIndexInfoW;   not existent on windows, stubbed in wine spec
-SymSrvGetFileIndexString@24
-SymSrvGetFileIndexStringW@24
-SymSrvGetFileIndexes@20
-SymSrvGetFileIndexesW@20
-SymSrvGetSupplement@16
-SymSrvGetSupplementW@16
-SymSrvIsStore@8
-SymSrvIsStoreW@8
-SymSrvStoreFile@16
-SymSrvStoreFileW@16
-SymSrvStoreSupplement@20
-SymSrvStoreSupplementW@20
-SymUnDName64@12
-SymUnDName@12
-SymUnloadModule64@12
-SymUnloadModule@8
-UnDecorateSymbolName@16
-UnDecorateSymbolNameW@16
-UnmapDebugInformation@4
-WinDbgExtensionDllInit@12
-;block
-;dbghelp
-;dh
-;fptr
-;homedir
-;lmi
-;lminfo
-;omap
-;srcfiles
-;stack_force_ebp
-;stackdbg
-;sym
-;symsrv
-;vc7fpo
index b7e71c8..236536a 100644 (file)
@@ -1,17 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
+<group>
 <module name="dbghelp" type="win32dll" baseaddress="${BASEADDRESS_DBGHELP}" installbase="system32" installname="dbghelp.dll" allowwarnings="true">
-       <importlibrary definition="dbghelp.def" />
+       <importlibrary definition="dbghelp.spec.def" />
        <include base="dbghelp">.</include>
        <include base="ReactOS">include/reactos/wine</include>
-       <define name="_WIN32_IE">0x600</define>
-       <define name="_WIN32_WINNT">0x502</define>
-       <define name="WINVER">0x502</define>
        <define name="__WINESRC__" />
+       <define name="WINVER">0x600</define>
+       <define name="_WIN32_WINNT">0x600</define>
        <define name="HAVE_REGEX_H" />
-       <library>ntdll</library>
-       <library>wine</library>
-       <library>pseh</library>
-       <library>kernel32</library>
-       <library>psapi</library>
        <file>coff.c</file>
        <file>dbghelp.c</file>
        <file>dwarf.c</file>
        <file>source.c</file>
        <file>stabs.c</file>
        <file>stack.c</file>
-       <file>stubs.c</file>
        <file>storage.c</file>
        <file>symbol.c</file>
        <file>type.c</file>
-       <file>dbghelp.rc</file>
+       <file>dbghelp.spec</file>
+       <library>wine</library>
+       <library>psapi</library>
+       <library>kernel32</library>
+       <library>version</library>
+       <library>ntdll</library>
 </module>
+</group>
diff --git a/reactos/dll/win32/dbghelp/dbghelp.rc b/reactos/dll/win32/dbghelp/dbghelp.rc
deleted file mode 100644 (file)
index 766ec2b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "wine/wine_common_ver.rc"
index b023f3d..b95a9e7 100644 (file)
@@ -15,8 +15,8 @@
 @ stub FindFileInPath
 @ stub FindFileInSearchPath
 @ stdcall GetTimestampForLoadedLibrary(long)
-@ stdcall ImageDirectoryEntryToData(ptr long long ptr) ntdll.RtlImageDirectoryEntryToData
-@ stub ImageDirectoryEntryToDataEx
+@ stdcall ImageDirectoryEntryToData(ptr long long ptr)
+@ stdcall ImageDirectoryEntryToDataEx(ptr long long ptr ptr)
 @ stdcall ImageNtHeader(ptr) ntdll.RtlImageNtHeader
 @ stdcall ImageRvaToSection(ptr ptr long) ntdll.RtlImageRvaToSection
 @ stdcall ImageRvaToVa(ptr ptr long ptr) ntdll.RtlImageRvaToVa
@@ -48,7 +48,7 @@
 @ stdcall SymEnumerateModules64(long ptr ptr)
 @ stdcall SymEnumerateModulesW64(long ptr ptr)
 @ stdcall SymEnumerateSymbols(long long ptr ptr)
-@ stub SymEnumerateSymbols64
+@ stdcall SymEnumerateSymbols64(long double ptr ptr)
 @ stub SymEnumerateSymbolsW
 @ stub SymEnumerateSymbolsW64
 @ stub SymFindDebugInfoFile
index 99b8b54..e4cae5b 100644 (file)
@@ -106,7 +106,7 @@ void     hash_table_iter_init(const struct hash_table* ht,
 void*    hash_table_iter_up(struct hash_table_iter* hti);
 
 #define GET_ENTRY(__i, __t, __f) \
-    ((__t*)((char*)(__i) - (unsigned int)(&((__t*)0)->__f)))
+    ((__t*)((char*)(__i) - FIELD_OFFSET(__t,__f)))
 
 
 extern unsigned dbghelp_options;
@@ -206,12 +206,12 @@ struct symt_function
     struct vector               vchildren;      /* locals, params, blocks, start/end, labels */
 };
 
-struct symt_function_point
+struct symt_hierarchy_point
 {
     struct symt                 symt;           /* either SymTagFunctionDebugStart, SymTagFunctionDebugEnd, SymTagLabel */
-    struct symt_function*       parent;
+    struct hash_table_elt       hash_elt;       /* if label (and in compiland's hash table if global) */
+    struct symt*                parent;         /* symt_function or symt_compiland */
     struct location             loc;
-    const char*                 name;           /* for labels */
 };
 
 struct symt_public
@@ -256,6 +256,7 @@ struct symt_basic
 struct symt_enum
 {
     struct symt                 symt;
+    struct symt*                base_type;
     const char*                 name;
     struct vector               vchildren;
 };
@@ -548,7 +549,7 @@ extern struct symt_block*
                     symt_close_func_block(struct module* module, 
                                           struct symt_function* func,
                                           struct symt_block* block, unsigned pc);
-extern struct symt_function_point*
+extern struct symt_hierarchy_point*
                     symt_add_function_point(struct module* module, 
                                             struct symt_function* func,
                                             enum SymTagEnum point, 
@@ -568,6 +569,10 @@ extern struct symt_data*
                                       struct symt_compiland* parent,
                                       const char* name, struct symt* type,
                                       const VARIANT* v);
+extern struct symt_hierarchy_point*
+                    symt_new_label(struct module* module,
+                                   struct symt_compiland* compiland,
+                                   const char* name, unsigned long address);
 
 /* type.c */
 extern void         symt_init_basic(struct module* module);
@@ -587,7 +592,8 @@ extern BOOL         symt_add_udt_element(struct module* module,
                                          struct symt* elt_type, unsigned offset, 
                                          unsigned size);
 extern struct symt_enum*
-                    symt_new_enum(struct module* module, const char* typename);
+                    symt_new_enum(struct module* module, const char* typename,
+                                  struct symt* basetype);
 extern BOOL         symt_add_enum_element(struct module* module, 
                                           struct symt_enum* enum_type, 
                                           const char* name, int value);
index a03b049..ccd39fb 100644 (file)
@@ -19,6 +19,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define NONAMELESSUNION
+
 #include "config.h"
 
 #include <sys/types.h>
@@ -167,6 +169,13 @@ typedef struct dwarf2_traverse_context_s
     unsigned char               word_size;
 } dwarf2_traverse_context_t;
 
+/* symt_cache indexes */
+#define sc_void 0
+#define sc_int1 1
+#define sc_int2 2
+#define sc_int4 3
+#define sc_num  4
+
 typedef struct dwarf2_parse_context_s
 {
     const dwarf2_section_t*     sections;
@@ -179,6 +188,7 @@ typedef struct dwarf2_parse_context_s
     unsigned long               load_offset;
     unsigned long               ref_offset;
     unsigned char               word_size;
+    struct symt*                symt_cache[sc_num]; /* void, int1, int2, int4 */
 } dwarf2_parse_context_t;
 
 /* stored in the dbghelp's module internal structure for later reuse */
@@ -932,7 +942,7 @@ static struct symt* dwarf2_parse_base_type(dwarf2_parse_context_t* ctx,
     struct attribute size;
     struct attribute encoding;
     enum BasicType bt;
-
+    int cache_idx = -1;
     if (di->symt) return di->symt;
 
     TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); 
@@ -956,6 +966,25 @@ static struct symt* dwarf2_parse_base_type(dwarf2_parse_context_t* ctx,
     default:                    bt = btNoType; break;
     }
     di->symt = &symt_new_basic(ctx->module, bt, name.u.string, size.u.uvalue)->symt;
+    switch (bt)
+    {
+    case btVoid:
+        assert(size.u.uvalue == 0);
+        cache_idx = sc_void;
+        break;
+    case btInt:
+        switch (size.u.uvalue)
+        {
+        case 1: cache_idx = sc_int1; break;
+        case 2: cache_idx = sc_int2; break;
+        case 4: cache_idx = sc_int4; break;
+        }
+        break;
+    default: break;
+    }
+    if (cache_idx != -1 && !ctx->symt_cache[cache_idx])
+        ctx->symt_cache[cache_idx] = di->symt;
+
     if (di->abbrev->have_child) FIXME("Unsupported children\n");
     return di->symt;
 }
@@ -991,8 +1020,10 @@ static struct symt* dwarf2_parse_pointer_type(dwarf2_parse_context_t* ctx,
 
     if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 0;
     if (!(ref_type = dwarf2_lookup_type(ctx, di)))
-        ref_type = &symt_new_basic(ctx->module, btVoid, "void", 0)->symt;
-
+    {
+        ref_type = ctx->symt_cache[sc_void];
+        assert(ref_type);
+    }
     di->symt = &symt_new_pointer(ctx->module, ref_type)->symt;
     if (di->abbrev->have_child) FIXME("Unsupported children\n");
     return di->symt;
@@ -1181,6 +1212,7 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx,
             case DW_TAG_structure_type:
             case DW_TAG_class_type:
             case DW_TAG_union_type:
+            case DW_TAG_typedef:
                 /* FIXME: we need to handle nested udt definitions */
                 break;
             default:
@@ -1215,15 +1247,24 @@ static struct symt* dwarf2_parse_enumeration_type(dwarf2_parse_context_t* ctx,
 {
     struct attribute    name;
     struct attribute    size;
+    struct symt_basic*  basetype;
 
     if (di->symt) return di->symt;
 
     TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); 
 
     if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) name.u.string = NULL;
-    if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 0;
+    if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 4;
+
+    switch (size.u.uvalue) /* FIXME: that's wrong */
+    {
+    case 1: basetype = symt_new_basic(ctx->module, btInt, "char", 1); break;
+    case 2: basetype = symt_new_basic(ctx->module, btInt, "short", 2); break;
+    default:
+    case 4: basetype = symt_new_basic(ctx->module, btInt, "int", 4); break;
+    }
 
-    di->symt = &symt_new_enum(ctx->module, name.u.string)->symt;
+    di->symt = &symt_new_enum(ctx->module, name.u.string, &basetype->symt)->symt;
 
     if (di->abbrev->have_child) /* any interest to not have child ? */
     {
@@ -1530,7 +1571,11 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
 
     TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
 
-    if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) name.u.string = NULL;
+    if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name))
+    {
+        WARN("No name for function... dropping function\n");
+        return NULL;
+    }
     /* if it's an abstract representation of an inline function, there should be
      * a concrete object that we'll handle
      */
@@ -1554,7 +1599,10 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
         is_decl.u.uvalue = 0;
         
     if (!(ret_type = dwarf2_lookup_type(ctx, di)))
-        ret_type = &symt_new_basic(ctx->module, btVoid, "void", 0)->symt;
+    {
+        ret_type = ctx->symt_cache[sc_void];
+        assert(ret_type);
+    }
 
     /* FIXME: assuming C source code */
     sig_type = symt_new_function_signature(ctx->module, ret_type, CV_CALL_FAR_C);
@@ -1631,7 +1679,7 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
         symt_add_function_point(ctx->module, subpgm.func, SymTagCustom,
                                 &subpgm.frame, NULL);
     }
-    symt_normalize_function(subpgm.ctx->module, subpgm.func);
+    if (subpgm.func) symt_normalize_function(subpgm.ctx->module, subpgm.func);
 
     return di->symt;
 }
@@ -1647,7 +1695,10 @@ static struct symt* dwarf2_parse_subroutine_type(dwarf2_parse_context_t* ctx,
     TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
 
     if (!(ret_type = dwarf2_lookup_type(ctx, di)))
-        ret_type = &symt_new_basic(ctx->module, btVoid, "void", 0)->symt;
+    {
+        ret_type = ctx->symt_cache[sc_void];
+        assert(ret_type);
+    }
 
     /* FIXME: assuming C source code */
     sig_type = symt_new_function_signature(ctx->module, ret_type, CV_CALL_FAR_C);
@@ -1935,29 +1986,40 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
 }
 
 static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
-                                          const dwarf2_comp_unit_t* comp_unit,
                                           struct module* module,
                                           const struct elf_thunk_area* thunks,
-                                          const unsigned char* comp_unit_cursor,
+                                          dwarf2_traverse_context_t* mod_ctx,
                                           unsigned long load_offset)
 {
     dwarf2_parse_context_t ctx;
-    dwarf2_traverse_context_t traverse;
     dwarf2_traverse_context_t abbrev_ctx;
     dwarf2_debug_info_t* di;
+    dwarf2_traverse_context_t cu_ctx;
+    const unsigned char* comp_unit_start = mod_ctx->data;
+    unsigned long cu_length;
+    unsigned short cu_version;
+    unsigned long cu_abbrev_offset;
     BOOL ret = FALSE;
 
+    cu_length = dwarf2_parse_u4(mod_ctx);
+    cu_ctx.data = cu_ctx.start_data = mod_ctx->data;
+    cu_ctx.end_data = mod_ctx->data + cu_length;
+    mod_ctx->data += cu_length;
+    cu_version = dwarf2_parse_u2(&cu_ctx);
+    cu_abbrev_offset = dwarf2_parse_u4(&cu_ctx);
+    cu_ctx.word_size = dwarf2_parse_byte(&cu_ctx);
+
     TRACE("Compilation Unit Header found at 0x%x:\n",
-          comp_unit_cursor - sections[section_debug].address);
-    TRACE("- length:        %lu\n", comp_unit->length);
-    TRACE("- version:       %u\n",  comp_unit->version);
-    TRACE("- abbrev_offset: %lu\n", comp_unit->abbrev_offset);
-    TRACE("- word_size:     %u\n",  comp_unit->word_size);
+          comp_unit_start - sections[section_debug].address);
+    TRACE("- length:        %lu\n", cu_length);
+    TRACE("- version:       %u\n",  cu_version);
+    TRACE("- abbrev_offset: %lu\n", cu_abbrev_offset);
+    TRACE("- word_size:     %u\n",  cu_ctx.word_size);
 
-    if (comp_unit->version != 2)
+    if (cu_version != 2)
     {
         WARN("%u DWARF version unsupported. Wine dbghelp only support DWARF 2.\n",
-             comp_unit->version);
+             cu_version);
         return FALSE;
     }
 
@@ -1965,24 +2027,21 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
     ctx.sections = sections;
     ctx.section = section_debug;
     ctx.module = module;
-    ctx.word_size = comp_unit->word_size;
+    ctx.word_size = cu_ctx.word_size;
     ctx.thunks = thunks;
     ctx.load_offset = load_offset;
-    ctx.ref_offset = comp_unit_cursor - sections[section_debug].address;
-
-    traverse.start_data = comp_unit_cursor + sizeof(dwarf2_comp_unit_stream_t);
-    traverse.data = traverse.start_data;
-    traverse.word_size = comp_unit->word_size;
-    traverse.end_data = comp_unit_cursor + comp_unit->length + sizeof(unsigned);
+    ctx.ref_offset = comp_unit_start - sections[section_debug].address;
+    memset(ctx.symt_cache, 0, sizeof(ctx.symt_cache));
+    ctx.symt_cache[sc_void] = &symt_new_basic(module, btVoid, "void", 0)->symt;
 
-    abbrev_ctx.start_data = sections[section_abbrev].address + comp_unit->abbrev_offset;
+    abbrev_ctx.start_data = sections[section_abbrev].address + cu_abbrev_offset;
     abbrev_ctx.data = abbrev_ctx.start_data;
     abbrev_ctx.end_data = sections[section_abbrev].address + sections[section_abbrev].size;
-    abbrev_ctx.word_size = comp_unit->word_size;
+    abbrev_ctx.word_size = cu_ctx.word_size;
     dwarf2_parse_abbrev_set(&abbrev_ctx, &ctx.abbrev_table, &ctx.pool);
 
     sparse_array_init(&ctx.debug_info_table, sizeof(dwarf2_debug_info_t), 128);
-    dwarf2_read_one_debug_info(&ctx, &traverse, &di);
+    dwarf2_read_one_debug_info(&ctx, &cu_ctx, &di);
 
     if (di->abbrev->tag == DW_TAG_compile_unit)
     {
@@ -2069,7 +2128,7 @@ static enum location_error loc_compute_frame(struct process* pcs,
         psym = vector_at(&func->vchildren, i);
         if ((*psym)->tag == SymTagCustom)
         {
-            pframe = &((struct symt_function_point*)*psym)->loc;
+            pframe = &((struct symt_hierarchy_point*)*psym)->loc;
 
             /* First, recompute the frame information, if needed */
             switch (pframe->kind)
@@ -2174,8 +2233,10 @@ BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
 {
     dwarf2_section_t    section[section_max];
     unsigned char*      ptr;
-    const unsigned char*comp_unit_cursor = debug;
-    const unsigned char*end_debug = debug + debug_size;
+    dwarf2_traverse_context_t   mod_ctx;
+
+    mod_ctx.start_data = mod_ctx.data = debug;
+    mod_ctx.end_data = debug + debug_size;
 
     module->loc_compute = dwarf2_location_compute;
 
@@ -2202,20 +2263,9 @@ BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
         module->dwarf2_info->debug_loc.size    = loclist_size;
     }
 
-    while (comp_unit_cursor < end_debug)
+    while (mod_ctx.data < mod_ctx.end_data)
     {
-        const dwarf2_comp_unit_stream_t* comp_unit_stream;
-        dwarf2_comp_unit_t comp_unit;
-    
-        comp_unit_stream = (const dwarf2_comp_unit_stream_t*) comp_unit_cursor;
-        comp_unit.length = *(const unsigned long*)  comp_unit_stream->length;
-        comp_unit.version = *(const unsigned short*) comp_unit_stream->version;
-        comp_unit.abbrev_offset = *(const unsigned long*) comp_unit_stream->abbrev_offset;
-        comp_unit.word_size = *(const unsigned char*) comp_unit_stream->word_size;
-
-        dwarf2_parse_compilation_unit(section, &comp_unit, module,
-                                      thunks, comp_unit_cursor, load_offset);
-        comp_unit_cursor += comp_unit.length + sizeof(unsigned);
+        dwarf2_parse_compilation_unit(section, module, thunks, &mod_ctx, load_offset);
     }
     module->module.SymType = SymDia;
     module->module.CVSig = 'D' | ('W' << 8) | ('A' << 16) | ('R' << 24);
index c03799e..6a34bb5 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-typedef struct
-{
-  unsigned char length[4];
-  unsigned char version[2];
-  unsigned char abbrev_offset[4];
-  unsigned char word_size[1];
-} dwarf2_comp_unit_stream_t;
-
-typedef struct
-{
-  unsigned long  length;
-  unsigned short version;
-  unsigned long  abbrev_offset;
-  unsigned char  word_size;
-} dwarf2_comp_unit_t;
-
-typedef struct
-{
-  unsigned int   length;
-  unsigned short version;
-  unsigned int   prologue_length;
-  unsigned char  min_insn_length;
-  unsigned char  default_is_stmt;
-  int            line_base;
-  unsigned char  line_range;
-  unsigned char  opcode_base;
-} dwarf2_line_info_t;
-
 typedef enum dwarf_tag_e
 {
   DW_TAG_padding                        = 0x00,
index dd0cd8d..52458f2 100644 (file)
@@ -57,8 +57,8 @@ struct dump_context
     void*                               pcs_buffer;
     SYSTEM_PROCESS_INFORMATION*         spi;
     /* module information */
-    struct dump_module*                 module;
-    unsigned                            num_module;
+    struct dump_module*                 modules;
+    unsigned                            num_modules;
     /* exception information */
     /* output information */
     MINIDUMP_TYPE                       type;
@@ -71,12 +71,12 @@ struct dump_context
 };
 
 /******************************************************************
- *             fetch_process_info
+ *             fetch_processes_info
  *
  * reads system wide process information, and make spi point to the record
  * for process of id 'pid'
  */
-static BOOL fetch_process_info(struct dump_context* dc)
+static BOOL fetch_processes_info(struct dump_context* dc)
 {
     ULONG       buf_size = 0x1000;
     NTSTATUS    nts;
@@ -119,20 +119,50 @@ static void fetch_thread_stack(struct dump_context* dc, const void* teb_addr,
     {
 #ifdef __i386__
         /* limiting the stack dumping to the size actually used */
-        if (ctx->Esp)
-            mmd->StartOfMemoryRange = (ctx->Esp - 4);
+        if (ctx->Esp){
+
+            /* make sure ESP is within the established range of the stack.  It could have
+               been clobbered by whatever caused the original exception. */
+            if (ctx->Esp - 4 < (ULONG_PTR)tib.StackLimit || ctx->Esp - 4 > (ULONG_PTR)tib.StackBase)
+                mmd->StartOfMemoryRange = (ULONG_PTR)tib.StackLimit;
+
+            else
+                mmd->StartOfMemoryRange = (ctx->Esp - 4);
+        }
+
         else
             mmd->StartOfMemoryRange = (ULONG_PTR)tib.StackLimit;
+
 #elif defined(__powerpc__)
-        if (ctx->Iar)
-            mmd->StartOfMemoryRange = ctx->Iar - 4;
+        if (ctx->Iar){
+
+            /* make sure IAR is within the established range of the stack.  It could have
+               been clobbered by whatever caused the original exception. */
+            if (ctx->Iar - 4 < (ULONG_PTR)tib.StackLimit || ctx->Iar - 4 > (ULONG_PTR)tib.StackBase)
+                mmd->StartOfMemoryRange = (ULONG_PTR)tib.StackLimit;
+
+            else
+                mmd->StartOfMemoryRange = (ctx->Iar - 4);
+        }
+
         else
             mmd->StartOfMemoryRange = (ULONG_PTR)tib.StackLimit;
+
 #elif defined(__x86_64__)
-        if (ctx->Rsp)
-            mmd->StartOfMemoryRange = (ctx->Rsp - 8);
+        if (ctx->Rsp){
+
+            /* make sure RSP is within the established range of the stack.  It could have
+               been clobbered by whatever caused the original exception. */
+            if (ctx->Rsp - 8 < (ULONG_PTR)tib.StackLimit || ctx->Rsp - 8 > (ULONG_PTR)tib.StackBase)
+                mmd->StartOfMemoryRange = (ULONG_PTR)tib.StackLimit;
+
+            else
+                mmd->StartOfMemoryRange = (ctx->Rsp - 8);
+        }
+
         else
             mmd->StartOfMemoryRange = (ULONG_PTR)tib.StackLimit;
+
 #else
 #error unsupported CPU
 #endif
@@ -182,7 +212,6 @@ static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx,
             if (tid != GetCurrentThreadId() &&
                 (mdThd->SuspendCount = SuspendThread(hThread)) != (DWORD)-1)
             {
-                mdThd->SuspendCount--;
                 ctx->ContextFlags = CONTEXT_FULL;
                 if (!GetThreadContext(hThread, ctx))
                     memset(ctx, 0, sizeof(*ctx));
@@ -193,6 +222,7 @@ static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx,
             else if (tid == GetCurrentThreadId() && except)
             {
                 CONTEXT lctx, *pctx;
+                mdThd->SuspendCount = 1;
                 if (except->ClientPointers)
                 {
                     EXCEPTION_POINTERS      ep;
@@ -204,8 +234,11 @@ static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx,
                     pctx = &lctx;
                 }
                 else pctx = except->ExceptionPointers->ContextRecord;
+
+                *ctx = *pctx;
                 fetch_thread_stack(dc, tbi.TebBaseAddress, pctx, &mdThd->Stack);
             }
+            else mdThd->SuspendCount = 0;
         }
     }
     CloseHandle(hThread);
@@ -221,24 +254,24 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name,
                        DWORD base, DWORD size, DWORD timestamp, DWORD checksum,
                        BOOL is_elf)
 {
-    if (!dc->module)
-        dc->module = HeapAlloc(GetProcessHeap(), 0,
-                               ++dc->num_module * sizeof(*dc->module));
+    if (!dc->modules)
+        dc->modules = HeapAlloc(GetProcessHeap(), 0,
+                                ++dc->num_modules * sizeof(*dc->modules));
     else
-        dc->module = HeapReAlloc(GetProcessHeap(), 0, dc->module,
-                                 ++dc->num_module * sizeof(*dc->module));
-    if (!dc->module) return FALSE;
+        dc->modules = HeapReAlloc(GetProcessHeap(), 0, dc->modules,
+                                  ++dc->num_modules * sizeof(*dc->modules));
+    if (!dc->modules) return FALSE;
     if (is_elf ||
         !GetModuleFileNameExW(dc->hProcess, (HMODULE)base,
-                              dc->module[dc->num_module - 1].name,
-                              sizeof(dc->module[dc->num_module - 1].name) / sizeof(WCHAR)))
-        lstrcpynW(dc->module[dc->num_module - 1].name, name,
-                  sizeof(dc->module[dc->num_module - 1].name) / sizeof(WCHAR));
-    dc->module[dc->num_module - 1].base = base;
-    dc->module[dc->num_module - 1].size = size;
-    dc->module[dc->num_module - 1].timestamp = timestamp;
-    dc->module[dc->num_module - 1].checksum = checksum;
-    dc->module[dc->num_module - 1].is_elf = is_elf;
+                              dc->modules[dc->num_modules - 1].name,
+                              sizeof(dc->modules[dc->num_modules - 1].name) / sizeof(WCHAR)))
+        lstrcpynW(dc->modules[dc->num_modules - 1].name, name,
+                  sizeof(dc->modules[dc->num_modules - 1].name) / sizeof(WCHAR));
+    dc->modules[dc->num_modules - 1].base = base;
+    dc->modules[dc->num_modules - 1].size = size;
+    dc->modules[dc->num_modules - 1].timestamp = timestamp;
+    dc->modules[dc->num_modules - 1].checksum = checksum;
+    dc->modules[dc->num_modules - 1].is_elf = is_elf;
 
     return TRUE;
 }
@@ -285,7 +318,7 @@ static BOOL fetch_elf_module_info_cb(const WCHAR* name, unsigned long base,
     return TRUE;
 }
 
-static void fetch_module_info(struct dump_context* dc)
+static void fetch_modules_info(struct dump_context* dc)
 {
     EnumerateLoadedModulesW64(dc->hProcess, fetch_pe_module_info_cb, dc);
     /* Since we include ELF modules in a separate stream from the regular PE ones,
@@ -296,6 +329,28 @@ static void fetch_module_info(struct dump_context* dc)
     elf_enum_modules(dc->hProcess, fetch_elf_module_info_cb, dc);
 }
 
+static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi)
+{
+    DWORD       handle;
+    DWORD       sz;
+    static const WCHAR backslashW[] = {'\\', '\0'};
+
+    memset(ffi, 0, sizeof(*ffi));
+    if ((sz = GetFileVersionInfoSizeW(filename, &handle)))
+    {
+        void*   info = HeapAlloc(GetProcessHeap(), 0, sz);
+        if (info && GetFileVersionInfoW(filename, handle, sz, info))
+        {
+            VS_FIXEDFILEINFO*   ptr;
+            UINT    len;
+
+            if (VerQueryValueW(info, backslashW, (void*)&ptr, &len))
+                memcpy(ffi, ptr, min(len, sizeof(*ffi)));
+        }
+        HeapFree(GetProcessHeap(), 0, info);
+    }
+}
+
 /******************************************************************
  *             add_memory_block
  *
@@ -350,9 +405,8 @@ static void append(struct dump_context* dc, void* data, unsigned size)
  *
  * Write in File the exception information from pcs
  */
-static  void    dump_exception_info(struct dump_context* dc,
-                                    const MINIDUMP_EXCEPTION_INFORMATION* except,
-                                    DWORD *size)
+static  unsigned        dump_exception_info(struct dump_context* dc,
+                                            const MINIDUMP_EXCEPTION_INFORMATION* except)
 {
     MINIDUMP_EXCEPTION_STREAM   mdExcpt;
     EXCEPTION_RECORD            rec, *prec;
@@ -386,13 +440,13 @@ static  void    dump_exception_info(struct dump_context* dc,
     mdExcpt.ExceptionRecord.NumberParameters = prec->NumberParameters;
     mdExcpt.ExceptionRecord.__unusedAlignment = 0;
     for (i = 0; i < mdExcpt.ExceptionRecord.NumberParameters; i++)
-        mdExcpt.ExceptionRecord.ExceptionInformation[i] = (DWORD_PTR)prec->ExceptionInformation[i];
+        mdExcpt.ExceptionRecord.ExceptionInformation[i] = prec->ExceptionInformation[i];
     mdExcpt.ThreadContext.DataSize = sizeof(*pctx);
     mdExcpt.ThreadContext.Rva = dc->rva + sizeof(mdExcpt);
 
     append(dc, &mdExcpt, sizeof(mdExcpt));
-    *size = sizeof(mdExcpt);
     append(dc, pctx, sizeof(*pctx));
+    return sizeof(mdExcpt);
 }
 
 /******************************************************************
@@ -400,7 +454,7 @@ static  void    dump_exception_info(struct dump_context* dc,
  *
  * Write in File the modules from pcs
  */
-static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size)
+static  unsigned        dump_modules(struct dump_context* dc, BOOL dump_elf)
 {
     MINIDUMP_MODULE             mdModule;
     MINIDUMP_MODULE_LIST        mdModuleList;
@@ -409,11 +463,12 @@ static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
     ULONG                       i, nmod;
     RVA                         rva_base;
     DWORD                       flags_out;
+    unsigned                    sz;
 
-    for (i = nmod = 0; i < dc->num_module; i++)
+    for (i = nmod = 0; i < dc->num_modules; i++)
     {
-        if ((dc->module[i].is_elf && dump_elf) ||
-            (!dc->module[i].is_elf && !dump_elf))
+        if ((dc->modules[i].is_elf && dump_elf) ||
+            (!dc->modules[i].is_elf && !dump_elf))
             nmod++;
     }
 
@@ -423,12 +478,17 @@ static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
      * size of mdModuleList
      * FIXME: if we don't ask for all modules in cb, we'll get a hole in the file
      */
+
+    /* the stream size is just the size of the module index.  It does not include the data for the
+       names of each module.  *Technically* the names are supposed to go into the common string table
+       in the minidump file.  Since each string is referenced by RVA they can all safely be located
+       anywhere between streams in the file, so the end of this stream is sufficient. */
     rva_base = dc->rva;
-    dc->rva += *size = sizeof(mdModuleList.NumberOfModules) + sizeof(mdModule) * nmod;
-    for (i = 0; i < dc->num_module; i++)
+    dc->rva += sz = sizeof(mdModuleList.NumberOfModules) + sizeof(mdModule) * nmod;
+    for (i = 0; i < dc->num_modules; i++)
     {
-        if ((dc->module[i].is_elf && !dump_elf) ||
-            (!dc->module[i].is_elf && dump_elf))
+        if ((dc->modules[i].is_elf && !dump_elf) ||
+            (!dc->modules[i].is_elf && dump_elf))
             continue;
 
         flags_out = ModuleWriteModule | ModuleWriteMiscRecord | ModuleWriteCvRecord;
@@ -438,10 +498,10 @@ static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
             flags_out |= ModuleWriteTlsData;
         if (dc->type & MiniDumpWithCodeSegs)
             flags_out |= ModuleWriteCodeSegs;
-        ms->Length = (lstrlenW(dc->module[i].name) + 1) * sizeof(WCHAR);
+        ms->Length = (lstrlenW(dc->modules[i].name) + 1) * sizeof(WCHAR);
         if (sizeof(ULONG) + ms->Length > sizeof(tmp))
             FIXME("Buffer overflow!!!\n");
-        lstrcpyW(ms->Buffer, dc->module[i].name);
+        lstrcpyW(ms->Buffer, dc->modules[i].name);
 
         if (dc->cb)
         {
@@ -453,10 +513,10 @@ static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
             cbin.CallbackType = ModuleCallback;
 
             cbin.u.Module.FullPath = ms->Buffer;
-            cbin.u.Module.BaseOfImage = dc->module[i].base;
-            cbin.u.Module.SizeOfImage = dc->module[i].size;
-            cbin.u.Module.CheckSum = dc->module[i].checksum;
-            cbin.u.Module.TimeDateStamp = dc->module[i].timestamp;
+            cbin.u.Module.BaseOfImage = dc->modules[i].base;
+            cbin.u.Module.SizeOfImage = dc->modules[i].size;
+            cbin.u.Module.CheckSum = dc->modules[i].checksum;
+            cbin.u.Module.TimeDateStamp = dc->modules[i].timestamp;
             memset(&cbin.u.Module.VersionInfo, 0, sizeof(cbin.u.Module.VersionInfo));
             cbin.u.Module.CvRecord = NULL;
             cbin.u.Module.SizeOfCvRecord = 0;
@@ -470,14 +530,14 @@ static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
         }
         if (flags_out & ModuleWriteModule)
         {
-            mdModule.BaseOfImage = dc->module[i].base;
-            mdModule.SizeOfImage = dc->module[i].size;
-            mdModule.CheckSum = dc->module[i].checksum;
-            mdModule.TimeDateStamp = dc->module[i].timestamp;
+            mdModule.BaseOfImage = dc->modules[i].base;
+            mdModule.SizeOfImage = dc->modules[i].size;
+            mdModule.CheckSum = dc->modules[i].checksum;
+            mdModule.TimeDateStamp = dc->modules[i].timestamp;
             mdModule.ModuleNameRva = dc->rva;
             ms->Length -= sizeof(WCHAR);
             append(dc, ms, sizeof(ULONG) + ms->Length + sizeof(WCHAR));
-            memset(&mdModule.VersionInfo, 0, sizeof(mdModule.VersionInfo)); /* FIXME */
+            fetch_module_versioninfo(ms->Buffer, &mdModule.VersionInfo);
             mdModule.CvRecord.DataSize = 0; /* FIXME */
             mdModule.CvRecord.Rva = 0; /* FIXME */
             mdModule.MiscRecord.DataSize = 0; /* FIXME */
@@ -492,6 +552,8 @@ static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
     }
     writeat(dc, rva_base, &mdModuleList.NumberOfModules, 
             sizeof(mdModuleList.NumberOfModules));
+
+    return sz;
 }
 
 /******************************************************************
@@ -499,7 +561,7 @@ static  void    dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
  *
  * Dumps into File the information about the system
  */
-static  void    dump_system_info(struct dump_context* dc, DWORD *size)
+static  unsigned        dump_system_info(struct dump_context* dc)
 {
     MINIDUMP_SYSTEM_INFO        mdSysInfo;
     SYSTEM_INFO                 sysInfo;
@@ -523,16 +585,21 @@ static  void    dump_system_info(struct dump_context* dc, DWORD *size)
 
     mdSysInfo.CSDVersionRva = dc->rva + sizeof(mdSysInfo);
     mdSysInfo.u1.Reserved1 = 0;
+    mdSysInfo.u1.s.SuiteMask = VER_SUITE_TERMINAL;
 
+    FIXME("fill in CPU vendorID and feature set\n");
     memset(&mdSysInfo.Cpu, 0, sizeof(mdSysInfo.Cpu));
 
     append(dc, &mdSysInfo, sizeof(mdSysInfo));
-    *size = sizeof(mdSysInfo);
 
+    /* write the service pack version string after this stream.  It is referenced within the
+       stream by its RVA in the file. */
     slen = lstrlenW(osInfo.szCSDVersion) * sizeof(WCHAR);
     WriteFile(dc->hFile, &slen, sizeof(slen), &written, NULL);
     WriteFile(dc->hFile, osInfo.szCSDVersion, slen, &written, NULL);
     dc->rva += sizeof(ULONG) + slen;
+
+    return sizeof(mdSysInfo);
 }
 
 /******************************************************************
@@ -540,9 +607,8 @@ static  void    dump_system_info(struct dump_context* dc, DWORD *size)
  *
  * Dumps into File the information about running threads
  */
-static  void    dump_threads(struct dump_context* dc,
-                             const MINIDUMP_EXCEPTION_INFORMATION* except,
-                             DWORD *size)
+static  unsigned        dump_threads(struct dump_context* dc,
+                                     const MINIDUMP_EXCEPTION_INFORMATION* except)
 {
     MINIDUMP_THREAD             mdThd;
     MINIDUMP_THREAD_LIST        mdThdList;
@@ -578,7 +644,7 @@ static  void    dump_threads(struct dump_context* dc,
             cbin.CallbackType = ThreadCallback;
             cbin.u.Thread.ThreadId = dc->spi->ti[i].dwThreadID;
             cbin.u.Thread.ThreadHandle = 0; /* FIXME */
-            memcpy(&cbin.u.Thread.Context, &ctx, sizeof(CONTEXT));
+            cbin.u.Thread.Context = ctx;
             cbin.u.Thread.SizeOfContext = sizeof(CONTEXT);
             cbin.u.Thread.StackBase = mdThd.Stack.StartOfMemoryRange;
             cbin.u.Thread.StackEnd = mdThd.Stack.StartOfMemoryRange +
@@ -622,7 +688,8 @@ static  void    dump_threads(struct dump_context* dc,
     }
     writeat(dc, rva_base,
             &mdThdList.NumberOfThreads, sizeof(mdThdList.NumberOfThreads));
-    *size = dc->rva - rva_base;
+
+    return dc->rva - rva_base;
 }
 
 /******************************************************************
@@ -630,12 +697,12 @@ static  void    dump_threads(struct dump_context* dc,
  *
  * dumps information about the memory of the process (stack of the threads)
  */
-static void dump_memory_info(struct dump_context* dc, DWORD* size)
+static unsigned         dump_memory_info(struct dump_context* dc)
 {
     MINIDUMP_MEMORY_LIST        mdMemList;
     MINIDUMP_MEMORY_DESCRIPTOR  mdMem;
     DWORD                       written;
-    unsigned                    i, pos, len;
+    unsigned                    i, pos, len, sz;
     RVA                         rva_base;
     char                        tmp[1024];
 
@@ -643,9 +710,9 @@ static void dump_memory_info(struct dump_context* dc, DWORD* size)
     append(dc, &mdMemList.NumberOfMemoryRanges,
            sizeof(mdMemList.NumberOfMemoryRanges));
     rva_base = dc->rva;
-    dc->rva += mdMemList.NumberOfMemoryRanges * sizeof(mdMem);
-    *size = sizeof(mdMemList.NumberOfMemoryRanges) +
-               mdMemList.NumberOfMemoryRanges * sizeof(mdMem);
+    sz = mdMemList.NumberOfMemoryRanges * sizeof(mdMem);
+    dc->rva += sz;
+    sz += sizeof(mdMemList.NumberOfMemoryRanges);
 
     for (i = 0; i < dc->num_mem; i++)
     {
@@ -657,7 +724,7 @@ static void dump_memory_info(struct dump_context* dc, DWORD* size)
         {
             len = min(dc->mem[i].size - pos, sizeof(tmp));
             if (ReadProcessMemory(dc->hProcess, 
-                                  (void*)(ULONG)(dc->mem[i].base + pos), 
+                                  (void*)(dc->mem[i].base + pos),
                                   tmp, len, NULL))
                 WriteFile(dc->hFile, tmp, len, &written, NULL);
         }
@@ -668,9 +735,11 @@ static void dump_memory_info(struct dump_context* dc, DWORD* size)
             writeat(dc, dc->mem[i].rva, &mdMem.Memory.Rva, sizeof(mdMem.Memory.Rva));
         }
     }
+
+    return sz;
 }
 
-static void dump_misc_info(struct dump_context* dc, DWORD* size)
+static unsigned         dump_misc_info(struct dump_context* dc)
 {
     MINIDUMP_MISC_INFO  mmi;
 
@@ -678,8 +747,12 @@ static void dump_misc_info(struct dump_context* dc, DWORD* size)
     mmi.Flags1 = MINIDUMP_MISC1_PROCESS_ID;
     mmi.ProcessId = dc->pid;
     /* FIXME: create/user/kernel time */
+    mmi.ProcessCreateTime = 0;
+    mmi.ProcessKernelTime = 0;
+    mmi.ProcessUserTime = 0;
+
     append(dc, &mmi, sizeof(mmi));
-    *size = sizeof(mmi);
+    return sizeof(mmi);
 }
 
 /******************************************************************
@@ -692,6 +765,7 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
                               PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
                               PMINIDUMP_CALLBACK_INFORMATION CallbackParam)
 {
+    static const MINIDUMP_DIRECTORY emptyDir = {UnusedStream, {0, 0}};
     MINIDUMP_HEADER     mdHead;
     MINIDUMP_DIRECTORY  mdDir;
     DWORD               i, nStreams, idx_stream;
@@ -700,21 +774,24 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
     dc.hProcess = hProcess;
     dc.hFile = hFile;
     dc.pid = pid;
-    dc.module = NULL;
-    dc.num_module = 0;
+    dc.modules = NULL;
+    dc.num_modules = 0;
     dc.cb = CallbackParam;
     dc.type = DumpType;
     dc.mem = NULL;
     dc.num_mem = 0;
     dc.rva = 0;
 
-    if (!fetch_process_info(&dc)) return FALSE;
-    fetch_module_info(&dc);
+    if (!fetch_processes_info(&dc)) return FALSE;
+    fetch_modules_info(&dc);
 
     /* 1) init */
     nStreams = 6 + (ExceptionParam ? 1 : 0) +
         (UserStreamParam ? UserStreamParam->UserStreamCount : 0);
 
+    /* pad the directory size to a multiple of 4 for alignment purposes */
+    nStreams = (nStreams + 3) & ~3;
+
     if (DumpType & MiniDumpWithDataSegs)
         FIXME("NIY MiniDumpWithDataSegs\n");
     if (DumpType & MiniDumpWithFullMemory)
@@ -728,12 +805,12 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
 
     /* 2) write header */
     mdHead.Signature = MINIDUMP_SIGNATURE;
-    mdHead.Version = MINIDUMP_VERSION;
+    mdHead.Version = MINIDUMP_VERSION;  /* NOTE: native puts in an 'implementation specific' value in the high order word of this member */
     mdHead.NumberOfStreams = nStreams;
+    mdHead.CheckSum = 0;                /* native sets a 0 checksum in its files */
     mdHead.StreamDirectoryRva = sizeof(mdHead);
     mdHead.u.TimeDateStamp = time(NULL);
     mdHead.Flags = DumpType;
-    mdHead.CheckSum = 0;
     append(&dc, &mdHead, sizeof(mdHead));
 
     /* 3) write stream directories */
@@ -745,43 +822,37 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
     /* must be first in minidump */
     mdDir.StreamType = SystemInfoStream;
     mdDir.Location.Rva = dc.rva;
-    dump_system_info(&dc, &mdDir.Location.DataSize);
+    mdDir.Location.DataSize = dump_system_info(&dc);
     writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
             &mdDir, sizeof(mdDir));
 
     mdDir.StreamType = ThreadListStream;
     mdDir.Location.Rva = dc.rva;
-    dump_threads(&dc, ExceptionParam, &mdDir.Location.DataSize);
+    mdDir.Location.DataSize = dump_threads(&dc, ExceptionParam);
     writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir), 
             &mdDir, sizeof(mdDir));
 
     mdDir.StreamType = ModuleListStream;
     mdDir.Location.Rva = dc.rva;
-    dump_modules(&dc, FALSE, &mdDir.Location.DataSize);
+    mdDir.Location.DataSize = dump_modules(&dc, FALSE);
     writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
             &mdDir, sizeof(mdDir));
 
     mdDir.StreamType = 0xfff0; /* FIXME: this is part of MS reserved streams */
     mdDir.Location.Rva = dc.rva;
-    dump_modules(&dc, TRUE, &mdDir.Location.DataSize);
+    mdDir.Location.DataSize = dump_modules(&dc, TRUE);
     writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
             &mdDir, sizeof(mdDir));
 
     mdDir.StreamType = MemoryListStream;
     mdDir.Location.Rva = dc.rva;
-    dump_memory_info(&dc, &mdDir.Location.DataSize);
+    mdDir.Location.DataSize = dump_memory_info(&dc);
     writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
             &mdDir, sizeof(mdDir));
 
     mdDir.StreamType = MiscInfoStream;
     mdDir.Location.Rva = dc.rva;
-    dump_misc_info(&dc, &mdDir.Location.DataSize);
-    writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
-            &mdDir, sizeof(mdDir));
-
-    mdDir.StreamType = SystemInfoStream;
-    mdDir.Location.Rva = dc.rva;
-    dump_system_info(&dc, &mdDir.Location.DataSize);
+    mdDir.Location.DataSize = dump_misc_info(&dc);
     writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
             &mdDir, sizeof(mdDir));
 
@@ -790,7 +861,7 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
     {
         mdDir.StreamType = ExceptionStream;
         mdDir.Location.Rva = dc.rva;
-        dump_exception_info(&dc, ExceptionParam, &mdDir.Location.DataSize);
+        mdDir.Location.DataSize = dump_exception_info(&dc, ExceptionParam);
         writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
                 &mdDir, sizeof(mdDir));
     }
@@ -810,9 +881,14 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
         }
     }
 
+    /* fill the remaining directory entries with 0's (unused stream types) */
+    /* NOTE: this should always come last in the dump! */
+    for (i = idx_stream; i < nStreams; i++)
+        writeat(&dc, mdHead.StreamDirectoryRva + i * sizeof(emptyDir), &emptyDir, sizeof(emptyDir));
+
     HeapFree(GetProcessHeap(), 0, dc.pcs_buffer);
     HeapFree(GetProcessHeap(), 0, dc.mem);
-    HeapFree(GetProcessHeap(), 0, dc.module);
+    HeapFree(GetProcessHeap(), 0, dc.modules);
 
     return TRUE;
 }
index 8b2ece0..a53e6b5 100644 (file)
@@ -308,7 +308,7 @@ BOOL module_get_debug(struct module_pair* pair)
             idslW64.CheckSum = pair->effective->module.CheckSum;
             idslW64.TimeDateStamp = pair->effective->module.TimeDateStamp;
             memcpy(idslW64.FileName, pair->effective->module.ImageName,
-                   sizeof(idslW64.FileName));
+                   sizeof(pair->effective->module.ImageName));
             idslW64.Reparse = FALSE;
             idslW64.hFile = INVALID_HANDLE_VALUE;
 
@@ -555,7 +555,7 @@ DWORD64 WINAPI  SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
     if (wModuleName)
         module_set_module(module, wModuleName);
     lstrcpynW(module->module.ImageName, wImageName,
-              sizeof(module->module.ImageName) / sizeof(CHAR));
+              sizeof(module->module.ImageName) / sizeof(WCHAR));
 
     return module->module.BaseOfImage;
 }
@@ -895,7 +895,12 @@ BOOL  WINAPI SymGetModuleInfo64(HANDLE hProcess, DWORD64 dwAddr,
     IMAGEHLP_MODULE64   mi64;
     IMAGEHLP_MODULEW64  miw64;
 
-    if (sizeof(mi64) < ModuleInfo->SizeOfStruct) FIXME("Wrong size\n");
+    if (sizeof(mi64) < ModuleInfo->SizeOfStruct)
+    {
+        SetLastError(ERROR_MOD_NOT_FOUND); /* NOTE: native returns this error */
+        WARN("Wrong size %u\n", ModuleInfo->SizeOfStruct);
+        return FALSE;
+    }
 
     miw64.SizeOfStruct = sizeof(miw64);
     if (!SymGetModuleInfoW64(hProcess, dwAddr, &miw64)) return FALSE;
index 5e6f8a8..d04ebfb 100644 (file)
@@ -32,6 +32,8 @@
  *     Add symbol size to internal symbol table.
  */
 
+#define NONAMELESSUNION
+
 #include "config.h"
 #include "wine/port.h"
 
@@ -125,12 +127,21 @@ static void codeview_init_basic_types(struct module* module)
     cv_basic_types[T_USHORT] = &symt_new_basic(module, btUInt,  "unsigned short", 2)->symt;
     cv_basic_types[T_ULONG]  = &symt_new_basic(module, btUInt,  "unsigned long", 4)->symt;
     cv_basic_types[T_UQUAD]  = &symt_new_basic(module, btUInt,  "unsigned long long", 8)->symt;
+    cv_basic_types[T_BOOL08] = &symt_new_basic(module, btBool,  "BOOL08", 1)->symt;
+    cv_basic_types[T_BOOL16] = &symt_new_basic(module, btBool,  "BOOL16", 2)->symt;
+    cv_basic_types[T_BOOL32] = &symt_new_basic(module, btBool,  "BOOL32", 4)->symt;
+    cv_basic_types[T_BOOL64] = &symt_new_basic(module, btBool,  "BOOL64", 8)->symt;
     cv_basic_types[T_REAL32] = &symt_new_basic(module, btFloat, "float", 4)->symt;
     cv_basic_types[T_REAL64] = &symt_new_basic(module, btFloat, "double", 8)->symt;
     cv_basic_types[T_RCHAR]  = &symt_new_basic(module, btInt,   "signed char", 1)->symt;
     cv_basic_types[T_WCHAR]  = &symt_new_basic(module, btWChar, "wchar_t", 2)->symt;
+    cv_basic_types[T_INT2]   = &symt_new_basic(module, btInt,   "INT2", 2)->symt;
+    cv_basic_types[T_UINT2]  = &symt_new_basic(module, btUInt,  "UINT2", 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_INT8]   = &symt_new_basic(module, btInt,   "INT8", 8)->symt;
+    cv_basic_types[T_UINT8]  = &symt_new_basic(module, btUInt,  "UINT8", 8)->symt;
+    cv_basic_types[T_HRESULT]= &symt_new_basic(module, btUInt,  "HRESULT", 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;
@@ -141,12 +152,21 @@ static void codeview_init_basic_types(struct module* module)
     cv_basic_types[T_32PUSHORT] = &symt_new_pointer(module, cv_basic_types[T_USHORT])->symt;
     cv_basic_types[T_32PULONG]  = &symt_new_pointer(module, cv_basic_types[T_ULONG])->symt;
     cv_basic_types[T_32PUQUAD]  = &symt_new_pointer(module, cv_basic_types[T_UQUAD])->symt;
+    cv_basic_types[T_32PBOOL08] = &symt_new_pointer(module, cv_basic_types[T_BOOL08])->symt;
+    cv_basic_types[T_32PBOOL16] = &symt_new_pointer(module, cv_basic_types[T_BOOL16])->symt;
+    cv_basic_types[T_32PBOOL32] = &symt_new_pointer(module, cv_basic_types[T_BOOL32])->symt;
+    cv_basic_types[T_32PBOOL64] = &symt_new_pointer(module, cv_basic_types[T_BOOL64])->symt;
     cv_basic_types[T_32PREAL32] = &symt_new_pointer(module, cv_basic_types[T_REAL32])->symt;
     cv_basic_types[T_32PREAL64] = &symt_new_pointer(module, cv_basic_types[T_REAL64])->symt;
     cv_basic_types[T_32PRCHAR]  = &symt_new_pointer(module, cv_basic_types[T_RCHAR])->symt;
     cv_basic_types[T_32PWCHAR]  = &symt_new_pointer(module, cv_basic_types[T_WCHAR])->symt;
+    cv_basic_types[T_32PINT2]   = &symt_new_pointer(module, cv_basic_types[T_INT2])->symt;
+    cv_basic_types[T_32PUINT2]  = &symt_new_pointer(module, cv_basic_types[T_UINT2])->symt;
     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;
+    cv_basic_types[T_32PINT8]   = &symt_new_pointer(module, cv_basic_types[T_INT8])->symt;
+    cv_basic_types[T_32PUINT8]  = &symt_new_pointer(module, cv_basic_types[T_UINT8])->symt;
+    cv_basic_types[T_32PHRESULT]= &symt_new_pointer(module, cv_basic_types[T_HRESULT])->symt;
 }
 
 static int numeric_leaf(int* value, const unsigned short int* leaf)
@@ -391,7 +411,7 @@ static void* codeview_cast_symt(struct symt* symt, enum SymTagEnum tag)
 }
 
 static struct symt* codeview_fetch_type(struct codeview_type_parse* ctp,
-                                        unsigned typeno)
+                                        unsigned typeno, BOOL details)
 {
     struct symt*                symt;
     const union codeview_type*  p;
@@ -405,7 +425,7 @@ static struct symt* codeview_fetch_type(struct codeview_type_parse* ctp,
         FIXME("Cannot locate type %x\n", typeno);
         return NULL;
     }
-    symt = codeview_parse_one_type(ctp, typeno, p, FALSE);
+    symt = codeview_parse_one_type(ctp, typeno, p, details);
     if (!symt) FIXME("Couldn't load forward type %x\n", typeno);
     return symt;
 }
@@ -421,7 +441,7 @@ static struct symt* codeview_add_type_pointer(struct codeview_type_parse* ctp,
         existing = codeview_cast_symt(existing, SymTagPointerType);
         return existing;
     }
-    pointee = codeview_fetch_type(ctp, pointee_type);
+    pointee = codeview_fetch_type(ctp, pointee_type, FALSE);
     return &symt_new_pointer(ctp->module, pointee)->symt;
 }
 
@@ -431,8 +451,8 @@ static struct symt* codeview_add_type_array(struct codeview_type_parse* ctp,
                                             unsigned int indextype,
                                             unsigned int arr_len)
 {
-    struct symt*        elem = codeview_fetch_type(ctp, elemtype);
-    struct symt*        index = codeview_fetch_type(ctp, indextype);
+    struct symt*        elem = codeview_fetch_type(ctp, elemtype, FALSE);
+    struct symt*        index = codeview_fetch_type(ctp, indextype, FALSE);
     DWORD               arr_max = 0;
 
     if (elem)
@@ -504,19 +524,19 @@ static void codeview_add_udt_element(struct codeview_type_parse* ctp,
         {
         case LF_BITFIELD_V1:
             symt_add_udt_element(ctp->module, symt, name,
-                                 codeview_fetch_type(ctp, cv_type->bitfield_v1.type),
+                                 codeview_fetch_type(ctp, cv_type->bitfield_v1.type, FALSE),
                                  cv_type->bitfield_v1.bitoff,
                                  cv_type->bitfield_v1.nbits);
             return;
         case LF_BITFIELD_V2:
             symt_add_udt_element(ctp->module, symt, name,
-                                 codeview_fetch_type(ctp, cv_type->bitfield_v2.type),
+                                 codeview_fetch_type(ctp, cv_type->bitfield_v2.type, FALSE),
                                  cv_type->bitfield_v2.bitoff,
                                  cv_type->bitfield_v2.nbits);
             return;
         }
     }
-    subtype = codeview_fetch_type(ctp, type);
+    subtype = codeview_fetch_type(ctp, type, FALSE);
 
     if (subtype)
     {
@@ -641,6 +661,11 @@ static int codeview_add_type_struct_field_list(struct codeview_type_parse* ctp,
             ptr += 2 + 4 + 2 + (1 + type->stmember_v2.p_name.namelen);
             break;
 
+        case LF_STMEMBER_V3:
+            /* FIXME: ignored for now */
+            ptr += 2 + 4 + 2 + (strlen(type->stmember_v3.name) + 1);
+            break;
+
         case LF_METHOD_V1:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + 2 + (1 + type->method_v1.p_name.namelen);
@@ -651,6 +676,11 @@ static int codeview_add_type_struct_field_list(struct codeview_type_parse* ctp,
             ptr += 2 + 2 + 4 + (1 + type->method_v2.p_name.namelen);
             break;
 
+        case LF_METHOD_V3:
+            /* FIXME: ignored for now */
+            ptr += 2 + 2 + 4 + (strlen(type->method_v3.name) + 1);
+            break;
+
         case LF_NESTTYPE_V1:
             /* FIXME: ignored for now */
             ptr += 2 + 2 + (1 + type->nesttype_v1.p_name.namelen);
@@ -661,6 +691,11 @@ static int codeview_add_type_struct_field_list(struct codeview_type_parse* ctp,
             ptr += 2 + 2 + 4 + (1 + type->nesttype_v2.p_name.namelen);
             break;
 
+        case LF_NESTTYPE_V3:
+            /* FIXME: ignored for now */
+            ptr += 2 + 2 + 4 + (strlen(type->nesttype_v3.name) + 1);
+            break;
+
         case LF_VFUNCTAB_V1:
             /* FIXME: ignored for now */
             ptr += 2 + 2;
@@ -699,6 +734,20 @@ static int codeview_add_type_struct_field_list(struct codeview_type_parse* ctp,
             }
             break;
 
+        case LF_ONEMETHOD_V3:
+            /* FIXME: ignored for now */
+            switch ((type->onemethod_v3.attribute >> 2) & 7)
+            {
+            case 4: case 6: /* (pure) introducing virtual method */
+                ptr += 2 + 2 + 4 + 4 + (strlen(type->onemethod_virt_v3.name) + 1);
+                break;
+
+            default:
+                ptr += 2 + 2 + 4 + (strlen(type->onemethod_v3.name) + 1);
+                break;
+            }
+            break;
+
         default:
             FIXME("Unsupported type %04x in STRUCT field list\n", type->generic.id);
             return FALSE;
@@ -711,7 +760,8 @@ static int codeview_add_type_struct_field_list(struct codeview_type_parse* ctp,
 static struct symt* codeview_add_type_enum(struct codeview_type_parse* ctp,
                                            struct symt* existing,
                                            const char* name,
-                                           unsigned fieldlistno)
+                                           unsigned fieldlistno,
+                                           unsigned basetype)
 {
     struct symt_enum*   symt;
 
@@ -722,7 +772,8 @@ static struct symt* codeview_add_type_enum(struct codeview_type_parse* ctp,
     }
     else
     {
-        symt = symt_new_enum(ctp->module, name);
+        symt = symt_new_enum(ctp->module, name,
+                             codeview_fetch_type(ctp, basetype, FALSE));
         if (fieldlistno)
         {
             const union codeview_reftype* fieldlist;
@@ -775,7 +826,7 @@ static void codeview_add_func_signature_args(struct codeview_type_parse* ctp,
 {
     const union codeview_reftype*       reftype;
 
-    sym->rettype = codeview_fetch_type(ctp, ret_type);
+    sym->rettype = codeview_fetch_type(ctp, ret_type, FALSE);
     if (args_list && (reftype = codeview_jump_to_type(ctp, args_list)))
     {
         int i;
@@ -784,12 +835,12 @@ static void codeview_add_func_signature_args(struct codeview_type_parse* ctp,
         case LF_ARGLIST_V1:
             for (i = 0; i < reftype->arglist_v1.num; i++)
                 symt_add_function_signature_parameter(ctp->module, sym,
-                                                      codeview_fetch_type(ctp, reftype->arglist_v1.args[i]));
+                                                      codeview_fetch_type(ctp, reftype->arglist_v1.args[i], FALSE));
             break;
         case LF_ARGLIST_V2:
             for (i = 0; i < reftype->arglist_v2.num; i++)
                 symt_add_function_signature_parameter(ctp->module, sym,
-                                                      codeview_fetch_type(ctp, reftype->arglist_v2.args[i]));
+                                                      codeview_fetch_type(ctp, reftype->arglist_v2.args[i], FALSE));
             break;
         default:
             FIXME("Unexpected leaf %x for signature's pmt\n", reftype->generic.id);
@@ -812,8 +863,8 @@ static struct symt* codeview_parse_one_type(struct codeview_type_parse* ctp,
     switch (type->generic.id)
     {
     case LF_MODIFIER_V1:
-        /* FIXME: we don't handle modifiers, 
-         * but readd previous type on the curr_type 
+        /* FIXME: we don't handle modifiers,
+         * but read previous type on the curr_type
          */
         WARN("Modifier on %x: %s%s%s%s\n",
              type->modifier_v1.type,
@@ -821,9 +872,7 @@ static struct symt* codeview_parse_one_type(struct codeview_type_parse* ctp,
              type->modifier_v1.attribute & 0x02 ? "volatile " : "",
              type->modifier_v1.attribute & 0x04 ? "unaligned " : "",
              type->modifier_v1.attribute & ~0x07 ? "unknown " : "");
-        if (!(symt = codeview_get_type(type->modifier_v1.type, TRUE)))
-            symt = codeview_parse_one_type(ctp, type->modifier_v1.type,
-                                           codeview_jump_to_type(ctp, type->modifier_v1.type), details);
+        symt = codeview_fetch_type(ctp, type->modifier_v1.type, details);
         break;
     case LF_MODIFIER_V2:
         /* FIXME: we don't handle modifiers, but readd previous type on the curr_type */
@@ -833,9 +882,7 @@ static struct symt* codeview_parse_one_type(struct codeview_type_parse* ctp,
              type->modifier_v2.attribute & 0x02 ? "volatile " : "",
              type->modifier_v2.attribute & 0x04 ? "unaligned " : "",
              type->modifier_v2.attribute & ~0x07 ? "unknown " : "");
-        if (!(symt = codeview_get_type(type->modifier_v2.type, TRUE)))
-            symt = codeview_parse_one_type(ctp, type->modifier_v2.type,
-                                           codeview_jump_to_type(ctp, type->modifier_v2.type), details);
+        symt = codeview_fetch_type(ctp, type->modifier_v2.type, details);
         break;
 
     case LF_POINTER_V1:
@@ -965,18 +1012,21 @@ static struct symt* codeview_parse_one_type(struct codeview_type_parse* ctp,
     case LF_ENUM_V1:
         symt = codeview_add_type_enum(ctp, existing,
                                       terminate_string(&type->enumeration_v1.p_name),
-                                      type->enumeration_v1.fieldlist);
+                                      type->enumeration_v1.fieldlist,
+                                      type->enumeration_v1.type);
         break;
 
     case LF_ENUM_V2:
         symt = codeview_add_type_enum(ctp, existing,
                                       terminate_string(&type->enumeration_v2.p_name),
-                                      type->enumeration_v2.fieldlist);
+                                      type->enumeration_v2.fieldlist,
+                                      type->enumeration_v2.type);
         break;
 
     case LF_ENUM_V3:
         symt = codeview_add_type_enum(ctp, existing, type->enumeration_v3.name,
-                                      type->enumeration_v3.fieldlist);
+                                      type->enumeration_v3.fieldlist,
+                                      type->enumeration_v3.type);
         break;
 
     case LF_PROCEDURE_V1:
@@ -1068,8 +1118,8 @@ static int codeview_parse_type_table(struct codeview_type_parse* ctp)
          *   X  1500-150d       for V3 types
          *      8000-8010       for numeric leafes
          */
-        if (type->generic.id & 0x8600) continue;
-        codeview_parse_one_type(ctp, curr_type, type, TRUE);
+        if (!(type->generic.id & 0x8600) || (type->generic.id & 0x0100))
+            codeview_parse_one_type(ctp, curr_type, type, TRUE);
     }
 
     return TRUE;
@@ -1272,6 +1322,7 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
         const union codeview_symbol* sym = (const union codeview_symbol*)(root + i);
         length = sym->generic.len + 2;
         if (i + length > size) break;
+        if (!sym->generic.id || length < 4) break;
         if (length & 3) FIXME("unpadded len %u\n", length);
 
         switch (sym->generic.id)
@@ -1433,6 +1484,17 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
                                 codeview_get_type(sym->stack_v3.symtype, FALSE),
                                 sym->stack_v3.name);
             break;
+       case S_BPREL_XXXX_V3:
+            loc.kind = loc_regrel;
+            loc.reg = 0; /* FIXME */
+            loc.offset = sym->stack_xxxx_v3.offset;
+            WARN("Supposed stack variable %s (%d)\n", sym->stack_xxxx_v3.name, sym->stack_xxxx_v3.unknown);
+            symt_add_func_local(msc_dbg->module, curr_func,
+                                sym->stack_xxxx_v3.offset > 0 ? DataIsParam : DataIsLocal,
+                                &loc, block,
+                                codeview_get_type(sym->stack_xxxx_v3.symtype, FALSE),
+                                sym->stack_xxxx_v3.name);
+            break;
 
         case S_REGISTER_V1:
             loc.kind = loc_register;
@@ -1452,6 +1514,15 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
                                 block, codeview_get_type(sym->register_v2.type, FALSE),
                                 terminate_string(&sym->register_v2.p_name));
             break;
+        case S_REGISTER_V3:
+            loc.kind = loc_register;
+            loc.reg = sym->register_v3.reg;
+            loc.offset = 0;
+            symt_add_func_local(msc_dbg->module, curr_func,
+                                DataIsLocal, &loc,
+                                block, codeview_get_type(sym->register_v3.type, FALSE),
+                                sym->register_v3.name);
+            break;
 
         case S_BLOCK_V1:
             block = symt_open_func_block(msc_dbg->module, curr_func, block, 
@@ -1490,7 +1561,7 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
                 while (*ptr1)
                 {
                     ptr2 = ptr1 + strlen(ptr1) + 1;
-                    TRACE("\t%s => %s\n", ptr1, ptr2); 
+                    TRACE("\t%s => %s\n", ptr1, debugstr_a(ptr2));
                     ptr1 = ptr2 + strlen(ptr2) + 1;
                 }
             }
@@ -1504,7 +1575,7 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
                 while (*ptr1)
                 {
                     ptr2 = ptr1 + strlen(ptr1) + 1;
-                    TRACE("\t%s => %s\n", ptr1, ptr2); 
+                    TRACE("\t%s => %s\n", ptr1, debugstr_a(ptr2));
                     ptr1 = ptr2 + strlen(ptr2) + 1;
                 }
             }
@@ -1525,9 +1596,9 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
                 symt_add_function_point(msc_dbg->module, curr_func, SymTagLabel, &loc,
                                         terminate_string(&sym->label_v1.p_name));
             }
-            else
-                FIXME("No current function for label %s\n",
-                      terminate_string(&sym->label_v1.p_name));
+            else symt_new_label(msc_dbg->module, compiland,
+                                terminate_string(&sym->label_v1.p_name),
+                                codeview_get_address(msc_dbg, sym->label_v1.segment, sym->label_v1.offset));
             break;
         case S_LABEL_V3:
             if (curr_func)
@@ -1537,8 +1608,8 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
                 symt_add_function_point(msc_dbg->module, curr_func, SymTagLabel, 
                                         &loc, sym->label_v3.name);
             }
-            else
-                FIXME("No current function for label %s\n", sym->label_v3.name);
+            else symt_new_label(msc_dbg->module, compiland, sym->label_v3.name,
+                                codeview_get_address(msc_dbg, sym->label_v3.segment, sym->label_v3.offset));
             break;
 
         case S_CONSTANT_V1:
@@ -1651,6 +1722,8 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
             break;
         case S_PUB_FUNC1_V3:
         case S_PUB_FUNC2_V3: /* using a data_v3 isn't what we'd expect */
+#if 0
+            /* FIXME: this is plain wrong (from a simple test) */
             if (!(dbghelp_options & SYMOPT_NO_PUBLICS))
             {
                 symt_new_public(msc_dbg->module, compiland,
@@ -1658,6 +1731,7 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
                                 codeview_get_address(msc_dbg, sym->data_v3.segment, sym->data_v3.offset),
                                 1, TRUE /* FIXME */, TRUE);
             }
+#endif
             break;
 
         case S_MSTOOL_V3: /* just to silence a few warnings */
index 2e191af..7057e26 100644 (file)
@@ -57,7 +57,7 @@ HANDLE WINAPI FindDebugInfoFile(PCSTR FileName, PCSTR SymbolPath, PSTR DebugFile
 {
     HANDLE      h;
 
-    h = CreateFileA(DebugFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
+    h = CreateFileA(FileName, GENERIC_READ, FILE_SHARE_READ, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
     if (h == INVALID_HANDLE_VALUE)
     {
@@ -79,7 +79,7 @@ HANDLE WINAPI FindDebugInfoFileEx(PCSTR FileName, PCSTR SymbolPath,
                                   PVOID CallerData)
 {
     FIXME("(%s %s %p %p %p): stub\n", 
-          FileName, SymbolPath, DebugFilePath, Callback, CallerData);
+          debugstr_a(FileName), debugstr_a(SymbolPath), debugstr_a(DebugFilePath), Callback, CallerData);
     return NULL;
 }
 
@@ -191,7 +191,7 @@ BOOL WINAPI SymMatchFileName(PCSTR file, PCSTR match,
     PCSTR fptr;
     PCSTR mptr;
 
-    TRACE("(%s %s %p %p)\n", file, match, filestop, matchstop);
+    TRACE("(%s %s %p %p)\n", debugstr_a(file), debugstr_a(match), filestop, matchstop);
 
     fptr = file + strlen(file) - 1;
     mptr = match + strlen(match) - 1;
@@ -217,7 +217,7 @@ static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse,
     BOOL                found = FALSE;
     static const WCHAR  S_AllW[] = {'*','.','*','\0'};
     static const WCHAR  S_DotW[] = {'.','\0'};
-    static const WCHAR  S_DotDotW[] = {'.','\0'};
+    static const WCHAR  S_DotDotW[] = {'.','.','\0'};
 
     pos = strlenW(buffer);
     if (buffer[pos - 1] != '\\') buffer[pos++] = '\\';
@@ -478,7 +478,7 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p
     WCHAR*              ptr;
     const WCHAR*        filename;
 
-    TRACE("(%p %s %s %p %08x %08x %08x %p %p %p)\n",
+    TRACE("(hProcess = %p, searchPath = %s, full_path = %s, id = %p, two = 0x%08x, three = 0x%08x, flags = 0x%08x, buffer = %p, cb = %p, user = %p)\n",
           hProcess, debugstr_w(searchPath), debugstr_w(full_path),
           id, two, three, flags, buffer, cb, user);
 
index 3027f5b..283962c 100644 (file)
@@ -22,6 +22,8 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -40,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
  * its debugging information)
  */
 static BOOL pe_load_stabs(const struct process* pcs, struct module* module, 
-                          const void* mapping, IMAGE_NT_HEADERS* nth)
+                          void* mapping, IMAGE_NT_HEADERS* nth)
 {
     IMAGE_SECTION_HEADER*       section;
     int                         i, stabsize = 0, stabstrsize = 0;
@@ -67,11 +69,13 @@ static BOOL pe_load_stabs(const struct process* pcs, struct module* module,
     {
         ret = stabs_parse(module, 
                           module->module.BaseOfImage - nth->OptionalHeader.ImageBase, 
-                          RtlImageRvaToVa(nth, (void*)mapping, stabs, NULL),
+                          RtlImageRvaToVa(nth, mapping, stabs, NULL),
                           stabsize,
-                          RtlImageRvaToVa(nth, (void*)mapping, stabstr, NULL),
+                          RtlImageRvaToVa(nth, mapping, stabstr, NULL),
                           stabstrsize);
     }
+
+    TRACE("%s the STABS debug info\n", ret ? "successfully loaded" : "failed to load");
     return ret;
 }
 
@@ -96,7 +100,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
     const IMAGE_DEBUG_DIRECTORY*        dbg;
     BOOL                                ret = FALSE;
 
-    WINE_TRACE("Processing DBG file %s\n", dbg_name);
+    WINE_TRACE("Processing DBG file %s\n", debugstr_a(dbg_name));
 
     if (SymFindFileInPath(pcs->handle, NULL, dbg_name, NULL, 0, 0, 0, tmp, dbg_match, NULL) &&
         (hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL,
@@ -108,7 +112,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
         if (hdr->TimeDateStamp != timestamp)
         {
             WINE_ERR("Warning - %s has incorrect internal timestamp\n",
-                     dbg_name);
+                     debugstr_a(dbg_name));
             /*
              * Well, sometimes this happens to DBG files which ARE REALLY the
              * right .DBG files but nonetheless this check fails. Anyway,
@@ -136,7 +140,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
             ERR("Wrong signature in .DBG file %s\n", debugstr_a(tmp));
     }
     else
-        WINE_ERR("-Unable to peruse .DBG file %s (%s)\n", dbg_name, debugstr_a(tmp));
+        WINE_ERR("-Unable to peruse .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_a(tmp));
 
     if (dbg_mapping) UnmapViewOfFile(dbg_mapping);
     if (hMap) CloseHandle(hMap);
@@ -151,7 +155,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
  */
 static BOOL pe_load_msc_debug_info(const struct process* pcs, 
                                    struct module* module,
-                                   const void* mapping, IMAGE_NT_HEADERS* nth)
+                                   void* mapping, IMAGE_NT_HEADERS* nth)
 {
     BOOL                        ret = FALSE;
     const IMAGE_DATA_DIRECTORY* dir;
@@ -163,7 +167,7 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs,
     nDbg = dir->Size / sizeof(IMAGE_DEBUG_DIRECTORY);
     if (!nDbg) return FALSE;
 
-    dbg = RtlImageRvaToVa(nth, (void*)mapping, dir->VirtualAddress, NULL);
+    dbg = RtlImageRvaToVa(nth, mapping, dir->VirtualAddress, NULL);
 
     /* Parse debug directory */
     if (nth->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED)
@@ -199,7 +203,7 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs,
  */
 static BOOL pe_load_export_debug_info(const struct process* pcs, 
                                       struct module* module, 
-                                      const void* mapping, IMAGE_NT_HEADERS* nth)
+                                      void* mapping, IMAGE_NT_HEADERS* nth)
 {
     unsigned int                       i;
     const IMAGE_EXPORT_DIRECTORY*      exports;
@@ -229,13 +233,13 @@ static BOOL pe_load_export_debug_info(const struct process* pcs,
     for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++) 
     {
        symt_new_public(module, NULL, section->Name, 
-                        RtlImageRvaToVa(nth, (void*)mapping, section->VirtualAddress, NULL), 
+                        RtlImageRvaToVa(nth, mapping, section->VirtualAddress, NULL), 
                         1, TRUE /* FIXME */, TRUE /* FIXME */);
     }
 #endif
 
     /* Add exported functions */
-    if ((exports = RtlImageDirectoryEntryToData((void*)mapping, FALSE,
+    if ((exports = RtlImageDirectoryEntryToData(mapping, FALSE,
                                                 IMAGE_DIRECTORY_ENTRY_EXPORT, &size)))
     {
         const WORD*             ordinals = NULL;
@@ -244,9 +248,9 @@ static BOOL pe_load_export_debug_info(const struct process* pcs,
         unsigned int           j;
         char                   buffer[16];
 
-        functions = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfFunctions, NULL);
-        ordinals  = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfNameOrdinals, NULL);
-        names     = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfNames, NULL);
+        functions = RtlImageRvaToVa(nth, mapping, exports->AddressOfFunctions, NULL);
+        ordinals  = RtlImageRvaToVa(nth, mapping, exports->AddressOfNameOrdinals, NULL);
+        names     = RtlImageRvaToVa(nth, mapping, exports->AddressOfNames, NULL);
 
         if (functions && ordinals && names)
         {
@@ -254,7 +258,7 @@ static BOOL pe_load_export_debug_info(const struct process* pcs,
             {
                 if (!names[i]) continue;
                 symt_new_public(module, NULL,
-                                RtlImageRvaToVa(nth, (void*)mapping, names[i], NULL),
+                                RtlImageRvaToVa(nth, mapping, names[i], NULL),
                                 base + functions[ordinals[i]],
                                 1, TRUE /* FIXME */, TRUE /* FIXME */);
             }
@@ -369,6 +373,8 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
                     else
                         pe_load_debug_info(pcs, module);
                 }
+                else
+                    ERR("could not load the module '%s'\n", debugstr_w(loaded_name));
             }
             UnmapViewOfFile(mapping);
         }
@@ -417,3 +423,50 @@ struct module* pe_load_builtin_module(struct process* pcs, const WCHAR* name,
     }
     return module;
 }
+
+/***********************************************************************
+ *           ImageDirectoryEntryToDataEx (DBGHELP.@)
+ *
+ * Search for specified directory in PE image
+ *
+ * PARAMS
+ *
+ *   base    [in]  Image base address
+ *   image   [in]  TRUE - image has been loaded by loader, FALSE - raw file image
+ *   dir     [in]  Target directory index
+ *   size    [out] Receives directory size
+ *   section [out] Receives pointer to section header of section containing directory data
+ *
+ * RETURNS
+ *   Success: pointer to directory data
+ *   Failure: NULL
+ *
+ */
+PVOID WINAPI ImageDirectoryEntryToDataEx( PVOID base, BOOLEAN image, USHORT dir, PULONG size, PIMAGE_SECTION_HEADER *section )
+{
+    const IMAGE_NT_HEADERS *nt;
+    DWORD addr;
+
+    *size = 0;
+    if (section) *section = NULL;
+
+    if (!(nt = RtlImageNtHeader( base ))) return NULL;
+    if (dir >= nt->OptionalHeader.NumberOfRvaAndSizes) return NULL;
+    if (!(addr = nt->OptionalHeader.DataDirectory[dir].VirtualAddress)) return NULL;
+
+    *size = nt->OptionalHeader.DataDirectory[dir].Size;
+    if (image || addr < nt->OptionalHeader.SizeOfHeaders) return (char *)base + addr;
+
+    return RtlImageRvaToVa( nt, (HMODULE)base, addr, section );
+}
+
+/***********************************************************************
+ *         ImageDirectoryEntryToData   (DBGHELP.@)
+ *
+ * NOTES
+ *   See ImageDirectoryEntryToDataEx
+ */
+PVOID WINAPI ImageDirectoryEntryToData( PVOID base, BOOLEAN image, USHORT dir, PULONG size )
+{
+    return ImageDirectoryEntryToDataEx( base, image, dir, size, NULL );
+}
index 8f651b1..9955b7e 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "config.h"
+#include "wine/port.h"
 
 #include <sys/types.h>
 #include <fcntl.h>
@@ -498,7 +499,7 @@ static int stabs_pts_read_range(struct ParseTypedefData* ptd, const char* typena
     PTS_ABORTIF(ptd, *ptd->ptr++ != ';');      /* ';' */
 
     /* basically, we don't use ref... in some cases, for example, float is declared
-     * as a derivated type of int... which won't help us... so we guess the types
+     * as a derived type of int... which won't help us... so we guess the types
      * from the various formats
      */
     if (lo.sign == 0 && hi.sign < 0)
@@ -793,9 +794,9 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ
                                    struct symt** ret_dt)
 {
     int                        idx;
-    long                sz = -1;
-    struct symt*        new_dt = NULL; /* newly created data type */
-    struct symt*        ref_dt;                   /* referenced data type (pointer...) */
+    long               sz = -1;
+    struct symt*       new_dt = NULL;     /* newly created data type */
+    struct symt*       ref_dt;            /* referenced data type (pointer...) */
     long               filenr1, subnr1, tmp;
 
     /* things are a bit complicated because of the way the typedefs are stored inside
@@ -807,7 +808,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ
     while (*ptd->ptr == '=')
     {
        ptd->ptr++;
-       PTS_ABORTIF(ptd, new_dt != btNoType);
+       PTS_ABORTIF(ptd, new_dt != NULL);
 
        /* first handle attribute if any */
        switch (*ptd->ptr)      
@@ -856,7 +857,8 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ
            new_dt = &symt_new_function_signature(ptd->module, ref_dt, -1)->symt;
            break;
        case 'e':
-           new_dt = &symt_new_enum(ptd->module, typename)->symt;
+            stabs_get_basic(ptd, 1 /* int */, &ref_dt);
+            new_dt = &symt_new_enum(ptd->module, typename, ref_dt)->symt;
            PTS_ABORTIF(ptd, stabs_pts_read_enum(ptd, (struct symt_enum*)new_dt) == -1);
            break;
        case 's':
@@ -910,7 +912,8 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ
            switch (tmp)
             {
            case 'e':
-                new_dt = &symt_new_enum(ptd->module, ptd->buf + idx)->symt;
+                stabs_get_basic(ptd, 1 /* int */, &ref_dt);
+                new_dt = &symt_new_enum(ptd->module, ptd->buf + idx, ref_dt)->symt;
                 break;
            case 's':
                 new_dt = &symt_new_udt(ptd->module, ptd->buf + idx, 0, UdtStruct)->symt;
@@ -1000,7 +1003,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ
 
     *stabs_find_ref(filenr1, subnr1) = *ret_dt = new_dt;
 
-    TRACE("Adding (%ld,%ld) %s\n", filenr1, subnr1, typename);
+    TRACE("Adding (%ld,%ld) %s\n", filenr1, subnr1, debugstr_a(typename));
 
     return 0;
 }
@@ -1145,7 +1148,7 @@ static void pending_flush(struct pending_block* pending, struct module* module,
  * Ends function creation: mainly:
  * - cleans up line number information
  * - tries to set up a debug-start tag (FIXME: heuristic to be enhanced)
- * - for stabs which have abolute address in them, initializes the size of the 
+ * - for stabs which have absolute address in them, initializes the size of the
  *   function (assuming that current function ends where next function starts)
  */
 static void stabs_finalize_function(struct module* module, struct symt_function* func,
diff --git a/reactos/dll/win32/dbghelp/stackframe.h b/reactos/dll/win32/dbghelp/stackframe.h
deleted file mode 100644 (file)
index c9af822..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 16-bit and 32-bit mode stack frame layout
- *
- * Copyright 1995, 1998 Alexandre Julliard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __WINE_STACKFRAME_H
-#define __WINE_STACKFRAME_H
-
-#include <string.h>
-#define NTOS_MODE_USER
-#include <ndk/umtypes.h>
-#include <ndk/extypes.h>
-#include <ndk/rtlfuncs.h>
-
-#define SELECTOROF(ptr)     (HIWORD(ptr))
-#define OFFSETOF(ptr)       (LOWORD(ptr))
-
-#include <pshpack1.h>
-
-  /* 32-bit stack layout after CallTo16() */
-typedef struct _STACK32FRAME
-{
-    DWORD   restore_addr;   /* 00 return address for restoring code selector */
-    DWORD   codeselector;   /* 04 code selector to restore */
-    EXCEPTION_REGISTRATION_RECORD frame;  /* 08 Exception frame */
-    SEGPTR  frame16;        /* 10 16-bit frame from last CallFrom16() */
-    DWORD   edi;            /* 14 saved registers */
-    DWORD   esi;            /* 18 */
-    DWORD   ebx;            /* 1c */
-    DWORD   ebp;            /* 20 saved 32-bit frame pointer */
-    DWORD   retaddr;        /* 24 return address */
-    DWORD   target;         /* 28 target address / CONTEXT86 pointer */
-    DWORD   nb_args;        /* 2c number of 16-bit argument bytes */
-} STACK32FRAME;
-
-  /* 16-bit stack layout after CallFrom16() */
-typedef struct _STACK16FRAME
-{
-    STACK32FRAME *frame32;        /* 00 32-bit frame from last CallTo16() */
-    DWORD         edx;            /* 04 saved registers */
-    DWORD         ecx;            /* 08 */
-    DWORD         ebp;            /* 0c */
-    WORD          ds;             /* 10 */
-    WORD          es;             /* 12 */
-    WORD          fs;             /* 14 */
-    WORD          gs;             /* 16 */
-    DWORD         callfrom_ip;    /* 18 callfrom tail IP */
-    DWORD         module_cs;      /* 1c module code segment */
-    DWORD         relay;          /* 20 relay function address */
-    WORD          entry_ip;       /* 22 entry point IP */
-    DWORD         entry_point;    /* 26 API entry point to call, reused as mutex count */
-    WORD          bp;             /* 2a 16-bit stack frame chain */
-    WORD          ip;             /* 2c return address */
-    WORD          cs;             /* 2e */
-} STACK16FRAME;
-
-#include <poppack.h>
-
-static __inline int MapSL(int size)
-{
-    return -1;
-}
-
-#define CURRENT_STACK16      ((STACK16FRAME*)MapSL(NtCurrentTeb()->cur_stack))
-#define CURRENT_DS           (CURRENT_STACK16->ds)
-
-
-#endif /* __WINE_STACKFRAME_H */
diff --git a/reactos/dll/win32/dbghelp/stubs.c b/reactos/dll/win32/dbghelp/stubs.c
deleted file mode 100644 (file)
index fcae671..0000000
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- * File stubs.c - stubs for exported functions
- *
- * Copyright (C) 2007, Timo Kreuzer
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#define WIN32_NO_STATUS
-#include <windows.h>
-#include <ndk/ntndk.h>
-
-#include "dbghelp_private.h"
-
-#define UNIMPLEMENTED DbgPrint("DBGHELP: %s is unimplemented, please try again later.\n", __FUNCTION__);
-
-BOOL WINAPI
-DbgHelpCreateUserDump(LPSTR pszFileName,
-                      PDBGHELP_CREATE_USER_DUMP_CALLBACK Callback,
-                      PVOID pUserData)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-DbgHelpCreateUserDumpW(LPWSTR pszFileName,
-                      PDBGHELP_CREATE_USER_DUMP_CALLBACK Callback,
-                      PVOID pUserData)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-FindFileInPath(HANDLE hProcess,
-                      LPSTR pszSearchPath,
-               LPSTR pszFileName,
-               PVOID id,
-               DWORD two,
-               DWORD three,
-               DWORD dwFlags,
-               LPSTR pszFilePath)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-FindFileInSearchPath(HANDLE hProcess,
-                     LPSTR pszSearchPath,
-                     LPSTR pszFileName,
-                     DWORD one,
-                     DWORD two,
-                     DWORD three,
-                     LPSTR pszFilePath)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-PVOID WINAPI
-ImageDirectoryEntryToDataEx(PVOID pModuleBase,
-                            BOOLEAN bMappedAsImage,
-                            USHORT DirectoryEntry,
-                            PULONG pulSize,
-                            PIMAGE_SECTION_HEADER *FoundHeader)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-BOOL WINAPI
-SymAddSymbol(HANDLE hProcess,
-             ULONG64 ModBase,
-             PCSTR pszName,
-             DWORD64 Address,
-             DWORD dwSize,
-             DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymAddSymbolW(HANDLE hProcess,
-              ULONG64 ModBase,
-              PCWSTR pszName,
-              DWORD64 Address,
-              DWORD dwSize,
-              DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymDeleteSymbol(HANDLE hProcess,
-                ULONG64 ModBase,
-                PCSTR pszName,
-                DWORD64 Address,
-                DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymDeleteSymbolW(HANDLE hProcess,
-                 ULONG64 ModBase,
-                 PCWSTR pszName,
-                 DWORD64 Address,
-                 DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumLinesW(HANDLE hProcess,
-              ULONG64 ModBase,
-              PCWSTR pszObj,
-              PCWSTR pszFile,
-              PSYM_ENUMLINES_CALLBACKW Callback,
-              PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL SymEnumProcesses(PSYM_ENUMPROCESSES_CALLBACK Callback,
-                      PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumSourceFilesW(HANDLE hProcess,
-                    ULONG64 ModBase,
-                    PCWSTR pszMask,
-                    PSYM_ENUMSOURCEFILES_CALLBACKW Callback,
-                    PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumSourceLines(HANDLE hProcess,
-                   ULONG64 ModBase,
-                   PCSTR pszObject,
-                   PCSTR pszFile,
-                   DWORD dwLine,
-                   DWORD dwFlags,
-                   PSYM_ENUMLINES_CALLBACK Callback,
-                   PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumSourceLinesW(HANDLE hProcess,
-                    ULONG64 ModBase,
-                    PCWSTR pszObject,
-                    PCWSTR pszFile,
-                    DWORD dwLine,
-                    DWORD dwFlags,
-                    PSYM_ENUMLINES_CALLBACKW Callback,
-                    PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumSym(HANDLE hProcess,
-           ULONG64 ModBase,
-           PSYM_ENUMERATESYMBOLS_CALLBACK Callback,
-           PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumSymbolsForAddr(HANDLE hProcess,
-                      DWORD64 Address,
-                      PSYM_ENUMERATESYMBOLS_CALLBACK Callback,
-                      PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumSymbolsForAddrW(HANDLE hProcess,
-                       DWORD64 Address,
-                       PSYM_ENUMERATESYMBOLS_CALLBACKW Callback,
-                       PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumerateSymbols64(HANDLE hProcess,
-                      DWORD64 ModBase,
-                      PSYM_ENUMSYMBOLS_CALLBACK64 Callback,
-                      PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumerateSymbolsW64(HANDLE hProcess,  
-             DWORD64 ModBase,  
-             PSYM_ENUMSYMBOLS_CALLBACK64W Callback,  
-             PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymEnumerateSymbolsW(HANDLE hProcess,
-             DWORD ModBase,
-             PSYM_ENUMSYMBOLS_CALLBACKW Callback,
-             PVOID pUserContext)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymFromIndex(HANDLE hProcess,
-             ULONG64 ModBase,
-             DWORD Index,
-             PSYMBOL_INFO Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymFromIndexW(HANDLE hProcess,
-              ULONG64 ModBase,
-              DWORD Index,
-              PSYMBOL_INFOW Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymFromNameW(HANDLE hProcess,
-             PCWSTR pszName,
-             PSYMBOL_INFOW Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymFromToken(HANDLE hProcess,
-             DWORD64 ModBase,
-             DWORD Token,
-             PSYMBOL_INFO Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymFromTokenW(HANDLE hProcess,
-              DWORD64 ModBase,
-                         DWORD Token,
-              PSYMBOL_INFOW Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetFileLineOffsets64(HANDLE hProcess,
-                        PSTR pszModuleName,
-                        PSTR pszFileName,
-                        PDWORD64 pBuffer,
-                        ULONG BufferLines)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-PCHAR WINAPI
-SymGetHomeDirectory(DWORD dwType,
-                    PSTR pszDir,
-                    size_t Size)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-PWCHAR WINAPI
-SymGetHomeDirectoryW(DWORD dwType,
-                     PWSTR pszDir,
-                     size_t Size)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-BOOL WINAPI
-SymGetLineFromName64(HANDLE hProcess,  
-                     PCSTR pszModuleName,  
-                     PCSTR pszFileName,  
-                     DWORD dwLineNumber,  
-                     PLONG plDisplacement,  
-                     PIMAGEHLP_LINE64 Line)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetLineFromName(HANDLE hProcess,
-                   PCSTR pszModuleName,
-                   PCSTR pszFileName,
-                   DWORD dwLineNumber,
-                   PLONG plDisplacement,
-                   PIMAGEHLP_LINE Line)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetLineFromNameW64(HANDLE hProcess,
-                           PCWSTR pszModuleName,
-                           PCWSTR pszFileName,
-                           DWORD dwLineNumber,
-                           PLONG lpDisplacement,
-                           PIMAGEHLP_LINEW64 Line)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetLineNextW64(HANDLE hProcess,
-                  PIMAGEHLP_LINEW64 Line)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetLinePrevW64(HANDLE hProcess,
-                  PIMAGEHLP_LINEW64 Line)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetScope(HANDLE hProcess,
-            ULONG64 ModBase,
-            DWORD Index,
-            PSYMBOL_INFO Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetScopeW(HANDLE hProcess,
-             ULONG64 ModBase,
-             DWORD Index,
-             PSYMBOL_INFOW Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetSourceFile(HANDLE hProcess,
-                 ULONG64 ModBase,
-                 PCSTR pszParams,
-                 PCSTR pszFileSpec,
-                 PSTR pszFilePath,
-                 DWORD Size)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetSourceFileFromToken(HANDLE hProcess,
-                          PVOID Token,
-                          PCSTR pszParams,
-                          PSTR pszFilePath,
-                          DWORD Size)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-
-BOOL WINAPI
-SymGetSourceFileFromTokenW(HANDLE hProcess,
-                           PVOID Token,
-                           PCWSTR pszParams,
-                           PWSTR pszFilePath,
-                           DWORD Size)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-// SymGetSourceFileW
-// SymGetSourceVarFromToken
-// SymGetSourceVarFromTokenW
-
-BOOL WINAPI
-SymGetSymFromName64(HANDLE hProcess,  
-                    PCSTR pszName,  
-                    PIMAGEHLP_SYMBOL64 Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetSymNext64(HANDLE hProcess,  
-                PIMAGEHLP_SYMBOL64 Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetSymPrev64(HANDLE hProcess,
-                PIMAGEHLP_SYMBOL64 Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetSymbolFile(HANDLE hProcess,
-                 PCSTR pszSymPath,
-                 PCSTR pszImageFile,
-                 DWORD Type,
-                 PSTR SymbolFile,
-                 size_t cSymbolFile,
-                 PSTR DbgFile,
-                 size_t cDbgFile)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetSymbolFileW(HANDLE hProcess,
-                  PCWSTR pszSymPath,
-                  PCWSTR pszImageFile,
-                  DWORD Type,
-                  PWSTR pszSymbolFile,
-                  size_t cSymbolFile,
-                  PWSTR pszDbgFile,
-                  size_t cDbgFile)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetTypeFromNameW(HANDLE hProcess,
-                    ULONG64 ModBase,
-                    PCWSTR pszName,
-                    PSYMBOL_INFOW Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymGetTypeInfoEx(HANDLE hProcess,
-                 DWORD64 ModBase,
-                 PIMAGEHLP_GET_TYPE_INFO_PARAMS Params)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymMatchStringA(PCSTR pszString,
-                PCSTR pszExpression,
-                BOOL bCaseSensitiv)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymMatchStringW(PCWSTR pszString,
-                PCWSTR pszExpression,
-                BOOL bCaseSensitiv)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymNext(HANDLE hProcess,
-        PSYMBOL_INFO Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymNextW(HANDLE hProcess,
-         PSYMBOL_INFOW Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymPrev(HANDLE hProcess,
-        PSYMBOL_INFO Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymPrevW(HANDLE hProcess,
-         PSYMBOL_INFOW Symbol)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-// SymRefreshModuleList
-
-PCHAR WINAPI
-SymSetHomeDirectory(HANDLE hProcess,
-                    PCSTR pszDir)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-PWCHAR WINAPI
-SymSetHomeDirectoryW(HANDLE hProcess,
-                     PCWSTR pszDir)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-// SymSetSymWithAddr64
-
-PCSTR WINAPI
-SymSrvDeltaName(HANDLE hProcess,
-                PCSTR pszSymPath,
-                PCSTR pszType,
-                PCSTR pszFile1,
-                PCSTR pszFile2)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-PCWSTR WINAPI
-SymSrvDeltaNameW(HANDLE hProcess,
-                 PCWSTR pszSymPath,
-                 PCWSTR pszType,
-                 PCWSTR pszFile1,
-                 PCWSTR pszFile2)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-BOOL WINAPI
-SymSrvGetFileIndexString(HANDLE hProcess,
-                         PCSTR pszSrvPath,
-                         PCSTR pszFile,
-                         PSTR pszIndex,
-                         size_t Size,
-                         DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymSrvGetFileIndexStringW(HANDLE hProcess,
-                          PCWSTR pszSrvPath,
-                          PCWSTR pszFile,
-                          PWSTR pszIndex,
-                          size_t Size,
-                          DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymSrvGetFileIndexes(PCSTR File,
-                     GUID* Id,
-                     DWORD* Val1,
-                     DWORD* Val2,
-                     DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymSrvGetFileIndexesW(PCWSTR File,
-                      GUID* Id,
-                      DWORD* Val1,
-                      DWORD* Val2,
-                      DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-PCSTR WINAPI
-SymSrvGetSupplement(HANDLE hProcess,
-                    PCSTR pszSymPath,
-                    PCSTR pszNode,
-                    PCSTR pszFile)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-PCWSTR WINAPI
-SymSrvGetSupplementW(HANDLE hProcess,
-                     PCWSTR pszSymPath,
-                     PCWSTR pszNode,
-                     PCWSTR pszFile)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-BOOL WINAPI
-SymSrvIsStore(HANDLE hProcess,
-              PCSTR pszPath)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-BOOL WINAPI
-SymSrvIsStoreW(HANDLE hProcess,
-               PCWSTR pszPath)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-PCSTR WINAPI
-SymSrvStoreFile(HANDLE hProcess,
-                PCSTR pszSrvPath,
-                PCSTR pszFile,
-                DWORD pszFlags)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-PCWSTR WINAPI
-SymSrvStoreFileW(HANDLE hProcess,
-                 PCWSTR pszSrvPath,
-                 PCWSTR pszFile,
-                 DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-PCSTR WINAPI
-SymSrvStoreSupplement(HANDLE hProcess,
-                      PCSTR pszSymPath,
-                      PCSTR pszNode,
-                      PCSTR pszFile,
-                      DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-PCWSTR WINAPI
-SymSrvStoreSupplementW(HANDLE hProcess,
-                       PCWSTR pszSymPath,
-                       PCWSTR pszNode,
-                       PCWSTR pszFile,
-                       DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return NULL;
-}
-
-BOOL WINAPI
-SymUnDName64(PIMAGEHLP_SYMBOL64 Symbol,
-             PSTR pszUndecoratedName,
-             DWORD dwUndecoratedNameLength)
-{
-    UNIMPLEMENTED;
-       return FALSE;
-}
-
-DWORD WINAPI
-UnDecorateSymbolNameW(PCWSTR DecoratedName,
-                      PWSTR pszUnDecoratedName,
-                      DWORD dwUndecoratedLength,
-                      DWORD dwFlags)
-{
-    UNIMPLEMENTED;
-       return 0;
-}
-
-
index d76811b..f4f2d11 100644 (file)
@@ -374,21 +374,21 @@ struct symt_block* symt_close_func_block(struct module* module,
         GET_ENTRY(block->container, struct symt_block, symt) : NULL;
 }
 
-struct symt_function_point* symt_add_function_point(struct module* module, 
-                                                    struct symt_function* func,
-                                                    enum SymTagEnum point, 
-                                                    const struct location* loc,
-                                                    const char* name)
+struct symt_hierarchy_point* symt_add_function_point(struct module* module,
+                                                     struct symt_function* func,
+                                                     enum SymTagEnum point,
+                                                     const struct location* loc,
+                                                     const char* name)
 {
-    struct symt_function_point* sym;
+    struct symt_hierarchy_point*sym;
     struct symt**               p;
 
     if ((sym = pool_alloc(&module->pool, sizeof(*sym))))
     {
         sym->symt.tag = point;
-        sym->parent   = func;
+        sym->parent   = &func->symt;
         sym->loc      = *loc;
-        sym->name     = name ? pool_strdup(&module->pool, name) : NULL;
+        sym->hash_elt.name = name ? pool_strdup(&module->pool, name) : NULL;
         p = vector_add(&func->vchildren, &module->pool);
         *p = &sym->symt;
     }
@@ -478,6 +478,34 @@ struct symt_data* symt_new_constant(struct module* module,
     return sym;
 }
 
+struct symt_hierarchy_point* symt_new_label(struct module* module,
+                                            struct symt_compiland* compiland,
+                                            const char* name, unsigned long address)
+{
+    struct symt_hierarchy_point*        sym;
+
+    TRACE_(dbghelp_symt)("Adding global label value %s:%s\n",
+                         debugstr_w(module->module.ModuleName), name);
+
+    if ((sym = pool_alloc(&module->pool, sizeof(*sym))))
+    {
+        sym->symt.tag      = SymTagLabel;
+        sym->hash_elt.name = pool_strdup(&module->pool, name);
+        hash_table_add(&module->ht_symbols, &sym->hash_elt);
+        module->sortlist_valid = FALSE;
+        sym->loc.kind      = loc_absolute;
+        sym->loc.offset    = address;
+        sym->parent        = compiland ? &compiland->symt : NULL;
+        if (compiland)
+        {
+            struct symt**       p;
+            p = vector_add(&compiland->vchildren, &module->pool);
+            *p = &sym->symt;
+        }
+    }
+    return sym;
+}
+
 /* expect sym_info->MaxNameLen to be set before being called */
 static void symt_fill_sym_info(const struct module_pair* pair,
                                const struct symt_function* func,
@@ -589,8 +617,8 @@ static void symt_fill_sym_info(const struct module_pair* pair,
     if (sym_info->MaxNameLen)
     {
         if (sym->tag != SymTagPublicSymbol || !(dbghelp_options & SYMOPT_UNDNAME) ||
-            (sym_info->NameLen = UnDecorateSymbolName(name, sym_info->Name, 
-                                                      sym_info->MaxNameLen, UNDNAME_COMPLETE) == 0))
+            (sym_info->NameLen = UnDecorateSymbolName(name, sym_info->Name,
+                                                      sym_info->MaxNameLen, UNDNAME_NAME_ONLY) == 0))
         {
             sym_info->NameLen = min(strlen(name), sym_info->MaxNameLen - 1);
             memcpy(sym_info->Name, name, sym_info->NameLen);
@@ -1027,6 +1055,33 @@ BOOL WINAPI SymEnumerateSymbols(HANDLE hProcess, DWORD BaseOfDll,
     return SymEnumSymbols(hProcess, BaseOfDll, NULL, sym_enumerate_cb, &se);
 }
 
+struct sym_enumerate64
+{
+    void*                       ctx;
+    PSYM_ENUMSYMBOLS_CALLBACK64 cb;
+};
+
+static BOOL CALLBACK sym_enumerate_cb64(PSYMBOL_INFO syminfo, ULONG size, void* ctx)
+{
+    struct sym_enumerate64*     se = (struct sym_enumerate64*)ctx;
+    return (se->cb)(syminfo->Name, syminfo->Address, syminfo->Size, se->ctx);
+}
+
+/***********************************************************************
+ *              SymEnumerateSymbols64 (DBGHELP.@)
+ */
+BOOL WINAPI SymEnumerateSymbols64(HANDLE hProcess, DWORD64 BaseOfDll,
+                                  PSYM_ENUMSYMBOLS_CALLBACK64 EnumSymbolsCallback,
+                                  PVOID UserContext)
+{
+    struct sym_enumerate64      se;
+
+    se.ctx = UserContext;
+    se.cb  = EnumSymbolsCallback;
+
+    return SymEnumSymbols(hProcess, BaseOfDll, NULL, sym_enumerate_cb64, &se);
+}
+
 /******************************************************************
  *             SymFromAddr (DBGHELP.@)
  *
diff --git a/reactos/dll/win32/dbghelp/thread.h b/reactos/dll/win32/dbghelp/thread.h
deleted file mode 100644 (file)
index 3ee2f8d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Thread definitions
- *
- * Copyright 1996 Alexandre Julliard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __WINE_THREAD_H
-#define __WINE_THREAD_H
-
-#include <stdarg.h>
-#define WIN32_NO_STATUS
-#include <windef.h>
-#include <winbase.h>
-#include <winreg.h>
-#define WINE_NO_TEB
-#include <wine/windef16.h>
-
-struct _SECURITY_ATTRIBUTES;
-struct tagSYSLEVEL;
-struct server_buffer_info;
-struct fiber_data;
-
-struct debug_info
-{
-    char *str_pos;       /* current position in strings buffer */
-    char *out_pos;       /* current position in output buffer */
-    char  strings[1024]; /* buffer for temporary strings */
-    char  output[1024];  /* current output line */
-};
-
-#endif  /* __WINE_THREAD_H */
index a8c6778..aeb3e75 100644 (file)
@@ -21,6 +21,9 @@
  * Note: This really doesn't do much at the moment, but it forms the framework
  * upon which full support for datatype handling will eventually be built.
  */
+
+#define NONAMELESSUNION
+
 #include "config.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -83,7 +86,7 @@ const char* symt_get_name(const struct symt* sym)
     case SymTagFunction:        return ((const struct symt_function*)sym)->hash_elt.name;
     case SymTagPublicSymbol:    return ((const struct symt_public*)sym)->hash_elt.name;
     case SymTagBaseType:        return ((const struct symt_basic*)sym)->hash_elt.name;
-    case SymTagLabel:           return ((const struct symt_function_point*)sym)->name;
+    case SymTagLabel:           return ((const struct symt_hierarchy_point*)sym)->hash_elt.name;
     case SymTagThunk:           return ((const struct symt_thunk*)sym)->hash_elt.name;
     /* hierarchy tree */
     case SymTagEnum:            return ((const struct symt_enum*)sym)->name;
@@ -243,7 +246,8 @@ BOOL symt_add_udt_element(struct module* module, struct symt_udt* udt_type,
     return TRUE;
 }
 
-struct symt_enum* symt_new_enum(struct module* module, const char* typename)
+struct symt_enum* symt_new_enum(struct module* module, const char* typename,
+                                struct symt* basetype)
 {
     struct symt_enum*   sym;
 
@@ -251,6 +255,7 @@ struct symt_enum* symt_new_enum(struct module* module, const char* typename)
     {
         sym->symt.tag            = SymTagEnum;
         sym->name = (typename) ? pool_strdup(&module->pool, typename) : NULL;
+        sym->base_type           = basetype;
         vector_init(&sym->vchildren, sizeof(struct symt*), 8);
     }
     return sym;
@@ -271,8 +276,7 @@ BOOL symt_add_enum_element(struct module* module, struct symt_enum* enum_type,
     e->hash_elt.next = NULL;
     e->kind = DataIsConstant;
     e->container = &enum_type->symt;
-    /* CV defines the underlying type for the enumeration */
-    e->type = &symt_new_basic(module, btInt, "int", 4)->symt;
+    e->type = enum_type->base_type;
     e->u.value.n1.n2.vt = VT_I4;
     e->u.value.n1.n2.n3.lVal = value;
 
@@ -518,8 +522,10 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
         case SymTagFuncDebugStart:
         case SymTagFuncDebugEnd:
         case SymTagLabel:
-            X(ULONG64) = ((const struct symt_function_point*)type)->parent->address + 
-                ((const struct symt_function_point*)type)->loc.offset;
+            if (!symt_get_info(((const struct symt_hierarchy_point*)type)->parent,
+                               req, pInfo))
+                return FALSE;
+            X(ULONG64) += ((const struct symt_hierarchy_point*)type)->loc.offset;
             break;
         case SymTagThunk:
             X(ULONG64) = ((const struct symt_thunk*)type)->address;
@@ -648,6 +654,9 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
         case SymTagThunk:
             X(DWORD64) = ((const struct symt_thunk*)type)->size;
             break;
+        case SymTagLabel:
+            X(DWORD64) = 0;
+            break;
         default:
             FIXME("Unsupported sym-tag %s for get-length\n", 
                   symt_get_tag_str(type->tag));
@@ -759,7 +768,9 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
         case SymTagFunction:
             X(DWORD) = (DWORD)((const struct symt_function*)type)->type;
             break;
-            /* FIXME: should also work for enums */
+        case SymTagEnum:
+            X(DWORD) = (DWORD)((const struct symt_enum*)type)->base_type;
+            break;
         case SymTagFunctionArgType:
             X(DWORD) = (DWORD)((const struct symt_function_arg_type*)type)->arg_type;
             break;
@@ -768,6 +779,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
                   symt_get_tag_str(type->tag));
         case SymTagPublicSymbol:
         case SymTagThunk:
+        case SymTagLabel:
             return FALSE;
         }
         break;
@@ -797,10 +809,15 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req,
         X(DWORD) = (DWORD)((const struct symt_array*)type)->index_type;
         break;
 
+    case TI_GET_CLASSPARENTID:
+        /* FIXME: we don't support properly C++ for now, pretend this symbol doesn't
+         * belong to a parent class
+         */
+        return FALSE;
+
 #undef X
 
     case TI_GET_ADDRESSOFFSET:
-    case TI_GET_CLASSPARENTID:
     case TI_GET_SYMINDEX:
     case TI_GET_THISADJUST:
     case TI_GET_VIRTUALBASECLASS:
index 6cb4431..39ed0f6 100644 (file)
@@ -349,10 +349,10 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER
         return FALSE;
     }
     CloseHandle(hFile);
-    if (!StrFormatByteSizeW(file_size.QuadPart, resultstr, sizeof(resultstr) / sizeof(WCHAR)))
+    if (!StrFormatByteSizeW(file_size.QuadPart, resultstr, sizeof(resultstr)/sizeof(resultstr[0])));
        return FALSE;
     hDlgCtrl = GetDlgItem(hwndDlg, 14011);
-    TRACE("result size %u resultstr %s\n", file_size.QuadPart, debugstr_w(resultstr));
+    ERR("result size %u resultstr %s %s\n", file_size.QuadPart, debugstr_w(resultstr), resultstr);
     SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)resultstr);
 
     if (lpfilesize)
index b62fdf2..a67daf3 100644 (file)
@@ -88,7 +88,7 @@ typedef struct _tagADDRESS64
 #define SYMF_THUNK            0x00002000
 #define SYMF_TLSREL           0x00004000
 
-typedef enum
+typedef enum 
 {
     SymNone = 0,
     SymCoff,
@@ -375,10 +375,10 @@ typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64
 #define SYMOPT_EXACT_SYMBOLS            0x00000400
 #define SYMOPT_WILD_UNDERSCORE          0x00000800
 #define SYMOPT_USE_DEFAULTS             0x00001000
-/* latest SDK defines: */
+/* latest SDK defines:
 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS   0x00000800
 #define SYMOPT_IGNORE_NT_SYMPATH        0x00001000
-
+*/
 #define SYMOPT_INCLUDE_32BIT_MODULES    0x00002000
 #define SYMOPT_PUBLICS_ONLY             0x00004000
 #define SYMOPT_NO_PUBLICS               0x00008000
@@ -430,7 +430,7 @@ typedef struct _DBGHELP_MODLOAD_DATA
 typedef DWORD   RVA;
 typedef ULONG64 RVA64;
 
-typedef enum _MINIDUMP_TYPE
+typedef enum _MINIDUMP_TYPE 
 {
     MiniDumpNormal                              = 0x0000,
     MiniDumpWithDataSegs                        = 0x0001,
@@ -469,7 +469,7 @@ typedef struct _MINIDUMP_THREAD_CALLBACK
     ULONG64                     StackEnd;
 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
 
-typedef struct _MINIDUMP_THREAD_EX_CALLBACK
+typedef struct _MINIDUMP_THREAD_EX_CALLBACK 
 {
     ULONG                       ThreadId;
     HANDLE                      ThreadHandle;
@@ -486,7 +486,7 @@ typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
     ULONG ThreadId;
 } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
 
-typedef enum _THREAD_WRITE_FLAGS
+typedef enum _THREAD_WRITE_FLAGS 
 {
     ThreadWriteThread            = 0x0001,
     ThreadWriteStack             = 0x0002,
@@ -497,7 +497,7 @@ typedef enum _THREAD_WRITE_FLAGS
     ThreadWriteThreadInfo        = 0x0040
 } THREAD_WRITE_FLAGS;
 
-typedef struct _MINIDUMP_MODULE_CALLBACK
+typedef struct _MINIDUMP_MODULE_CALLBACK 
 {
     PWCHAR                      FullPath;
     ULONG64                     BaseOfImage;
@@ -511,12 +511,12 @@ typedef struct _MINIDUMP_MODULE_CALLBACK
     ULONG                       SizeOfMiscRecord;
 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
 
-typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
+typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK 
 {
     ULONG64 BaseOfImage;
 } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
 
-typedef enum _MODULE_WRITE_FLAGS
+typedef enum _MODULE_WRITE_FLAGS 
 {
     ModuleWriteModule        = 0x0001,
     ModuleWriteDataSeg       = 0x0002,
@@ -527,12 +527,12 @@ typedef enum _MODULE_WRITE_FLAGS
     ModuleWriteCodeSegs      = 0x0040,
 } MODULE_WRITE_FLAGS;
 
-typedef struct _MINIDUMP_CALLBACK_INPUT
+typedef struct _MINIDUMP_CALLBACK_INPUT 
 {
     ULONG                       ProcessId;
     HANDLE                      ProcessHandle;
     ULONG                       CallbackType;
-    union
+    union 
     {
         MINIDUMP_THREAD_CALLBACK        Thread;
         MINIDUMP_THREAD_EX_CALLBACK     ThreadEx;
@@ -544,7 +544,7 @@ typedef struct _MINIDUMP_CALLBACK_INPUT
 
 typedef struct _MINIDUMP_CALLBACK_OUTPUT
 {
-    union
+    union 
     {
         ULONG                           ModuleWriteFlags;
         ULONG                           ThreadWriteFlags;
@@ -558,19 +558,19 @@ typedef struct _MINIDUMP_CALLBACK_OUTPUT
 
 typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID, const PMINIDUMP_CALLBACK_INPUT, PMINIDUMP_CALLBACK_OUTPUT);
 
-typedef struct _MINIDUMP_CALLBACK_INFORMATION
+typedef struct _MINIDUMP_CALLBACK_INFORMATION 
 {
     MINIDUMP_CALLBACK_ROUTINE   CallbackRoutine;
     void*                       CallbackParam;
 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
 
-typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
+typedef struct _MINIDUMP_LOCATION_DESCRIPTOR 
 {
     ULONG                       DataSize;
     RVA                         Rva;
 } MINIDUMP_LOCATION_DESCRIPTOR;
 
-typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64
+typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64 
 {
     ULONG64                     DataSize;
     RVA64                       Rva;
@@ -615,7 +615,7 @@ typedef struct _MINIDUMP_HEADER
     DWORD                       NumberOfStreams;
     RVA                         StreamDirectoryRva;
     DWORD                       CheckSum;
-    union
+    union 
     {
         DWORD                           Reserved;
         DWORD                           TimeDateStamp;
@@ -662,7 +662,7 @@ typedef struct _MINIDUMP_MODULE
     ULONG64                     Reserved1;
 } MINIDUMP_MODULE, *PMINIDUMP_MODULE;
 
-typedef struct _MINIDUMP_MODULE_LIST
+typedef struct _MINIDUMP_MODULE_LIST 
 {
     ULONG                       NumberOfModules;
     MINIDUMP_MODULE             Modules[1]; /* FIXME: 0-sized array not supported */
@@ -713,7 +713,7 @@ typedef struct _MINIDUMP_SYSTEM_INFO
             ULONG                       FeatureInformation;
             ULONG                       AMDExtendedCpuFeatures;
         } X86CpuInfo;
-        struct
+        struct 
         {
             ULONG64                     ProcessorFeatures[2];
         } OtherCpuInfo;
@@ -784,13 +784,6 @@ BOOL WINAPI MiniDumpReadDumpStream(PVOID, ULONG, PMINIDUMP_DIRECTORY*, PVOID*,
 
 #include <poppack.h>
 
-/*************************
- * User mode dump        *
- *************************/
-typedef BOOL (WINAPI *PDBGHELP_CREATE_USER_DUMP_CALLBACK)(DWORD, PVOID*, LPDWORD, PVOID);
-BOOL WINAPI DbgHelpCreateUserDump(LPSTR, PDBGHELP_CREATE_USER_DUMP_CALLBACK, PVOID);
-BOOL WINAPI DbgHelpCreateUserDumpW(LPWSTR, PDBGHELP_CREATE_USER_DUMP_CALLBACK, PVOID);
-
 /*************************
  *    MODULE handling    *
  *************************/
@@ -906,7 +899,7 @@ typedef struct _SYMBOL_INFO_PACKAGEW
     WCHAR        name[MAX_SYM_NAME+1];
 } SYMBOL_INFO_PACKAGEW, *PSYMBOL_INFO_PACKAGEW;
 
-typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
+typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO 
 {
     TI_GET_SYMTAG,
     TI_GET_SYMNAME,
@@ -961,7 +954,7 @@ typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS
     PULONG64    ReqsValid;
 } IMAGEHLP_GET_TYPE_INFO_PARAMS, *PIMAGEHLP_GET_TYPE_INFO_PARAMS;
 
-typedef struct _TI_FINDCHILDREN_PARAMS
+typedef struct _TI_FINDCHILDREN_PARAMS 
 {
     ULONG Count;
     ULONG Start;
@@ -1076,7 +1069,7 @@ BOOL WINAPI SymGetLineNextW64(HANDLE, PIMAGEHLP_LINEW64);
 BOOL WINAPI SymGetLineFromName(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE);
 BOOL WINAPI SymGetLineFromName64(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE64);
 BOOL WINAPI SymGetLineFromNameW64(HANDLE, PCWSTR, PCWSTR, DWORD, PLONG, PIMAGEHLP_LINEW64);
-BOOL WINAPI SymGetFileLineOffsets64(HANDLE, PSTR, PSTR, PDWORD64, ULONG);
+ULONG WINAPI SymGetFileLineOffsets64(HANDLE, PCSTR, PCSTR, PDWORD64, ULONG);
 BOOL WINAPI SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD);
 BOOL WINAPI SymGetSourceFileW(HANDLE, ULONG64, PCWSTR, PCWSTR, PWSTR, DWORD);
 BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID*, DWORD*);
@@ -1131,7 +1124,8 @@ HANDLE WINAPI SymFindDebugInfoFile(HANDLE, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBAC
 HANDLE WINAPI SymFindDebugInfoFileW(HANDLE, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PCSTR, PVOID);
 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR, PVOID);
-BOOL WINAPI FindFileInPath(HANDLE, LPSTR, LPSTR, PVOID, DWORD, DWORD, DWORD, LPSTR);
+BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
+                           PSTR, PFINDFILEINPATHCALLBACK, PVOID);
 BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
                               PSTR, PFINDFILEINPATHCALLBACK, PVOID);
 BOOL WINAPI SymFindFileInPathW(HANDLE, PCWSTR, PCWSTR, PVOID, DWORD, DWORD, DWORD,
@@ -1177,11 +1171,6 @@ PWSTR WINAPI SymGetHomeDirectoryW(DWORD, PWSTR, size_t);
  *************************/
 BOOL WINAPI SymSetContext(HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT);
 
-/*************************
- *   Processes           *
- *************************/
-typedef BOOL (*PSYM_ENUMPROCESSES_CALLBACK)(HANDLE, PVOID); 
-BOOL SymEnumProcesses(PSYM_ENUMPROCESSES_CALLBACK, PVOID);
 
 /*************************
  *    Stack management   *
index 1aa70a8..306d893 100644 (file)
@@ -81,7 +81,7 @@
  * For the evolution of types, the need of the second flavor was the
  * number of types to be defined (limited to 0xFFFF, including the C
  * basic types); the need of the third flavor is the increase of
- * symbol size (to be greated than 256), which was likely needed for
+ * symbol size (to be greater than 256), which was likely needed for
  * complex C++ types (nested + templates).
  *
  * It's somehow difficult to represent the layout of those types on
@@ -343,9 +343,9 @@ union codeview_type
     {
         unsigned short int      len;
         short int               id;
-        unsigned                this_type;
-        unsigned int            class_type;
         unsigned int            rvtype;
+        unsigned int            class_type;
+        unsigned                this_type;
         unsigned char           call;
         unsigned char           reserved;
         unsigned short          params;
@@ -732,41 +732,317 @@ union codeview_fieldtype
  * bit mode.  There are many other types listed in the documents, but these
  * are apparently not used by the compiler, or represent pointer types
  * that are not used.
+ *
+ * Official MS documentation says that type (< 0x4000, so 12 bits) is made of:
+ *        +----------+------+------+----------+------+
+ *        |    11    | 10-8 | 7-4  |     3    | 2-0  |
+ *        +----------+------+------+----------+------+
+ *        | reserved | mode | type | reserved | size |
+ *        +----------+------+------+----------+------+
+ * In recent PDB files, type 8 exists, and is seen as an HRESULT... So we've
+ * added this basic type... as if bit 3 had been integrated into the size field
  */
-#define T_NOTYPE               0x0000  /* Notype */
-#define T_ABS                  0x0001  /* Abs */
-#define T_VOID                 0x0003  /* Void */
-#define T_CHAR                 0x0010  /* signed char */
-#define T_SHORT                        0x0011  /* short */
-#define T_LONG                 0x0012  /* long */
-#define T_QUAD                 0x0013  /* long long */
-#define T_UCHAR                        0x0020  /* unsigned  char */
-#define T_USHORT               0x0021  /* unsigned short */
-#define T_ULONG                        0x0022  /* unsigned long */
-#define T_UQUAD                        0x0023  /* unsigned long long */
-#define T_REAL32               0x0040  /* float */
-#define T_REAL64               0x0041  /* double */
-#define T_RCHAR                        0x0070  /* real char */
-#define T_WCHAR                        0x0071  /* wide char */
-#define T_INT4                 0x0074  /* int */
-#define T_UINT4                        0x0075  /* unsigned int */
-
-#define T_32PVOID              0x0403  /* 32 bit near pointer to void */
-#define T_32PCHAR              0x0410  /* 16:32 near pointer to signed char */
-#define T_32PSHORT             0x0411  /* 16:32 near pointer to short */
-#define T_32PLONG              0x0412  /* 16:32 near pointer to int */
-#define T_32PQUAD              0x0413  /* 16:32 near pointer to long long */
-#define T_32PUCHAR             0x0420  /* 16:32 near pointer to unsigned char */
-#define T_32PUSHORT            0x0421  /* 16:32 near pointer to unsigned short */
-#define T_32PULONG             0x0422  /* 16:32 near pointer to unsigned int */
-#define T_32PUQUAD             0x0423  /* 16:32 near pointer to long long */
-#define T_32PREAL32            0x0440  /* 16:32 near pointer to float */
-#define T_32PREAL64            0x0441  /* 16:32 near pointer to float */
-#define T_32PRCHAR             0x0470  /* 16:32 near pointer to real char */
-#define T_32PWCHAR             0x0471  /* 16:32 near pointer to real char */
-#define T_32PINT4              0x0474  /* 16:32 near pointer to int */
-#define T_32PUINT4             0x0475  /* 16:32 near pointer to unsigned int */
 
+/* the type number of a built-in type is a 16-bit value specified in the following format:
+    bit #   |   11     |   10-8   |   7-4    |    3     |    2-0   |
+    field   | reserved |   mode   |   type   | reserved |   size   |
+
+    where
+        <type> is one of the following types:
+                0x00 Special
+                0x01 Signed integral value
+                0x02 Unsigned integral value
+                0x03 Boolean
+                0x04 Real
+                0x05 Complex
+                0x06 Special2
+                0x07 Real int value
+                0x08 Reserved
+                0x09 Reserved
+                0x0a Reserved
+                0x0b Reserved
+                0x0c Reserved
+                0x0d Reserved
+                0x0e Reserved
+                0x0f Reserved for debugger expression evaluator
+
+        <size> is an enumerated value for each of the types.
+                Type = special
+                    0x00 No type
+                    0x01 Absolute symbol
+                    0x02 Segment
+                    0x03 Void
+                    0x04 Basic 8-byte currency value
+                    0x05 Near Basic string
+                    0x06 Far Basic string
+                    0x07 Untranslated type from previous Microsoft symbol formats
+                Type = signed/unsigned integral and Boolean values
+                    0x00 1 byte
+                    0x01 2 byte
+                    0x02 4 byte
+                    0x03 8 byte
+                    0x04 Reserved
+                    0x05 Reserved
+                    0x06 Reserved
+                    0x07 Reserved
+                Type = real and complex
+                    0x00 32 bit
+                    0x01 64 bit
+                    0x02 80 bit
+                    0x03 128 bit
+                    0x04 48 bit
+                    0x05 Reserved
+                    0x06 Reserved
+                    0x07 Reserved
+                Type = special2
+                    0x00 Bit
+                    0x01 Pascal CHAR
+                Type = Real int
+                    0x00 Char
+                    0x01 Wide character
+                    0x02 2-byte signed integer
+                    0x03 2-byte unsigned integer
+                    0x04 4-byte signed integer
+                    0x05 4-byte unsigned integer
+                    0x06 8-byte signed integer
+                    0x07 8-byte unsigned integer
+
+            <mode> is the pointer mode:
+                0x00 Direct; not a pointer
+                0x01 Near pointer
+                0x02 Far pointer
+                0x03 Huge pointer
+                0x04 32-bit near pointer
+                0x05 32-bit far pointer
+                0x06 64-bit near pointer
+                0x07 Reserved
+*/
+
+/* basic types */
+#define T_NOTYPE            0x0000  /* Notype */
+#define T_ABS               0x0001  /* Abs */
+#define T_SEGMENT           0x0002  /* segment type */
+#define T_VOID              0x0003  /* Void */
+#define T_CURRENCY          0x0004  /* basic 8-byte currency value */
+#define T_NBASICSTR         0x0005  /* near basic string */
+#define T_FBASICSTR         0x0006  /* far basic string */
+#define T_NOTTRANS          0x0007  /* untranslated type record from MS symbol format */
+#define T_HRESULT           0x0008  /* HRESULT - or error code ??? */
+#define T_CHAR              0x0010  /* signed char */
+#define T_SHORT             0x0011  /* short */
+#define T_LONG              0x0012  /* long */
+#define T_QUAD              0x0013  /* long long */
+#define T_UCHAR             0x0020  /* unsigned  char */
+#define T_USHORT            0x0021  /* unsigned short */
+#define T_ULONG             0x0022  /* unsigned long */
+#define T_UQUAD             0x0023  /* unsigned long long */
+#define T_BOOL08            0x0030  /* 8-bit boolean */
+#define T_BOOL16            0x0031  /* 16-bit boolean */
+#define T_BOOL32            0x0032  /* 32-bit boolean */
+#define T_BOOL64            0x0033  /* 64-bit boolean */
+#define T_REAL32            0x0040  /* float */
+#define T_REAL64            0x0041  /* double */
+#define T_REAL80            0x0042  /* 80-bit real */
+#define T_REAL128           0x0043  /* 128-bit real */
+#define T_REAL48            0x0044  /* 48-bit real */
+#define T_CPLX32            0x0050  /* 32-bit complex number */
+#define T_CPLX64            0x0051  /* 64-bit complex number */
+#define T_CPLX80            0x0052  /* 80-bit complex number */
+#define T_CPLX128           0x0053  /* 128-bit complex number */
+#define T_BIT               0x0060  /* bit */
+#define T_PASCHAR           0x0061  /* pascal CHAR */
+#define T_RCHAR             0x0070  /* real char */
+#define T_WCHAR             0x0071  /* wide char */
+#define T_INT2              0x0072  /* real 16-bit signed int */
+#define T_UINT2             0x0073  /* real 16-bit unsigned int */
+#define T_INT4              0x0074  /* int */
+#define T_UINT4             0x0075  /* unsigned int */
+#define T_INT8              0x0076  /* 64-bit signed int */
+#define T_UINT8             0x0077  /* 64-bit unsigned int */
+
+
+/* near pointers to basic types */
+#define T_PVOID             0x0103  /* near pointer to void */
+#define T_PCHAR             0x0110  /* Near pointer to 8-bit signed */
+#define T_PSHORT            0x0111  /* Near pointer to 16-bit signed */
+#define T_PLONG             0x0112  /* Near pointer to 32-bit signed */
+#define T_PQUAD             0x0113  /* Near pointer to 64-bit signed */
+#define T_PUCHAR            0x0120  /* Near pointer to 8-bit unsigned */
+#define T_PUSHORT           0x0121  /* Near pointer to 16-bit unsigned */
+#define T_PULONG            0x0122  /* Near pointer to 32-bit unsigned */
+#define T_PUQUAD            0x0123  /* Near pointer to 64-bit unsigned */
+#define T_PBOOL08           0x0130  /* Near pointer to 8-bit Boolean */
+#define T_PBOOL16           0x0131  /* Near pointer to 16-bit Boolean */
+#define T_PBOOL32           0x0132  /* Near pointer to 32-bit Boolean */
+#define T_PBOOL64           0x0133  /* Near pointer to 64-bit Boolean */
+#define T_PREAL32           0x0140  /* Near pointer to 32-bit real */
+#define T_PREAL64           0x0141  /* Near pointer to 64-bit real */
+#define T_PREAL80           0x0142  /* Near pointer to 80-bit real */
+#define T_PREAL128          0x0143  /* Near pointer to 128-bit real */
+#define T_PREAL48           0x0144  /* Near pointer to 48-bit real */
+#define T_PCPLX32           0x0150  /* Near pointer to 32-bit complex */
+#define T_PCPLX64           0x0151  /* Near pointer to 64-bit complex */
+#define T_PCPLX80           0x0152  /* Near pointer to 80-bit complex */
+#define T_PCPLX128          0x0153  /* Near pointer to 128-bit complex */
+#define T_PRCHAR            0x0170  /* Near pointer to a real char */
+#define T_PWCHAR            0x0171  /* Near pointer to a wide char */
+#define T_PINT2             0x0172  /* Near pointer to 16-bit signed int */
+#define T_PUINT2            0x0173  /* Near pointer to 16-bit unsigned int */
+#define T_PINT4             0x0174  /* Near pointer to 32-bit signed int */
+#define T_PUINT4            0x0175  /* Near pointer to 32-bit unsigned int */
+#define T_PINT8             0x0176  /* Near pointer to 64-bit signed int */
+#define T_PUINT8            0x0177  /* Near pointer to 64-bit unsigned int */
+
+
+/* far pointers to basic types */
+#define T_PFVOID            0x0203  /* Far pointer to void */
+#define T_PFCHAR            0x0210  /* Far pointer to 8-bit signed */
+#define T_PFSHORT           0x0211  /* Far pointer to 16-bit signed */
+#define T_PFLONG            0x0212  /* Far pointer to 32-bit signed */
+#define T_PFQUAD            0x0213  /* Far pointer to 64-bit signed */
+#define T_PFUCHAR           0x0220  /* Far pointer to 8-bit unsigned */
+#define T_PFUSHORT          0x0221  /* Far pointer to 16-bit unsigned */
+#define T_PFULONG           0x0222  /* Far pointer to 32-bit unsigned */
+#define T_PFUQUAD           0x0223  /* Far pointer to 64-bit unsigned */
+#define T_PFBOOL08          0x0230  /* Far pointer to 8-bit Boolean */
+#define T_PFBOOL16          0x0231  /* Far pointer to 16-bit Boolean */
+#define T_PFBOOL32          0x0232  /* Far pointer to 32-bit Boolean */
+#define T_PFBOOL64          0x0233  /* Far pointer to 64-bit Boolean */
+#define T_PFREAL32          0x0240  /* Far pointer to 32-bit real */
+#define T_PFREAL64          0x0241  /* Far pointer to 64-bit real */
+#define T_PFREAL80          0x0242  /* Far pointer to 80-bit real */
+#define T_PFREAL128         0x0243  /* Far pointer to 128-bit real */
+#define T_PFREAL48          0x0244  /* Far pointer to 48-bit real */
+#define T_PFCPLX32          0x0250  /* Far pointer to 32-bit complex */
+#define T_PFCPLX64          0x0251  /* Far pointer to 64-bit complex */
+#define T_PFCPLX80          0x0252  /* Far pointer to 80-bit complex */
+#define T_PFCPLX128         0x0253  /* Far pointer to 128-bit complex */
+#define T_PFRCHAR           0x0270  /* Far pointer to a real char */
+#define T_PFWCHAR           0x0271  /* Far pointer to a wide char */
+#define T_PFINT2            0x0272  /* Far pointer to 16-bit signed int */
+#define T_PFUINT2           0x0273  /* Far pointer to 16-bit unsigned int */
+#define T_PFINT4            0x0274  /* Far pointer to 32-bit signed int */
+#define T_PFUINT4           0x0275  /* Far pointer to 32-bit unsigned int */
+#define T_PFINT8            0x0276  /* Far pointer to 64-bit signed int */
+#define T_PFUINT8           0x0277  /* Far pointer to 64-bit unsigned int */
+
+
+/* huge pointers to basic types */
+#define T_PHVOID            0x0303  /* Huge pointer to void */
+#define T_PHCHAR            0x0310  /* Huge pointer to 8-bit signed */
+#define T_PHSHORT           0x0311  /* Huge pointer to 16-bit signed */
+#define T_PHLONG            0x0312  /* Huge pointer to 32-bit signed */
+#define T_PHQUAD            0x0313  /* Huge pointer to 64-bit signed */
+#define T_PHUCHAR           0x0320  /* Huge pointer to 8-bit unsigned */
+#define T_PHUSHORT          0x0321  /* Huge pointer to 16-bit unsigned */
+#define T_PHULONG           0x0322  /* Huge pointer to 32-bit unsigned */
+#define T_PHUQUAD           0x0323  /* Huge pointer to 64-bit unsigned */
+#define T_PHBOOL08          0x0330  /* Huge pointer to 8-bit Boolean */
+#define T_PHBOOL16          0x0331  /* Huge pointer to 16-bit Boolean */
+#define T_PHBOOL32          0x0332  /* Huge pointer to 32-bit Boolean */
+#define T_PHBOOL64          0x0333  /* Huge pointer to 64-bit Boolean */
+#define T_PHREAL32          0x0340  /* Huge pointer to 32-bit real */
+#define T_PHREAL64          0x0341  /* Huge pointer to 64-bit real */
+#define T_PHREAL80          0x0342  /* Huge pointer to 80-bit real */
+#define T_PHREAL128         0x0343  /* Huge pointer to 128-bit real */
+#define T_PHREAL48          0x0344  /* Huge pointer to 48-bit real */
+#define T_PHCPLX32          0x0350  /* Huge pointer to 32-bit complex */
+#define T_PHCPLX64          0x0351  /* Huge pointer to 64-bit complex */
+#define T_PHCPLX80          0x0352  /* Huge pointer to 80-bit complex */
+#define T_PHCPLX128         0x0353  /* Huge pointer to 128-bit real */
+#define T_PHRCHAR           0x0370  /* Huge pointer to a real char */
+#define T_PHWCHAR           0x0371  /* Huge pointer to a wide char */
+#define T_PHINT2            0x0372  /* Huge pointer to 16-bit signed int */
+#define T_PHUINT2           0x0373  /* Huge pointer to 16-bit unsigned int */
+#define T_PHINT4            0x0374  /* Huge pointer to 32-bit signed int */
+#define T_PHUINT4           0x0375  /* Huge pointer to 32-bit unsigned int */
+#define T_PHINT8            0x0376  /* Huge pointer to 64-bit signed int */
+#define T_PHUINT8           0x0377  /* Huge pointer to 64-bit unsigned int */
+
+
+/* 32-bit near pointers to basic types */
+#define T_32PVOID           0x0403  /* 32-bit near pointer to void */
+#define T_32PHRESULT        0x0408  /* 16:32 near pointer to HRESULT - or error code ??? */
+#define T_32PCHAR           0x0410  /* 16:32 near pointer to 8-bit signed */
+#define T_32PSHORT          0x0411  /* 16:32 near pointer to 16-bit signed */
+#define T_32PLONG           0x0412  /* 16:32 near pointer to 32-bit signed */
+#define T_32PQUAD           0x0413  /* 16:32 near pointer to 64-bit signed */
+#define T_32PUCHAR          0x0420  /* 16:32 near pointer to 8-bit unsigned */
+#define T_32PUSHORT         0x0421  /* 16:32 near pointer to 16-bit unsigned */
+#define T_32PULONG          0x0422  /* 16:32 near pointer to 32-bit unsigned */
+#define T_32PUQUAD          0x0423  /* 16:32 near pointer to 64-bit unsigned */
+#define T_32PBOOL08         0x0430  /* 16:32 near pointer to 8-bit Boolean */
+#define T_32PBOOL16         0x0431  /* 16:32 near pointer to 16-bit Boolean */
+#define T_32PBOOL32         0x0432  /* 16:32 near pointer to 32-bit Boolean */
+#define T_32PBOOL64         0x0433  /* 16:32 near pointer to 64-bit Boolean */
+#define T_32PREAL32         0x0440  /* 16:32 near pointer to 32-bit real */
+#define T_32PREAL64         0x0441  /* 16:32 near pointer to 64-bit real */
+#define T_32PREAL80         0x0442  /* 16:32 near pointer to 80-bit real */
+#define T_32PREAL128        0x0443  /* 16:32 near pointer to 128-bit real */
+#define T_32PREAL48         0x0444  /* 16:32 near pointer to 48-bit real */
+#define T_32PCPLX32         0x0450  /* 16:32 near pointer to 32-bit complex */
+#define T_32PCPLX64         0x0451  /* 16:32 near pointer to 64-bit complex */
+#define T_32PCPLX80         0x0452  /* 16:32 near pointer to 80-bit complex */
+#define T_32PCPLX128        0x0453  /* 16:32 near pointer to 128-bit complex */
+#define T_32PRCHAR          0x0470  /* 16:32 near pointer to a real char */
+#define T_32PWCHAR          0x0471  /* 16:32 near pointer to a wide char */
+#define T_32PINT2           0x0472  /* 16:32 near pointer to 16-bit signed int */
+#define T_32PUINT2          0x0473  /* 16:32 near pointer to 16-bit unsigned int */
+#define T_32PINT4           0x0474  /* 16:32 near pointer to 32-bit signed int */
+#define T_32PUINT4          0x0475  /* 16:32 near pointer to 32-bit unsigned int */
+#define T_32PINT8           0x0476  /* 16:32 near pointer to 64-bit signed int */
+#define T_32PUINT8          0x0477  /* 16:32 near pointer to 64-bit unsigned int */
+
+
+/* 32-bit far pointers to basic types */
+#define T_32PFVOID          0x0503  /* 32-bit far pointer to void */
+#define T_32PFCHAR          0x0510  /* 16:32 far pointer to 8-bit signed */
+#define T_32PFSHORT         0x0511  /* 16:32 far pointer to 16-bit signed */
+#define T_32PFLONG          0x0512  /* 16:32 far pointer to 32-bit signed */
+#define T_32PFQUAD          0x0513  /* 16:32 far pointer to 64-bit signed */
+#define T_32PFUCHAR         0x0520  /* 16:32 far pointer to 8-bit unsigned */
+#define T_32PFUSHORT        0x0521  /* 16:32 far pointer to 16-bit unsigned */
+#define T_32PFULONG         0x0522  /* 16:32 far pointer to 32-bit unsigned */
+#define T_32PFUQUAD         0x0523  /* 16:32 far pointer to 64-bit unsigned */
+#define T_32PFBOOL08        0x0530  /* 16:32 far pointer to 8-bit Boolean */
+#define T_32PFBOOL16        0x0531  /* 16:32 far pointer to 16-bit Boolean */
+#define T_32PFBOOL32        0x0532  /* 16:32 far pointer to 32-bit Boolean */
+#define T_32PFBOOL64        0x0533  /* 16:32 far pointer to 64-bit Boolean */
+#define T_32PFREAL32        0x0540  /* 16:32 far pointer to 32-bit real */
+#define T_32PFREAL64        0x0541  /* 16:32 far pointer to 64-bit real */
+#define T_32PFREAL80        0x0542  /* 16:32 far pointer to 80-bit real */
+#define T_32PFREAL128       0x0543  /* 16:32 far pointer to 128-bit real */
+#define T_32PFREAL48        0x0544  /* 16:32 far pointer to 48-bit real */
+#define T_32PFCPLX32        0x0550  /* 16:32 far pointer to 32-bit complex */
+#define T_32PFCPLX64        0x0551  /* 16:32 far pointer to 64-bit complex */
+#define T_32PFCPLX80        0x0552  /* 16:32 far pointer to 80-bit complex */
+#define T_32PFCPLX128       0x0553  /* 16:32 far pointer to 128-bit complex */
+#define T_32PFRCHAR         0x0570  /* 16:32 far pointer to a real char */
+#define T_32PFWCHAR         0x0571  /* 16:32 far pointer to a wide char */
+#define T_32PFINT2          0x0572  /* 16:32 far pointer to 16-bit signed int */
+#define T_32PFUINT2         0x0573  /* 16:32 far pointer to 16-bit unsigned int */
+#define T_32PFINT4          0x0574  /* 16:32 far pointer to 32-bit signed int */
+#define T_32PFUINT4         0x0575  /* 16:32 far pointer to 32-bit unsigned int */
+#define T_32PFINT8          0x0576  /* 16:32 far pointer to 64-bit signed int */
+#define T_32PFUINT8         0x0577  /* 16:32 far pointer to 64-bit unsigned int */
+
+
+/* counts, bit masks, and shift values needed to access various parts of the built-in type numbers */
+#define T_MAXPREDEFINEDTYPE 0x0580  /* maximum type index for all built-in types */
+#define T_MAXBASICTYPE      0x0080  /* maximum type index all non-pointer built-in types */
+#define T_BASICTYPE_MASK    0x00ff  /* mask of bits that can potentially identify a non-pointer basic type */
+#define T_BASICTYPE_SHIFT   8       /* shift count to push out the basic type bits from a type number */
+#define T_MODE_MASK         0x0700  /* type mode mask (ptr/non-ptr) */
+#define T_SIZE_MASK         0x0007  /* type size mask (depends on 'type' value) */
+#define T_TYPE_MASK         0x00f0  /* type type mask (data treatment mode) */
+
+/* bit patterns for the <mode> portion of a built-in type number */
+#define T_NEARPTR_BITS      0x0100
+#define T_FARPTR_BITS       0x0200
+#define T_HUGEPTR_BITS      0x0300
+#define T_NEAR32PTR_BITS    0x0400
+#define T_FAR32PTR_BITS     0x0500
+#define T_NEAR64PTR_BITS    0x0600
 
 #define LF_MODIFIER_V1          0x0001
 #define LF_POINTER_V1           0x0002
@@ -1065,6 +1341,16 @@ union codeview_symbol
         char                    name[1];
     } stack_v3;
 
+    struct
+    {
+        short int               len;            /* Total length of this entry */
+        short int               id;             /* Always S_BPREL_V3 */
+        int                     offset;         /* Stack offset relative to BP */
+        unsigned int            symtype;
+        unsigned short          unknown;
+        char                    name[1];
+    } stack_xxxx_v3;
+
     struct
     {
        short int               len;            /* Total length of this entry */
@@ -1307,7 +1593,8 @@ union codeview_symbol
 #define S_PUB_V3        0x110E
 #define S_LPROC_V3      0x110F
 #define S_GPROC_V3      0x1110
-#define S_MSTOOL_V3     0x1116  /* not really understood */
+#define S_BPREL_XXXX_V3 0x1111  /* not really understood, but looks like bprel... */
+#define S_MSTOOL_V3     0x1116  /* compiler command line options and build information */
 #define S_PUB_FUNC1_V3  0x1125  /* didn't get the difference between the two */
 #define S_PUB_FUNC2_V3  0x1127
 
@@ -1523,7 +1810,8 @@ typedef struct _PDB_SYMBOLS
     DWORD       unknown;
     DWORD       hash1_file;
     DWORD       hash2_file;
-    DWORD       gsym_file;
+    WORD        gsym_file;
+    WORD        unknown1;
     DWORD       module_size;
     DWORD       offset_size;
     DWORD       hash_size;
index 288ee4b..d98a15e 100644 (file)
@@ -44,7 +44,7 @@ reactos/dll/win32/crypt32         # Synced to Wine-1_0-rc1
 reactos/dll/win32/cryptdll        # Autosync
 reactos/dll/win32/cryptnet        # Autosync
 reactos/dll/win32/cryptui         # Autosync
-reactos/dll/win32/dbghelp         # Synced to Wine-20080106
+reactos/dll/win32/dbghelp         # Synced to Wine-20080802
 reactos/dll/win32/dciman32        # Synced to Wine-1_0-rc2
 reactos/dll/win32/gdiplus         # Autosync
 reactos/dll/win32/hhctrl.ocx      # Autosync