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 //===----------------------------------------------------------------------===//
11 // File: MICmnLLDBDebuggerHandleEvents.h
13 // Overview: CMICmnLLDBDebuggerHandleEvents interface.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
25 #include "MICmnBase.h"
26 #include "MICmnMIValueTuple.h"
27 #include "MIUtilSingletonBase.h"
30 class CMICmnLLDBDebugSessionInfo;
31 class CMICmnMIResultRecord;
32 class CMICmnStreamStdout;
33 class CMICmnMIOutOfBandRecord;
35 //++ ============================================================================
36 // Details: MI class to take LLDB SBEvent objects, filter them and form
37 // MI Out-of-band records from the information inside the event object.
38 // These records are then pushed to stdout.
41 // Authors: Illya Rudkin 02/03/2014.
44 class CMICmnLLDBDebuggerHandleEvents : public CMICmnBase, public MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>
46 friend class MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>;
50 bool Initialize(void);
53 bool HandleEvent(const lldb::SBEvent &vEvent, bool &vrbHandledEvent, bool &vrbExitAppEvent);
57 /* ctor */ CMICmnLLDBDebuggerHandleEvents(void);
58 /* ctor */ CMICmnLLDBDebuggerHandleEvents(const CMICmnLLDBDebuggerHandleEvents &);
59 void operator=(const CMICmnLLDBDebuggerHandleEvents &);
61 bool ChkForStateChanges(void);
62 bool GetProcessStdout(void);
63 bool GetProcessStderr(void);
64 bool HandleEventSBBreakPoint(const lldb::SBEvent &vEvent);
65 bool HandleEventSBBreakpointCmn(const lldb::SBEvent &vEvent);
66 bool HandleEventSBBreakpointAdded(const lldb::SBEvent &vEvent);
67 bool HandleEventSBBreakpointLocationsAdded(const lldb::SBEvent &vEvent);
68 bool HandleEventSBProcess(const lldb::SBEvent &vEvent, bool &vrbExitAppEvent);
69 bool HandleEventSBThread(const lldb::SBEvent &vEvent);
70 bool HandleEventSBThreadBitStackChanged(const lldb::SBEvent &vEvent);
71 bool HandleEventSBThreadSuspended(const lldb::SBEvent &vEvent);
72 bool HandleEventSBCommandInterpreter(const lldb::SBEvent &vEvent);
73 bool HandleProcessEventBroadcastBitStateChanged(const lldb::SBEvent &vEvent, bool &vrbExitAppEvent);
74 bool HandleProcessEventStateRunning(void);
75 bool HandleProcessEventStateExited(void);
76 bool HandleProcessEventStateStopped(bool &vwrbShouldBrk);
77 bool HandleProcessEventStopReasonTrace(void);
78 bool HandleProcessEventStopReasonBreakpoint(void);
79 bool HandleProcessEventStopSignal(bool &vwrbShouldBrk);
80 bool HandleProcessEventStateSuspended(const lldb::SBEvent &vEvent);
81 bool MiHelpGetCurrentThreadFrame(CMICmnMIValueTuple &vwrMiValueTuple);
82 bool MiResultRecordToStdout(const CMICmnMIResultRecord &vrMiResultRecord);
83 bool MiOutOfBandRecordToStdout(const CMICmnMIOutOfBandRecord &vrMiResultRecord);
84 bool MiStoppedAtBreakPoint(const MIuint64 vBrkPtId, const lldb::SBBreakpoint &vBrkPt);
85 bool TextToStdout(const CMIUtilString &vrTxt);
86 bool TextToStderr(const CMIUtilString &vrTxt);
87 bool UpdateSelectedThread(void);
88 bool ConvertPrintfCtrlCodeToString(const MIchar vCtrl, CMIUtilString &vwrStrEquivalent);
93 /* dtor */ virtual ~CMICmnLLDBDebuggerHandleEvents(void);