Example #1
0
 public void UpdateExceptionInfo(Exception clrException, object type, object value, List <DynamicStackFrame> traceback)
 {
     lock (this) {
         _exceptionState = new ExceptionState(clrException, type, value, traceback);
         _setValues      = _removedValues = 0;
     }
 }
Example #2
0
        public override void AddNoLock(ref DictionaryStorage storage, object key, object value)
        {
            // add always needs to check...
            string strKey = key as string;

            if (strKey != null)
            {
                switch (strKey)
                {
                case "exc_type":
                    _setValues     |= ExceptionStateFlags.Type;
                    _removedValues &= ~ExceptionStateFlags.Type;
                    _excType        = value;
                    break;

                case "exc_value":
                    _setValues     |= ExceptionStateFlags.Value;
                    _removedValues &= ~ExceptionStateFlags.Value;
                    _excValue       = value;
                    break;

                case "exc_traceback":
                    _setValues     |= ExceptionStateFlags.Traceback;
                    _removedValues &= ~ExceptionStateFlags.Traceback;
                    _excTraceback   = value;
                    break;
                }
            }

            base.AddNoLock(ref storage, key, value);
        }
Example #3
0
        private bool TryGetExcValue(ExceptionState exState, string strKey, out object value)
        {
            switch (strKey)
            {
            case "exc_type":
                lock (this) {
                    if ((_removedValues & ExceptionStateFlags.Type) == 0)
                    {
                        if ((_setValues & ExceptionStateFlags.Type) != 0)
                        {
                            value = _excType;
                        }
                        else
                        {
                            value = exState.Type;
                        }
                        return(true);
                    }
                }
                break;

            case "exc_value":
                lock (this) {
                    if ((_removedValues & ExceptionStateFlags.Value) == 0)
                    {
                        if ((_setValues & ExceptionStateFlags.Value) != 0)
                        {
                            value = _excValue;
                        }
                        else
                        {
                            value = exState.Value;
                        }
                        return(true);
                    }
                }
                break;

            case "exc_traceback":
                lock (this) {
                    if ((_removedValues & ExceptionStateFlags.Traceback) == 0)
                    {
                        if ((_setValues & ExceptionStateFlags.Traceback) != 0)
                        {
                            value = _excTraceback;
                        }
                        else
                        {
                            _excTraceback = CreateTraceBack(exState);
                            _setValues   |= ExceptionStateFlags.Traceback;
                            value         = _excTraceback;
                        }
                        return(true);
                    }
                }
                break;
            }
            value = null;
            return(false);
        }
 public override void AddNoLock(ref DictionaryStorage storage, object key, object value) {            
     // add always needs to check...
     string strKey = key as string;
     if (strKey != null) {
         switch (strKey) {
             case "exc_type":
                 _setValues |= ExceptionStateFlags.Type;
                 _removedValues &= ~ExceptionStateFlags.Type;
                 _excType = value;
                 break;
             case "exc_value":
                 _setValues |= ExceptionStateFlags.Value;
                 _removedValues &= ~ExceptionStateFlags.Value;
                 _excValue = value;
                 break;
             case "exc_traceback":
                 _setValues |= ExceptionStateFlags.Traceback;
                 _removedValues &= ~ExceptionStateFlags.Traceback;
                 _excTraceback = value;
                 break;
         }
     }
     
     base.AddNoLock(ref storage, key, value);
 }
        public override bool Remove(ref DictionaryStorage storage, object key) {
            // check the strKey only if we have some exception info set
            ExceptionState exState = _exceptionState;
            if (exState != null || _setValues != 0) {
                string strKey = key as string;
                if (strKey != null) {
                    switch (strKey) {
                        case "exc_type":
                            lock (this) {
                                _excType = null;
                                _setValues &= ~ExceptionStateFlags.Type;
                                _removedValues |= ExceptionStateFlags.Type;
                            }
                            break;
                        case "exc_value":
                            lock (this) {
                                _excValue = null;
                                _setValues &= ~ExceptionStateFlags.Value;
                                _removedValues |= ExceptionStateFlags.Value;
                            }
                            break;
                        case "exc_traceback":
                            lock (this) {
                                _excTraceback = null;
                                _setValues &= ~ExceptionStateFlags.Traceback;
                                _removedValues |= ExceptionStateFlags.Traceback;
                            }
                            break;
                    }
                }
            }

            return base.Remove(ref storage, key);
        }
Example #6
0
 public void ExceptionHandled()
 {
     lock (this) {
         _setValues      = ExceptionStateFlags.Traceback | ExceptionStateFlags.Type | ExceptionStateFlags.Value;
         _removedValues  = 0;
         _exceptionState = null;
         _excTraceback   = _excType = _excValue = null;
     }
 }
Example #7
0
 public void UpdateExceptionInfo(object type, object value, object traceback)
 {
     lock (this) {
         _exceptionState = new ExceptionState(null, type, value, null);
         _excTraceback   = traceback;
         _setValues      = ExceptionStateFlags.Traceback;
         _removedValues  = 0;
     }
 }
Example #8
0
 public override void Clear(ref DictionaryStorage storage)
 {
     lock (this) {
         _exceptionState = null;
         _setValues      = 0;
         _removedValues  = 0;
         _excTraceback   = _excType = _excValue = null;
         base.Clear(ref storage);
     }
 }
Example #9
0
        public override bool Remove(ref DictionaryStorage storage, object key)
        {
            // check the strKey only if we have some exception info set
            ExceptionState exState = _exceptionState;

            if (exState != null || _setValues != 0)
            {
                string strKey = key as string;
                if (strKey != null)
                {
                    switch (strKey)
                    {
                    case "exc_type":
                        lock (this) {
                            _excType        = null;
                            _setValues     &= ~ExceptionStateFlags.Type;
                            _removedValues |= ExceptionStateFlags.Type;
                        }
                        break;

                    case "exc_value":
                        lock (this) {
                            _excValue       = null;
                            _setValues     &= ~ExceptionStateFlags.Value;
                            _removedValues |= ExceptionStateFlags.Value;
                        }
                        break;

                    case "exc_traceback":
                        lock (this) {
                            _excTraceback   = null;
                            _setValues     &= ~ExceptionStateFlags.Traceback;
                            _removedValues |= ExceptionStateFlags.Traceback;
                        }
                        break;
                    }
                }
            }

            return(base.Remove(ref storage, key));
        }
 public void ExceptionHandled() {
     lock (this) {
         _setValues = ExceptionStateFlags.Traceback | ExceptionStateFlags.Type | ExceptionStateFlags.Value;
         _removedValues = 0;
         _exceptionState = null;
         _excTraceback = _excType = _excValue = null;
     }
 }
 public void UpdateExceptionInfo(object type, object value, object traceback) {
     lock (this) {
         _exceptionState = new ExceptionState(null, type, value, null);
         _excTraceback = traceback;
         _setValues = ExceptionStateFlags.Traceback;
         _removedValues = 0;
     }
 }
 public void UpdateExceptionInfo(Exception clrException, object type, object value, List<DynamicStackFrame> traceback) {
     lock (this) {
         _exceptionState = new ExceptionState(clrException, type, value, traceback);
         _setValues = _removedValues = 0;
     }
 }
 public override void Clear(ref DictionaryStorage storage) {
     lock (this) {
         _exceptionState = null;
         _setValues = 0;
         _removedValues = 0;
         _excTraceback = _excType = _excValue = null;
         base.Clear(ref storage);
     }
 }
 private bool TryGetExcValue(ExceptionState exState, string strKey, out object value) {
     switch (strKey) {
         case "exc_type":
             lock (this) {
                 if ((_removedValues & ExceptionStateFlags.Type) == 0) {
                     if ((_setValues & ExceptionStateFlags.Type) != 0) {
                         value = _excType;
                     } else {
                         value = exState.Type;
                     }
                     return true;
                 }
             }
             break;
         case "exc_value":
             lock (this) {
                 if ((_removedValues & ExceptionStateFlags.Value) == 0) {
                     if ((_setValues & ExceptionStateFlags.Value) != 0) {
                         value = _excValue;
                     } else {
                         value = exState.Value;
                     }
                     return true;
                 }
             }
             break;
         case "exc_traceback":
             lock (this) {
                 if ((_removedValues & ExceptionStateFlags.Traceback) == 0) {
                     if ((_setValues & ExceptionStateFlags.Traceback) != 0) {
                         value = _excTraceback;
                     } else {
                         _excTraceback = CreateTraceBack(exState);
                         _setValues |= ExceptionStateFlags.Traceback;
                         value = _excTraceback;
                     }
                     return true;
                 }
             }
             break;
     }
     value = null;
     return false;
 }