OpendTect  6.3
debug.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H.Lammertink
8  Date: Jun 2003
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "basicmod.h"
14 #include "gendefs.h"
15 #include "bufstring.h"
16 
17 namespace google_breakpad { class ExceptionHandler; }
18 
31 namespace DBG
32 {
33  mGlobal(Basic) void turnOn( int flag );
35  mGlobal(Basic) bool isOn( int flag=0xffff );
36  mGlobal(Basic) void message( const char* );
37  mGlobal(Basic) void message( int flag, const char* msg );
38  mGlobal(Basic) void putProgInfo(int,char**);
40  mGlobal(Basic) void forceCrash(bool withdump);
41  mGlobal(Basic) bool crashOnNaN();
42  mGlobal(Basic) bool setCrashOnProgError(bool yn);
44 };
45 
46 extern "C" {
47 
48  mGlobal(Basic) int od_debug_isOn( int flag );
49  mGlobal(Basic) void od_debug_message( const char* msg );
50  mGlobal(Basic) void od_debug_messagef( int flag, const char* msg );
51  mGlobal(Basic) void od_debug_putProgInfo(int,char**);
52  mGlobal(Basic) void od_putProgInfo(int,char**);
53  mGlobal(Basic) void od_init_test_program(int,char**);
56 }
57 
58 
59 
60 
61 #ifdef HAS_BREAKPAD
62 #define mUseCrashDumper
63 
64 namespace System
65 {
66 
69 mExpClass(Basic) CrashDumper
70 {
71 public:
72  static CrashDumper& getInstance();
74 
75  void sendDump(const char* filename);
76 
77  void setSendAppl(const char* a) { sendappl_ = a; }
78 
79  static FixedString sSenderAppl(); //od_ReportIssue
80  static FixedString sUiSenderAppl(); //od_uiReportIssue
81 
82 private:
83  CrashDumper();
84 
85  void init();
86 
87  static CrashDumper* theinst_;
88 
89  BufferString sendappl_;
90  google_breakpad::ExceptionHandler* handler_;
91 };
92 
93 } // namespace System
94 
95 #endif // HAS_BREAKPAD
96 
97 /*
98  This is a list of reserved debug masks, in order to avoid conflicts.
99  Don't just throw any of these away or change a value, adding new masks
100  should be OK.
101 */
102 
103 #define DBG_DBG 0x0001 // general, low frequency stuff
104 #define DBG_MT 0x0002 // multi-threaded stuff
105 #define DBG_UI 0x0004 // ui-related stuff
106 #define DBG_IO 0x0008 // general I/O stuff
107 #define DBG_SOCKIO 0x0010 // socket I/O
108 #define DBG_MM 0x0020 // Multi-machine batch processing
109 #define DBG_SETTINGS 0x0040 // User settings
110 #define DBG_PROGSTART 0x0080 // Program start and stop
111 #define DBG_FILEPATH 0x0100 // File name handling, conversion, etc.
#define mExpClass(module)
Definition: commondefs.h:157
void turnOn(int flag)
Overrides the envirnonment variable.
bool crashOnNaN()
#define mGlobal(module)
Definition: commondefs.h:160
void message(int flag, const char *msg)
OD::String that holds an existing text string.
Definition: fixedstring.h:27
bool init()
void od_debug_putProgInfo(int, char **)
void od_debug_message(const char *msg)
bool isOn(int flag=0xffff)
int od_debug_isOn(int flag)
void od_debug_messagef(int flag, const char *msg)
void putProgInfo(int, char **)
one line; more if isOn()
Definition: debug.h:17
Defines a generic interface for supplying debug/runtime info.
Definition: debug.h:31
Definition: issuereporter.h:17
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
void forceCrash(bool withdump)
bool setCrashOnProgError(bool yn)
Returns old status.
void od_init_test_program(int, char **)
void od_putProgInfo(int, char **)

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017