Наследование: DebuggerMarshalByRefObject, ISymbolLookup, IComparable
Пример #1
0
        public AssemblerMethod(Method method, AssemblerLine[] lines)
        {
            this.method = method;
            this.lines = lines;
            addresses = new ArrayList ();

            ArrayList contents = new ArrayList ();
            foreach (AssemblerLine line in lines) {
                if (line.Label != null) {
                    if (end_row > 0) {
                        contents.Add ("");
                        end_row++;
                    } else
                        start_row++;
                    contents.Add (String.Format ("{0}:", line.Label));
                    end_row++;
                }

                addresses.Add (new LineEntry (line.Address, 0, ++end_row));
                contents.Add (String.Format ("  {0:x}   {1}", line.Address, line.Text));
            }

            string[] text = new string [contents.Count];
            contents.CopyTo (text);

            buffer = new SourceBuffer (method.Name, text);
        }
Пример #2
0
        public override AssemblerLine DisassembleInstruction(TargetMemoryAccess memory,
								      Method method,
								      TargetAddress address)
        {
            lock (this) {
                memory_exception = null;
                sb = new StringBuilder ();

                address = new TargetAddress (memory.AddressDomain, address.Address);

                string insn;
                int insn_size;
                try {
                    this.memory = memory;
                    current_method = method;
                    insn_size = bfd_glue_disassemble_insn (handle, address.Address);
                    if (memory_exception != null)
                        return null;
                    insn = sb.ToString ();
                } finally {
                    sb = null;
                    this.memory = null;
                    memory_exception = null;
                    current_method = null;
                }

                Symbol label = null;
                if (process != null)
                    label = process.SymbolTableManager.SimpleLookup (address, true);

                string label_name = null;
                if (label != null)
                    label_name = label.ToString ();

                return new AssemblerLine (
                    label_name, address, (byte) insn_size, insn);
            }
        }
Пример #3
0
        // <summary>
        //   Disassemble one method.
        // </summary>
        public abstract AssemblerMethod DisassembleMethod(TargetMemoryAccess memory,
								   Method method);
Пример #4
0
        // <summary>
        //   Disassemble one instruction.
        //   If @imethod is non-null, it specifies the current method which will
        //   be used to lookup function names from trampoline calls.
        // </summary>
        public abstract AssemblerLine DisassembleInstruction(TargetMemoryAccess memory,
								      Method method,
								      TargetAddress address);
Пример #5
0
        protected override bool DoResolve(ScriptingContext context)
        {
            if (Repeating)
                return true;

            if (Argument != "") {
                if (count < 0)
                    count = 1;

                expression = ParseExpression (context);
                if (expression == null)
                    return false;

                expression = expression.Resolve (context);
                return expression != null;
            }

            if (count < 0)
                count = 10;

            address = CurrentFrame.TargetAddress;
            method = CurrentFrame.Method;
            return true;
        }
Пример #6
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);
            }
        }
Пример #7
0
        protected Method(Method method)
            : this(method.Name, method.ImageFile, method.Module,
				method.StartAddress, method.EndAddress)
        {
        }
Пример #8
0
        public static bool IsInSameMethod(Method method, TargetAddress address)
        {
            if (address.IsNull || !method.IsLoaded)
                return false;

                        if ((address < method.StartAddress) || (address >= method.EndAddress))
                                return false;

                        return true;
        }
Пример #9
0
 public AssemblerMethod DisassembleMethod(Method method)
 {
     check_alive ();
     return servant.DisassembleMethod (method);
 }
Пример #10
0
 public AssemblerLine DisassembleInstruction(Method method, TargetAddress address)
 {
     check_alive ();
     return servant.DisassembleInstruction (method, address);
 }
Пример #11
0
        internal StackFrame(Thread thread, FrameType type, TargetAddress address,
				     TargetAddress stack_ptr, TargetAddress frame_address,
				     Registers registers, Method method, SourceAddress source)
            : this(thread, type, address, stack_ptr, frame_address, registers, method)
        {
            this.source = source;
            if (method.HasSource && !method.MethodSource.IsDynamic)
                location = new SourceLocation (
                    method.MethodSource, source.SourceFile, source.Row);
            has_source = true;
        }
Пример #12
0
        internal StackFrame(Thread thread, FrameType type, TargetAddress address,
				     TargetAddress stack_ptr, TargetAddress frame_address,
				     Registers registers, Method method)
            : this(thread, type, address, stack_ptr, frame_address, registers)
        {
            this.method = method;
            this.language = method.Module.Language;
            if (method.IsLoaded)
                this.name = new Symbol (method.Name, method.StartAddress, 0);
            else
                this.name = new Symbol (method.Name, address, 0);
        }
Пример #13
0
            protected MonoLineNumberTable(MonoSymbolFile file, Method method)
            {
                this.File = file;
                this.Method = method;

                this.start = method.StartAddress;
                this.end = method.EndAddress;
            }