SBValue.h revision a0d0a7cbd773ded4ced8d5065f993b6e0feb8dfe
1//===-- SBValue.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#ifndef LLDB_SBValue_h_
11#define LLDB_SBValue_h_
12
13#include "lldb/API/SBDefines.h"
14
15#include <stdio.h>
16
17namespace lldb {
18
19#ifdef SWIG
20%feature("docstring",
21         "Represents the value of a variable, a register, or an expression."
22         ) SBValue;
23#endif
24class SBValue
25{
26#ifdef SWIG
27    %feature("autodoc", "1");
28#endif
29public:
30    SBValue ();
31
32    SBValue (const SBValue &rhs);
33
34#ifndef SWIG
35    const SBValue &
36    operator =(const SBValue &rhs);
37#endif
38
39    ~SBValue ();
40
41    bool
42    IsValid() const;
43
44    SBError
45    GetError();
46
47    const char *
48    GetName();
49
50    const char *
51    GetTypeName ();
52
53    size_t
54    GetByteSize ();
55
56    bool
57    IsInScope (const lldb::SBFrame &frame);  // DEPRECATED - SBValues know their own frames.
58
59    bool
60    IsInScope ();
61
62    lldb::Format
63    GetFormat () const;
64
65    void
66    SetFormat (lldb::Format format);
67
68    const char *
69    GetValue (const lldb::SBFrame &frame);   // DEPRECATED - SBValues know their own frames.
70
71    const char *
72    GetValue ();
73
74    ValueType
75    GetValueType ();
76
77    bool
78    GetValueDidChange (const lldb::SBFrame &frame);  // DEPRECATED - SBValues know their own frames.
79
80    bool
81    GetValueDidChange ();
82
83    const char *
84    GetSummary (const lldb::SBFrame &frame);  // DEPRECATED - SBValues know their own frames.
85
86    const char *
87    GetSummary ();
88
89    const char *
90    GetObjectDescription (const lldb::SBFrame &frame);  // DEPRECATED - SBValues know their own frames.
91
92    const char *
93    GetObjectDescription ();
94
95    const char *
96    GetLocation (const lldb::SBFrame &frame);  // DEPRECATED - SBValues know their own frames.
97
98    const char *
99    GetLocation ();
100
101    bool
102    SetValueFromCString (const lldb::SBFrame &frame, const char *value_str);  // DEPRECATED - SBValues know their own frames.
103
104    bool
105    SetValueFromCString (const char *value_str);
106
107    lldb::SBValue
108    GetChildAtIndex (uint32_t idx);
109
110    lldb::SBValue
111    GetChildAtIndex (uint32_t idx, lldb::DynamicValueType use_dynamic);
112
113    // Matches children of this object only and will match base classes and
114    // member names if this is a clang typed object.
115    uint32_t
116    GetIndexOfChildWithName (const char *name);
117
118    // Matches child members of this object and child members of any base
119    // classes.
120    lldb::SBValue
121    GetChildMemberWithName (const char *name);
122
123    // Matches child members of this object and child members of any base
124    // classes.
125    lldb::SBValue
126    GetChildMemberWithName (const char *name, lldb::DynamicValueType use_dynamic);
127
128    uint32_t
129    GetNumChildren ();
130
131    void *
132    GetOpaqueType();
133
134
135    lldb::SBValue
136    Dereference ();
137
138    bool
139    TypeIsPointerType ();
140
141    bool
142    GetDescription (lldb::SBStream &description);
143
144    bool
145    GetExpressionPath (lldb::SBStream &description);
146
147    bool
148    GetExpressionPath (lldb::SBStream &description, bool qualify_cxx_base_classes);
149
150protected:
151    friend class SBValueList;
152    friend class SBFrame;
153
154    SBValue (const lldb::ValueObjectSP &value_sp);
155
156#ifndef SWIG
157
158    // Mimic shared pointer...
159    lldb_private::ValueObject *
160    get() const;
161
162    lldb_private::ValueObject *
163    operator->() const;
164
165    lldb::ValueObjectSP &
166    operator*();
167
168    const lldb::ValueObjectSP &
169    operator*() const;
170
171#endif
172
173private:
174    lldb::ValueObjectSP m_opaque_sp;
175};
176
177} // namespace lldb
178
179#endif  // LLDB_SBValue_h_
180