|
|
1.1 root 1: //
2: // nono
1.1.1.2 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
1.1.1.7 root 7: //
8: // デバッガ (M88xx0 依存部分)
9: //
10:
1.1 root 11: #pragma once
12:
13: #include "debugger_private.h"
1.1.1.2 root 14: #include "mpu88xx0.h"
1.1 root 15: #include "m88100disasm.h"
16:
17: class DebuggerMD_m88xx0 : public DebuggerMD
18: {
1.1.1.2 root 19: using inherited = DebuggerMD;
1.1 root 20: public:
1.1.1.10 root 21: explicit DebuggerMD_m88xx0(Debugger *parent_);
1.1.1.2 root 22: ~DebuggerMD_m88xx0() override;
1.1 root 23:
1.1.1.8 root 24: CPUState GetCPUState() const override { return (CPUState)cpu->GetState(); }
25: bool IsSuper() const override { return cpu->IsSuper(); }
1.1.1.2 root 26: bool MMUEnabled() const override;
1.1.1.9 root 27: busaddr TranslateAddr(busaddr laddr) const override;
1.1 root 28:
1.1.1.8 root 29: uint32 GetPC() const override { return cpu->GetPPC(); }
1.1 root 30:
1.1.1.2 root 31: void SetStepOut() override;
32: bool IsStepOut() const override;
1.1.1.5 root 33: bool IsOpStepIn(DebuggerMemoryStream& mem) override;
1.1.1.2 root 34: uint64 GetRegAddr(const char *name) const override;
35: void BackupRegs() override;
1.1.1.7 root 36: bool ShowRegister(FILE *, const std::vector<std::string>& args) override;
1.1.1.5 root 37: const HelpMessages& GetHelpListReg() const override;
38: const HelpMessages& GetHelpReg() const override;
1.1.1.2 root 39:
40: bool CheckLEA(uint32 laddr) override {
1.1 root 41: bool rv = cpu->lastaddr == laddr;
1.1.1.8 root 42: cpu->lastaddr = (uint64)-1; // XXX: ていうかここでクリアはおかしい
1.1 root 43: return rv;
44: }
45:
1.1.1.8 root 46: std::string Disassemble(DebuggerMemoryStream& mem) override;
1.1.1.11! root 47: std::string ParseInst(const std::string&) const override;
1.1 root 48:
49: private:
1.1.1.8 root 50: MPU88xx0Device *cpu {}; // MPU デバイス
51: m88200 *cmmu0 {}; // 命令 CMMU
52: m88200 *cmmu1 {}; // データ CMMU
1.1.1.4 root 53: m88100reg prev {}; // 前回のレジスタセットのコピー
1.1.1.2 root 54:
1.1.1.4 root 55: static bool IsBB0(uint32 op);
56: static bool IsTB0(uint32 op);
1.1.1.2 root 57: static bool IsBBTB0(uint32 op);
58: static bool IsBB1(uint32 op);
59: static bool IsTB1(uint32 op);
60: static bool IsBBTB1(uint32 op);
61: const char *CondStr(uint32 op);
62:
1.1.1.5 root 63: static const HelpMessages HelpListReg;
64: static const HelpMessages HelpReg;
1.1.1.2 root 65: bool MatchCMMUCmd(const std::string& cmdname, const char *name, int *);
1.1.1.7 root 66: void ShowRegMain();
67: bool ShowRegCache(FILE *, const std::vector<std::string>& args, int id);
68: void ShowRegCacheOverview(m88200 *cmmu);
69: void ShowRegCacheSet(m88200 *cmmu, int setidx);
70: void ShowRegCtrl();
71: void ShowRegFPU();
72: void ShowRegOther();
1.1.1.2 root 73:
74: // cmp 命令後の分岐命令で結果レジスタを表示するため、
75: // cmp 命令のデスティネーションレジスタを覚えておく。
76: // -1 なら該当しないの意。
1.1.1.4 root 77: int cmp_rd {};
1.1.1.2 root 78:
1.1.1.8 root 79: const BranchHistory *brhist {};
80:
1.1.1.4 root 81: uint32 so_r1 {}; // ステップアウト判定用
1.1 root 82: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.