Beispiel #1
0
 private void UpdateExcItem(ref BException item, ICollection <BException> items, BThread bThread)
 {
     items.Add(item);
     item = new BException {
         BThread = bThread
     };
 }
Beispiel #2
0
        private List <BException> GenerateExceptionGroups(BThread bThread, IEnumerable <CTFERecord> gcItems, List <uint> exceptionsId)
        {
            var exceptionGroups = new List <BException>();

            var exceptionGroup = new BException {
                BThread = bThread
            };
            var isCatch = false;

            foreach (var tmp in gcItems)
            {
                if (exceptionGroup.StartAtTS == 0)
                {
                    exceptionGroup.StartAtTS = tmp.Time;
                }

                switch (tmp.Name())
                {
                case "\"DotNETRuntime:ExceptionCatchStart\"":
                    exceptionGroup.ExcCatchStart.Add(tmp);
                    isCatch = true;
                    break;

                case "\"DotNETRuntime:ExceptionFilterStart\"":
                    if (isCatch)
                    {
                        UpdateExcItem(ref exceptionGroup, exceptionGroups, bThread);
                        isCatch = false;
                    }

                    exceptionGroup.ExcFilterStart.Add(tmp);
                    break;

                case "\"DotNETRuntime:ExceptionFinallyStart\"":
                    if (isCatch)
                    {
                        UpdateExcItem(ref exceptionGroup, exceptionGroups, bThread);
                        isCatch = false;
                    }

                    exceptionGroup.ExcFinallyStart.Add(tmp);
                    break;

                default:
                    if (isCatch)
                    {
                        UpdateExcItem(ref exceptionGroup, exceptionGroups, bThread);
                        isCatch = false;
                    }

                    break;
                }
            }

            return(exceptionGroups);
        }