1 //===-- MICmnLLDBDebuggerHandleEvents.h -------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
13 #include "MICmnBase.h"
14 #include "MICmnMIValueList.h"
15 #include "MICmnMIValueTuple.h"
16 #include "MIUtilSingletonBase.h"
19 class CMICmnLLDBDebugSessionInfo;
20 class CMICmnMIResultRecord;
21 class CMICmnStreamStdout;
22 class CMICmnMIOutOfBandRecord;
24 //++ ============================================================================
25 // Details: MI class to take LLDB SBEvent objects, filter them and form
26 // MI Out-of-band records from the information inside the event object.
27 // These records are then pushed to stdout.
30 // Authors: Illya Rudkin 02/03/2014.
33 class CMICmnLLDBDebuggerHandleEvents : public CMICmnBase, public MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>
35 friend class MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>;
39 bool Initialize(void) override;
40 bool Shutdown(void) override;
42 bool HandleEvent(const lldb::SBEvent &vEvent, bool &vrbHandledEvent);
46 /* ctor */ CMICmnLLDBDebuggerHandleEvents(void);
47 /* ctor */ CMICmnLLDBDebuggerHandleEvents(const CMICmnLLDBDebuggerHandleEvents &);
48 void operator=(const CMICmnLLDBDebuggerHandleEvents &);
50 bool ChkForStateChanges(void);
51 bool GetProcessStdout(void);
52 bool GetProcessStderr(void);
53 bool HandleEventSBBreakPoint(const lldb::SBEvent &vEvent);
54 bool HandleEventSBBreakpointCmn(const lldb::SBEvent &vEvent);
55 bool HandleEventSBBreakpointAdded(const lldb::SBEvent &vEvent);
56 bool HandleEventSBBreakpointLocationsAdded(const lldb::SBEvent &vEvent);
57 bool HandleEventSBProcess(const lldb::SBEvent &vEvent);
58 bool HandleEventSBTarget(const lldb::SBEvent &vEvent);
59 bool HandleEventSBThread(const lldb::SBEvent &vEvent);
60 bool HandleEventSBThreadBitStackChanged(const lldb::SBEvent &vEvent);
61 bool HandleEventSBThreadSuspended(const lldb::SBEvent &vEvent);
62 bool HandleEventSBCommandInterpreter(const lldb::SBEvent &vEvent);
63 bool HandleProcessEventBroadcastBitStateChanged(const lldb::SBEvent &vEvent);
64 bool HandleProcessEventStateRunning(void);
65 bool HandleProcessEventStateExited(void);
66 bool HandleProcessEventStateStopped(const lldb::SBEvent &vrEvent, bool &vwrbShouldBrk);
67 bool HandleProcessEventStopReasonTrace(void);
68 bool HandleProcessEventStopReasonBreakpoint(void);
69 bool HandleProcessEventStopSignal(const lldb::SBEvent &vrEvent);
70 bool HandleProcessEventStopException(void);
71 bool HandleProcessEventStateSuspended(const lldb::SBEvent &vEvent);
72 bool HandleTargetEventBroadcastBitModulesLoaded(const lldb::SBEvent &vEvent);
73 bool HandleTargetEventBroadcastBitModulesUnloaded(const lldb::SBEvent &vEvent);
74 bool MiHelpGetModuleInfo(const lldb::SBModule &vModule, const bool vbWithExtraFields,
75 CMICmnMIOutOfBandRecord &vwrMiOutOfBandRecord);
76 bool MiHelpGetCurrentThreadFrame(CMICmnMIValueTuple &vwrMiValueTuple);
77 bool MiResultRecordToStdout(const CMICmnMIResultRecord &vrMiResultRecord);
78 bool MiOutOfBandRecordToStdout(const CMICmnMIOutOfBandRecord &vrMiResultRecord);
79 bool MiStoppedAtBreakPoint(const MIuint64 vBrkPtId, const lldb::SBBreakpoint &vBrkPt);
80 bool TextToStdout(const CMIUtilString &vrTxt);
81 bool TextToStderr(const CMIUtilString &vrTxt);
82 bool UpdateSelectedThread(void);
87 /* dtor */ ~CMICmnLLDBDebuggerHandleEvents(void) override;
88 void InitializeSignals();
89 bool m_bSignalsInitialized;