diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index a5104d3cf..27bb5d762 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.7 2005-06-15 20:41:08 urchlay Exp $ +// $Id: Debugger.cxx,v 1.8 2005-06-15 23:45:04 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -340,3 +340,8 @@ void Debugger::toggleN() { myDebugger->ps( myDebugger->ps() ^ 0x80 ); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +EquateList *Debugger::equates() { + return equateList; +} + diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index de61a186a..b14e29ecd 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.4 2005-06-15 20:41:08 urchlay Exp $ +// $Id: Debugger.hxx,v 1.5 2005-06-15 23:45:04 urchlay Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -47,7 +47,7 @@ enum { for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.4 2005-06-15 20:41:08 urchlay Exp $ + @version $Id: Debugger.hxx,v 1.5 2005-06-15 23:45:04 urchlay Exp $ */ class Debugger : public DialogContainer { @@ -136,7 +136,7 @@ class Debugger : public DialogContainer void reset(); void formatFlags(int f, char *out); - void setEquateList(EquateList *l); + EquateList *equates(); protected: Console* myConsole; diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index 3729ae830..40043d66b 100644 --- a/stella/src/debugger/DebuggerParser.cxx +++ b/stella/src/debugger/DebuggerParser.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: DebuggerParser.cxx,v 1.5 2005-06-15 20:41:08 urchlay Exp $ +// $Id: DebuggerParser.cxx,v 1.6 2005-06-15 23:45:04 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -33,12 +33,11 @@ enum { DebuggerParser::DebuggerParser(Debugger* d) : debugger(d) { - equateList = new EquateList(); + equateList = d->equates(); done = false; } DebuggerParser::~DebuggerParser() { - delete equateList; } string DebuggerParser::currentAddress() { @@ -179,7 +178,7 @@ string DebuggerParser::run(const string& command) { if(subStringMatch("loadsym ", command)) { result = command; result.erase(0, 8); - result = equateList->loadFile(result); + result = debugger->equateList->loadFile(result); return result; } diff --git a/stella/src/debugger/EquateList.cxx b/stella/src/debugger/EquateList.cxx index 8a6269edb..51cf0be21 100644 --- a/stella/src/debugger/EquateList.cxx +++ b/stella/src/debugger/EquateList.cxx @@ -82,7 +82,7 @@ static struct Equate hardCodedEquates[] = { }; EquateList::EquateList() { - cerr << sizeof(hardCodedEquates)/sizeof(struct Equate) << endl; + // cerr << sizeof(hardCodedEquates)/sizeof(struct Equate) << endl; ourVcsEquates = new Equate[ sizeof(hardCodedEquates)/sizeof(struct Equate) ]; for(int i=0; hardCodedEquates[i].label != NULL; i++) ourVcsEquates[i] = hardCodedEquates[i]; @@ -99,11 +99,11 @@ int EquateList::calcSize() { // FIXME: use something smarter than a linear search in the future. char *EquateList::getLabel(int addr) { - cerr << "getLabel(" << addr << ")" << endl; + // cerr << "getLabel(" << addr << ")" << endl; for(int i=0; ourVcsEquates[i].label != NULL; i++) { - cerr << "Checking ourVcsEquates[" << i << "] (" << ourVcsEquates[i].label << endl; + // cerr << "Checking ourVcsEquates[" << i << "] (" << ourVcsEquates[i].label << endl; if(ourVcsEquates[i].address == addr) { - cerr << "Found label " << ourVcsEquates[i].label << endl; + // cerr << "Found label " << ourVcsEquates[i].label << endl; return ourVcsEquates[i].label; } } @@ -199,11 +199,11 @@ string EquateList::loadFile(string file) { newEquates[lines].label = NULL; newEquates[lines].address = 0; - calcSize(); delete ourVcsEquates; ourVcsEquates = newEquates; + calcSize(); - dumpAll(); + // dumpAll(); return "loaded " + file + " OK"; } diff --git a/stella/src/emucore/m6502/src/D6502.cxx b/stella/src/emucore/m6502/src/D6502.cxx index c4f095a2b..2b747a196 100644 --- a/stella/src/emucore/m6502/src/D6502.cxx +++ b/stella/src/emucore/m6502/src/D6502.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: D6502.cxx,v 1.6 2005-06-15 20:41:09 urchlay Exp $ +// $Id: D6502.cxx,v 1.7 2005-06-15 23:45:04 urchlay Exp $ //============================================================================ #include @@ -49,7 +49,7 @@ uInt16 D6502::dPeek(uInt16 address) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt16 D6502::disassemble(uInt16 address, char* buffer, EquateList *equateList) { - equateList->dumpAll(); + // equateList->dumpAll(); uInt8 opcode = mySystem->peek(address); switch(M6502::ourAddressingModeTable[opcode])