ReadMemory() public abstract method

public abstract ReadMemory ( TargetAddress address, int size ) : TargetBlob
address TargetAddress
size int
return TargetBlob
コード例 #1
0
ファイル: MonoThreadManager.cs プロジェクト: baulig/debugger
        public static MonoDebuggerInfo Create(TargetMemoryAccess memory, TargetAddress info)
        {
            TargetBinaryReader header = memory.ReadMemory (info, 24).GetReader ();
            long magic = header.ReadInt64 ();
            if (magic != DynamicMagic) {
                Report.Error ("`MONO_DEBUGGER__debugger_info' at {0} has unknown magic {1:x}.", info, magic);
                return null;
            }

            int version = header.ReadInt32 ();
            if (version < MinDynamicVersion) {
                Report.Error ("`MONO_DEBUGGER__debugger_info' has version {0}, " +
                          "but expected at least {1}.", version,
                          MonoDebuggerInfo.MinDynamicVersion);
                return null;
            }
            if (version > MaxDynamicVersion) {
                Report.Error ("`MONO_DEBUGGER__debugger_info' has version {0}, " +
                          "but expected at most {1}.", version,
                          MonoDebuggerInfo.MaxDynamicVersion);
                return null;
            }

            header.ReadInt32 (); // minor version
            header.ReadInt32 ();

            int size = header.ReadInt32 ();

            TargetReader reader = new TargetReader (memory.ReadMemory (info, size));
            return new MonoDebuggerInfo (memory, reader);
        }
コード例 #2
0
            public static RangeEntry Create(MonoSymbolFile file, TargetMemoryAccess memory,
							 TargetReader reader, byte[] contents)
            {
                int domain = reader.BinaryReader.ReadInt32 ();
                int index = reader.BinaryReader.ReadInt32 ();

                TargetAddress wrapper_data = reader.ReadAddress ();
                TargetAddress method = reader.ReadAddress ();
                reader.ReadAddress (); /* address_list */
                TargetAddress code_start = reader.ReadAddress ();
                TargetAddress wrapper_addr = reader.ReadAddress ();
                int code_size = reader.BinaryReader.ReadInt32 ();

                WrapperEntry wrapper = null;

                if (!wrapper_data.IsNull) {
                    int wrapper_size = 4 + 3 * memory.TargetMemoryInfo.TargetAddressSize;

                    TargetReader wrapper_reader = new TargetReader (
                        memory.ReadMemory (wrapper_data, wrapper_size));

                    TargetAddress name_address = wrapper_reader.ReadAddress ();
                    TargetAddress cil_address = wrapper_reader.ReadAddress ();
                    int wrapper_type = wrapper_reader.BinaryReader.ReadInt32 ();

                    string name = "<" + memory.ReadString (name_address) + ">";
                    string cil_code = memory.ReadString (cil_address);

                    wrapper = new WrapperEntry (
                        wrapper_addr, (WrapperType) wrapper_type, name, cil_code);
                }

                return new RangeEntry (
                    file, domain, index, wrapper, method,
                    code_start, code_start + code_size, contents);
            }