summaryrefslogtreecommitdiffstats
path: root/apps/uscxml-browser.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-03-11 14:45:38 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-03-11 14:45:38 (GMT)
commitc34e0ce034586a05308e552cbbdff48beec7dd96 (patch)
tree39c73ba64b0d228b3c53913ea4e7ab6dda6ad5c1 /apps/uscxml-browser.cpp
parentca46aa711fb5d08a8fd1cc6b91593c281189e8e3 (diff)
downloaduscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.zip
uscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.tar.gz
uscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.tar.bz2
Integrated debugger into browser (use -d command line parameter)
Diffstat (limited to 'apps/uscxml-browser.cpp')
-rw-r--r--apps/uscxml-browser.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp
index 4188132..81d8883 100644
--- a/apps/uscxml-browser.cpp
+++ b/apps/uscxml-browser.cpp
@@ -1,7 +1,7 @@
#include "uscxml/config.h"
#include "uscxml/Interpreter.h"
#include "uscxml/DOMUtils.h"
-#include "uscxml/debug/SCXMLDotWriter.h"
+#include "uscxml/debug/DebuggerServlet.h"
#include <glog/logging.h>
#ifdef HAS_SIGNAL_H
@@ -142,6 +142,12 @@ int main(int argc, char** argv) {
}
HTTPServer::getInstance(options.httpPort, options.wsPort, sslConf);
+ DebuggerServlet* debugger;
+ if (options.withDebugger) {
+ debugger = new DebuggerServlet();
+ HTTPServer::getInstance()->registerServlet("/debug", debugger);
+ }
+
// instantiate and configure interpreters
std::list<Interpreter> interpreters;
std::map<std::string, InterpreterOptions*>::iterator confIter = options.interpreters.begin();
@@ -160,9 +166,8 @@ int main(int argc, char** argv) {
VerboseMonitor* vm = new VerboseMonitor();
interpreter.addMonitor(vm);
}
- if (options.useDot) {
- SCXMLDotWriter* dotWriter = new SCXMLDotWriter();
- interpreter.addMonitor(dotWriter);
+ if (options.withDebugger) {
+ interpreter.addMonitor(debugger);
}
interpreters.push_back(interpreter);
@@ -194,5 +199,11 @@ int main(int argc, char** argv) {
}
}
+ if (options.withDebugger) {
+ // idle and wait for CTRL+C or debugging events
+ while(true)
+ tthread::this_thread::sleep_for(tthread::chrono::seconds(1));
+ }
+
return EXIT_SUCCESS;
} \ No newline at end of file