Skip to content

Commit

Permalink
[Debugger] JS: Make debug.breakhere stable
Browse files Browse the repository at this point in the history
  • Loading branch information
shygoo committed Jan 20, 2019
1 parent 7a1dd38 commit 62baab2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Source/Project64/UserInterface/API.js
Expand Up @@ -289,8 +289,7 @@ const debug = {
},
breakhere: function()
{
debug.showcommands(gpr.pc)
system.pause()
_native.breakHere()
},
disasm: function()
{
Expand Down
6 changes: 6 additions & 0 deletions Source/Project64/UserInterface/Debugger/ScriptInstance.cpp
Expand Up @@ -1470,6 +1470,12 @@ duk_ret_t CScriptInstance::js_ConsoleClear(duk_context* ctx)
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*/)
{
g_System->Pause();
Expand Down
3 changes: 3 additions & 0 deletions Source/Project64/UserInterface/Debugger/ScriptInstance.h
Expand Up @@ -170,6 +170,7 @@ class CScriptInstance
static duk_ret_t js_ConsolePrint(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_ShowCommands(duk_context*); // ([address]) ; shows commands window

Expand Down Expand Up @@ -227,6 +228,8 @@ class CScriptInstance
{ "pause", js_Pause, DUK_VARARGS },
{ "showCommands", js_ShowCommands, DUK_VARARGS },

{ "breakHere", js_BreakHere, DUK_VARARGS },

{ "screenPrint", js_ScreenPrint, DUK_VARARGS },

{ "fsOpen", js_FSOpen, DUK_VARARGS },
Expand Down

0 comments on commit 62baab2

Please sign in to comment.