]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h
MFV r288408:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmnLLDBDebuggerHandleEvents.h
1 //===-- MICmnLLDBDebuggerHandleEvents.h -------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //++
11 // File:        MICmnLLDBDebuggerHandleEvents.h
12 //
13 // Overview:    CMICmnLLDBDebuggerHandleEvents interface.
14 //
15 // Environment: Compilers:  Visual C++ 12.
16 //                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 //              Libraries:  See MIReadmetxt.
18 //
19 // Copyright:   None.
20 //--
21
22 #pragma once
23
24 // In-house headers:
25 #include "MICmnBase.h"
26 #include "MICmnMIValueTuple.h"
27 #include "MIUtilSingletonBase.h"
28
29 // Declarations:
30 class CMICmnLLDBDebugSessionInfo;
31 class CMICmnMIResultRecord;
32 class CMICmnStreamStdout;
33 class CMICmnMIOutOfBandRecord;
34
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.
39 //          A singleton class.
40 // Gotchas: None.
41 // Authors: Illya Rudkin 02/03/2014.
42 // Changes: None.
43 //--
44 class CMICmnLLDBDebuggerHandleEvents : public CMICmnBase, public MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>
45 {
46     friend class MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>;
47
48     // Methods:
49   public:
50     bool Initialize(void);
51     bool Shutdown(void);
52     //
53     bool HandleEvent(const lldb::SBEvent &vEvent, bool &vrbHandledEvent, bool &vrbExitAppEvent);
54
55     // Methods:
56   private:
57     /* ctor */ CMICmnLLDBDebuggerHandleEvents(void);
58     /* ctor */ CMICmnLLDBDebuggerHandleEvents(const CMICmnLLDBDebuggerHandleEvents &);
59     void operator=(const CMICmnLLDBDebuggerHandleEvents &);
60     //
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);
89
90     // Overridden:
91   private:
92     // From CMICmnBase
93     /* dtor */ virtual ~CMICmnLLDBDebuggerHandleEvents(void);
94 };