~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to Core/Debugger/DebugInterface.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2012- PPSSPP Project.
 
2
 
 
3
// This program is free software: you can redistribute it and/or modify
 
4
// it under the terms of the GNU General Public License as published by
 
5
// the Free Software Foundation, version 2.0 or later versions.
 
6
 
 
7
// This program is distributed in the hope that it will be useful,
 
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
// GNU General Public License 2.0 for more details.
 
11
 
 
12
// A copy of the GPL 2.0 should have been included with the program.
 
13
// If not, see http://www.gnu.org/licenses/
 
14
 
 
15
// Official git repository and contact information can be found at
 
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
 
17
 
 
18
#pragma once
 
19
#include <string>
 
20
#include <cstdio>
 
21
#include "Common/CommonTypes.h"
 
22
#include "math/expression_parser.h"
 
23
 
 
24
struct MemMap;
 
25
 
 
26
enum {
 
27
        GPR_SIZE_32,
 
28
        GPR_SIZE_64,
 
29
};
 
30
 
 
31
class DebugInterface
 
32
{
 
33
public:
 
34
        virtual const char *disasm(unsigned int address, unsigned int align) {return "NODEBUGGER";}
 
35
        virtual int getInstructionSize(int instruction) {return 1;}
 
36
 
 
37
        virtual bool isAlive() {return true;}
 
38
        virtual bool isBreakpoint(unsigned int address) {return false;}
 
39
        virtual void setBreakpoint(unsigned int address){}
 
40
        virtual void clearBreakpoint(unsigned int address){}
 
41
        virtual void clearAllBreakpoints() {}
 
42
        virtual void toggleBreakpoint(unsigned int address){}
 
43
        virtual unsigned int readMemory(unsigned int address){return 0;}
 
44
        virtual unsigned int getPC() {return 0;}
 
45
        virtual void setPC(unsigned int address) {}
 
46
        virtual void step() {}
 
47
        virtual void runToBreakpoint() {}
 
48
        virtual int getColor(unsigned int address){return 0xFFFFFFFF;}
 
49
        virtual std::string getDescription(unsigned int address) {return "";}
 
50
        virtual bool initExpression(const char* exp, PostfixExpression& dest) { return false; };
 
51
        virtual bool parseExpression(PostfixExpression& exp, u32& dest) { return false; };
 
52
 
 
53
        
 
54
        virtual u32 GetHi() { return 0; };
 
55
        virtual u32 GetLo() { return 0; };
 
56
        virtual void SetHi(u32 val) { };
 
57
        virtual void SetLo(u32 val) { };
 
58
        virtual const char *GetName() = 0;
 
59
        virtual int GetGPRSize() = 0; //32 or 64
 
60
        virtual u32 GetGPR32Value(int reg) {return 0;}
 
61
        virtual void SetGPR32Value(int reg) {}
 
62
        virtual void SetGPR64Value(int reg) {}
 
63
        virtual u32 GetPC() = 0;
 
64
        virtual void SetPC(u32 _pc) = 0;
 
65
        virtual u32 GetLR() {return GetPC();}
 
66
        virtual void DisAsm(u32 op, u32 pc, int align, char *out) {sprintf(out,"[%08x] UNKNOWN", op);}
 
67
        //More stuff for debugger
 
68
        virtual int GetNumCategories() {return 0;}
 
69
        virtual int GetNumRegsInCategory(int cat) {return 0;}
 
70
        virtual const char *GetCategoryName(int cat) {return 0;}
 
71
        virtual const char *GetRegName(int cat, int index) {return 0;}
 
72
        virtual void PrintRegValue(int cat, int index, char *out)
 
73
        {
 
74
                sprintf(out,"%08X",GetGPR32Value(index));
 
75
        }
 
76
        virtual u32 GetRegValue(int cat, int index) {return 0;}
 
77
        virtual void SetRegValue(int cat, int index, u32 value) {}
 
78
 
 
79
};