xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
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 {
31  class core_export_ debugger static_ {
32  public:
35  static bool is_attached();
36 
44  static void debug_break();
45 
48  static bool is_logging();
49 
54  static bool launch();
55 
62  static void log(int level, xtd::ustring& category, const xtd::ustring& message);
63  };
64  }
65 }
66 
67 #if defined(_MSC_VER)
68 #define debug_break_() \
79  if (xtd::diagnostics::debugger::launch()) __debugbreak()
80 #else
81 #define debug_break_() \
92  if (xtd::diagnostics::debugger::launch()) std::abort()
93 #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:48
Enables communication with a debugger. This class cannot be inherited.
Definition: debugger.h:31