
00001 /* 00002 Interface to Charm++ portion of parallel debugger. 00003 Orion Sky Lawlor, olawlor@acm.org, 7/30/2001 00004 */ 00005 #ifndef __CMK_DEBUG_CHARM_H 00006 #define __CMK_DEBUG_CHARM_H 00007 00008 #ifndef __cplusplus 00009 # error "debug-charm.h is for C++; use debug-conv.h for C programs" 00010 #endif 00011 00012 #include "converse.h" 00013 #include "debug-conv++.h" 00014 #include "pup.h" 00015 #include "cklists.h" 00016 00017 void *CpdGetCurrentObject(); 00018 void *CpdGetCurrentMsg(); 00019 00020 //Hooks inside the debugger before and after an entry method is invoked 00021 extern void CpdBeforeEp(int, void*, void*); 00022 extern void CpdAfterEp(int); 00023 extern void CpdFinishInitialization(); 00024 00025 class CpdPersistentChecker { 00026 public: 00027 virtual ~CpdPersistentChecker() {} 00028 virtual void cpdCheck(void*) {} 00029 }; 00030 00031 typedef struct DebugPersistentCheck { 00032 CpdPersistentChecker *object; 00033 void *msg; 00034 00035 DebugPersistentCheck() : object(NULL), msg(NULL) {} 00036 DebugPersistentCheck(CpdPersistentChecker *o, void *m) : object(o), msg(m) {} 00037 } DebugPersistentCheck; 00038 00039 // This class is the parallel of EntryInfo declared in register.h and is used 00040 // to extend the former with additional debug information. There is a direct 00041 // correspondence between elements on the two arrays. 00042 class DebugEntryInfo { 00043 public: 00044 // true if this entry method has a breakpoint set 00045 CmiBool isBreakpoint; 00046 CkVec<DebugPersistentCheck> preProcess; 00047 CkVec<DebugPersistentCheck> postProcess; 00048 00049 DebugEntryInfo() : isBreakpoint(CmiFalse) { } 00050 }; 00051 00052 typedef CkVec<DebugEntryInfo> DebugEntryTable; 00053 00054 //These pup functions are useful in CpdLists, as they document the name 00055 // of the variable. Your object must be named "c" (a stupid hack). 00056 #define PCOM(field) p.comment(#field); p(c->field); 00057 #define PCOMS(field) \ 00058 if (!p.isUnpacking()) { \ 00059 p.comment(#field); p((char *)c->field,strlen(c->field)); \ 00060 } 00061 00062 #endif
1.5.5