xtd - Reference Guide 0.2.0
debugger.h
Go to the documentation of this file.
1 #pragma once
5 #include <cstdint>
6 #include <cstdlib>
7 #include <mutex>
8 #include "../core_export.h"
9 #include "../static.h"
10 #include "../ustring.h"
11 
13 // Workaround : the std::abort function on Visual Studio shows a message box.
14 #if defined(_MSC_VER)
15 #define __std_abort__ __debugbreak
16 #else
17 #define __std_abort__ std::abort
18 #endif
19 
22 namespace xtd {
24  namespace diagnostics {
36  class core_export_ debugger static_ {
37  public:
39 
43  static bool is_attached();
44 
52  static void debug_break();
53 
56  static bool is_logging();
57 
62  static bool launch();
63 
70  static void log(int level, xtd::ustring& category, const xtd::ustring& message);
72  };
73  }
74 }
75 
76 #if defined(_MSC_VER)
77 #define debug_break_() \
88  if (xtd::diagnostics::debugger::launch()) __debugbreak()
89 #else
90 #define debug_break_() \
101  if (xtd::diagnostics::debugger::launch()) std::abort()
102 #endif
#define static_
This keyword is use to represent a static object. A static object can&#39;t be instantiated (constructors...
Definition: static.h:38
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:50
Enables communication with a debugger. This class cannot be inherited.
Definition: debugger.h:36