Mono.Debugger.Languages.Mono.MonoStringObject.DoGetObject C# (CSharp) Method

DoGetObject() protected method

protected DoGetObject ( TargetMemoryAccess target ) : object
target TargetMemoryAccess
return object
        protected override object DoGetObject(TargetMemoryAccess target)
        {
            TargetLocation dynamic_location;
            TargetBlob object_blob = Location.ReadMemory (target, type.Size);
            long size = GetDynamicSize (
                target, object_blob, Location, out dynamic_location);

            if (size > (long) MonoStringType.MaximumStringLength)
                size = MonoStringType.MaximumStringLength;

            TargetBlob blob = dynamic_location.ReadMemory (target, (int) size);

            TargetBinaryReader reader = blob.GetReader ();
            int length = (int) reader.Size / 2;

            char[] retval = new char [length];

            for (int i = 0; i < length; i++)
                retval [i] = (char) reader.ReadInt16 ();

            return new String (retval);
        }

Usage Example

Example #1
0
        internal static string ReadString(MonoLanguageBackend mono, TargetMemoryAccess target,
						   TargetAddress address)
        {
            if (address.IsNull)
                return null;

            TargetLocation location = new AbsoluteTargetLocation (address);
            MonoStringObject so = new MonoStringObject (mono.BuiltinTypes.StringType, location);
            return (string) so.DoGetObject (target);
        }
All Usage Examples Of Mono.Debugger.Languages.Mono.MonoStringObject::DoGetObject