1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
using System;
using System.Runtime.Serialization;
namespace Mono.Debugger
{
[Serializable]
public class TargetMemoryException : TargetException
{
public TargetMemoryException ()
: this ("Memory access")
{ }
public TargetMemoryException (string message)
: base (TargetError.MemoryAccess, message)
{ }
public TargetMemoryException (TargetAddress address)
: this (String.Format ("Cannot read target memory at address {0:x}", address))
{ }
public TargetMemoryException (TargetAddress address, int size)
: this (String.Format ("Cannot read {1} bytes from target memory at address {0:x}",
address, size))
{ }
protected TargetMemoryException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
}
}
[Serializable]
public class TargetMemoryReadOnlyException : TargetMemoryException
{
public TargetMemoryReadOnlyException ()
: base ("The current target's memory is read-only")
{ }
public TargetMemoryReadOnlyException (TargetAddress address)
: base (String.Format ("Can't write to target memory at address 0x{0:x}: {1}",
address, "the current target's memory is read-only"))
{ }
protected TargetMemoryReadOnlyException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
}
}
}
|