Ejemplo n.º 1
0
        public override void PrintFrame(ScriptingContext context, StackFrame frame)
        {
            context.Print(frame);
            bool native = false;

            if (!PrintSource(context.Interpreter, frame))
            {
                native = true;
            }
            if (native)
            {
                AssemblerLine insn = frame.Thread.DisassembleInstruction(
                    frame.Method, frame.TargetAddress);

                if (insn != null)
                {
                    context.Interpreter.PrintInstruction(insn);
                }
                else
                {
                    throw new ScriptingException(
                              "Cannot disassemble instruction at address {0}.",
                              frame.TargetAddress);
                }
            }
        }
Ejemplo n.º 2
0
 public void PrintInstruction(AssemblerLine line)
 {
     if (line.Label != null)
     {
         Print("{0}:", line.Label);
     }
     Print("{0:11x}\t{1}", line.Address, line.Text);
 }
Ejemplo n.º 3
0
        public override void TargetStopped(Interpreter interpreter, StackFrame frame,
                                           AssemblerLine current_insn)
        {
            if (frame == null)
            {
                return;
            }

            if (frame != null && frame.SourceAddress != null)
            {
                Console.WriteLine("\x1A\x1A{0}:{1}:beg:{2}",
                                  frame.SourceAddress.Name, "55" /* XXX */,
                                  "0x80594d8" /* XXX */);
            }
        }
Ejemplo n.º 4
0
        public override void TargetStopped(Interpreter interpreter, StackFrame frame,
                                           AssemblerLine current_insn)
        {
            if (frame != null)
            {
                if (!PrintSource(interpreter, frame))
                {
                    native = true;
                }

                interpreter.ShowDisplays(frame);
            }
            if (native && (current_insn != null))
            {
                interpreter.PrintInstruction(current_insn);
            }
        }
Ejemplo n.º 5
0
        public override AssemblerMethod DisassembleMethod(TargetMemoryAccess memory, Method method)
        {
            lock (this) {
                ArrayList     list    = new ArrayList();
                TargetAddress current = method.StartAddress;
                while (current < method.EndAddress)
                {
                    AssemblerLine line = DisassembleInstruction(
                        memory, method, current);
                    if (line == null)
                    {
                        break;
                    }

                    current += line.InstructionSize;
                    list.Add(line);
                }

                AssemblerLine[] lines = new AssemblerLine [list.Count];
                list.CopyTo(lines, 0);

                return(new AssemblerMethod(method, lines));
            }
        }
Ejemplo n.º 6
0
 public abstract void UnhandledException(Interpreter interpreter, StackFrame frame,
                                         AssemblerLine current_insn);
Ejemplo n.º 7
0
 public abstract void TargetStopped(Interpreter interpreter, StackFrame frame,
                                    AssemblerLine current_insn);
Ejemplo n.º 8
0
 public override void UnhandledException(Interpreter interpreter, StackFrame frame,
                                         AssemblerLine insn)
 {
     TargetStopped(interpreter, frame, insn);
 }