Пример #1
0
 protected TargetException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Type = (TargetError) info.GetValue ("Type", typeof (TargetError));
 }
Пример #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";
     }
 }
Пример #3
0
        public TargetException(TargetError type, string format,
					params object[] args)
            : this(type, String.Format (format, args))
        {
        }
Пример #4
0
 public TargetException(TargetError type)
     : this(type, GetMessage (type))
 {
 }
Пример #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");
            }
        }
Пример #6
0
 public TargetException(TargetError type, string message)
     : base(message)
 {
     this.Type = type;
 }
Пример #7
0
 public TargetException(TargetError type)
     : this(type, GetMessage(type))
 {
 }
Пример #8
0
 public TargetException(TargetError type, string format,
                        params object[] args)
     : this(type, String.Format(format, args))
 {
 }
Пример #9
0
 public TargetException(TargetError type, string message)
     : base(message)
 {
     this.Type = type;
 }
Пример #10
0
 protected TargetException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Type = (TargetError)info.GetValue("Type", typeof(TargetError));
 }
Пример #11
0
        protected static void check_error(TargetError error)
        {
            if (error == TargetError.None)
                return;

            throw new TargetException (error);
        }