aboutsummaryrefslogtreecommitdiffstats
path: root/source/Commands/CommandObjectStats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Commands/CommandObjectStats.cpp')
-rw-r--r--source/Commands/CommandObjectStats.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/Commands/CommandObjectStats.cpp b/source/Commands/CommandObjectStats.cpp
index a73c2a8e0409..e3a1f9433662 100644
--- a/source/Commands/CommandObjectStats.cpp
+++ b/source/Commands/CommandObjectStats.cpp
@@ -26,15 +26,15 @@ public:
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
- Target *target = GetSelectedOrDummyTarget();
+ Target &target = GetSelectedOrDummyTarget();
- if (target->GetCollectingStats()) {
+ if (target.GetCollectingStats()) {
result.AppendError("statistics already enabled");
result.SetStatus(eReturnStatusFailed);
return false;
}
- target->SetCollectingStats(true);
+ target.SetCollectingStats(true);
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
}
@@ -51,15 +51,15 @@ public:
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
- Target *target = GetSelectedOrDummyTarget();
+ Target &target = GetSelectedOrDummyTarget();
- if (!target->GetCollectingStats()) {
+ if (!target.GetCollectingStats()) {
result.AppendError("need to enable statistics before disabling them");
result.SetStatus(eReturnStatusFailed);
return false;
}
- target->SetCollectingStats(false);
+ target.SetCollectingStats(false);
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
}
@@ -75,10 +75,10 @@ public:
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
- Target *target = GetSelectedOrDummyTarget();
+ Target &target = GetSelectedOrDummyTarget();
uint32_t i = 0;
- for (auto &stat : target->GetStatistics()) {
+ for (auto &stat : target.GetStatistics()) {
result.AppendMessageWithFormat(
"%s : %u\n",
lldb_private::GetStatDescription(static_cast<lldb_private::StatisticKind>(i))