mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user