mirror of https://github.com/stella-emu/stella.git
Some formatting/nullptr fixes for src/debugger.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3052 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
a9aa84e3a3
commit
f54118226c
|
@ -114,31 +114,25 @@ Debugger::Debugger(OSystem& osystem, Console& console)
|
||||||
: DialogContainer(osystem),
|
: DialogContainer(osystem),
|
||||||
myConsole(console),
|
myConsole(console),
|
||||||
mySystem(console.system()),
|
mySystem(console.system()),
|
||||||
myDialog(NULL),
|
myDialog(nullptr),
|
||||||
myParser(NULL),
|
myBreakPoints(nullptr),
|
||||||
myCartDebug(NULL),
|
myReadTraps(nullptr),
|
||||||
myCpuDebug(NULL),
|
myWriteTraps(nullptr),
|
||||||
myRiotDebug(NULL),
|
|
||||||
myTiaDebug(NULL),
|
|
||||||
myBreakPoints(NULL),
|
|
||||||
myReadTraps(NULL),
|
|
||||||
myWriteTraps(NULL),
|
|
||||||
myWidth(DebuggerDialog::kSmallFontMinW),
|
myWidth(DebuggerDialog::kSmallFontMinW),
|
||||||
myHeight(DebuggerDialog::kSmallFontMinH),
|
myHeight(DebuggerDialog::kSmallFontMinH)
|
||||||
myRewindManager(NULL)
|
|
||||||
{
|
{
|
||||||
// Init parser
|
// Init parser
|
||||||
myParser = new DebuggerParser(*this, osystem.settings());
|
myParser = make_ptr<DebuggerParser>(*this, osystem.settings());
|
||||||
|
|
||||||
// Create debugger subsystems
|
// Create debugger subsystems
|
||||||
myCpuDebug = new CpuDebug(*this, myConsole);
|
myCpuDebug = make_ptr<CpuDebug>(*this, myConsole);
|
||||||
myCartDebug = new CartDebug(*this, myConsole, osystem);
|
myCartDebug = make_ptr<CartDebug>(*this, myConsole, osystem);
|
||||||
myRiotDebug = new RiotDebug(*this, myConsole);
|
myRiotDebug = make_ptr<RiotDebug>(*this, myConsole);
|
||||||
myTiaDebug = new TIADebug(*this, myConsole);
|
myTiaDebug = make_ptr<TIADebug>(*this, myConsole);
|
||||||
|
|
||||||
myBreakPoints = new PackedBitArray(0x10000);
|
myBreakPoints = new PackedBitArray(0x10000);
|
||||||
myReadTraps = new PackedBitArray(0x10000);
|
myReadTraps = new PackedBitArray(0x10000);
|
||||||
myWriteTraps = new PackedBitArray(0x10000);
|
myWriteTraps = new PackedBitArray(0x10000);
|
||||||
|
|
||||||
// Allow access to this object from any class
|
// Allow access to this object from any class
|
||||||
// Technically this violates pure OO programming, but since I know
|
// Technically this violates pure OO programming, but since I know
|
||||||
|
@ -150,17 +144,11 @@ Debugger::Debugger(OSystem& osystem, Console& console)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Debugger::~Debugger()
|
Debugger::~Debugger()
|
||||||
{
|
{
|
||||||
delete myParser;
|
|
||||||
delete myCartDebug;
|
|
||||||
delete myCpuDebug;
|
|
||||||
delete myRiotDebug;
|
|
||||||
delete myTiaDebug;
|
|
||||||
delete myBreakPoints;
|
delete myBreakPoints;
|
||||||
delete myReadTraps;
|
delete myReadTraps;
|
||||||
delete myWriteTraps;
|
delete myWriteTraps;
|
||||||
delete myRewindManager;
|
|
||||||
|
|
||||||
myStaticDebugger = 0;
|
myStaticDebugger = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -179,11 +167,11 @@ void Debugger::initialize()
|
||||||
|
|
||||||
myOSystem.settings().setValue("dbg.res", GUI::Size(myWidth, myHeight));
|
myOSystem.settings().setValue("dbg.res", GUI::Size(myWidth, myHeight));
|
||||||
|
|
||||||
delete myBaseDialog; myBaseDialog = myDialog = NULL;
|
delete myBaseDialog; myBaseDialog = myDialog = nullptr;
|
||||||
myDialog = new DebuggerDialog(myOSystem, *this, 0, 0, myWidth, myHeight);
|
myDialog = new DebuggerDialog(myOSystem, *this, 0, 0, myWidth, myHeight);
|
||||||
myBaseDialog = myDialog;
|
myBaseDialog = myDialog;
|
||||||
|
|
||||||
myRewindManager = new RewindManager(myOSystem, myDialog->rewindButton());
|
myRewindManager = make_ptr<RewindManager>(myOSystem, myDialog->rewindButton());
|
||||||
myCartDebug->setDebugWidget(&(myDialog->cartDebug()));
|
myCartDebug->setDebugWidget(&(myDialog->cartDebug()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +465,7 @@ void Debugger::clearAllBreakPoints()
|
||||||
{
|
{
|
||||||
delete myBreakPoints;
|
delete myBreakPoints;
|
||||||
myBreakPoints = new PackedBitArray(0x10000);
|
myBreakPoints = new PackedBitArray(0x10000);
|
||||||
mySystem.m6502().setBreakPoints(NULL);
|
mySystem.m6502().setBreakPoints(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -487,7 +475,7 @@ void Debugger::clearAllTraps()
|
||||||
delete myWriteTraps;
|
delete myWriteTraps;
|
||||||
myReadTraps = new PackedBitArray(0x10000);
|
myReadTraps = new PackedBitArray(0x10000);
|
||||||
myWriteTraps = new PackedBitArray(0x10000);
|
myWriteTraps = new PackedBitArray(0x10000);
|
||||||
mySystem.m6502().setTraps(NULL, NULL);
|
mySystem.m6502().setTraps(nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -675,7 +663,7 @@ Debugger::RewindManager::RewindManager(OSystem& system, ButtonWidget& button)
|
||||||
myTop(0)
|
myTop(0)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_SIZE; ++i)
|
for(int i = 0; i < MAX_SIZE; ++i)
|
||||||
myStateList[i] = (Serializer*) NULL;
|
myStateList[i] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -689,7 +677,7 @@ Debugger::RewindManager::~RewindManager()
|
||||||
bool Debugger::RewindManager::addState()
|
bool Debugger::RewindManager::addState()
|
||||||
{
|
{
|
||||||
// Create a new Serializer object if we need one
|
// Create a new Serializer object if we need one
|
||||||
if(myStateList[myTop] == NULL)
|
if(myStateList[myTop] == nullptr)
|
||||||
myStateList[myTop] = new Serializer();
|
myStateList[myTop] = new Serializer();
|
||||||
Serializer& s = *(myStateList[myTop]);
|
Serializer& s = *(myStateList[myTop]);
|
||||||
|
|
||||||
|
@ -741,7 +729,7 @@ bool Debugger::RewindManager::isEmpty()
|
||||||
void Debugger::RewindManager::clear()
|
void Debugger::RewindManager::clear()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_SIZE; ++i)
|
for(int i = 0; i < MAX_SIZE; ++i)
|
||||||
if(myStateList[i] != NULL)
|
if(myStateList[i] != nullptr)
|
||||||
myStateList[i]->reset();
|
myStateList[i]->reset();
|
||||||
|
|
||||||
myTop = mySize = 0;
|
myTop = mySize = 0;
|
||||||
|
|
|
@ -297,11 +297,11 @@ class Debugger : public DialogContainer
|
||||||
System& mySystem;
|
System& mySystem;
|
||||||
|
|
||||||
DebuggerDialog* myDialog;
|
DebuggerDialog* myDialog;
|
||||||
DebuggerParser* myParser;
|
unique_ptr<DebuggerParser> myParser;
|
||||||
CartDebug* myCartDebug;
|
unique_ptr<CartDebug> myCartDebug;
|
||||||
CpuDebug* myCpuDebug;
|
unique_ptr<CpuDebug> myCpuDebug;
|
||||||
RiotDebug* myRiotDebug;
|
unique_ptr<RiotDebug> myRiotDebug;
|
||||||
TIADebug* myTiaDebug;
|
unique_ptr<TIADebug> myTiaDebug;
|
||||||
|
|
||||||
PackedBitArray* myBreakPoints;
|
PackedBitArray* myBreakPoints;
|
||||||
PackedBitArray* myReadTraps;
|
PackedBitArray* myReadTraps;
|
||||||
|
@ -338,7 +338,7 @@ class Debugger : public DialogContainer
|
||||||
Serializer* myStateList[MAX_SIZE];
|
Serializer* myStateList[MAX_SIZE];
|
||||||
uInt32 mySize, myTop;
|
uInt32 mySize, myTop;
|
||||||
};
|
};
|
||||||
RewindManager* myRewindManager;
|
unique_ptr<RewindManager> myRewindManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -48,7 +48,7 @@ class DebuggerParser
|
||||||
void getCompletions(const char* in, StringList& list) const;
|
void getCompletions(const char* in, StringList& list) const;
|
||||||
|
|
||||||
/** Evaluate the given expression using operators, current base, etc */
|
/** Evaluate the given expression using operators, current base, etc */
|
||||||
int decipher_arg(const string &str);
|
int decipher_arg(const string& str);
|
||||||
|
|
||||||
/** String representation of all watches currently defined */
|
/** String representation of all watches currently defined */
|
||||||
string showWatches();
|
string showWatches();
|
||||||
|
@ -84,7 +84,7 @@ class DebuggerParser
|
||||||
kIN_ARG
|
kIN_ARG
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum parameters {
|
||||||
kARG_WORD, // single 16-bit value
|
kARG_WORD, // single 16-bit value
|
||||||
kARG_MULTI_WORD, // multiple 16-bit values (must occur last)
|
kARG_MULTI_WORD, // multiple 16-bit values (must occur last)
|
||||||
kARG_BYTE, // single 8-bit value
|
kARG_BYTE, // single 8-bit value
|
||||||
|
@ -94,7 +94,7 @@ class DebuggerParser
|
||||||
kARG_FILE, // filename
|
kARG_FILE, // filename
|
||||||
kARG_BASE_SPCL, // base specifier: 2, 10, or 16 (or "bin" "dec" "hex")
|
kARG_BASE_SPCL, // base specifier: 2, 10, or 16 (or "bin" "dec" "hex")
|
||||||
kARG_END_ARGS // sentinel, occurs at end of list
|
kARG_END_ARGS // sentinel, occurs at end of list
|
||||||
} parameters;
|
};
|
||||||
|
|
||||||
// Pointer to DebuggerParser instance method, no args, returns void.
|
// Pointer to DebuggerParser instance method, no args, returns void.
|
||||||
typedef void (DebuggerParser::*METHOD)();
|
typedef void (DebuggerParser::*METHOD)();
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
exactly the same, except that generated data is now redirected to a
|
exactly the same, except that generated data is now redirected to a
|
||||||
DisassemblyList structure rather than being printed.
|
DisassemblyList structure rather than being printed.
|
||||||
|
|
||||||
All 7800-related stuff has been removed, as well as all commandline options.
|
All 7800-related stuff has been removed, as well as some commandline options.
|
||||||
Over time, some of the configurability of Distella may be added again.
|
Over time, some of the configurability of Distella may be added again.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
|
@ -44,7 +44,7 @@ class DiStella
|
||||||
// A list of options that can be applied to the disassembly
|
// A list of options that can be applied to the disassembly
|
||||||
// This will eventually grow to include all options supported by
|
// This will eventually grow to include all options supported by
|
||||||
// standalone Distella
|
// standalone Distella
|
||||||
typedef struct {
|
struct Settings{
|
||||||
Common::Base::Format gfx_format;
|
Common::Base::Format gfx_format;
|
||||||
bool resolve_code; // Attempt to detect code vs. data sections
|
bool resolve_code; // Attempt to detect code vs. data sections
|
||||||
bool show_addresses; // Show PC addresses (always off for external output)
|
bool show_addresses; // Show PC addresses (always off for external output)
|
||||||
|
@ -52,7 +52,7 @@ class DiStella
|
||||||
bool fflag; // Forces correct address length (-f in Distella)
|
bool fflag; // Forces correct address length (-f in Distella)
|
||||||
bool rflag; // Relocate calls out of address range (-r in Distella)
|
bool rflag; // Relocate calls out of address range (-r in Distella)
|
||||||
int bwidth; // Number of bytes to use per line (with .byte xxx)
|
int bwidth; // Number of bytes to use per line (with .byte xxx)
|
||||||
} Settings;
|
};
|
||||||
static Settings settings; // Default settings
|
static Settings settings; // Default settings
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue