summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/API/SBTarget.h3
-rw-r--r--lldb/scripts/interface/SBTarget.i4
-rw-r--r--lldb/source/API/SBTarget.cpp13
3 files changed, 20 insertions, 0 deletions
diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h
index dcca4e7b3a1..2ca0b124ce0 100644
--- a/lldb/include/lldb/API/SBTarget.h
+++ b/lldb/include/lldb/API/SBTarget.h
@@ -769,6 +769,9 @@ public:
GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
lldb::SBValue
+ EvaluateExpression (const char *expr);
+
+ lldb::SBValue
EvaluateExpression (const char *expr, const SBExpressionOptions &options);
lldb::addr_t
diff --git a/lldb/scripts/interface/SBTarget.i b/lldb/scripts/interface/SBTarget.i
index 311b469c78b..6cbeba0782f 100644
--- a/lldb/scripts/interface/SBTarget.i
+++ b/lldb/scripts/interface/SBTarget.i
@@ -739,7 +739,11 @@ public:
operator != (const lldb::SBTarget &rhs) const;
lldb::SBValue
+ EvaluateExpression (const char *expr);
+
+ lldb::SBValue
EvaluateExpression (const char *expr, const lldb::SBExpressionOptions &options);
+
%pythoncode %{
class modules_access(object):
'''A helper object that will lazily hand out lldb.SBModule objects for a target when supplied an index, or by full or partial path.'''
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 923885223a5..6597d4e77c7 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -2293,6 +2293,19 @@ SBTarget::FindSymbols (const char *name, lldb::SymbolType symbol_type)
}
+lldb::SBValue
+SBTarget::EvaluateExpression (const char *expr)
+{
+ TargetSP target_sp(GetSP());
+ if (!target_sp)
+ return SBValue();
+
+ SBExpressionOptions options;
+ lldb::DynamicValueType fetch_dynamic_value = target_sp->GetPreferDynamicValue();
+ options.SetFetchDynamicValue (fetch_dynamic_value);
+ options.SetUnwindOnError (true);
+ return EvaluateExpression(expr, options);
+}
lldb::SBValue
SBTarget::EvaluateExpression (const char *expr, const SBExpressionOptions &options)
OpenPOWER on IntegriCloud