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
46 , public MI::ISingleton< CMICmnLLDBDebuggerHandleEvents >
48 friend class MI::ISingleton< CMICmnLLDBDebuggerHandleEvents >;
52 bool Initialize( void );
53 bool Shutdown( void );
55 bool HandleEvent( const lldb::SBEvent & vEvent, bool & vrbHandledEvent, bool & vrbExitAppEvent );
59 /* ctor */ CMICmnLLDBDebuggerHandleEvents( void );
60 /* ctor */ CMICmnLLDBDebuggerHandleEvents( const CMICmnLLDBDebuggerHandleEvents & );
61 void operator=( const CMICmnLLDBDebuggerHandleEvents & );
63 bool ChkForStateChanges( void );
64 bool GetProcessStdout( void );
65 bool GetProcessStderr( void );
66 bool HandleEventSBBreakPoint( const lldb::SBEvent & vEvent );
67 bool HandleEventSBBreakpointCmn( const lldb::SBEvent & vEvent );
68 bool HandleEventSBBreakpointAdded( const lldb::SBEvent & vEvent );
69 bool HandleEventSBBreakpointLocationsAdded( const lldb::SBEvent & vEvent );
70 bool HandleEventSBProcess( const lldb::SBEvent & vEvent, bool & vrbExitAppEvent );
71 bool HandleEventSBThread( const lldb::SBEvent & vEvent );
72 bool HandleEventSBThreadBitStackChanged( const lldb::SBEvent & vEvent );
73 bool HandleEventSBThreadSuspended( const lldb::SBEvent & vEvent );
74 bool HandleEventSBCommandInterpreter( const lldb::SBEvent & vEvent );
75 bool HandleProcessEventBroadcastBitStateChanged( const lldb::SBEvent & vEvent, bool & vrbExitAppEvent );
76 bool HandleProcessEventStateRunning( void );
77 bool HandleProcessEventStateExited( void );
78 bool HandleProcessEventStateStopped( bool & vwrbShouldBrk );
79 bool HandleProcessEventStopReasonTrace( void );
80 bool HandleProcessEventStopReasonBreakpoint( void );
81 bool HandleProcessEventStopSignal( bool & vwrbShouldBrk );
82 bool HandleProcessEventStateSuspended( const lldb::SBEvent & vEvent );
83 bool MiHelpGetCurrentThreadFrame( CMICmnMIValueTuple & vwrMiValueTuple );
84 bool MiResultRecordToStdout( const CMICmnMIResultRecord & vrMiResultRecord );
85 bool MiOutOfBandRecordToStdout( const CMICmnMIOutOfBandRecord & vrMiResultRecord );
86 bool MiStoppedAtBreakPoint( const MIuint64 vBrkPtId, const lldb::SBBreakpoint & vBrkPt );
87 bool TextToStdout( const CMIUtilString & vrTxt );
88 bool TextToStderr( const CMIUtilString & vrTxt );
89 bool UpdateSelectedThread( void );
90 bool ConvertPrintfCtrlCodeToString( const MIchar vCtrl, CMIUtilString & vwrStrEquivalent );
95 /* dtor */ virtual ~CMICmnLLDBDebuggerHandleEvents( void );