Skip to content

Commit

Permalink
xrCore: fix linux linkage
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Jul 29, 2018
1 parent 525a775 commit b6800aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/xrCore/xrDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ void xrDebug::GatherInfo(char* assertionInfo, size_t bufferSize, const ErrorLoca
#ifdef USE_OWN_ERROR_MESSAGE_WINDOW
buffer += xr_sprintf(buffer, bufferSize, "stack trace:\n\n");
#endif // USE_OWN_ERROR_MESSAGE_WINDOW
#if defined(WINDOWS)
xr_vector<xr_string> stackTrace = BuildStackTrace();
for (size_t i = 2; i < stackTrace.size(); i++)
{
Expand All @@ -422,6 +423,7 @@ void xrDebug::GatherInfo(char* assertionInfo, size_t bufferSize, const ErrorLoca
buffer += xr_sprintf(buffer, bufferSize, "%s\n", stackTrace[i].c_str());
#endif // USE_OWN_ERROR_MESSAGE_WINDOW
}
#endif
if (shared_str_initialized)
FlushLog();
os_clipboard::copy_to_clipboard(assertionInfo);
Expand Down Expand Up @@ -836,7 +838,9 @@ void xrDebug::Initialize(const bool& dedicated)
{
*BugReportFile = 0;
OnThreadSpawn();
#ifdef USE_BUG_TRAP
SetupExceptionHandler(dedicated);
#endif
// exception handler to all "unhandled" exceptions
#if defined(WINDOWS)
PrevFilter = ::SetUnhandledExceptionFilter(UnhandledFilter);
Expand Down
4 changes: 4 additions & 0 deletions src/xrCore/xrDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@ class XRCORE_API xrDebug
static int ShowMessage(pcstr title, pcstr message, bool simple = true);

static void LogStackTrace(const char* header);
#if defined(WINDOWS)
static xr_vector<xr_string> BuildStackTrace(u16 maxFramesCount = 512);
#endif
private:
static bool symEngineInitialized;
static Lock dbgHelpLock;
static void FormatLastError(char* buffer, const size_t& bufferSize);
#ifdef USE_BUG_TRAP
static void SetupExceptionHandler(const bool& dedicated);
#endif
static LONG WINAPI UnhandledFilter(EXCEPTION_POINTERS* exPtrs);
static void WINAPI PreErrorHandler(INT_PTR);
static void SaveMiniDump(EXCEPTION_POINTERS* exPtrs);
Expand Down

0 comments on commit b6800aa

Please sign in to comment.