SBValue.h revision 4ae519666628cca07c194bf677163009cc2e5a8b
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 19class SBValue 20{ 21public: 22 SBValue (); 23 24 ~SBValue (); 25 26 bool 27 IsValid() const; 28 29 void 30 Print (FILE *out_file, lldb::SBFrame *frame, bool print_type, bool print_value); 31 32 const char * 33 GetName(); 34 35 const char * 36 GetTypeName (); 37 38 size_t 39 GetByteSize (); 40 41 bool 42 IsInScope (const lldb::SBFrame &frame); 43 44 const char * 45 GetValue (const lldb::SBFrame &frame); 46 47 bool 48 GetValueDidChange (const lldb::SBFrame &frame); 49 50 const char * 51 GetSummary (const lldb::SBFrame &frame); 52 53 const char * 54 GetObjectDescription (const lldb::SBFrame &frame); 55 56 const char * 57 GetLocation (const lldb::SBFrame &frame); 58 59 bool 60 SetValueFromCString (const lldb::SBFrame &frame, const char *value_str); 61 62 lldb::SBValue 63 GetChildAtIndex (uint32_t idx); 64 65 // Matches children of this object only and will match base classes and 66 // member names if this is a clang typed object. 67 uint32_t 68 GetIndexOfChildWithName (const char *name); 69 70 // Matches child members of this object and child members of any base 71 // classes. 72 lldb::SBValue 73 GetChildMemberWithName (const char *name); 74 75 uint32_t 76 GetNumChildren (); 77 78 bool 79 ValueIsStale (); 80 81 void * 82 GetOpaqueType(); 83 84 //void 85 //DumpType (); 86 87 lldb::SBValue 88 Dereference (); 89 90 bool 91 TypeIsPtrType (); 92 93 94protected: 95 friend class SBValueList; 96 friend class SBFrame; 97 98 SBValue (const lldb::ValueObjectSP &value_sp); 99 100#ifndef SWIG 101 102 // Mimic shared pointer... 103 lldb_private::ValueObject * 104 get() const; 105 106 lldb_private::ValueObject * 107 operator->() const; 108 109 lldb::ValueObjectSP & 110 operator*(); 111 112 const lldb::ValueObjectSP & 113 operator*() const; 114 115#endif 116 117private: 118 lldb::ValueObjectSP m_opaque_sp; 119}; 120 121} // namespace lldb 122 123#endif // LLDB_SBValue_h_ 124