@@ -67,9 +67,10 @@ DebuggerConsole::printHelp(isize tab)
6767void 
6868DebuggerConsole::pressReturn (bool  shift)
6969{
70-     if  (!shift && input.empty ()) {
70+     if  (emulator. isPaused () &&  !shift && input.empty ()) {
7171
72-         emulator.isRunning () ? emulator.put (Cmd::PAUSE) : emulator.stepInto ();
72+         emulator.stepInto ();
73+         //  emulator.isRunning() ? emulator.put(Cmd::PAUSE) : emulator.stepInto();
7374
7475    } else  {
7576
@@ -117,6 +118,21 @@ DebuggerConsole::initCommands(RSCommand &root)
117118
118119    RSCommand::currentGroup = " Program execution" 
119120
121+     root.add ({ .tokens  = { " p[ause]" ghelp   = { " Pause emulation" chelp   = { " p or pause" 
122+ 
123+     root.add ({
124+ 
125+         .tokens  = { " pause" 
126+         .chelp   = { " Pause emulation" 
127+         .flags   = rs::shadowed,
128+         .func    = [this ] (std::ostream &os, const  Arguments &args, const  std::vector<isize> &values) {
129+ 
130+             if  (emulator.isRunning ()) emulator.put (Cmd::PAUSE);
131+         }
132+     });
133+ 
134+     root.clone ({ " pause" " p" 
135+ 
120136    root.add ({ .tokens  = { " g[oto]" ghelp   = { " Goto address" chelp   = { " g or goto" 
121137
122138    root.add ({
@@ -127,7 +143,7 @@ DebuggerConsole::initCommands(RSCommand &root)
127143        .args    = { { .name  = { " address" " Memory address" flags  = rs::opt } },
128144        .func    = [this ] (std::ostream &os, const  Arguments &args, const  std::vector<isize> &values) {
129145
130-             args.contains (" address" emulator. run () :  cpu.jump (parseAddr (args.at (" address" 
146+             args.contains (" address" jump (parseAddr (args.at (" address" ) : emulator. run ( );
131147        }
132148    });
133149
0 commit comments