class Protocol
{
+protected:
+ bool m_exit;
+ Debugger *m_debugger;
+
public:
+ Protocol() : m_exit(false), m_debugger(nullptr) {}
+ void SetDebugger(Debugger *debugger) { m_debugger = debugger; }
+
virtual void EmitInitializedEvent() = 0;
virtual void EmitStoppedEvent(StoppedEvent event) = 0;
virtual void EmitExitedEvent(ExitedEvent event) = 0;
class MIProtocol : public Protocol
{
static std::mutex m_outMutex;
- bool m_exit;
- Debugger *m_debugger;
std::string m_fileExec;
std::vector<std::string> m_execArgs;
std::unordered_map<std::string, Variable> m_vars;
std::unordered_map<std::string, std::unordered_map<int32_t, int> > m_breakpoints;
public:
- void SetDebugger(Debugger *debugger) { m_debugger = debugger; }
static std::string EscapeMIValue(const std::string &str);
- MIProtocol() : m_exit(false), m_debugger(nullptr), m_varCounter(0) {}
+ MIProtocol() : Protocol(), m_varCounter(0) {}
void EmitInitializedEvent() override {}
void EmitStoppedEvent(StoppedEvent event) override;
void EmitExitedEvent(ExitedEvent event) override;
LogFile
} m_engineLogOutput;
std::ofstream m_engineLog;
- bool m_exit;
- Debugger *m_debugger;
uint64_t m_seqCounter;
public:
- VSCodeProtocol() : m_engineLogOutput(LogNone), m_exit(false), m_debugger(nullptr), m_seqCounter(1) {}
- void SetDebugger(Debugger *debugger) { m_debugger = debugger; }
+ VSCodeProtocol() : Protocol(), m_engineLogOutput(LogNone), m_seqCounter(1) {}
void EngineLogging(const std::string &path);
void EmitInitializedEvent() override;