mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
7a045d0c0d
This commit does the following: * It drops `revamb-dump` and transforms all the passes it featured in passes that can be used directly from `opt`. * It rename `revamb` to `revng-lift`. * It introduces a script called `revng` which acts as a driver for the whole rev.ng project. It replaces `translate`, `revcc`, `csv-to-ld-options` and `revamb-dump`, since it offers an `opt` subcommand which allows to easily invoke all the analysis passes. * It makes the project a CMake package that can be easily used externally. * It allows to easily create libraries of analysis to use through `revng-opt`.
34 lines
849 B
C++
34 lines
849 B
C++
/// \file debug.cpp
|
|
/// \brief Implementation of the debug framework
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
// Standard includes
|
|
#include <fstream>
|
|
#include <iostream>
|
|
|
|
// Local libraries includes
|
|
#include "revng/Support/CommandLine.h"
|
|
|
|
namespace cl = llvm::cl;
|
|
|
|
cl::OptionCategory MainCategory("Options", "");
|
|
|
|
cl::opt<bool> UseDebugSymbols("use-debug-symbols",
|
|
cl::desc("use section and symbol function "
|
|
"informations, if available"),
|
|
cl::cat(MainCategory));
|
|
|
|
std::ostream &pathToStream(const std::string &Path, std::ofstream &File) {
|
|
if (Path[0] == '-' && Path[1] == '\0') {
|
|
return std::cout;
|
|
} else {
|
|
if (File.is_open())
|
|
File.close();
|
|
File.open(Path);
|
|
return File;
|
|
}
|
|
}
|