Exemplo n.º 1
0
 protected TargetException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Type = (TargetError) info.GetValue ("Type", typeof (TargetError));
 }
Exemplo n.º 2
0
 protected static string GetMessage(TargetError type)
 {
     switch (type) {
     case TargetError.UnknownError:
         return "Unknown error.";
     case TargetError.NoTarget:
         return "No target.";
     case TargetError.AlreadyHaveTarget:
         return "Already have a program to debug.";
     case TargetError.CannotStartTarget:
         return "Cannot start target.";
     case TargetError.NotStopped:
         return "The target is currently running, but it must be " +
             "stopped to perform the requested operation.";
     case TargetError.AlreadyStopped:
         return "The target is already stopped.";
     case TargetError.RecursiveCall:
         return "Internal error: recursive call";
     case TargetError.NoSuchBreakpoint:
         return "No such breakpoint.";
     case TargetError.NoSuchRegister:
         return "No such register.";
     case TargetError.DebugRegisterOccupied:
         return "Cannot insert hardware breakpoint/watchpoint: " +
             "all debugging registers are already occupied.";
     case TargetError.MemoryAccess:
         return "Memory access.";
     case TargetError.NotImplemented:
         return "Requested feature not implemented on this platform.";
     case TargetError.IOError:
         return "Unknown I/O error.";
     case TargetError.NoStack:
         return "No stack.";
     case TargetError.NoMethod:
         return "Cannot get bounds of current method.";
     case TargetError.MethodNotLoaded:
         return "Method not loaded.";
     case TargetError.ClassNotInitialized:
         return "Class not initialized.";
     case TargetError.AlreadyHaveBreakpoint:
         return "Already have a breakpoint at this location.";
     case TargetError.SymbolTable:
         return "Symbol table error.";
     case TargetError.InvocationException:
         return "Error while invoking a method in the target.";
     case TargetError.LocationInvalid:
         return "Location is invalid.";
     case TargetError.CannotDetach:
         return "Cannot detach from this target because we did not " +
             "attach to it.";
     case TargetError.InvalidReturn:
         return "Cannot return from this kind of stack frame.";
     case TargetError.NoInvocation:
         return "No invocation found.";
     case TargetError.InvalidContext:
         return "Operation not permitted outside managed context.";
     case TargetError.PermissionDenied:
         return "Permission denied.";
     default:
         return "Unknown error";
     }
 }
Exemplo n.º 3
0
        public TargetException(TargetError type, string format,
					params object[] args)
            : this(type, String.Format (format, args))
        {
        }
Exemplo n.º 4
0
 public TargetException(TargetError type)
     : this(type, GetMessage (type))
 {
 }
Exemplo n.º 5
0
        protected static string GetMessage(TargetError type)
        {
            switch (type)
            {
            case TargetError.UnknownError:
                return("Unknown error.");

            case TargetError.NoTarget:
                return("No target.");

            case TargetError.AlreadyHaveTarget:
                return("Already have a program to debug.");

            case TargetError.CannotStartTarget:
                return("Cannot start target.");

            case TargetError.NotStopped:
                return("The target is currently running, but it must be " +
                       "stopped to perform the requested operation.");

            case TargetError.AlreadyStopped:
                return("The target is already stopped.");

            case TargetError.RecursiveCall:
                return("Internal error: recursive call");

            case TargetError.NoSuchBreakpoint:
                return("No such breakpoint.");

            case TargetError.NoSuchRegister:
                return("No such register.");

            case TargetError.DebugRegisterOccupied:
                return("Cannot insert hardware breakpoint/watchpoint: " +
                       "all debugging registers are already occupied.");

            case TargetError.MemoryAccess:
                return("Memory access.");

            case TargetError.NotImplemented:
                return("Requested feature not implemented on this platform.");

            case TargetError.IOError:
                return("Unknown I/O error.");

            case TargetError.NoStack:
                return("No stack.");

            case TargetError.NoMethod:
                return("Cannot get bounds of current method.");

            case TargetError.MethodNotLoaded:
                return("Method not loaded.");

            case TargetError.ClassNotInitialized:
                return("Class not initialized.");

            case TargetError.AlreadyHaveBreakpoint:
                return("Already have a breakpoint at this location.");

            case TargetError.SymbolTable:
                return("Symbol table error.");

            case TargetError.InvocationException:
                return("Error while invoking a method in the target.");

            case TargetError.LocationInvalid:
                return("Location is invalid.");

            case TargetError.CannotDetach:
                return("Cannot detach from this target because we did not " +
                       "attach to it.");

            case TargetError.InvalidReturn:
                return("Cannot return from this kind of stack frame.");

            case TargetError.NoInvocation:
                return("No invocation found.");

            case TargetError.InvalidContext:
                return("Operation not permitted outside managed context.");

            case TargetError.PermissionDenied:
                return("Permission denied.");

            default:
                return("Unknown error");
            }
        }
Exemplo n.º 6
0
 public TargetException(TargetError type, string message)
     : base(message)
 {
     this.Type = type;
 }
Exemplo n.º 7
0
 public TargetException(TargetError type)
     : this(type, GetMessage(type))
 {
 }
Exemplo n.º 8
0
 public TargetException(TargetError type, string format,
                        params object[] args)
     : this(type, String.Format(format, args))
 {
 }
Exemplo n.º 9
0
 public TargetException(TargetError type, string message)
     : base(message)
 {
     this.Type = type;
 }
Exemplo n.º 10
0
 protected TargetException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Type = (TargetError)info.GetValue("Type", typeof(TargetError));
 }
Exemplo n.º 11
0
        protected static void check_error(TargetError error)
        {
            if (error == TargetError.None)
                return;

            throw new TargetException (error);
        }