Added ability to (de)select breakpoints from the RomWidget by clicking

in the leftmost area.  So for those who hate commandlines, that's one
more thing you can do with the mouse/GUI.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-08-25 18:18:48 +00:00
parent b9c20f3287
commit 3fbe8aae44
5 changed files with 31 additions and 22 deletions

View File

@ -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.87 2005-08-24 22:01:45 stephena Exp $
// $Id: Debugger.cxx,v 1.88 2005-08-25 18:18:48 stephena Exp $
//============================================================================
#include "bspf.hxx"
@ -789,6 +789,7 @@ void Debugger::disassemble(StringList& addr, StringList& data,
result = "";
const char *label = equateList->getFormatted(start, 4);
addr.push_back(label);
result += label;
result += ": ";
@ -806,7 +807,6 @@ void Debugger::disassemble(StringList& addr, StringList& data,
result += " ";
result += buf;
addr.push_back(label);
data.push_back(result);
} while(--lines > 0 && start <= 0xffff);

View File

@ -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: RomWidget.cxx,v 1.5 2005-08-24 22:01:45 stephena Exp $
// $Id: RomWidget.cxx,v 1.6 2005-08-25 18:18:48 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -62,7 +62,13 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break;
case kListItemChecked:
cerr << "(un)set a breakpoint at address " << data << endl;
// We don't care about state, as breakpoints are turned on
// and off with the same command
// FIXME - at some point, we might want to add 'breakon'
// and 'breakoff' to DebuggerParser, so the states
// don't get out of sync
instance()->debugger().run(string("break " + myAddrList[data]));
break;
}
}
@ -70,13 +76,7 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::loadConfig()
{
/* FIXME
We need logic here to only fill the grid at startup and when
bankswitching. At other times, we receive 'kListScrolledCmd'
command, which means the current romlist view is invalid and
should be filled with new data.
*/
cerr << "RomWidget::loadConfig()\n";
//cerr << "RomWidget::loadConfig()\n";
// Only reload full bank when necessary
if(myFirstLoad || myCurrentBank != instance()->debugger().getBank())
{
@ -96,16 +96,17 @@ void RomWidget::initialUpdate()
myCurrentBank = dbg.getBank();
// Fill romlist with entire ROM (FIXME - only fill with current bank)
// Fill romlist the current bank of source or disassembly
if(mySourceAvailable)
; // FIXME
else
{
StringList addr, data;
StringList data;
BoolArray state;
myAddrList.clear();
// Disassemble entire bank (up to 4096 lines)
dbg.disassemble(addr, data, 0xf000, 4096);
dbg.disassemble(myAddrList, data, 0xf000, 4096);
for(unsigned int i = 0; i < data.size(); ++i)
state.push_back(false);

View File

@ -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: RomWidget.hxx,v 1.3 2005-08-24 22:01:45 stephena Exp $
// $Id: RomWidget.hxx,v 1.4 2005-08-25 18:18:48 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -24,15 +24,12 @@
class GuiObject;
class CheckListWidget;
#include <map>
class StringList;
#include "Array.hxx"
#include "Widget.hxx"
#include "Command.hxx"
typedef multimap<int,int> LinePCMapping;
class RomWidget : public Widget, public CommandSender
{
public:
@ -50,7 +47,7 @@ class RomWidget : public Widget, public CommandSender
private:
CheckListWidget* myRomList;
LinePCMapping myLinePCMapping;
StringList myAddrList;
bool myFirstLoad;
bool mySourceAvailable;

View File

@ -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: CheckListWidget.cxx,v 1.5 2005-08-24 13:18:02 stephena Exp $
// $Id: CheckListWidget.cxx,v 1.6 2005-08-25 18:18:48 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -180,6 +180,15 @@ GUI::Rect CheckListWidget::getEditRect() const
return r;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CheckListWidget::getState(int line)
{
if(line < (int)_stateList.size())
return _stateList[line];
else
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheckListWidget::handleCommand(CommandSender* sender, int cmd,
int data, int id)

View File

@ -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: CheckListWidget.hxx,v 1.4 2005-08-23 18:32:51 stephena Exp $
// $Id: CheckListWidget.hxx,v 1.5 2005-08-25 18:18:48 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -51,6 +51,8 @@ class CheckListWidget : public ListWidget
void setList(const StringList& list, const BoolArray& state);
void setLine(int line, const string& str, const bool& state);
bool getState(int line);
void handleCommand(CommandSender* sender, int cmd, int data, int id);
protected: