[Lldb-commits] [lldb] r328378 - [Commands] Add a (currently empty) `stats` command.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Fri Mar 23 14:55:49 PDT 2018
Author: davide
Date: Fri Mar 23 14:55:48 2018
New Revision: 328378
URL: http://llvm.org/viewvc/llvm-project?rev=328378&view=rev
Log:
[Commands] Add a (currently empty) `stats` command.
This one will be used to print statistics about lldb sessions
(including, e.g. number of expression evaluation succeeded or
failed). I decided to commit the skeleton first so that we have
a clean reference on how a command should be implemented.
My future commits are going to populate this command and test
it.
<rdar://problem/36555975>
Added:
lldb/trunk/source/Commands/CommandObjectStats.cpp
lldb/trunk/source/Commands/CommandObjectStats.h
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Commands/CMakeLists.txt
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=328378&r1=328377&r2=328378&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Mar 23 14:55:48 2018
@@ -765,6 +765,8 @@
4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };
54067BF11DF2041B00749AA5 /* UBSanRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54067BEC1DF2034B00749AA5 /* UBSanRuntime.cpp */; };
6B74D89B200696BB0074051B /* Environment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22DC561920064C9600A7E9E8 /* Environment.cpp */; };
+ 6B8894792065AE5D002E5C59 /* CommandObjectStats.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6B8894772065AE5C002E5C59 /* CommandObjectStats.h */; };
+ 6B88947A2065AE5D002E5C59 /* CommandObjectStats.cpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6B8894782065AE5C002E5C59 /* CommandObjectStats.cpp */; };
6D0F61431C80AAAE00A4ECEE /* JavaASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61411C80AAAA00A4ECEE /* JavaASTContext.cpp */; };
6D0F61481C80AAD600A4ECEE /* DWARFASTParserJava.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61441C80AACF00A4ECEE /* DWARFASTParserJava.cpp */; };
6D0F614E1C80AB0700A4ECEE /* JavaLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F614A1C80AB0400A4ECEE /* JavaLanguageRuntime.cpp */; };
@@ -1266,6 +1268,8 @@
dstPath = "$(DEVELOPER_INSTALL_DIR)/usr/share/man/man1";
dstSubfolderSpec = 0;
files = (
+ 6B88947A2065AE5D002E5C59 /* CommandObjectStats.cpp in CopyFiles */,
+ 6B8894792065AE5D002E5C59 /* CommandObjectStats.h in CopyFiles */,
7F94D7182040A13A006EE3EA /* CleanUpTest.cpp in CopyFiles */,
AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */,
);
@@ -2667,6 +2671,8 @@
69A01E1C1236C5D400C660B5 /* Host.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Host.cpp; sourceTree = "<group>"; };
69A01E1F1236C5D400C660B5 /* Symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Symbols.cpp; sourceTree = "<group>"; };
6B74D89C2006972D0074051B /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Environment.h; path = include/lldb/Utility/Environment.h; sourceTree = "<group>"; };
+ 6B8894772065AE5C002E5C59 /* CommandObjectStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectStats.h; path = source/Commands/CommandObjectStats.h; sourceTree = "<group>"; };
+ 6B8894782065AE5C002E5C59 /* CommandObjectStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectStats.cpp; path = source/Commands/CommandObjectStats.cpp; sourceTree = "<group>"; };
6D0F613C1C80AA8900A4ECEE /* DebugMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebugMacros.h; path = include/lldb/Symbol/DebugMacros.h; sourceTree = "<group>"; };
6D0F613D1C80AA8900A4ECEE /* JavaASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaASTContext.h; path = include/lldb/Symbol/JavaASTContext.h; sourceTree = "<group>"; };
6D0F61411C80AAAA00A4ECEE /* JavaASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaASTContext.cpp; path = source/Symbol/JavaASTContext.cpp; sourceTree = "<group>"; };
@@ -5165,6 +5171,8 @@
26BC7D0D10F1B71D00F91463 /* Commands */ = {
isa = PBXGroup;
children = (
+ 6B8894782065AE5C002E5C59 /* CommandObjectStats.cpp */,
+ 6B8894772065AE5C002E5C59 /* CommandObjectStats.h */,
4CA9637A11B6E99A00780E28 /* CommandObjectApropos.h */,
4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */,
26BC7D1410F1B76300F91463 /* CommandObjectBreakpoint.h */,
Modified: lldb/trunk/source/Commands/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CMakeLists.txt?rev=328378&r1=328377&r2=328378&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CMakeLists.txt (original)
+++ lldb/trunk/source/Commands/CMakeLists.txt Fri Mar 23 14:55:48 2018
@@ -20,6 +20,7 @@ add_lldb_library(lldbCommands
CommandObjectRegister.cpp
CommandObjectSettings.cpp
CommandObjectSource.cpp
+ CommandObjectStats.cpp
CommandObjectTarget.cpp
CommandObjectThread.cpp
CommandObjectType.cpp
Added: lldb/trunk/source/Commands/CommandObjectStats.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectStats.cpp?rev=328378&view=auto
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectStats.cpp (added)
+++ lldb/trunk/source/Commands/CommandObjectStats.cpp Fri Mar 23 14:55:48 2018
@@ -0,0 +1,28 @@
+//===-- CommandObjectStats.cpp ----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CommandObjectStats.h"
+#include "lldb/Host/Host.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+CommandObjectStats::CommandObjectStats(CommandInterpreter &interpreter)
+ : CommandObjectParsed(
+ interpreter, "stats", "Print statistics about a debugging session",
+ nullptr) {
+}
+
+bool CommandObjectStats::DoExecute(Args &command, CommandReturnObject &result) {
+ return true;
+}
+
+CommandObjectStats::~CommandObjectStats() {}
Added: lldb/trunk/source/Commands/CommandObjectStats.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectStats.h?rev=328378&view=auto
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectStats.h (added)
+++ lldb/trunk/source/Commands/CommandObjectStats.h Fri Mar 23 14:55:48 2018
@@ -0,0 +1,27 @@
+//===-- CommandObjectStats.h ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandObjectStats_h_
+#define liblldb_CommandObjectStats_h_
+
+#include "lldb/Interpreter/CommandObject.h"
+
+namespace lldb_private {
+class CommandObjectStats : public CommandObjectParsed {
+public:
+ CommandObjectStats(CommandInterpreter &interpreter);
+
+ ~CommandObjectStats() override;
+
+protected:
+ bool DoExecute(Args &command, CommandReturnObject &result) override;
+};
+} // namespace lldb_private
+
+#endif // liblldb_CommandObjectLanguage_h_
Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=328378&r1=328377&r2=328378&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Fri Mar 23 14:55:48 2018
@@ -33,6 +33,7 @@
#include "../Commands/CommandObjectRegister.h"
#include "../Commands/CommandObjectSettings.h"
#include "../Commands/CommandObjectSource.h"
+#include "../Commands/CommandObjectStats.h"
#include "../Commands/CommandObjectTarget.h"
#include "../Commands/CommandObjectThread.h"
#include "../Commands/CommandObjectType.h"
@@ -424,6 +425,7 @@ void CommandInterpreter::LoadCommandDict
CommandObjectSP(new CommandObjectMultiwordSettings(*this));
m_command_dict["source"] =
CommandObjectSP(new CommandObjectMultiwordSource(*this));
+ m_command_dict["stats"] = CommandObjectSP(new CommandObjectStats(*this));
m_command_dict["target"] =
CommandObjectSP(new CommandObjectMultiwordTarget(*this));
m_command_dict["thread"] =
More information about the lldb-commits
mailing list