|
|
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.6 root 7: //
8: // デバッガ (M680x0 依存部分)
9: //
10:
1.1 root 11: #pragma once
12:
13: #include "debugger_private.h"
1.1.1.2 root 14: #include "mpu680x0.h"
1.1.1.10 root 15: #include "m680x0disasm.h"
1.1 root 16:
1.1.1.12! root 17: class StackData;
! 18:
1.1 root 19: class DebuggerMD_m680x0 : public DebuggerMD
20: {
1.1.1.2 root 21: using inherited = DebuggerMD;
1.1 root 22: public:
1.1.1.9 root 23: explicit DebuggerMD_m680x0(Debugger *parent);
1.1.1.2 root 24: ~DebuggerMD_m680x0() override;
25:
1.1.1.7 root 26: CPUState GetCPUState() const override { return (CPUState)cpu->GetState(); }
27: bool IsSuper() const override { return cpu->IsSuper(); }
1.1.1.2 root 28: bool MMUEnabled() const override { return cpu->mmu_enable; }
1.1.1.8 root 29: busaddr TranslateAddr(busaddr laddr) const override;
1.1.1.2 root 30:
1.1.1.7 root 31: uint32 GetPC() const override { return cpu->reg.pc; }
1.1.1.12! root 32: int32 GetAndResetLastVector() override {
! 33: return cpu->GetAndResetLastVector();
! 34: }
1.1.1.2 root 35:
36: void SetStepOut() override;
37: bool IsStepOut() const override;
1.1.1.5 root 38: bool IsOpStepIn(DebuggerMemoryStream& mem) override;
1.1.1.2 root 39: uint64 GetRegAddr(const char *name) const override;
40: void BackupRegs() override { prev = cpu->reg; }
1.1.1.6 root 41: bool ShowRegister(FILE *, const std::vector<std::string>& args) override;
1.1.1.5 root 42: const HelpMessages& GetHelpListReg() const override;
43: const HelpMessages& GetHelpReg() const override;
1.1 root 44:
1.1.1.2 root 45: bool CheckLEA(uint32 laddr) override { return false; }
1.1 root 46:
1.1.1.7 root 47: std::string Disassemble(DebuggerMemoryStream& mem) override;
1.1.1.11 root 48: std::string ParseInst(const std::string&) const override;
1.1 root 49:
1.1.1.12! root 50: void PrintExceptionFrame(FILE *, busaddr) override;
! 51:
! 52: // 浮動小数点ステートフレームを表示する。
! 53: void PrintFPStateFrame(FILE *, busaddr);
! 54:
1.1 root 55: private:
1.1.1.7 root 56: MPU680x0Device *cpu {}; // MPU デバイス
1.1.1.4 root 57: m68kreg prev {}; // 前回のレジスタセットのコピー
1.1 root 58:
1.1.1.10 root 59: static bool IsOPcc(uint16 op);
60: static bool IsDBcc(uint16 op);
61: static int IsFXcc(const std::vector<uint16>& ir);
62: bool IsCond(uint16 op) const;
63: const char *CondStr(const std::vector<uint16>& ir) const;
1.1 root 64:
1.1.1.5 root 65: static const HelpMessages HelpListReg;
66: static const HelpMessages HelpReg;
1.1.1.6 root 67: void ShowRegMain(FILE *);
68: void ShowRegFPU(FILE *);
1.1.1.10 root 69: void ShowRegMMU30(FILE *);
70: void ShowRegMMU40(FILE *);
1.1.1.6 root 71: void ShowRegATC();
72: void ShowRegOther();
1.1.1.2 root 73:
1.1.1.12! root 74: bool PrintExceptionFrameCommon(FILE *, const StackData&, bool);
! 75: void PrintExceptionFrame0(FILE *, StackData&);
! 76: void PrintExceptionFrame2(FILE *, StackData&);
! 77: void PrintExceptionFrame3(FILE *, StackData&);
! 78: void PrintExceptionFrame4(FILE *, StackData&);
! 79: void PrintExceptionFrame7(FILE *, StackData&);
! 80: void PrintExceptionFrameB(FILE *, StackData&);
! 81:
! 82: void PrintFPFrame6888xIdle(FILE *, StackData&, uint32 len);
! 83: void PrintFPFrame6888xBusy(FILE *, StackData&, uint32 len);
! 84: void PrintFPFrame68040Unimpl(FILE *, StackData&, uint base);
! 85: void PrintFPFrame68040Busy(FILE *, StackData&);
! 86:
1.1.1.4 root 87: uint32 so_a7 {}; // ステップアウト判定用
88: uint16 so_sr {};
1.1 root 89: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.