Exemplo n.º 1
0
        public void UpdateThreadWindow()
        {
            // Update display from data
            ListView listView = m_mainForm.GetThreads();

            listView.Items.Clear();

            for (int threadIndex = 0; threadIndex < m_state.m_threads.Count; ++threadIndex)
            {
                DebuggerState.ThreadInfo curThreadInfo = m_state.m_threads[threadIndex];

                String stateDesc = App.GetThreadStateAsString(curThreadInfo.m_state);

                listView.Items.Add(App.MakeListViewItem(curThreadInfo.m_id.ToString(), stateDesc, curThreadInfo));
            }
        }
Exemplo n.º 2
0
    public void FindAddThread(int a_threadId, int a_state, bool a_select)
    {
      if (a_threadId <= 0)
      {
        return;
      }

      ListView listView = m_mainForm.GetThreads();

      // Clear selection
      if (a_select)
      {
        foreach (ListViewItem item in listView.Items)
        {
          item.Selected = false;
        }
      }

      // find in list
      for (int thIndex = 0; thIndex < m_state.m_threads.Count; ++thIndex)
      {
        DebuggerState.ThreadInfo info = m_state.m_threads[thIndex];

        if (info.m_id == a_threadId)
        {
          // update state
          if (info.m_state != a_state || a_select)
          {
            if (info.m_state != a_state)
            {
              info.m_state = a_state;
            }

            for (int itemIndex = 0; itemIndex < listView.Items.Count; ++itemIndex)
            {
              if (listView.Items[itemIndex].Tag == info)
              {
                String stateDesc = GetThreadStateAsString(info.m_state);
                listView.Items[itemIndex] = App.MakeListViewItem(info.m_id.ToString(), stateDesc, info);

                if (a_select)
                {
                  listView.Items[itemIndex].Selected = true;
                }
                break;
              }
            }
          }
          return;
        }
      }

      // add
      {
        DebuggerState.ThreadInfo info = new DebuggerState.ThreadInfo(a_threadId, a_state);
        m_state.m_threads.Add(info);

        String stateDesc = GetThreadStateAsString(info.m_state);
        listView.Items.Insert(0, App.MakeListViewItem(info.m_id.ToString(), stateDesc, info));

        if (a_select)
        {
          listView.Items[0].Selected = true;
        }
      }
    }
Exemplo n.º 3
0
 public void OnGetThreadContext(DebuggerState.ThreadInfo a_threadInfo)
 {
     m_debuggerSession.gmMachineGetContext(a_threadInfo.m_id, 0);
 }
Exemplo n.º 4
0
        public void FindAddThread(int a_threadId, int a_state, bool a_select)
        {
            if (a_threadId <= 0)
            {
                return;
            }

            ListView listView = m_mainForm.GetThreads();

            // Clear selection
            if (a_select)
            {
                foreach (ListViewItem item in listView.Items)
                {
                    item.Selected = false;
                }
            }

            // find in list
            for (int thIndex = 0; thIndex < m_state.m_threads.Count; ++thIndex)
            {
                DebuggerState.ThreadInfo info = m_state.m_threads[thIndex];

                if (info.m_id == a_threadId)
                {
                    // update state
                    if (info.m_state != a_state || a_select)
                    {
                        if (info.m_state != a_state)
                        {
                            info.m_state = a_state;
                        }

                        for (int itemIndex = 0; itemIndex < listView.Items.Count; ++itemIndex)
                        {
                            if (listView.Items[itemIndex].Tag == info)
                            {
                                String stateDesc = GetThreadStateAsString(info.m_state);
                                listView.Items[itemIndex] = App.MakeListViewItem(info.m_id.ToString(), stateDesc, info);

                                if (a_select)
                                {
                                    listView.Items[itemIndex].Selected = true;
                                }
                                break;
                            }
                        }
                    }
                    return;
                }
            }

            // add
            {
                DebuggerState.ThreadInfo info = new DebuggerState.ThreadInfo(a_threadId, a_state);
                m_state.m_threads.Add(info);

                String stateDesc = GetThreadStateAsString(info.m_state);
                listView.Items.Insert(0, App.MakeListViewItem(info.m_id.ToString(), stateDesc, info));

                if (a_select)
                {
                    listView.Items[0].Selected = true;
                }
            }
        }