1 //===-- MICmnMIOutOfBandRecord.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 //===----------------------------------------------------------------------===//
12 // Third party headers:
16 #include "MICmnBase.h"
17 #include "MIUtilString.h"
18 #include "MICmnMIValueConst.h"
19 #include "MICmnMIValueResult.h"
21 //++ ============================================================================
22 // Details: MI common code MI Out-of-band (Async) Record class. A class that encapsulates
23 // MI result record data and the forming/format of data added to it.
24 // Out-of-band records are used to notify the GDB/MI client of additional
25 // changes that have occurred. Those changes can either be a consequence
26 // of GDB/MI (e.g., a breakpoint modified) or a result of target activity
27 // (e.g., target stopped).
28 // The syntax is as follows:
29 // "*" type ( "," result )*
30 // type ==> running | stopped
32 // The Out-of-band record can be retrieve at any time *this object is
33 // instantiated so unless work is done on *this Out-of-band record then it is
34 // possible to return a malformed Out-of-band record. If nothing has been set
35 // or added to *this MI Out-of-band record object then text "<Invalid>" will
38 // More information see:
39 // http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html//
41 // Authors: Illya Rudkin 24/02/2014.
44 class CMICmnMIOutOfBandRecord : public CMICmnBase
49 // Details: Enumeration of the type of Out-of-band for *this Out-of-band record
53 eOutOfBand_Running = 0,
55 eOutOfBand_BreakPointCreated,
56 eOutOfBand_BreakPointModified,
58 eOutOfBand_ThreadGroupAdded,
59 eOutOfBand_ThreadGroupExited,
60 eOutOfBand_ThreadGroupRemoved,
61 eOutOfBand_ThreadGroupStarted,
62 eOutOfBand_ThreadCreated,
63 eOutOfBand_ThreadExited,
64 eOutOfBand_ThreadSelected,
65 eOutOfBand_TargetModuleLoaded,
66 eOutOfBand_TargetModuleUnloaded,
67 eOutOfBand_TargetStreamOutput,
68 eOutOfBand_count // Always the last one
73 typedef std::map<OutOfBand_e, CMIUtilString> MapOutOfBandToOutOfBandText_t;
74 typedef std::map<OutOfBand_e, CMIUtilString> MapOutOfBandToToken_t;
78 /* ctor */ CMICmnMIOutOfBandRecord(void);
79 /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType);
80 /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType, const CMICmnMIValueConst &vConst);
81 /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType, const CMICmnMIValueResult &vResult);
83 const CMIUtilString &GetString(void) const;
84 bool Add(const CMICmnMIValueResult &vResult);
89 /* dtor */ virtual ~CMICmnMIOutOfBandRecord(void);
93 bool BuildAsyncRecord(void);
97 static MapOutOfBandToOutOfBandText_t ms_constMapOutOfBandToAsyncRecordText;
98 static MapOutOfBandToToken_t ms_constMapOutOfBandTextToToken;
100 OutOfBand_e m_eResultAsyncRecordClass;
101 CMIUtilString m_strAsyncRecord; // Holds the text version of the result record to date
102 CMICmnMIValueResult m_partResult;