/// <summary> /// Constructs an Engine for the specified Debugger. /// </summary> /// <param name="debugger">Debugger instance.</param> public Engine(Debugger debugger) { Debugger = debugger; _pause = false; _stop = false; AllowedToContinue = new AutoResetEvent(false); }
/// <summary> /// Creates a Memory breakpoint by optaining the address from /// the Debug Information object of the Debugger. /// </summary> /// <remarks> /// If the Debug Symbol is marked as Executable, the breakpoint /// will be triggered on Execution by default; otherwise on Write. /// </remarks> /// <param name="debugger">Debugger used to access Debug Information</param> /// <param name="file">Source filename where the symbol is defined. If null or empty, /// the filename of the first Debug symbol in the table will be assumed.</param> /// <param name="line">Line within the file where the symbol is defined.</param> public MemoryBreakpoint(Debugger debugger, string file, int line) { if (debugger == null) throw new ArgumentNullException("debugger"); if (string.IsNullOrEmpty(file)) { try { file = debugger.DebugInformation.Symbols[0].Location.File; } catch { } } DebugSymbolLocation location = new DebugSymbolLocation(); location.File = file; location.Line = line; DebugSymbol symbol; if (!debugger.DebugInformation.ByLocation.TryGetValue(location, out symbol)) { throw new DebugSymbolNotFoundException(); } Address = symbol.Value; OnExecute = symbol.IsExecutable; OnWrite = !symbol.IsExecutable; Enabled = true; }
/// <summary> /// Creates a debugger for picoComputer and initializes the virtual machine. /// </summary> public override void CreateDebugger() { var vm = new VirtualMachine(new Data(), new NullIODevice()); var target = new MessyLab.Debugger.Target.Pico.PicoTarget(vm); Debugger = new MessyLab.Debugger.Debugger(target); Debugger.ExecutionInterrupt += new ExecutionInterruptHandler(HandleExecutionInterrupt); }
static void Main(string[] args) { Greet(); // TODO: When support of another architecture is added, implement architecture // selection here. Debugger debugger = new Debugger(new MessyLab.Debugger.Target.Pico.PicoTarget()); Console.WriteLine("Target architecture: picoComputer"); Cli cli = new Cli(debugger); cli.Run(); }
/// <summary> /// Creates a Memory breakpoint by optaining the address from /// the Debug Information object of the Debugger. /// </summary> /// <remarks> /// If the Debug Symbol is marked as Executable, the breakpoint /// will be triggered on Execution by default; otherwise on Write. /// </remarks> /// <param name="debugger">Debugger used to access Debug Information</param> /// <param name="line">Line within the default source file, where the symbol is defined.</param> public MemoryBreakpoint(Debugger debugger, int line) : this(debugger, string.Empty, line) { }