Beispiel #1
0
        /// <summary>
        /// get/create a single thread group of actions containing the given branch id.
        /// it is used for loading debugger viewer
        /// </summary>
        /// <param name="branchId">the given branch id to be included in the result group</param>
        /// <returns>the action group containing the given branch id</returns>
        public IActionGroup GetThreadGroup(UInt32 branchId)
        {
            List <ActionBranch> independentThreads = FindoutActionThreads(false);

            foreach (ActionBranch a in independentThreads)
            {
                if (a.ContainsAction(branchId))
                {
                    IActionGroup g = a as IActionGroup;
                    if (g != null)
                    {
                        g = (IActionGroup)g.Clone();
                        g.ResetGroupId(_method.MethodID);                        //all threads has the same group id. they can be distinguished at runtime by thread id
                        return(g);
                    }
                    AB_ActionString s = a as AB_ActionString;
                    if (s != null)
                    {
                        IActionGroup sg = s.GetThreadGroup(branchId);
                        sg.ResetGroupId(_method.MethodID);                        //all threads has the same group id. they can be distinguished at runtime by thread id
                        return(sg);
                    }
                    List <UInt32>  used = new List <uint>();
                    AB_ActionGroup ag   = new AB_ActionGroup(_actsHolder);
                    ag.SetOwnerMethod(used, _method);
                    ag.BranchId = _method.MethodID;                     //all threads has the same group id. they can be distinguished at runtime by thread id
                    ag.AppendAction(a);
                    return(ag);
                }
            }
            return(null);
        }
Beispiel #2
0
 /// <summary>
 /// convert ActionnString to ActionGroup to be displayed in a debug viewer.
 /// it should appear as a deeper level call stack for a same thread
 /// </summary>
 /// <param name="branchId">the given branch id to be included in the result group</param>
 /// <returns>the action group containing the given branch id</returns>
 public virtual IActionGroup GetThreadGroup(UInt32 branchId)
 {
     if (this.ContainsAction(branchId))
     {
         List <UInt32>  used = new List <uint>();
         AB_ActionGroup g    = new AB_ActionGroup(ActionsHolder);
         g.SetOwnerMethod(used, this.Method);
         g.Name        = this.Name;
         g.Description = this.Description;
         g.BranchId    = this.BranchId;             //the calling function may change it according to the situations
         g.ActionList  = GetActionsClone();
         return(g);
     }
     return(null);
 }