diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-27 08:43:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-27 08:43:52 +0000 |
commit | 43e3f7c9627d0793a31a9457d3bbbe4d8d56d331 (patch) | |
tree | 16cf7181c3a2e5e66765516273e7accb232ed444 /lib/ExecutionEngine/Interpreter/UserInput.cpp | |
parent | c25931673092b1dae646aeeac1d18f75d9640ec7 (diff) |
Implement a -trace command line option and a trace option in the interpreter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/UserInput.cpp')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/UserInput.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/Interpreter/UserInput.cpp b/lib/ExecutionEngine/Interpreter/UserInput.cpp index a24b311750..97bba9cf7d 100644 --- a/lib/ExecutionEngine/Interpreter/UserInput.cpp +++ b/lib/ExecutionEngine/Interpreter/UserInput.cpp @@ -16,7 +16,8 @@ enum CommandID { Print, Info, List, StackTrace, Up, Down, // Inspection Next, Step, Run, Finish, Call, // Control flow changes Break, Watch, // Debugging - Load, Flush + Load, Flush, + TraceOpt, ProfileOpt // Toggle features }; // CommandTable - Build a lookup table for the commands available to the user... @@ -52,6 +53,9 @@ static struct CommandTableElement { { "load" , Load }, { "flush" , Flush }, + + { "trace" , TraceOpt }, + { "profile" , ProfileOpt }, }; static CommandTableElement *CommandTableEnd = CommandTable+sizeof(CommandTable)/sizeof(CommandTable[0]); @@ -118,6 +122,16 @@ void Interpreter::handleUserInput() { finish(); // Run until it's complete break; + case TraceOpt: + Trace = !Trace; + cout << "Tracing " << (Trace ? "enabled\n" : "disabled\n"); + break; + + case ProfileOpt: + Profile = !Profile; + cout << "Profiling " << (Trace ? "enabled\n" : "disabled\n"); + break; + default: cout << "Command '" << Command << "' unimplemented!\n"; break; |