summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-db/llvm-db.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-05 02:29:51 +0000
committerChris Lattner <sabre@nondot.org>2009-10-05 02:29:51 +0000
commitcb08fb7b8301ebaf1d91207644f6b45e3ff1c27e (patch)
tree70dbd001b44a08252e580badf2077dd625054b32 /llvm/tools/llvm-db/llvm-db.cpp
parent4002c8eeaa7d8d44408089bd64904d2e0d5cb28a (diff)
downloadbcm5719-llvm-cb08fb7b8301ebaf1d91207644f6b45e3ff1c27e.tar.gz
bcm5719-llvm-cb08fb7b8301ebaf1d91207644f6b45e3ff1c27e.zip
remove llvm-db: it is completely broken and if anyone wants to do a debugger,
they should not base it on llvm-db (which not following almost any "best practices"). llvm-svn: 83288
Diffstat (limited to 'llvm/tools/llvm-db/llvm-db.cpp')
-rw-r--r--llvm/tools/llvm-db/llvm-db.cpp102
1 files changed, 0 insertions, 102 deletions
diff --git a/llvm/tools/llvm-db/llvm-db.cpp b/llvm/tools/llvm-db/llvm-db.cpp
deleted file mode 100644
index 463a1bdf884..00000000000
--- a/llvm/tools/llvm-db/llvm-db.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//===- llvm-db.cpp - LLVM Debugger ----------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility implements a simple text-mode front-end to the LLVM debugger
-// library.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CLIDebugger.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/System/Signals.h"
-using namespace llvm;
-
-namespace {
- // Command line options for specifying the program to debug and options to use
- cl::opt<std::string>
- InputFile(cl::desc("<program>"), cl::Positional, cl::init(""));
-
- cl::list<std::string>
- InputArgs("args", cl::Positional, cl::desc("<program and arguments>"),
- cl::ZeroOrMore);
-
- // Command line options to control various directory related stuff
- cl::list<std::string>
- SourceDirectories("directory", cl::value_desc("directory"),
- cl::desc("Add directory to the search for source files"));
- cl::alias SDA("d", cl::desc("Alias for --directory"),
- cl::aliasopt(SourceDirectories));
-
- cl::opt<std::string>
- WorkingDirectory("cd", cl::desc("Use directory as current working directory"),
- cl::value_desc("directory"));
-
- // Command line options specific to the llvm-db debugger driver
- cl::opt<bool> Quiet("quiet", cl::desc("Do not print introductory messages"));
- cl::alias QA1("silent", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet));
- cl::alias QA2("q", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet));
-}
-
-//===----------------------------------------------------------------------===//
-// main Driver function
-//
-int main(int argc, char **argv, char * const *envp) {
- // Print a stack trace if we signal out.
- sys::PrintStackTraceOnErrorSignal();
- PrettyStackTraceProgram X(argc, argv);
-
- LLVMContext &Context = getGlobalContext();
- llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
- outs() << "NOTE: llvm-db is known useless right now.\n";
- try {
- cl::ParseCommandLineOptions(argc, argv,
- "llvm source-level debugger\n");
-
- if (!Quiet)
- outs() << "llvm-db: The LLVM source-level debugger\n";
-
- // Merge Inputfile and InputArgs into the InputArgs list...
- if (!InputFile.empty() && InputArgs.empty())
- InputArgs.push_back(InputFile);
-
- // Create the CLI debugger...
- CLIDebugger D(Context);
-
- // Initialize the debugger with the command line options we read...
- Debugger &Dbg = D.getDebugger();
-
- // Initialize the debugger environment.
- Dbg.initializeEnvironment(envp);
- Dbg.setWorkingDirectory(WorkingDirectory);
- for (unsigned i = 0, e = SourceDirectories.size(); i != e; ++i)
- D.addSourceDirectory(SourceDirectories[i]);
-
- if (!InputArgs.empty()) {
- try {
- D.fileCommand(InputArgs[0]);
- } catch (const std::string &Error) {
- outs() << "Error: " << Error << "\n";
- }
-
- Dbg.setProgramArguments(InputArgs.begin()+1, InputArgs.end());
- }
-
- // Now that we have initialized the debugger, run it.
- return D.run();
- } catch (const std::string& msg) {
- errs() << argv[0] << ": " << msg << "\n";
- } catch (...) {
- errs() << argv[0] << ": Unexpected unknown exception occurred.\n";
- }
- return 1;
-}
OpenPOWER on IntegriCloud