mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-01-22 14:17:03 +00:00
Add cmd line: -debugger-auto-run <script file>
. Use this to override the default "DebuggerAutoRun.txt"
This commit is contained in:
@@ -777,6 +777,13 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
|
||||
{
|
||||
g_cmdLine.useAltCpuEmulation = true;
|
||||
}
|
||||
else if (strcmp(lpCmdLine, "-debugger-auto-run") == 0)
|
||||
{
|
||||
lpCmdLine = GetCurrArg(lpNextArg);
|
||||
lpNextArg = GetNextArg(lpNextArg);
|
||||
|
||||
g_cmdLine.debuggerAutoRunScriptFilename = lpCmdLine;
|
||||
}
|
||||
else // unsupported
|
||||
{
|
||||
LogFileOutput("Unsupported arg: %s\n", lpCmdLine);
|
||||
|
||||
@@ -126,7 +126,8 @@ struct CmdLine
|
||||
bool auxSlotEmpty;
|
||||
SS_CARDTYPE auxSlotInsert;
|
||||
std::string sBootSectorFileName;
|
||||
size_t nBootSectorFileSize;
|
||||
size_t nBootSectorFileSize;
|
||||
std::string debuggerAutoRunScriptFilename;
|
||||
};
|
||||
|
||||
bool ProcessCmdLine(LPSTR lpCmdLine);
|
||||
|
||||
@@ -360,6 +360,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
static bool g_bScriptReadOk = false;
|
||||
|
||||
static std::string g_sAutoRunScriptFilename("DebuggerAutoRun.txt");
|
||||
|
||||
// Private ________________________________________________________________________________________
|
||||
|
||||
|
||||
@@ -9093,11 +9095,9 @@ void DebugInitialize ()
|
||||
{
|
||||
doneAutoRun = true;
|
||||
|
||||
const std::string debuggerAutoRunName = "DebuggerAutoRun.txt";
|
||||
|
||||
// Look in g_sCurrentDir, otherwise try g_sProgramDir
|
||||
|
||||
std::string pathname = g_sCurrentDir + debuggerAutoRunName;
|
||||
std::string pathname = g_sCurrentDir + g_sAutoRunScriptFilename;
|
||||
errno_t error = strncpy_s(g_aArgs[1].sArg, MAX_PATH, pathname.c_str(), pathname.size());
|
||||
if (error != 0)
|
||||
{
|
||||
@@ -9111,7 +9111,7 @@ void DebugInitialize ()
|
||||
|
||||
if (!g_bScriptReadOk)
|
||||
{
|
||||
pathname = g_sProgramDir + debuggerAutoRunName;
|
||||
pathname = g_sProgramDir + g_sAutoRunScriptFilename;
|
||||
error = strncpy_s(g_aArgs[1].sArg, MAX_PATH, pathname.c_str(), pathname.size());
|
||||
if (error != 0)
|
||||
{
|
||||
@@ -9829,3 +9829,10 @@ bool IsDebugSteppingAtFullSpeed (void)
|
||||
{
|
||||
return (g_nAppMode == MODE_STEPPING) && g_bDebugFullSpeed;
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
void DebugSetAutoRunScript (std::string& sAutoRunScriptFilename)
|
||||
{
|
||||
g_sAutoRunScriptFilename = sAutoRunScriptFilename;
|
||||
}
|
||||
|
||||
@@ -192,3 +192,4 @@
|
||||
bool DebuggerCheckMemBreakpoints(WORD nAddress, WORD nSize, bool isDmaToMemory);
|
||||
|
||||
void ClearTempBreakpoints();
|
||||
void DebugSetAutoRunScript(std::string& sAutoRunScriptFilename);
|
||||
|
||||
@@ -930,6 +930,9 @@ static void RepeatInitialization(void)
|
||||
if (g_cmdLine.useAltCpuEmulation)
|
||||
ForceAltCpuEmulation();
|
||||
|
||||
if (!g_cmdLine.debuggerAutoRunScriptFilename.empty())
|
||||
DebugSetAutoRunScript(g_cmdLine.debuggerAutoRunScriptFilename);
|
||||
|
||||
// Call DebugInitialize() after SetCurrentImageDir()
|
||||
DebugInitialize();
|
||||
LogFileOutput("Main: DebugInitialize()\n");
|
||||
|
||||
Reference in New Issue
Block a user