//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void Refresh(ref MiResultValue threadData) { LoggingUtils.PrintFunction(); if (threadData.HasField("name")) { m_threadDisplayName = threadData ["name"] [0].GetString(); // user-specified name } else if (threadData.HasField("target-id")) { uint threadPid; m_threadDisplayName = threadData ["target-id"] [0].GetString(); // usually the raw name, i.e. 'Thread 18771' if (m_threadDisplayName.StartsWith("Thread ") && uint.TryParse(m_threadDisplayName.Substring("Thread ".Length), out threadPid)) { AndroidDevice hostDevice = NativeProgram.DebugProgram.DebugProcess.NativeProcess.HostDevice; AndroidProcess threadProcess = hostDevice.GetProcessFromPid(threadPid); if (threadProcess != null) { m_threadDisplayName = threadProcess.Name; } } } if (threadData.HasField("frame")) { MiResultValueTuple frameTuple = threadData ["frame"] [0] as MiResultValueTuple; uint stackLevel = frameTuple ["level"] [0].GetUnsignedInt(); string stackFrameId = m_threadName + "#" + stackLevel; CLangDebuggeeStackFrame stackFrame = new CLangDebuggeeStackFrame(m_debugger, this, frameTuple, stackFrameId); lock (m_threadStackFrames) { m_threadStackFrames.Add(stackFrame); } } RequiresRefresh = false; }