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