build: fix travis MPI/SMP build
[charm.git] / src / ck-core / debug-charm.h
blob8414927aacbcad0b90bcee7cc80c1179b64b3aed
1 /*
2 Interface to Charm++ portion of parallel debugger.
3 Orion Sky Lawlor, olawlor@acm.org, 7/30/2001
4 */
5 #ifndef __CMK_DEBUG_CHARM_H
6 #define __CMK_DEBUG_CHARM_H
8 #ifndef __cplusplus
9 # error "debug-charm.h is for C++; use debug-conv.h for C programs"
10 #endif
12 #include "converse.h"
13 #include "debug-conv++.h"
14 #include "pup.h"
15 #include "cklists.h"
16 #include <vector>
18 void CkPupMessage(PUP::er &p,void **atMsg,int pack_detail=1);
20 void *CpdGetCurrentObject();
21 void *CpdGetCurrentMsg();
23 //Hooks inside the debugger before and after an entry method is invoked
24 extern void CpdBeforeEp(int, void*, void*);
25 extern void CpdAfterEp(int);
26 extern void CpdFinishInitialization();
28 class CpdPersistentChecker {
29 public:
30 virtual ~CpdPersistentChecker() {}
31 virtual void cpdCheck(void*) {}
34 typedef struct DebugPersistentCheck {
35 CpdPersistentChecker *object;
36 void *msg;
38 DebugPersistentCheck() : object(NULL), msg(NULL) {}
39 DebugPersistentCheck(CpdPersistentChecker *o, void *m) : object(o), msg(m) {}
40 } DebugPersistentCheck;
42 // This class is the parallel of EntryInfo declared in register.h and is used
43 // to extend the former with additional debug information. There is a direct
44 // correspondence between elements on the two arrays.
45 class DebugEntryInfo {
46 public:
47 // true if this entry method has a breakpoint set
48 bool isBreakpoint;
49 std::vector<DebugPersistentCheck> preProcess;
50 std::vector<DebugPersistentCheck> postProcess;
52 DebugEntryInfo() : isBreakpoint(false) { }
55 typedef std::vector<DebugEntryInfo> DebugEntryTable;
57 //These pup functions are useful in CpdLists, as they document the name
58 // of the variable. Your object must be named "c" (a stupid hack).
59 #define PCOM(field) p.comment(#field); p(c->field);
60 #define PCOMS(field) \
61 if (!p.isUnpacking()) { \
62 p.comment(#field); p((char *)c->field,strlen(c->field)); \
65 #endif