| 298 | } |
| 299 | |
| 300 | void FrameStackModel::setCurrentThread(int threadNumber) |
| 301 | { |
| 302 | Q_D(FrameStackModel); |
| 303 | |
| 304 | qCDebug(DEBUGGER) << threadNumber; |
| 305 | if (d->m_currentThread != threadNumber && threadNumber != -1) { |
| 306 | // FIXME: this logic means that if we switch to thread 3 and |
| 307 | // then to thread 2 and then to thread 3, we'll request frames |
| 308 | // for thread 3 again, even if the program was not run in between |
| 309 | // and therefore frames could not have changed. |
| 310 | d->m_currentFrame = 0; //set before fetchFrames else --frame argument would be wrong |
| 311 | d->m_updateCurrentFrameOnNextFetch = true; |
| 312 | fetchFrames(threadNumber, 0, 20); |
| 313 | } |
| 314 | if (threadNumber != d->m_currentThread) { |
| 315 | d->m_currentFrame = 0; |
| 316 | d->m_currentThread = threadNumber; |
| 317 | emit currentFrameChanged(d->m_currentFrame); |
| 318 | } |
| 319 | qCDebug(DEBUGGER) << "currentThread: " << d->m_currentThread << "currentFrame: " << d->m_currentFrame; |
| 320 | emit currentThreadChanged(threadNumber); |
| 321 | session()->raiseEvent(IDebugSession::thread_or_frame_changed); |
| 322 | } |
| 323 | |
| 324 | void FrameStackModel::setCurrentThread(const QModelIndex& index) |
| 325 | { |