Merge pull request #1568 from shygoo2/fix-js-breakhere

[Debugger] JS: Make debug.breakhere stable
This commit is contained in:
zilmar 2019-01-21 12:02:43 +10:30 committed by GitHub
commit 25bd63cc9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -289,8 +289,7 @@ const debug = {
}, },
breakhere: function() breakhere: function()
{ {
debug.showcommands(gpr.pc) _native.breakHere()
system.pause()
}, },
disasm: function() disasm: function()
{ {

View File

@ -1470,6 +1470,12 @@ duk_ret_t CScriptInstance::js_ConsoleClear(duk_context* ctx)
return 1; return 1;
} }
duk_ret_t CScriptInstance::js_BreakHere(duk_context* /*ctx*/)
{
g_Settings->SaveBool(Debugger_SteppingOps, true);
return 1;
}
duk_ret_t CScriptInstance::js_Pause(duk_context* /*ctx*/) duk_ret_t CScriptInstance::js_Pause(duk_context* /*ctx*/)
{ {
g_System->Pause(); g_System->Pause();

View File

@ -170,6 +170,7 @@ private:
static duk_ret_t js_ConsolePrint(duk_context*); static duk_ret_t js_ConsolePrint(duk_context*);
static duk_ret_t js_ConsoleClear(duk_context*); static duk_ret_t js_ConsoleClear(duk_context*);
static duk_ret_t js_BreakHere(duk_context*);
static duk_ret_t js_Pause(duk_context*); // () ; pauses emulation static duk_ret_t js_Pause(duk_context*); // () ; pauses emulation
static duk_ret_t js_ShowCommands(duk_context*); // ([address]) ; shows commands window static duk_ret_t js_ShowCommands(duk_context*); // ([address]) ; shows commands window
@ -227,6 +228,8 @@ private:
{ "pause", js_Pause, DUK_VARARGS }, { "pause", js_Pause, DUK_VARARGS },
{ "showCommands", js_ShowCommands, DUK_VARARGS }, { "showCommands", js_ShowCommands, DUK_VARARGS },
{ "breakHere", js_BreakHere, DUK_VARARGS },
{ "screenPrint", js_ScreenPrint, DUK_VARARGS }, { "screenPrint", js_ScreenPrint, DUK_VARARGS },
{ "fsOpen", js_FSOpen, DUK_VARARGS }, { "fsOpen", js_FSOpen, DUK_VARARGS },