SBValue.h revision 17dae081d7b88d24a7af6b07c10fc5981f81e2a9
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 GetLocation (const lldb::SBFrame &frame); 55 56 bool 57 SetValueFromCString (const lldb::SBFrame &frame, const char *value_str); 58 59 lldb::SBValue 60 GetChildAtIndex (uint32_t idx); 61 62 // Matches children of this object only and will match base classes and 63 // member names if this is a clang typed object. 64 uint32_t 65 GetIndexOfChildWithName (const char *name); 66 67 // Matches child members of this object and child members of any base 68 // classes. 69 lldb::SBValue 70 GetChildMemberWithName (const char *name); 71 72 uint32_t 73 GetNumChildren (); 74 75 bool 76 ValueIsStale (); 77 78 void * 79 GetOpaqueType(); 80 81 //void 82 //DumpType (); 83 84 lldb::SBValue 85 Dereference (); 86 87 bool 88 TypeIsPtrType (); 89 90 91protected: 92 friend class SBValueList; 93 friend class SBFrame; 94 95 SBValue (const lldb::ValueObjectSP &value_sp); 96 97#ifndef SWIG 98 99 // Mimic shared pointer... 100 lldb_private::ValueObject * 101 get() const; 102 103 lldb_private::ValueObject * 104 operator->() const; 105 106 lldb::ValueObjectSP & 107 operator*(); 108 109 const lldb::ValueObjectSP & 110 operator*() const; 111 112#endif 113 114private: 115 lldb::ValueObjectSP m_opaque_sp; 116}; 117 118} // namespace lldb 119 120#endif // LLDB_SBValue_h_ 121