summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2018-04-13 18:37:14 +0000
committerDavide Italiano <davide@freebsd.org>2018-04-13 18:37:14 +0000
commit0df817aac59d789ba8879b597650b85f70eb3ebb (patch)
treea4015d529ff57a52953ff25318bb6738b2cfee85
parent197194b6c9829b9cdc5222939dd8cb25af05b3ca (diff)
downloadbcm5719-llvm-0df817aac59d789ba8879b597650b85f70eb3ebb.tar.gz
bcm5719-llvm-0df817aac59d789ba8879b597650b85f70eb3ebb.zip
[Command] Simplify the code and make it less error prone. NFCI.
Pointed out by Jim. llvm-svn: 330047
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp5
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp4
2 files changed, 2 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 5e2810e4adb..fc62b396839 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -623,10 +623,7 @@ bool CommandObjectExpression::DoExecute(const char *command,
if (expr == nullptr)
expr = command;
- Target *target = m_interpreter.GetExecutionContext().GetTargetPtr();
- if (!target)
- target = GetDummyTarget();
-
+ Target *target = GetSelectedOrDummyTarget();
if (EvaluateExpression(expr, &(result.GetOutputStream()),
&(result.GetErrorStream()), &result)) {
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 66fcc9c88e2..b40cd090a5c 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -722,9 +722,7 @@ protected:
// Increment statistics.
bool res = result.Succeeded();
- Target *target = m_exe_ctx.GetTargetPtr();
- if (!target)
- target = GetDummyTarget();
+ Target *target = GetSelectedOrDummyTarget();
if (res)
target->IncrementStats(StatisticKind::FrameVarSuccess);
else
OpenPOWER on IntegriCloud