| 1 | //============================================================================ |
| 2 | // |
| 3 | // SSSS tt lll lll |
| 4 | // SS SS tt ll ll |
| 5 | // SS tttttt eeee ll ll aaaa |
| 6 | // SSSS tt ee ee ll ll aa |
| 7 | // SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" |
| 8 | // SS SS tt ee ll ll aa aa |
| 9 | // SSSS ttt eeeee llll llll aaaaa |
| 10 | // |
| 11 | // Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony |
| 12 | // and the Stella Team |
| 13 | // |
| 14 | // See the file "License.txt" for information on usage and redistribution of |
| 15 | // this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 16 | //============================================================================ |
| 17 | |
| 18 | #ifndef DEBUGGER_SYSTEM_HXX |
| 19 | #define DEBUGGER_SYSTEM_HXX |
| 20 | |
| 21 | class Debugger; |
| 22 | |
| 23 | #include "Console.hxx" |
| 24 | |
| 25 | /** |
| 26 | The DebuggerState class is used as a base class for state in all |
| 27 | DebuggerSystem objects. We make it a class so we can take advantage |
| 28 | of the copy constructor. |
| 29 | */ |
| 30 | class DebuggerState |
| 31 | { |
| 32 | public: |
| 33 | DebuggerState() = default; |
| 34 | ~DebuggerState() = default; |
| 35 | |
| 36 | DebuggerState(const DebuggerState&) = default; |
| 37 | DebuggerState(DebuggerState&&) = delete; |
| 38 | DebuggerState& operator=(const DebuggerState&) = default; |
| 39 | DebuggerState& operator=(DebuggerState&&) = delete; |
| 40 | }; |
| 41 | |
| 42 | /** |
| 43 | The base class for all debugger objects. Its real purpose is to |
| 44 | clean up the Debugger API, partitioning it into separate |
| 45 | subsystems. |
| 46 | */ |
| 47 | class DebuggerSystem |
| 48 | { |
| 49 | public: |
| 50 | DebuggerSystem(Debugger& dbg, Console& console) : |
| 51 | myDebugger(dbg), myConsole(console), mySystem(console.system()) { } |
| 52 | virtual ~DebuggerSystem() = default; |
| 53 | |
| 54 | virtual const DebuggerState& getState() = 0; |
| 55 | virtual const DebuggerState& getOldState() = 0; |
| 56 | |
| 57 | virtual void saveOldState() = 0; |
| 58 | virtual string toString() = 0; |
| 59 | |
| 60 | protected: |
| 61 | Debugger& myDebugger; |
| 62 | Console& myConsole; |
| 63 | System& mySystem; |
| 64 | |
| 65 | private: |
| 66 | // Following constructors and assignment operators not supported |
| 67 | DebuggerSystem() = delete; |
| 68 | DebuggerSystem(const DebuggerSystem&) = delete; |
| 69 | DebuggerSystem(DebuggerSystem&&) = delete; |
| 70 | DebuggerSystem& operator=(const DebuggerSystem&) = delete; |
| 71 | DebuggerSystem& operator=(DebuggerSystem&&) = delete; |
| 72 | }; |
| 73 | |
| 74 | #endif |
| 75 | |