diff options
Diffstat (limited to 'src/uscxml/debug/Debugger.h')
-rw-r--r-- | src/uscxml/debug/Debugger.h | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/uscxml/debug/Debugger.h b/src/uscxml/debug/Debugger.h index d69e6f6..ec00a95 100644 --- a/src/uscxml/debug/Debugger.h +++ b/src/uscxml/debug/Debugger.h @@ -35,80 +35,80 @@ public: } virtual ~Debugger() {} - virtual void attachSession(InterpreterImpl* impl, std::shared_ptr<DebugSession> session) { + virtual void attachSession(const std::string& sessionId, std::shared_ptr<DebugSession> session) { std::lock_guard<std::recursive_mutex> lock(_sessionMutex); - _sessionForInterpreter[impl] = session; + _sessionForInterpreter[sessionId] = session; } - virtual void detachSession(InterpreterImpl* impl) { + virtual void detachSession(const std::string& sessionId) { std::lock_guard<std::recursive_mutex> lock(_sessionMutex); - _sessionForInterpreter.erase(impl); + _sessionForInterpreter.erase(sessionId); } - virtual std::shared_ptr<DebugSession> getSession(InterpreterImpl* impl) { + virtual std::shared_ptr<DebugSession> getSession(const std::string& sessionId) { std::lock_guard<std::recursive_mutex> lock(_sessionMutex); - if (_sessionForInterpreter.find(impl) != _sessionForInterpreter.end()) - return _sessionForInterpreter[impl]; + if (_sessionForInterpreter.find(sessionId) != _sessionForInterpreter.end()) + return _sessionForInterpreter[sessionId]; return std::shared_ptr<DebugSession>(); } virtual void pushData(std::shared_ptr<DebugSession> session, Data pushData) = 0; // InterpreterMonitor - virtual void beforeProcessingEvent(Interpreter& interpreter, const Event& event); - virtual void beforeMicroStep(Interpreter& interpreter); - virtual void beforeExitingState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state); - virtual void afterExitingState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state); - virtual void beforeExecutingContent(Interpreter& interpreter, const XERCESC_NS::DOMElement* execContent); - virtual void afterExecutingContent(Interpreter& interpreter, const XERCESC_NS::DOMElement* execContent); - virtual void beforeUninvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); - virtual void afterUninvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); - virtual void beforeTakingTransition(Interpreter& interpreter, const XERCESC_NS::DOMElement* transition); - virtual void afterTakingTransition(Interpreter& interpreter, const XERCESC_NS::DOMElement* transition); - virtual void beforeEnteringState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state); - virtual void afterEnteringState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state); - virtual void beforeInvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); - virtual void afterInvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); - virtual void afterMicroStep(Interpreter& interpreter); - virtual void onStableConfiguration(Interpreter& interpreter); - virtual void beforeCompletion(Interpreter& interpreter); - virtual void afterCompletion(Interpreter& interpreter); + virtual void beforeProcessingEvent(const std::string& sessionId, const Event& event); + virtual void beforeMicroStep(const std::string& sessionId); + virtual void beforeExitingState(const std::string& sessionId, const std::string& stateName, const XERCESC_NS::DOMElement* state); + virtual void afterExitingState(const std::string& sessionId, const std::string& stateName, const XERCESC_NS::DOMElement* state); + virtual void beforeExecutingContent(const std::string& sessionId, const XERCESC_NS::DOMElement* execContent); + virtual void afterExecutingContent(const std::string& sessionId, const XERCESC_NS::DOMElement* execContent); + virtual void beforeUninvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); + virtual void afterUninvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); + virtual void beforeTakingTransition(const std::string& sessionId, const XERCESC_NS::DOMElement* transition); + virtual void afterTakingTransition(const std::string& sessionId, const XERCESC_NS::DOMElement* transition); + virtual void beforeEnteringState(const std::string& sessionId, const std::string& stateName, const XERCESC_NS::DOMElement* state); + virtual void afterEnteringState(const std::string& sessionId, const std::string& stateName, const XERCESC_NS::DOMElement* state); + virtual void beforeInvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); + virtual void afterInvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid); + virtual void afterMicroStep(const std::string& sessionId); + virtual void onStableConfiguration(const std::string& sessionId); + virtual void beforeCompletion(const std::string& sessionId); + virtual void afterCompletion(const std::string& sessionId); protected: - void handleTransition(Interpreter& interpreter, + void handleTransition(const std::string& sessionId, const XERCESC_NS::DOMElement* transition, Breakpoint::When when); - void handleState(Interpreter& interpreter, + void handleState(const std::string& sessionId, const XERCESC_NS::DOMElement* state, Breakpoint::When when, Breakpoint::Action action); - void handleInvoke(Interpreter& interpreter, + void handleInvoke(const std::string& sessionId, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeId, Breakpoint::When when, Breakpoint::Action action); - void handleExecutable(Interpreter& interpreter, + void handleExecutable(const std::string& sessionId, const XERCESC_NS::DOMElement* execContentElem, Breakpoint::When when); - void handleStable(Interpreter& interpreter, Breakpoint::When when); - void handleMicrostep(Interpreter& interpreter, Breakpoint::When when); - void handleEvent(Interpreter& interpreter, const Event& event, Breakpoint::When when); + void handleStable(const std::string& sessionId, Breakpoint::When when); + void handleMicrostep(const std::string& sessionId, Breakpoint::When when); + void handleEvent(const std::string& sessionId, const Event& event, Breakpoint::When when); - std::list<Breakpoint> getQualifiedTransBreakpoints(InterpreterImpl* impl, + std::list<Breakpoint> getQualifiedTransBreakpoints(const std::string& sessionId, const XERCESC_NS::DOMElement* transition, Breakpoint breakpointTemplate); - std::list<Breakpoint> getQualifiedStateBreakpoints(InterpreterImpl* impl, + std::list<Breakpoint> getQualifiedStateBreakpoints(const std::string& sessionId, const XERCESC_NS::DOMElement* state, Breakpoint breakpointTemplate); - std::list<Breakpoint> getQualifiedInvokeBreakpoints(InterpreterImpl* impl, + std::list<Breakpoint> getQualifiedInvokeBreakpoints(const std::string& sessionId, const XERCESC_NS::DOMElement* invokeElem, const std::string invokeId, Breakpoint breakpointTemplate); std::recursive_mutex _sessionMutex; /// @todo: We ought to change form InterpreterImpl to Interpreter everywhere - std::map<InterpreterImpl*, std::shared_ptr<DebugSession> > _sessionForInterpreter; + std::map<std::string, std::shared_ptr<DebugSession> > _sessionForInterpreter; }; } |