From ad5ab7be920ff7cad0db549f8681140683561452 Mon Sep 17 00:00:00 2001 From: urchlay Date: Thu, 7 Jul 2005 02:30:48 +0000 Subject: [PATCH] Added -break command line option. It sets a breakpoint before emulation even starts, so you can enter the debugger before the first frame is even drawn. This will be useful for everyone, but I particularly need it for testing per-scanline TIA update code (which doesn't even exist yet). I should eventually be able to run "stella -break kernel poker.bin" and then advance one scanline at a time, watching the first frame get drawn. Not even close yet :) git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@614 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/debugger/Debugger.cxx | 8 +++++++- stella/src/debugger/Debugger.hxx | 7 +++++-- stella/src/emucore/OSystem.hxx | 12 ++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 4889b8bd0..7722c6741 100644 --- a/stella/src/debugger/Debugger.cxx +++ b/stella/src/debugger/Debugger.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.cxx,v 1.51 2005-07-06 19:09:24 stephena Exp $ +// $Id: Debugger.cxx,v 1.52 2005-07-07 02:30:48 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -90,6 +90,12 @@ void Debugger::initialize() DebuggerDialog *dd = new DebuggerDialog(myOSystem, this, x, y, w, h); myPrompt = dd->prompt(); myBaseDialog = dd; + + // set up any breakpoint that was on the command line + // (and remove the key from the settings, so they won't get set again) + string initBreak = myOSystem->settings().getString("break"); + if(initBreak != "") run("break " + initBreak); + myOSystem->settings().setString("break", "", false); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index 42e777001..38867bbf7 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.hxx,v 1.41 2005-07-06 19:09:25 stephena Exp $ +// $Id: Debugger.hxx,v 1.42 2005-07-07 02:30:48 urchlay Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -51,7 +51,7 @@ enum { for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.41 2005-07-06 19:09:25 stephena Exp $ + @version $Id: Debugger.hxx,v 1.42 2005-07-07 02:30:48 urchlay Exp $ */ class Debugger : public DialogContainer { @@ -87,6 +87,9 @@ class Debugger : public DialogContainer /* save registers to oldA, oldX, etc. */ void saveRegs(); + /* return the TIADebugger, since the GUI needs it */ + TIADebug& tiaDebug() { return *myTIAdebug; } + /** Convenience methods to convert to hexidecimal values */ static char *to_hex_4(int i) { diff --git a/stella/src/emucore/OSystem.hxx b/stella/src/emucore/OSystem.hxx index c95cda17b..847002565 100644 --- a/stella/src/emucore/OSystem.hxx +++ b/stella/src/emucore/OSystem.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystem.hxx,v 1.23 2005-06-20 18:32:11 stephena Exp $ +// $Id: OSystem.hxx,v 1.24 2005-07-07 02:30:48 urchlay Exp $ //============================================================================ #ifndef OSYSTEM_HXX @@ -44,7 +44,7 @@ class Debugger; other objects belong. @author Stephen Anthony - @version $Id: OSystem.hxx,v 1.23 2005-06-20 18:32:11 stephena Exp $ + @version $Id: OSystem.hxx,v 1.24 2005-07-07 02:30:48 urchlay Exp $ */ class OSystem { @@ -144,6 +144,14 @@ class OSystem */ Debugger& debugger(void) const { return *myDebugger; } + /** + Get the TIA debugger of the system. + + @return The debugger object + I can't make this compile, weird header dependencies + */ + //TIADebug& tiaDebug(void) const { return *myDebugger->tiaDebug(); } + /** Get the font object of the system