CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/Debugger/DebugInterface.h
Views: 1401
// Copyright (c) 2012- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once18#include <string>19#include <cstdio>2021#include "Common/CommonTypes.h"22#include "Common/Math/expression_parser.h"2324struct MemMap;2526class DebugInterface {27public:28virtual int getInstructionSize(int instruction) {return 1;}2930virtual bool isAlive() {return true;}31virtual bool isBreakpoint(unsigned int address) {return false;}32virtual void setBreakpoint(unsigned int address){}33virtual void clearBreakpoint(unsigned int address){}34virtual void clearAllBreakpoints() {}35virtual void toggleBreakpoint(unsigned int address){}36virtual unsigned int readMemory(unsigned int address){return 0;}37virtual unsigned int getPC() {return 0;}38virtual void setPC(unsigned int address) {}39virtual void step() {}40virtual void runToBreakpoint() {}41virtual int getColor(unsigned int address){return 0xFFFFFFFF;}42virtual std::string getDescription(unsigned int address) {return "";}43virtual bool initExpression(const char* exp, PostfixExpression& dest) { return false; };44virtual bool parseExpression(PostfixExpression& exp, u32& dest) { return false; };4546virtual u32 GetHi() { return 0; };47virtual u32 GetLo() { return 0; };48virtual void SetHi(u32 val) { };49virtual void SetLo(u32 val) { };50virtual const char *GetName() = 0;51virtual u32 GetGPR32Value(int reg) {return 0;}52virtual void SetGPR32Value(int reg) {}53virtual u32 GetPC() = 0;54virtual void SetPC(u32 _pc) = 0;55virtual u32 GetLR() {return GetPC();}56virtual void DisAsm(u32 pc, char *out, size_t outSize) {57snprintf(out, outSize, "[%08x] UNKNOWN", pc);58}59// More stuff for debugger60virtual int GetNumCategories() {return 0;}61virtual int GetNumRegsInCategory(int cat) {return 0;}62virtual const char *GetCategoryName(int cat) {return 0;}63virtual std::string GetRegName(int cat, int index) { return ""; }64virtual void PrintRegValue(int cat, int index, char *out, size_t outSize) {65snprintf(out, outSize, "%08X", GetGPR32Value(index));66}67virtual u32 GetRegValue(int cat, int index) {return 0;}68virtual void SetRegValue(int cat, int index, u32 value) {}69};707172