lldb::SBProcess GetProcess();
+ //------------------------------------------------------------------
+ /// Sets whether we should collect statistics on lldb or not.
+ ///
+ /// @param[in] v
+ /// A boolean to control the collection.
+ /// @return
+ /// void
+ //------------------------------------------------------------------
+ void SetCollectingStats(bool v);
+
+ //------------------------------------------------------------------
+ /// Returns whether statistics collection are enabled.
+ ///
+ /// @return
+ /// true if statistics are currently being collected, false
+ /// otherwise.
+ //------------------------------------------------------------------
+ bool GetCollectingStats();
+
+ //------------------------------------------------------------------
+ /// Returns a dump of the collected statistics.
+ ///
+ /// @return
+ /// A SBStructuredData with the statistics collected.
+ //------------------------------------------------------------------
lldb::SBStructuredData GetStatistics();
//------------------------------------------------------------------
self.build()
exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
+
+ # Test enabling/disabling stats
+ self.assertFalse(target.GetCollectingStats())
+ target.SetCollectingStats(True)
+ self.assertTrue(target.GetCollectingStats())
+ target.SetCollectingStats(False)
+ self.assertFalse(target.GetCollectingStats())
+
+ # Test the function to get the statistics in JSON'ish.
stats = target.GetStatistics()
stream = lldb.SBStream()
res = stats.GetAsJSON(stream)
void
SetLaunchInfo (const lldb::SBLaunchInfo &launch_info);
+ void SetCollectingStats(bool v);
+
+ bool GetCollectingStats();
+
lldb::SBStructuredData GetStatistics();
bool
return data;
}
+void SBTarget::SetCollectingStats(bool v) {
+ TargetSP target_sp(GetSP());
+ if (!target_sp)
+ return;
+ return target_sp->SetCollectingStats(v);
+}
+
+bool SBTarget::GetCollectingStats() {
+ TargetSP target_sp(GetSP());
+ if (!target_sp)
+ return false;
+ return target_sp->GetCollectingStats();
+}
+
+
SBProcess SBTarget::LoadCore(const char *core_file) {
lldb::SBError error; // Ignored
return LoadCore(core_file, error);