[Lldb-commits] [lldb] r251838 - Change ValueObject::IsLogicalTrue so that it starts by asking the applicable Language plugin before using the C-style rule
Enrico Granata via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 2 13:52:06 PST 2015
Author: enrico
Date: Mon Nov 2 15:52:05 2015
New Revision: 251838
URL: http://llvm.org/viewvc/llvm-project?rev=251838&view=rev
Log:
Change ValueObject::IsLogicalTrue so that it starts by asking the applicable Language plugin before using the C-style rule
Modified:
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Target/Language.cpp
Modified: lldb/trunk/include/lldb/Target/Language.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=251838&r1=251837&r2=251838&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Mon Nov 2 15:52:05 2015
@@ -119,6 +119,10 @@ public:
virtual DumpValueObjectOptions::DeclPrintingHelper
GetDeclPrintingHelper ();
+ virtual LazyBool
+ IsLogicalTrue (ValueObject& valobj,
+ Error& error);
+
// These are accessors for general information about the Languages lldb knows about:
static lldb::LanguageType
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=251838&r1=251837&r2=251838&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Mon Nov 2 15:52:05 2015
@@ -47,6 +47,7 @@
#include "lldb/Symbol/Type.h"
#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Target/Language.h"
#include "lldb/Target/LanguageRuntime.h"
#include "lldb/Target/ObjCLanguageRuntime.h"
#include "lldb/Target/Process.h"
@@ -515,6 +516,20 @@ ValueObject::ResolveValue (Scalar &scala
bool
ValueObject::IsLogicalTrue (Error& error)
{
+ if (Language *language = Language::FindPlugin(GetObjectRuntimeLanguage()))
+ {
+ LazyBool is_logical_true = language->IsLogicalTrue(*this, error);
+ switch (is_logical_true)
+ {
+ case eLazyBoolYes:
+ case eLazyBoolNo:
+ return (is_logical_true == true);
+ case eLazyBoolCalculate:
+ default:
+ break;
+ }
+ }
+
Scalar scalar_value;
if (!ResolveValue (scalar_value))
Modified: lldb/trunk/source/Target/Language.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Language.cpp?rev=251838&r1=251837&r2=251838&view=diff
==============================================================================
--- lldb/trunk/source/Target/Language.cpp (original)
+++ lldb/trunk/source/Target/Language.cpp Mon Nov 2 15:52:05 2015
@@ -351,6 +351,13 @@ Language::GetDeclPrintingHelper ()
return nullptr;
}
+LazyBool
+Language::IsLogicalTrue (ValueObject& valobj,
+ Error& error)
+{
+ return eLazyBoolCalculate;
+}
+
//----------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------
More information about the lldb-commits
mailing list