[llvm-commits] CVS: llvm/lib/Debugger/Debugger.cpp
Chris Lattner
sabre at nondot.org
Sat May 5 22:19:11 PDT 2007
Changes in directory llvm/lib/Debugger:
Debugger.cpp updated: 1.7 -> 1.8
---
Log message:
teach this to read from bitcode files
---
Diffs of the changes: (+13 -1)
Debugger.cpp | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletion(-)
Index: llvm/lib/Debugger/Debugger.cpp
diff -u llvm/lib/Debugger/Debugger.cpp:1.7 llvm/lib/Debugger/Debugger.cpp:1.8
--- llvm/lib/Debugger/Debugger.cpp:1.7 Fri Aug 25 12:43:11 2006
+++ llvm/lib/Debugger/Debugger.cpp Sun May 6 00:18:53 2007
@@ -15,11 +15,15 @@
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/Bytecode/Reader.h"
+#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Debugger/InferiorProcess.h"
+#include "llvm/Support/MemoryBuffer.h"
#include "llvm/ADT/StringExtras.h"
#include <memory>
using namespace llvm;
+static bool Bitcode = false;
+
/// Debugger constructor - Initialize the debugger to its initial, empty, state.
///
Debugger::Debugger() : Environment(0), Program(0), Process(0) {
@@ -45,7 +49,15 @@
static Module *
getMaterializedModuleProvider(const std::string &Filename) {
- return ParseBytecodeFile(Filename);
+ if (Bitcode) {
+ return ParseBytecodeFile(Filename);
+ } else {
+ std::auto_ptr<MemoryBuffer> Buffer;
+ Buffer.reset(MemoryBuffer::getFileOrSTDIN(&Filename[0], Filename.size()));
+ if (Buffer.get())
+ return ParseBitcodeFile(Buffer.get());
+ return 0;
+ }
}
/// loadProgram - If a program is currently loaded, unload it. Then search
More information about the llvm-commits
mailing list