LLVM API Documentation
#include <Debugger.h>
Collaboration diagram for llvm::Debugger:
Public Member Functions | |
Debugger () | |
~Debugger () | |
void | initializeEnvironment (const char *const *envp) |
void | setWorkingDirectory (const std::string &Dir) |
template<typename It> | |
void | setProgramArguments (It I, It E) |
unsigned | getNumProgramArguments () const |
const std::string & | getProgramArgument (unsigned i) const |
bool | isProgramLoaded () const |
Module * | getProgram () const |
std::string | getProgramPath () const |
void | loadProgram (const std::string &Path) |
void | unloadProgram () |
bool | isProgramRunning () const |
const InferiorProcess & | getRunningProcess () const |
void | createProgram () |
void | killProgram () |
void | stepProgram () |
void | nextProgram () |
void | finishProgram (void *Frame) |
void | contProgram () |
Definition at line 28 of file Debugger.h.
Debugger::Debugger | ( | ) |
Debugger constructor - Initialize the debugger to its initial, empty, state.
Definition at line 25 of file Debugger.cpp.
Debugger::~Debugger | ( | ) |
void Debugger::contProgram | ( | ) |
contProgram - Implement the 'cont' command, continuing execution until the next breakpoint is encountered.
Definition at line 220 of file Debugger.cpp.
References llvm::InferiorProcessDead::getExitCode(), isProgramRunning(), llvm::itostr(), and killProgram().
void Debugger::createProgram | ( | ) |
createProgram - Create an instance of the currently loaded program, killing off any existing one. This creates the program and stops it at the first possible moment. If there is no program loaded or if there is a problem starting the program, this method throws an exception.
Definition at line 101 of file Debugger.cpp.
References llvm::InferiorProcess::create(), getProgramPath(), isProgramLoaded(), and killProgram().
void Debugger::finishProgram | ( | void * | Frame | ) |
finishProgram - Implement the 'finish' command, continuing execution until the specified frame ID returns.
Definition at line 204 of file Debugger.cpp.
References llvm::InferiorProcessDead::getExitCode(), isProgramRunning(), llvm::itostr(), and killProgram().
unsigned llvm::Debugger::getNumProgramArguments | ( | ) | const [inline] |
Definition at line 70 of file Debugger.h.
Module* llvm::Debugger::getProgram | ( | ) | const [inline] |
getProgram - Return the LLVM module corresponding to the program.
Definition at line 86 of file Debugger.h.
const std::string& llvm::Debugger::getProgramArgument | ( | unsigned | i | ) | const [inline] |
Definition at line 71 of file Debugger.h.
std::string Debugger::getProgramPath | ( | ) | const |
getProgramPath - Get the path of the currently loaded program, or an empty string if none is loaded.
Definition at line 42 of file Debugger.cpp.
Referenced by createProgram().
const InferiorProcess& llvm::Debugger::getRunningProcess | ( | ) | const [inline] |
getRunningProcess - If there is no program running, throw an exception. Otherwise return the running process so that it can be inspected by the debugger.
Definition at line 118 of file Debugger.h.
void llvm::Debugger::initializeEnvironment | ( | const char *const * | envp | ) | [inline] |
initializeEnvironment - Specify the environment the program should run with. This is used to initialize the environment of the program to the environment of the debugger.
Definition at line 56 of file Debugger.h.
bool llvm::Debugger::isProgramLoaded | ( | ) | const [inline] |
isProgramLoaded - Return true if there is a program currently loaded.
Definition at line 82 of file Debugger.h.
Referenced by createProgram(), and unloadProgram().
bool llvm::Debugger::isProgramRunning | ( | ) | const [inline] |
isProgramRunning - Return true if a program is loaded and has a currently active instance.
Definition at line 113 of file Debugger.h.
Referenced by contProgram(), finishProgram(), nextProgram(), and stepProgram().
void Debugger::killProgram | ( | ) |
killProgram - If the program is currently executing, kill off the process and free up any state related to the currently running program. If there is no program currently running, this just silently succeeds. If something horrible happens when killing the program, an exception gets thrown.
Definition at line 125 of file Debugger.cpp.
Referenced by contProgram(), createProgram(), finishProgram(), nextProgram(), stepProgram(), unloadProgram(), and ~Debugger().
void Debugger::loadProgram | ( | const std::string & | Path | ) |
loadProgram - If a program is currently loaded, unload it. Then search the PATH for the specified program, loading it when found. If the specified program cannot be found, an exception is thrown to indicate the error.
Definition at line 63 of file Debugger.cpp.
References getMaterializedModuleProvider(), and llvm::getToken().
void Debugger::nextProgram | ( | ) |
nextProgram - Implement the 'next' command, continuing execution until the next possible stop point that is in the current function.
Definition at line 154 of file Debugger.cpp.
References llvm::InferiorProcessDead::getExitCode(), isProgramRunning(), llvm::itostr(), and killProgram().
void llvm::Debugger::setProgramArguments | ( | It | I, | |
It | E | |||
) | [inline] |
Definition at line 67 of file Debugger.h.
void llvm::Debugger::setWorkingDirectory | ( | const std::string & | Dir | ) | [inline] |
setWorkingDirectory - Specify the working directory for the program to be started from.
Definition at line 62 of file Debugger.h.
void Debugger::stepProgram | ( | ) |
stepProgram - Implement the 'step' command, continuing execution until the next possible stop point.
Definition at line 138 of file Debugger.cpp.
References llvm::InferiorProcessDead::getExitCode(), isProgramRunning(), llvm::itostr(), and killProgram().
void Debugger::unloadProgram | ( | ) |
unloadProgram - If a program is running, kill it, then unload all traces of the current program. If no program is loaded, this method silently succeeds.
Definition at line 89 of file Debugger.cpp.
References isProgramLoaded(), and killProgram().
Referenced by ~Debugger().