本文整理汇总了C#中TargetMemoryAccess类的典型用法代码示例。如果您正苦于以下问题:C# TargetMemoryAccess类的具体用法?C# TargetMemoryAccess怎么用?C# TargetMemoryAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetMemoryAccess类属于命名空间,在下文中一共展示了TargetMemoryAccess类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetCurrentType
internal override TargetType GetCurrentType(TargetMemoryAccess target)
{
if (!Type.HasStaticType)
throw new InvalidOperationException ();
return Type.StaticType;
}
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:NativePointerObject.cs
示例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);
}
开发者ID:baulig,项目名称:debugger,代码行数:25,代码来源:MonoVariableLocation.cs
示例3: GetCurrentObject
internal override TargetClassObject GetCurrentObject(TargetMemoryAccess target)
{
if (!type.IsByRef)
return null;
return type.GetCurrentObject (target, Location);
}
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:MonoClassObject.cs
示例4: Print
internal override string Print(TargetMemoryAccess target)
{
if (Location.HasAddress)
return String.Format ("{0}", Location.GetAddress (target));
else
return String.Format ("{0}", Location);
}
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:NativeStructObject.cs
示例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);
}
开发者ID:baulig,项目名称:debugger,代码行数:28,代码来源:MonoNullableType.cs
示例6: WriteBuffer
internal override void WriteBuffer(TargetMemoryAccess target, byte[] data)
{
if (data.Length > blob.Size)
throw new ArgumentException ();
data.CopyTo (blob.Contents, 0);
}
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:ClientSuppliedTargetLocation.cs
示例7: Print
internal override string Print(TargetMemoryAccess target)
{
if (Location.GetAddress (target).IsNull)
return "null";
object obj = DoGetObject (target);
return '"' + (string) obj + '"';
}
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:MonoStringObject.cs
示例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);
}
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:TargetObjectObject.cs
示例9: GetAddress
internal override TargetAddress GetAddress(TargetMemoryAccess target)
{
if (!is_valid)
throw new LocationInvalidException ();
return address;
}
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:MonoVariableLocation.cs
示例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);
}
开发者ID:baulig,项目名称:debugger,代码行数:8,代码来源:MonoPointerObject.cs
示例11: DoGetObject
protected override object DoGetObject(TargetMemoryAccess target)
{
try {
return ReadString (target, Location);
} catch (TargetException ex) {
throw new LocationInvalidException (ex);
}
}
开发者ID:baulig,项目名称:debugger,代码行数:8,代码来源:NativeStringObject.cs
示例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);
}
开发者ID:baulig,项目名称:debugger,代码行数:8,代码来源:MonoArrayObject.cs
示例13: GetAddress
internal override TargetAddress GetAddress(TargetMemoryAccess target)
{
TargetAddress address = reference.GetAddress (target);
if (address.IsNull)
return TargetAddress.Null;
else
return target.ReadAddress (address);
}
开发者ID:baulig,项目名称:debugger,代码行数:8,代码来源:DereferencedTargetLocation.cs
示例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);
}
开发者ID:baulig,项目名称:debugger,代码行数:8,代码来源:MetadataHelper.cs
示例15: Print
internal override string Print(TargetMemoryAccess target)
{
TargetAddress address = GetAddress (target);
if (address.IsNull)
return "null";
else
return String.Format ("{0}", address);
}
开发者ID:baulig,项目名称:debugger,代码行数:8,代码来源:NativeFunctionObject.cs
示例16: GetDynamicSize
internal override long GetDynamicSize(TargetMemoryAccess target, TargetBlob blob,
TargetLocation location,
out TargetLocation dynamic_location)
{
TargetBinaryReader reader = blob.GetReader ();
reader.Position = Type.ObjectSize;
dynamic_location = location.GetLocationAtOffset (Type.ObjectSize + 4);
return reader.ReadInteger (4) * 2;
}
开发者ID:baulig,项目名称:debugger,代码行数:9,代码来源:MonoStringObject.cs
示例17: Create
public static MonoVariableLocation Create(TargetMemoryAccess target, bool is_regoffset,
Register register, long regoffset,
bool is_byref)
{
MonoVariableLocation location = new MonoVariableLocation (
is_regoffset, register, regoffset, is_byref);
location.update (target);
return location;
}
开发者ID:baulig,项目名称:debugger,代码行数:9,代码来源:MonoVariableLocation.cs
示例18: Print
internal override string Print(TargetMemoryAccess target)
{
object obj = DoGetObject (target);
if (obj is IntPtr)
return String.Format ("0x{0:x}", ((IntPtr) obj).ToInt64 ());
else if (obj is UIntPtr)
return String.Format ("0x{0:x}", ((UIntPtr) obj).ToUInt64 ());
else
return obj.ToString ();
}
开发者ID:baulig,项目名称:debugger,代码行数:10,代码来源:TargetFundamentalObject.cs
示例19: ReadMemory
internal override TargetBlob ReadMemory(TargetMemoryAccess target, int size)
{
if (size > blob.Size)
throw new ArgumentException ();
byte[] data = new byte [size];
Array.Copy (blob.Contents, 0, data, 0, size);
return new TargetBlob (data, blob.TargetMemoryInfo);
}
开发者ID:baulig,项目名称:debugger,代码行数:10,代码来源:ClientSuppliedTargetLocation.cs
示例20: GetElement
internal override TargetObject GetElement(TargetMemoryAccess target, int[] indices)
{
int offset = GetArrayOffset (target, indices);
TargetLocation new_location = Location.GetLocationAtOffset (offset);
if (Type.ElementType.IsByRef)
new_location = new_location.GetDereferencedLocation ();
return Type.ElementType.GetObject (target, new_location);
}
开发者ID:baulig,项目名称:debugger,代码行数:10,代码来源:NativeArrayObject.cs
注:本文中的TargetMemoryAccess类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论