From 2d9d4873000789e7605328ead11306d1a7b62029 Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 11 Jun 2011 22:45:50 +0000 Subject: [PATCH] Fixed bug with autoexec.stella debugger file not actually executing its contents. The file was being accessed and read, but the commands it contained weren't being executed! This bug appeared in April 2010, so it looks like not many people are using this feature (or at least they're not reporting it). Cleaned up a few compiler warnings in DebuggerParser class. Bumped version # for beta release. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2254 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- Changes.txt | 3 +++ src/common/Version.hxx | 2 +- src/debugger/DebuggerParser.cxx | 9 +++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Changes.txt b/Changes.txt index 0e8bc6f7f..9aa6924d1 100644 --- a/Changes.txt +++ b/Changes.txt @@ -41,6 +41,9 @@ a bug whereby ROMs were saved in strange locations and couldn't later be found. + * Fixed bug in automatically executing the debugger 'autoexec.stella' + file; any commands it contained weren't actually being executed. + * Zero-byte ROMs are no longer loaded and mis-detected as Supercharger images. diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 498ec87be..c8a351508 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -22,7 +22,7 @@ #include -#define STELLA_VERSION "3.4.1_svn1" +#define STELLA_VERSION "3.4.1_beta1" #define STELLA_BUILD atoi("$Rev$" + 6) #endif diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index bd94d3f16..c9be5cb2d 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -139,12 +139,13 @@ string DebuggerParser::exec(const FilesystemNode& file) ostringstream buf; int count = 0; - char buffer[256]; + string command; while( !in.eof() ) { - if(!in.getline(buffer, 255)) + if(!getline(in, command)) break; + run(command); count++; } buf << "Executed " << debugger->valueToString(count) << " commands from \"" @@ -433,7 +434,7 @@ bool DebuggerParser::validateArgs(int cmd) while(*p != kARG_END_ARGS && *p != kARG_MULTI_BYTE) { count++; - *p++; + p++; } // Evil hack: some commands intentionally take multiple arguments @@ -497,7 +498,7 @@ bool DebuggerParser::validateArgs(int cmd) break; } curCount++; - *p++; + p++; } while(*p != kARG_END_ARGS && curCount < argRequiredCount);