mirror of https://github.com/PCSX2/pcsx2.git
Debugger: Prefer override over virtual
This commit is contained in:
parent
6da938a714
commit
f873e3b630
|
@ -17,8 +17,22 @@
|
||||||
#include "MemoryTypes.h"
|
#include "MemoryTypes.h"
|
||||||
#include "ExpressionParser.h"
|
#include "ExpressionParser.h"
|
||||||
|
|
||||||
enum { EECAT_GPR, EECAT_CP0, EECAT_FPR, EECAT_FCR, EECAT_VU0F, EECAT_VU0I, EECAT_GSPRIV, EECAT_COUNT };
|
enum
|
||||||
enum { IOPCAT_GPR, IOPCAT_COUNT };
|
{
|
||||||
|
EECAT_GPR,
|
||||||
|
EECAT_CP0,
|
||||||
|
EECAT_FPR,
|
||||||
|
EECAT_FCR,
|
||||||
|
EECAT_VU0F,
|
||||||
|
EECAT_VU0I,
|
||||||
|
EECAT_GSPRIV,
|
||||||
|
EECAT_COUNT
|
||||||
|
};
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
IOPCAT_GPR,
|
||||||
|
IOPCAT_COUNT
|
||||||
|
};
|
||||||
enum BreakPointCpu
|
enum BreakPointCpu
|
||||||
{
|
{
|
||||||
BREAKPOINT_EE = 0x01,
|
BREAKPOINT_EE = 0x01,
|
||||||
|
@ -29,7 +43,11 @@ enum BreakPointCpu
|
||||||
class DebugInterface
|
class DebugInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum RegisterType { NORMAL, SPECIAL };
|
enum RegisterType
|
||||||
|
{
|
||||||
|
NORMAL,
|
||||||
|
SPECIAL
|
||||||
|
};
|
||||||
|
|
||||||
virtual u32 read8(u32 address) = 0;
|
virtual u32 read8(u32 address) = 0;
|
||||||
virtual u32 read16(u32 address) = 0;
|
virtual u32 read16(u32 address) = 0;
|
||||||
|
@ -53,85 +71,85 @@ public:
|
||||||
virtual u32 getPC() = 0;
|
virtual u32 getPC() = 0;
|
||||||
virtual void setPc(u32 newPc) = 0;
|
virtual void setPc(u32 newPc) = 0;
|
||||||
virtual void setRegister(int cat, int num, u128 newValue) = 0;
|
virtual void setRegister(int cat, int num, u128 newValue) = 0;
|
||||||
|
|
||||||
virtual std::string disasm(u32 address, bool simplify) = 0;
|
virtual std::string disasm(u32 address, bool simplify) = 0;
|
||||||
virtual bool isValidAddress(u32 address) = 0;
|
virtual bool isValidAddress(u32 address) = 0;
|
||||||
virtual u32 getCycles() = 0;
|
virtual u32 getCycles() = 0;
|
||||||
virtual BreakPointCpu getCpuType() = 0;
|
virtual BreakPointCpu getCpuType() = 0;
|
||||||
|
|
||||||
bool initExpression(const char* exp, PostfixExpression& dest);
|
bool initExpression(const char* exp, PostfixExpression& dest);
|
||||||
bool parseExpression(PostfixExpression& exp, u64& dest);
|
bool parseExpression(PostfixExpression& exp, u64& dest);
|
||||||
bool isAlive();
|
bool isAlive();
|
||||||
bool isCpuPaused();
|
bool isCpuPaused();
|
||||||
void pauseCpu();
|
void pauseCpu();
|
||||||
void resumeCpu();
|
void resumeCpu();
|
||||||
char *stringFromPointer(u32 p);
|
char* stringFromPointer(u32 p);
|
||||||
};
|
};
|
||||||
|
|
||||||
class R5900DebugInterface: public DebugInterface
|
class R5900DebugInterface : public DebugInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual u32 read8(u32 address);
|
u32 read8(u32 address) override;
|
||||||
virtual u32 read16(u32 address);
|
u32 read16(u32 address) override;
|
||||||
virtual u32 read32(u32 address);
|
u32 read32(u32 address) override;
|
||||||
virtual u64 read64(u32 address);
|
u64 read64(u32 address) override;
|
||||||
virtual u128 read128(u32 address);
|
u128 read128(u32 address) override;
|
||||||
virtual void write8(u32 address, u8 value);
|
void write8(u32 address, u8 value) override;
|
||||||
virtual void write32(u32 address, u32 value);
|
void write32(u32 address, u32 value) override;
|
||||||
|
|
||||||
// register stuff
|
// register stuff
|
||||||
virtual int getRegisterCategoryCount();
|
int getRegisterCategoryCount() override;
|
||||||
virtual const char* getRegisterCategoryName(int cat);
|
const char* getRegisterCategoryName(int cat) override;
|
||||||
virtual int getRegisterSize(int cat);
|
int getRegisterSize(int cat) override;
|
||||||
virtual int getRegisterCount(int cat);
|
int getRegisterCount(int cat) override;
|
||||||
virtual RegisterType getRegisterType(int cat);
|
RegisterType getRegisterType(int cat) override;
|
||||||
virtual const char* getRegisterName(int cat, int num);
|
const char* getRegisterName(int cat, int num) override;
|
||||||
virtual u128 getRegister(int cat, int num);
|
u128 getRegister(int cat, int num) override;
|
||||||
virtual wxString getRegisterString(int cat, int num);
|
wxString getRegisterString(int cat, int num) override;
|
||||||
virtual u128 getHI();
|
u128 getHI() override;
|
||||||
virtual u128 getLO();
|
u128 getLO() override;
|
||||||
virtual u32 getPC();
|
u32 getPC() override;
|
||||||
virtual void setPc(u32 newPc);
|
void setPc(u32 newPc) override;
|
||||||
virtual void setRegister(int cat, int num, u128 newValue);
|
void setRegister(int cat, int num, u128 newValue) override;
|
||||||
|
|
||||||
virtual std::string disasm(u32 address, bool simplify);
|
std::string disasm(u32 address, bool simplify) override;
|
||||||
virtual bool isValidAddress(u32 address);
|
bool isValidAddress(u32 address) override;
|
||||||
virtual u32 getCycles();
|
u32 getCycles() override;
|
||||||
virtual BreakPointCpu getCpuType();
|
BreakPointCpu getCpuType() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class R3000DebugInterface: public DebugInterface
|
class R3000DebugInterface : public DebugInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual u32 read8(u32 address);
|
u32 read8(u32 address) override;
|
||||||
virtual u32 read16(u32 address);
|
u32 read16(u32 address) override;
|
||||||
virtual u32 read32(u32 address);
|
u32 read32(u32 address) override;
|
||||||
virtual u64 read64(u32 address);
|
u64 read64(u32 address) override;
|
||||||
virtual u128 read128(u32 address);
|
u128 read128(u32 address) override;
|
||||||
virtual void write8(u32 address, u8 value);
|
void write8(u32 address, u8 value) override;
|
||||||
virtual void write32(u32 address, u32 value);
|
void write32(u32 address, u32 value) override;
|
||||||
|
|
||||||
// register stuff
|
// register stuff
|
||||||
virtual int getRegisterCategoryCount();
|
int getRegisterCategoryCount() override;
|
||||||
virtual const char* getRegisterCategoryName(int cat);
|
const char* getRegisterCategoryName(int cat) override;
|
||||||
virtual int getRegisterSize(int cat);
|
int getRegisterSize(int cat) override;
|
||||||
virtual int getRegisterCount(int cat);
|
int getRegisterCount(int cat) override;
|
||||||
virtual RegisterType getRegisterType(int cat);
|
RegisterType getRegisterType(int cat) override;
|
||||||
virtual const char* getRegisterName(int cat, int num);
|
const char* getRegisterName(int cat, int num) override;
|
||||||
virtual u128 getRegister(int cat, int num);
|
u128 getRegister(int cat, int num) override;
|
||||||
virtual wxString getRegisterString(int cat, int num);
|
wxString getRegisterString(int cat, int num) override;
|
||||||
virtual u128 getHI();
|
u128 getHI() override;
|
||||||
virtual u128 getLO();
|
u128 getLO() override;
|
||||||
virtual u32 getPC();
|
u32 getPC() override;
|
||||||
virtual void setPc(u32 newPc);
|
void setPc(u32 newPc) override;
|
||||||
virtual void setRegister(int cat, int num, u128 newValue);
|
void setRegister(int cat, int num, u128 newValue) override;
|
||||||
|
|
||||||
virtual std::string disasm(u32 address, bool simplify);
|
std::string disasm(u32 address, bool simplify) override;
|
||||||
virtual bool isValidAddress(u32 address);
|
bool isValidAddress(u32 address) override;
|
||||||
virtual u32 getCycles();
|
u32 getCycles() override;
|
||||||
virtual BreakPointCpu getCpuType();
|
BreakPointCpu getCpuType() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern R5900DebugInterface r5900Debug;
|
extern R5900DebugInterface r5900Debug;
|
||||||
extern R3000DebugInterface r3000Debug;
|
extern R3000DebugInterface r3000Debug;
|
||||||
|
|
Loading…
Reference in New Issue