Add simple debug initialisation function

This commit is contained in:
Danny Robson 2012-08-10 17:40:19 +10:00
parent fa5a6c9ed9
commit 5e764244ac
2 changed files with 19 additions and 1 deletions

View File

@ -17,8 +17,8 @@
* Copyright 2010 Danny Robson <danny@nerdcruft.net>
*/
#include "debug.hpp"
#include "backtrace.hpp"
#include "debug.hpp"
#include "log.hpp"
#include "platform.hpp"
@ -127,3 +127,14 @@ disable_fpe (void) {
// _controlfp_s (&ignored, 0, _MCW_EM);
}
#endif
//------------------------------------------------------------------------------
void debug::init (void) {
#if defined(PLATFORM_WIN32)
if (nullptr == LoadLibrary("exchndl.dll")) {
std::cerr << GetLastError () << "\n";
LOG_WARNING("Emergency debugger not loaded");
}
#endif
}

View File

@ -162,9 +162,11 @@ class panic_error {
void panic (const std::string&) terminal;
void panic (void) terminal;
void not_implemented (void) terminal;
void not_implemented (const char*) terminal;
void unreachable (void) terminal;
void unreachable (const std::string&) terminal;
void unusual (void);
@ -176,4 +178,9 @@ void breakpoint (void);
void enable_fpe (void);
void disable_fpe (void);
namespace debug {
void init (void);
}
#endif // __DEBUG_HPP