From 711bff0d3ade9169f0c0b47db2d01c6caf2f15a1 Mon Sep 17 00:00:00 2001 From: janwas Date: Tue, 25 Jan 2005 18:54:48 +0000 Subject: [PATCH] lib.h: moved assert2 to sysdep/debug.h mmgr: remove wdbg calls (was prototype); use sysdep/debug interface wdbg: no longer call it dbghelp63.h; should be installed normally in compiler dir win_internal.h: fix inevitable MS screwups in new dbghelp.h (*sigh*) This was SVN commit r1816. --- source/lib/lib.h | 18 ---------- source/lib/mmgr.cpp | 15 ++++---- source/lib/sysdep/win/wdbg.cpp | 2 +- source/lib/sysdep/win/win_internal.h | 54 ++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 28 deletions(-) diff --git a/source/lib/lib.h b/source/lib/lib.h index 039b4e0711..c064b70266 100755 --- a/source/lib/lib.h +++ b/source/lib/lib.h @@ -102,24 +102,6 @@ STMT(\ } -// superassert -// recommended use: assert2(expr && "descriptive string") -#define assert2(expr)\ -{\ - static int suppress__ = 0;\ - if(!suppress__ && !expr)\ - switch(debug_assert_failed(__FILE__, __LINE__, #expr))\ - {\ - case 1:\ - suppress__ = 1;\ - break;\ - case 2:\ - debug_break();\ - break;\ - }\ -} - - enum LibError { diff --git a/source/lib/mmgr.cpp b/source/lib/mmgr.cpp index 9a32354682..4da3d70825 100644 --- a/source/lib/mmgr.cpp +++ b/source/lib/mmgr.cpp @@ -969,9 +969,6 @@ void mmgr_break_on_free(const void* p) // actual allocator, making use of all of the above :) ////////////////////////////////////////////////////////////////////////////// - -#include "sysdep/win/wdbg.h" - void* alloc_dbg(size_t user_size, AllocType type, const char* file, int line, const char* func, uint stack_frames) { void* ret = 0; @@ -988,8 +985,8 @@ void* alloc_dbg(size_t user_size, AllocType type, const char* file, int line, co { if(options & MMGR_RESOLVE_OWNER) { - void* pfunc = wdbg_get_nth_caller(1+stack_frames); - wdbg_resolve_symbol(pfunc, func_buf, file_buf, &line); + void* pfunc = debug_get_nth_caller(1+stack_frames); + debug_resolve_symbol(pfunc, func_buf, file_buf, &line); file = file_buf; func = func_buf; } @@ -1083,8 +1080,8 @@ void free_dbg(const void* user_p, AllocType type, const char* file, int line, co { if(options & MMGR_RESOLVE_OWNER) { - void* pfunc = wdbg_get_nth_caller(1+stack_frames); - wdbg_resolve_symbol(pfunc, func_buf, file_buf, &line); + void* pfunc = debug_get_nth_caller(1+stack_frames); + debug_resolve_symbol(pfunc, func_buf, file_buf, &line); file = file_buf; func = func_buf; } @@ -1186,8 +1183,8 @@ void* realloc_dbg(const void* user_p, size_t user_size, AllocType type, const ch { if(options & MMGR_RESOLVE_OWNER) { - void* pfunc = wdbg_get_nth_caller(1+stack_frames); - wdbg_resolve_symbol(pfunc, func_buf, file_buf, &line); + void* pfunc = debug_get_nth_caller(1+stack_frames); + debug_resolve_symbol(pfunc, func_buf, file_buf, &line); file = file_buf; func = func_buf; } diff --git a/source/lib/sysdep/win/wdbg.cpp b/source/lib/sysdep/win/wdbg.cpp index d58581649c..2aaf79e4bb 100755 --- a/source/lib/sysdep/win/wdbg.cpp +++ b/source/lib/sysdep/win/wdbg.cpp @@ -24,7 +24,7 @@ #include "win_internal.h" #define _NO_CVCONST_H // request SymTagEnum be defined -#include "dbghelp63.h" +#include "dbghelp.h" #include // VARIANT #include "wdbg.h" diff --git a/source/lib/sysdep/win/win_internal.h b/source/lib/sysdep/win/win_internal.h index a542cf67f0..20aa1e4f68 100755 --- a/source/lib/sysdep/win/win_internal.h +++ b/source/lib/sysdep/win/win_internal.h @@ -235,6 +235,60 @@ typedef struct _SYSTEM_POWER_INFORMATION // or there is no thermal zone defined [..] +/////////////////////////////////////////////////////////////////////////////// +// +// fixes for dbghelp.h 6.3 +// +/////////////////////////////////////////////////////////////////////////////// + +// the macros defined "for those without specstrings.h" are incorrect - +// parameter definition is missing. +#ifndef __specstrings +# define __specstrings // prevent dbghelp from changing these + +# define __in +# define __out +# define __inout +# define __in_opt +# define __out_opt +# define __inout_opt +# define __in_ecount(s) +# define __out_ecount(s) +# define __inout_ecount(s) +# define __in_bcount(s) +# define __out_bcount(s) +# define __inout_bcount(s) +# define __deref_opt_out +# define __deref_out +#endif + +// missing from dbghelp's list +#define __out_xcount(s) + + +// not defined by dbghelp; these values are taken from DIA cvconst.h +enum BasicType +{ + btNoType = 0, + btVoid = 1, + btChar = 2, + btWChar = 3, + btInt = 6, + btUInt = 7, + btFloat = 8, + btBCD = 9, + btBool = 10, + btLong = 13, + btULong = 14, + btCurrency = 25, + btDate = 26, + btVariant = 27, + btComplex = 28, + btBit = 29, + btBSTR = 30, + btHresult = 31 +}; + ///////////////////////////////////////////////////////////////////////////////