[Lldb-commits] [lldb] r328368 - [Command] Remove dead code for the syntax command.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Fri Mar 23 13:58:06 PDT 2018
Author: davide
Date: Fri Mar 23 13:58:05 2018
New Revision: 328368
URL: http://llvm.org/viewvc/llvm-project?rev=328368&view=rev
Log:
[Command] Remove dead code for the syntax command.
I'm going to add a new commend so I figured I could do
some spring cleaning.
Removed:
lldb/trunk/source/Commands/CommandObjectSyntax.cpp
lldb/trunk/source/Commands/CommandObjectSyntax.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=328368&r1=328367&r2=328368&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Mar 23 13:58:05 2018
@@ -396,7 +396,6 @@
2689002313353DDE00698AC0 /* CommandObjectScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3D10F1B84700F91463 /* CommandObjectScript.cpp */; };
2689002413353DDE00698AC0 /* CommandObjectSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */; };
2689002513353DDE00698AC0 /* CommandObjectSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */; };
- 2689002613353DDE00698AC0 /* CommandObjectSyntax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4510F1B84700F91463 /* CommandObjectSyntax.cpp */; };
2689002713353DDE00698AC0 /* CommandObjectTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269416AD119A024800FF2715 /* CommandObjectTarget.cpp */; };
2689002813353DDE00698AC0 /* CommandObjectThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */; };
2689002913353DDE00698AC0 /* CommandObjectVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */; };
@@ -2114,7 +2113,6 @@
26BC7D2410F1B76300F91463 /* CommandObjectScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectScript.h; path = source/Interpreter/CommandObjectScript.h; sourceTree = "<group>"; };
26BC7D2710F1B76300F91463 /* CommandObjectSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSettings.h; path = source/Commands/CommandObjectSettings.h; sourceTree = "<group>"; };
26BC7D2910F1B76300F91463 /* CommandObjectSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSource.h; path = source/Commands/CommandObjectSource.h; sourceTree = "<group>"; };
- 26BC7D2C10F1B76300F91463 /* CommandObjectSyntax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSyntax.h; path = source/Commands/CommandObjectSyntax.h; sourceTree = "<group>"; };
26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectThread.h; path = source/Commands/CommandObjectThread.h; sourceTree = "<group>"; };
26BC7D5010F1B77400F91463 /* Address.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Address.h; path = include/lldb/Core/Address.h; sourceTree = "<group>"; };
26BC7D5110F1B77400F91463 /* AddressRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressRange.h; path = include/lldb/Core/AddressRange.h; sourceTree = "<group>"; };
@@ -2197,7 +2195,6 @@
26BC7E3D10F1B84700F91463 /* CommandObjectScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectScript.cpp; path = source/Interpreter/CommandObjectScript.cpp; sourceTree = "<group>"; };
26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSettings.cpp; path = source/Commands/CommandObjectSettings.cpp; sourceTree = "<group>"; };
26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSource.cpp; path = source/Commands/CommandObjectSource.cpp; sourceTree = "<group>"; };
- 26BC7E4510F1B84700F91463 /* CommandObjectSyntax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSyntax.cpp; path = source/Commands/CommandObjectSyntax.cpp; sourceTree = "<group>"; };
26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectThread.cpp; path = source/Commands/CommandObjectThread.cpp; sourceTree = "<group>"; };
26BC7E6910F1B85900F91463 /* Address.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Address.cpp; path = source/Core/Address.cpp; sourceTree = "<group>"; };
26BC7E6A10F1B85900F91463 /* AddressRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressRange.cpp; path = source/Core/AddressRange.cpp; sourceTree = "<group>"; };
@@ -5215,8 +5212,6 @@
26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */,
26BC7D2910F1B76300F91463 /* CommandObjectSource.h */,
26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */,
- 26BC7D2C10F1B76300F91463 /* CommandObjectSyntax.h */,
- 26BC7E4510F1B84700F91463 /* CommandObjectSyntax.cpp */,
269416AE119A024800FF2715 /* CommandObjectTarget.h */,
269416AD119A024800FF2715 /* CommandObjectTarget.cpp */,
26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */,
@@ -7562,7 +7557,6 @@
2689002313353DDE00698AC0 /* CommandObjectScript.cpp in Sources */,
2689002413353DDE00698AC0 /* CommandObjectSettings.cpp in Sources */,
2689002513353DDE00698AC0 /* CommandObjectSource.cpp in Sources */,
- 2689002613353DDE00698AC0 /* CommandObjectSyntax.cpp in Sources */,
267A48011B1411E40021A5BC /* XML.cpp in Sources */,
AF8AD6371BEC28C400150209 /* PlatformRemoteAppleTV.cpp in Sources */,
6D0F614E1C80AB0700A4ECEE /* JavaLanguageRuntime.cpp in Sources */,
Modified: lldb/trunk/source/Commands/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CMakeLists.txt?rev=328368&r1=328367&r2=328368&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CMakeLists.txt (original)
+++ lldb/trunk/source/Commands/CMakeLists.txt Fri Mar 23 13:58:05 2018
@@ -21,7 +21,6 @@ add_lldb_library(lldbCommands
CommandObjectRegister.cpp
CommandObjectSettings.cpp
CommandObjectSource.cpp
- CommandObjectSyntax.cpp
CommandObjectTarget.cpp
CommandObjectThread.cpp
CommandObjectType.cpp
Removed: lldb/trunk/source/Commands/CommandObjectSyntax.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSyntax.cpp?rev=328367&view=auto
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSyntax.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSyntax.cpp (removed)
@@ -1,103 +0,0 @@
-//===-- CommandObjectSyntax.cpp ---------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "CommandObjectSyntax.h"
-#include "CommandObjectHelp.h"
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandObjectMultiword.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Interpreter/Options.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-//-------------------------------------------------------------------------
-// CommandObjectSyntax
-//-------------------------------------------------------------------------
-
-CommandObjectSyntax::CommandObjectSyntax(CommandInterpreter &interpreter)
- : CommandObjectParsed(
- interpreter, "syntax",
- "Shows the correct syntax for a given debugger command.",
- "syntax <command>") {
- CommandArgumentEntry arg;
- CommandArgumentData command_arg;
-
- // Define the first (and only) variant of this arg.
- command_arg.arg_type = eArgTypeCommandName;
- command_arg.arg_repetition = eArgRepeatPlain;
-
- // There is only one variant this argument could be; put it into the argument
- // entry.
- arg.push_back(command_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
-}
-
-CommandObjectSyntax::~CommandObjectSyntax() = default;
-
-bool CommandObjectSyntax::DoExecute(Args &command,
- CommandReturnObject &result) {
- CommandObject::CommandMap::iterator pos;
- CommandObject *cmd_obj;
- const size_t argc = command.GetArgumentCount();
-
- if (argc == 0) {
- result.AppendError("Must call 'syntax' with a valid command.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- cmd_obj = m_interpreter.GetCommandObject(command[0].ref);
- bool all_okay = llvm::all_of(
- command.entries().drop_front(), [&cmd_obj](const Args::ArgEntry &e) {
- if (!cmd_obj || !cmd_obj->IsMultiwordObject())
- return false;
-
- if (!(cmd_obj = cmd_obj->GetSubcommandObject(e.ref)))
- return false;
-
- return true;
- });
-
- if (!all_okay) {
- std::string cmd_string;
- command.GetCommandString(cmd_string);
-
- StreamString error_msg_stream;
- const bool generate_apropos = true;
- const bool generate_type_lookup = false;
- CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(
- &error_msg_stream, cmd_string, "", "", generate_apropos,
- generate_type_lookup);
- result.AppendErrorWithFormat("%s", error_msg_stream.GetData());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- Stream &output_strm = result.GetOutputStream();
- if (cmd_obj->GetOptions() != nullptr) {
- output_strm.Printf("\nSyntax: %s\n", cmd_obj->GetSyntax().str().c_str());
- output_strm.Printf(
- "(Try 'help %s' for more information on command options syntax.)\n",
- cmd_obj->GetCommandName().str().c_str());
- result.SetStatus(eReturnStatusSuccessFinishNoResult);
- } else {
- output_strm.Printf("\nSyntax: %s\n", cmd_obj->GetSyntax().str().c_str());
- result.SetStatus(eReturnStatusSuccessFinishNoResult);
- }
-
- return result.Succeeded();
-}
Removed: lldb/trunk/source/Commands/CommandObjectSyntax.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSyntax.h?rev=328367&view=auto
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSyntax.h (original)
+++ lldb/trunk/source/Commands/CommandObjectSyntax.h (removed)
@@ -1,37 +0,0 @@
-//===-- CommandObjectSyntax.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_CommandObjectSyntax_h_
-#define liblldb_CommandObjectSyntax_h_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Interpreter/CommandObject.h"
-
-namespace lldb_private {
-
-//-------------------------------------------------------------------------
-// CommandObjectSyntax
-//-------------------------------------------------------------------------
-
-class CommandObjectSyntax : public CommandObjectParsed {
-public:
- CommandObjectSyntax(CommandInterpreter &interpreter);
-
- ~CommandObjectSyntax() override;
-
-protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override;
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_CommandObjectSyntax_h_
Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=328368&r1=328367&r2=328368&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Fri Mar 23 13:58:05 2018
@@ -34,7 +34,6 @@
#include "../Commands/CommandObjectRegister.h"
#include "../Commands/CommandObjectSettings.h"
#include "../Commands/CommandObjectSource.h"
-#include "../Commands/CommandObjectSyntax.h"
#include "../Commands/CommandObjectTarget.h"
#include "../Commands/CommandObjectThread.h"
#include "../Commands/CommandObjectType.h"
More information about the lldb-commits
mailing list