From 5e764244ac5c4cab9d0b135b692bc6a90e0a274f Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 10 Aug 2012 17:40:19 +1000 Subject: [PATCH] Add simple debug initialisation function --- debug.cpp | 13 ++++++++++++- debug.hpp | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/debug.cpp b/debug.cpp index 7b5ca4fa..94fc06aa 100644 --- a/debug.cpp +++ b/debug.cpp @@ -17,8 +17,8 @@ * Copyright 2010 Danny Robson */ -#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 +} diff --git a/debug.hpp b/debug.hpp index 665c9af5..8a2ec0ae 100644 --- a/debug.hpp +++ b/debug.hpp @@ -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