From 10de09044e1de695faab21fecaca51352563f04e Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 10 Oct 2012 22:54:17 +0000 Subject: 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 --- lldb/source/API/SBValue.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lldb/source/API/SBValue.cpp') 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) { -- cgit v1.2.3