本文整理汇总了C#中TargetMemoryAccess类的典型用法代码示例。如果您正苦于以下问题:C# TargetMemoryAccess类的具体用法?C# TargetMemoryAccess怎么用?C# TargetMemoryAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetMemoryAccess类属于命名空间,在下文中一共展示了TargetMemoryAccess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCurrentType
internal override TargetType GetCurrentType(TargetMemoryAccess target)
{
if (!Type.HasStaticType)
throw new InvalidOperationException ();
return Type.StaticType;
}
示例2: ReadMemory
internal override TargetBlob ReadMemory(TargetMemoryAccess target, int size)
{
if (!is_valid)
throw new LocationInvalidException ();
if (HasAddress)
return base.ReadMemory (target, size);
// If this is a valuetype, the register hold the whole data.
long contents = address.Address;
byte[] buffer;
if (size == 1)
buffer = BitConverter.GetBytes ((byte) contents);
else if (size == 2)
buffer = BitConverter.GetBytes ((short) contents);
else if (size == 4)
buffer = BitConverter.GetBytes ((int) contents);
else if (size == 8)
buffer = BitConverter.GetBytes (contents);
else
throw new ArgumentException ();
return new TargetBlob (buffer, target.TargetMemoryInfo);
}
示例3: GetCurrentObject
internal override TargetClassObject GetCurrentObject(TargetMemoryAccess target)
{
if (!type.IsByRef)
return null;
return type.GetCurrentObject (target, Location);
}
示例4: Print
internal override string Print(TargetMemoryAccess target)
{
if (Location.HasAddress)
return String.Format ("{0}", Location.GetAddress (target));
else
return String.Format ("{0}", Location);
}
示例5: SetObject
internal override void SetObject(TargetMemoryAccess target, TargetLocation location,
TargetObject obj)
{
TargetLocation flag_loc = location.GetLocationAtOffset (ElementType.Size);
byte[] buffer = new byte [1];
if (obj is TargetNullObject) {
buffer [0] = 0;
flag_loc.WriteBuffer (target, buffer);
return;
}
MonoNullableObject nobj = obj as MonoNullableObject;
if (nobj != null) {
if (!nobj.HasValue (target)) {
buffer [0] = 0;
flag_loc.WriteBuffer (target, buffer);
return;
} else {
obj = nobj.GetValue (target);
}
}
buffer [0] = 1;
flag_loc.WriteBuffer (target, buffer);
ElementType.SetObject (target, location, obj);
}
示例6: WriteBuffer
internal override void WriteBuffer(TargetMemoryAccess target, byte[] data)
{
if (data.Length > blob.Size)
throw new ArgumentException ();
data.CopyTo (blob.Contents, 0);
}
示例7: Print
internal override string Print(TargetMemoryAccess target)
{
if (Location.GetAddress (target).IsNull)
return "null";
object obj = DoGetObject (target);
return '"' + (string) obj + '"';
}
示例8: Print
internal override string Print(TargetMemoryAccess target)
{
if (HasAddress)
return String.Format ("{0} ({1})", Type.Name, GetAddress (target));
else
return String.Format ("{0} ({1})", Type.Name, Location);
}
示例9: GetAddress
internal override TargetAddress GetAddress(TargetMemoryAccess target)
{
if (!is_valid)
throw new LocationInvalidException ();
return address;
}
示例10: GetDereferencedObject
internal override TargetObject GetDereferencedObject(TargetMemoryAccess target)
{
if (Type.StaticType is TargetPointerType) {
TargetLocation loc = GetDereferencedLocation ();
return Type.StaticType.GetObject (target, loc);
} else
return Type.StaticType.GetObject (target, Location);
}
示例11: DoGetObject
protected override object DoGetObject(TargetMemoryAccess target)
{
try {
return ReadString (target, Location);
} catch (TargetException ex) {
throw new LocationInvalidException (ex);
}
}
示例12: GetDynamicSize
internal override long GetDynamicSize(TargetMemoryAccess target, TargetBlob blob,
TargetLocation location,
out TargetLocation dynamic_location)
{
int element_size = Type.GetElementSize (target);
dynamic_location = location.GetLocationAtOffset (Type.Size);
return element_size * GetLength (target);
}
示例13: GetAddress
internal override TargetAddress GetAddress(TargetMemoryAccess target)
{
TargetAddress address = reference.GetAddress (target);
if (address.IsNull)
return TargetAddress.Null;
else
return target.ReadAddress (address);
}
示例14: GetAppDomainInfo
public AppDomainInfo GetAppDomainInfo(MonoLanguageBackend mono, TargetMemoryAccess memory,
TargetAddress address)
{
int addr_size = memory.TargetMemoryInfo.TargetAddressSize;
TargetReader reader = new TargetReader (memory.ReadMemory (address, 12 * addr_size));
return new AppDomainInfo (mono, memory, reader);
}
示例15: Print
internal override string Print(TargetMemoryAccess target)
{
TargetAddress address = GetAddress (target);
if (address.IsNull)
return "null";
else
return String.Format ("{0}", address);
}