mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Add breakpoint at the end of script execution
With --wait-before-exit it can be turned on in the debugger-server or in the debugger-client. Signed-off-by: Gergo Csizi gergocs@inf.u-szeged.hu
This commit is contained in:
parent
bd35e41168
commit
4bbd9d6cc6
14 changed files with 124 additions and 3 deletions
|
|
@ -935,6 +935,8 @@ int main(int argc, char* argv[])
|
|||
mallopt(M_MMAP_MAX, 1024 * 1024);
|
||||
#endif
|
||||
|
||||
bool wait_before_exit = false;
|
||||
|
||||
ShellPlatform* platform = new ShellPlatform();
|
||||
Globals::initialize(platform);
|
||||
|
||||
|
|
@ -988,6 +990,10 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(argv[i], "--wait-before-exit") == 0) {
|
||||
wait_before_exit = true;
|
||||
continue;
|
||||
}
|
||||
} else { // `-option` case
|
||||
if (strcmp(argv[i], "-e") == 0) {
|
||||
runShell = false;
|
||||
|
|
@ -1037,6 +1043,14 @@ int main(int argc, char* argv[])
|
|||
printf("escargot version:%s, %s%s\n", Globals::version(), Globals::buildDate(), Globals::supportsThreading() ? "(supports threading)" : "");
|
||||
}
|
||||
|
||||
if (wait_before_exit || context->isWaitBeforeExit()) {
|
||||
context->setAsAlwaysStopState();
|
||||
auto evalResult = Evaluator::execute(context, [](ExecutionStateRef* state, ScriptRef* script) -> ValueRef* {
|
||||
return script->execute(state);
|
||||
},
|
||||
context->scriptParser()->initializeScript(StringRef::createFromASCII(""), StringRef::createFromASCII("<ScriptEnd>"), seenModule).script.get());
|
||||
}
|
||||
|
||||
while (runShell) {
|
||||
static char buf[2048];
|
||||
printf("escargot> ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue