mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-01 12:31:59 +00:00
Debugger: When MODE_STEPPING (eg. g or gg mode), prevent ESC from exiting back to the debugger. F7 or Pause keys can still be used. (#217)
This commit is contained in:
parent
a5274ca7d0
commit
5e6a445bab
@ -8604,6 +8604,18 @@ void DebugContinueStepping ()
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
void DebugStopStepping(void)
|
||||
{
|
||||
_ASSERT(g_nAppMode == MODE_STEPPING);
|
||||
|
||||
if (g_nAppMode != MODE_STEPPING)
|
||||
return;
|
||||
|
||||
g_nDebugSteps = 0; // On next DebugContinueStepping(), stop single-stepping and transition to MODE_DEBUG
|
||||
ClearTempBreakpoints();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
void DebugDestroy ()
|
||||
{
|
||||
@ -8990,19 +9002,11 @@ void DebugInitialize ()
|
||||
CmdMOTD(0);
|
||||
}
|
||||
|
||||
// wparam = 0x16
|
||||
// lparam = 0x002f 0x0001
|
||||
// insert = VK_INSERT
|
||||
|
||||
// Add character to the input line
|
||||
//===========================================================================
|
||||
void DebuggerInputConsoleChar( TCHAR ch )
|
||||
{
|
||||
if ((g_nAppMode == MODE_STEPPING) && (ch == DEBUG_STEPPING_EXIT_KEY))
|
||||
{
|
||||
g_nDebugSteps = 0; // On next DebugContinueStepping(), stop single-stepping and transition to MODE_DEBUG
|
||||
ClearTempBreakpoints();
|
||||
}
|
||||
_ASSERT(g_nAppMode == MODE_DEBUG);
|
||||
|
||||
if (g_nAppMode != MODE_DEBUG)
|
||||
return;
|
||||
@ -9194,7 +9198,6 @@ void ToggleFullScreenConsole()
|
||||
|
||||
//===========================================================================
|
||||
void DebuggerProcessKey( int keycode )
|
||||
//void DebugProcessCommand (int keycode)
|
||||
{
|
||||
if (g_nAppMode != MODE_DEBUG)
|
||||
return;
|
||||
@ -9293,10 +9296,10 @@ void DebuggerProcessKey( int keycode )
|
||||
}
|
||||
else
|
||||
{
|
||||
g_nConsoleInputSkip = 0; // VK_OEM_3; // don't pass to DebugProcessChar()
|
||||
g_nConsoleInputSkip = 0; // VK_OEM_3;
|
||||
DebuggerInputConsoleChar( '~' );
|
||||
}
|
||||
g_nConsoleInputSkip = '~'; // VK_OEM_3; // don't pass to DebugProcessChar()
|
||||
g_nConsoleInputSkip = '~'; // VK_OEM_3;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -161,23 +161,17 @@
|
||||
|
||||
// Prototypes _______________________________________________________________
|
||||
|
||||
enum
|
||||
{
|
||||
DEBUG_STEPPING_EXIT_KEY = 0x1B, // Escape
|
||||
DEBUG_TOGGLE_KEY = VK_F1 + BTN_DEBUG
|
||||
};
|
||||
|
||||
bool DebugGetVideoMode(UINT* pVideoMode);
|
||||
|
||||
void DebugBegin ();
|
||||
void DebugExitDebugger ();
|
||||
void DebugContinueStepping ();
|
||||
void DebugStopStepping(void);
|
||||
void DebugDestroy ();
|
||||
void DebugDisplay (BOOL);
|
||||
void DebugInitialize ();
|
||||
// void DebugProcessChar (TCHAR);
|
||||
|
||||
void DebuggerInputConsoleChar( TCHAR ch );
|
||||
// void DebugProcessCommand (int);
|
||||
void DebuggerProcessKey( int keycode );
|
||||
|
||||
void DebuggerUpdate();
|
||||
|
@ -1012,22 +1012,19 @@ LRESULT CALLBACK FrameWndProc (
|
||||
break;
|
||||
|
||||
case WM_CHAR:
|
||||
if ((g_nAppMode == MODE_RUNNING) || (g_nAppMode == MODE_LOGO) ||
|
||||
((g_nAppMode == MODE_STEPPING) && (wparam != TEXT('\x1B'))))
|
||||
if ((g_nAppMode == MODE_RUNNING) || (g_nAppMode == MODE_STEPPING) || (g_nAppMode == MODE_LOGO))
|
||||
{
|
||||
if( !g_bDebuggerEatKey )
|
||||
{
|
||||
KeybQueueKeypress((int)wparam,ASCII);
|
||||
} else {
|
||||
KeybQueueKeypress((int)wparam, ASCII);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_bDebuggerEatKey = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
if ((g_nAppMode == MODE_DEBUG) || (g_nAppMode == MODE_STEPPING))
|
||||
else if (g_nAppMode == MODE_DEBUG)
|
||||
{
|
||||
if (g_nAppMode == MODE_STEPPING && (TCHAR)wparam == DEBUG_STEPPING_EXIT_KEY)
|
||||
SoundCore_SetFade(FADE_OUT);
|
||||
|
||||
DebuggerInputConsoleChar((TCHAR)wparam);
|
||||
}
|
||||
break;
|
||||
@ -1303,7 +1300,7 @@ LRESULT CALLBACK FrameWndProc (
|
||||
break;
|
||||
case MODE_STEPPING:
|
||||
SoundCore_SetFade(FADE_OUT);
|
||||
DebuggerInputConsoleChar( DEBUG_STEPPING_EXIT_KEY );
|
||||
DebugStopStepping();
|
||||
break;
|
||||
}
|
||||
DrawStatusArea((HDC)0,DRAW_TITLE);
|
||||
@ -1892,17 +1889,18 @@ static void ProcessButtonClick(int button, bool bFromButtonUI /*=false*/)
|
||||
case BTN_DEBUG:
|
||||
if (g_nAppMode == MODE_LOGO && !GetLoadedSaveStateFlag())
|
||||
{
|
||||
// FIXME: Why is this needed? Surely when state is MODE_LOGO, then AppleII system will have been reset!
|
||||
// - Transition to MODE_LOGO when: (a) AppleWin starts, (b) there's a Config change to the AppleII h/w
|
||||
ResetMachineState();
|
||||
}
|
||||
|
||||
if (g_nAppMode == MODE_STEPPING)
|
||||
{
|
||||
// Allow F7 to enter debugger even when not MODE_RUNNING
|
||||
DebuggerInputConsoleChar( DEBUG_STEPPING_EXIT_KEY );
|
||||
DebugStopStepping();
|
||||
bAllowFadeIn = false;
|
||||
}
|
||||
else
|
||||
if (g_nAppMode == MODE_DEBUG)
|
||||
else if (g_nAppMode == MODE_DEBUG)
|
||||
{
|
||||
ProcessButtonClick(BTN_RUN); // Exit debugger, switch to MODE_RUNNING or MODE_STEPPING
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user