diff options
| author | Enrico Granata <egranata@apple.com> | 2012-10-10 22:54:17 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2012-10-10 22:54:17 +0000 |
| commit | 10de09044e1de695faab21fecaca51352563f04e (patch) | |
| tree | 7233cdc1031ddedb9168a7183fffd0ac0e6a13af /lldb/source/API/SBValue.cpp | |
| parent | a529f8c9c285cf1ad6614bf5cd0171bf3b12cd57 (diff) | |
| download | bcm5719-llvm-10de09044e1de695faab21fecaca51352563f04e.tar.gz bcm5719-llvm-10de09044e1de695faab21fecaca51352563f04e.zip | |
<rdar://problem/12462744> Implement a new SBDeclaration class to wrap an lldb_private::Declaration - make a GetDeclaration() API on SBValue to return a declaration. This will only work for vroot variables as they are they only objects for which we currently provide a valid Declaration
llvm-svn: 165672
Diffstat (limited to 'lldb/source/API/SBValue.cpp')
| -rw-r--r-- | lldb/source/API/SBValue.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 3f2a37953be..913a447aba5 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -9,6 +9,7 @@ #include "lldb/API/SBValue.h" +#include "lldb/API/SBDeclaration.h" #include "lldb/API/SBStream.h" #include "lldb/API/SBTypeFilter.h" #include "lldb/API/SBTypeFormat.h" @@ -28,6 +29,7 @@ #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Symbol/Block.h" +#include "lldb/Symbol/Declaration.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Type.h" #include "lldb/Symbol/Variable.h" @@ -1694,6 +1696,20 @@ SBValue::GetData () return sb_data; } +lldb::SBDeclaration +SBValue::GetDeclaration () +{ + lldb::ValueObjectSP value_sp(GetSP()); + SBDeclaration decl_sb; + if (value_sp) + { + Declaration decl; + if (value_sp->GetDeclaration(decl)) + decl_sb.SetDeclaration(decl); + } + return decl_sb; +} + lldb::SBWatchpoint SBValue::Watch (bool resolve_location, bool read, bool write, SBError &error) { |

