diff options
Diffstat (limited to 'src/common/extended_trace.h')
| -rw-r--r-- | src/common/extended_trace.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/common/extended_trace.h b/src/common/extended_trace.h new file mode 100644 index 000000000..1552e901b --- /dev/null +++ b/src/common/extended_trace.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | // ----------------------------------------------------------------------------------------- | ||
| 2 | // | ||
| 3 | // Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com | ||
| 4 | // For companies(Austin,TX): If you would like to get my resume, send an email. | ||
| 5 | // | ||
| 6 | // The source is free, but if you want to use it, mention my name and e-mail address | ||
| 7 | // | ||
| 8 | // History: | ||
| 9 | // 1.0 Initial version Zoltan Csizmadia | ||
| 10 | // 1.1 WhineCube version Masken | ||
| 11 | // 1.2 Dolphin version Masken | ||
| 12 | // | ||
| 13 | // ---------------------------------------------------------------------------------------- | ||
| 14 | |||
| 15 | #ifndef _EXTENDEDTRACE_H_INCLUDED_ | ||
| 16 | #define _EXTENDEDTRACE_H_INCLUDED_ | ||
| 17 | |||
| 18 | #if defined(WIN32) | ||
| 19 | |||
| 20 | #include <windows.h> | ||
| 21 | #include <tchar.h> | ||
| 22 | |||
| 23 | #include <string> | ||
| 24 | |||
| 25 | #pragma comment( lib, "imagehlp.lib" ) | ||
| 26 | |||
| 27 | #define EXTENDEDTRACEINITIALIZE( IniSymbolPath ) InitSymInfo( IniSymbolPath ) | ||
| 28 | #define EXTENDEDTRACEUNINITIALIZE() UninitSymInfo() | ||
| 29 | #define STACKTRACE(file) StackTrace( GetCurrentThread(), "", file) | ||
| 30 | #define STACKTRACE2(file, eip, esp, ebp) StackTrace(GetCurrentThread(), "", file, eip, esp, ebp) | ||
| 31 | // class File; | ||
| 32 | |||
| 33 | BOOL InitSymInfo( PCSTR ); | ||
| 34 | BOOL UninitSymInfo(); | ||
| 35 | void StackTrace(HANDLE, char const* msg, FILE *file); | ||
| 36 | void StackTrace(HANDLE, char const* msg, FILE *file, DWORD eip, DWORD esp, DWORD ebp); | ||
| 37 | |||
| 38 | // functions by Masken | ||
| 39 | void etfprintf(FILE *file, const char *format, ...); | ||
| 40 | void etfprint(FILE *file, const std::string &text); | ||
| 41 | #define UEFBUFSIZE 2048 | ||
| 42 | extern char g_uefbuf[UEFBUFSIZE]; | ||
| 43 | |||
| 44 | #else // not WIN32 | ||
| 45 | |||
| 46 | #define EXTENDEDTRACEINITIALIZE( IniSymbolPath ) ((void)0) | ||
| 47 | #define EXTENDEDTRACEUNINITIALIZE() ((void)0) | ||
| 48 | #define STACKTRACE(file) ((void)0) | ||
| 49 | #define STACKTRACE2(file, eip, esp, ebp) ((void)0) | ||
| 50 | |||
| 51 | #endif // WIN32 | ||
| 52 | |||
| 53 | #endif // _EXTENDEDTRACE_H_INCLUDED_ | ||