Commit 0d9a56ab authored by hjk's avatar hjk

Debugger: Rework thread data aquisition

Listen to gdb/MI notifications when possible. This is more
granular, gives access to the thread group id and takes
care of thread changes at any time.

Change-Id: I8c67f6f19b204059deefdf7e07fe3b4ce13ed963
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 617f74aa
...@@ -1302,15 +1302,6 @@ void CdbEngine::assignValueInDebugger(const WatchData *w, const QString &expr, c ...@@ -1302,15 +1302,6 @@ void CdbEngine::assignValueInDebugger(const WatchData *w, const QString &expr, c
updateLocals(); updateLocals();
} }
void CdbEngine::parseThreads(const GdbMi &data, int forceCurrentThreadId /* = -1 */)
{
int currentThreadId;
Threads threads = ThreadsHandler::parseGdbmiThreads(data, &currentThreadId);
threadsHandler()->setThreads(threads);
threadsHandler()->setCurrentThreadId(forceCurrentThreadId >= 0 ?
forceCurrentThreadId : currentThreadId);
}
void CdbEngine::handleThreads(const CdbExtensionCommandPtr &reply) void CdbEngine::handleThreads(const CdbExtensionCommandPtr &reply)
{ {
if (debug) if (debug)
...@@ -1318,7 +1309,7 @@ void CdbEngine::handleThreads(const CdbExtensionCommandPtr &reply) ...@@ -1318,7 +1309,7 @@ void CdbEngine::handleThreads(const CdbExtensionCommandPtr &reply)
if (reply->success) { if (reply->success) {
GdbMi data; GdbMi data;
data.fromString(reply->reply); data.fromString(reply->reply);
parseThreads(data); threadsHandler()->updateThreads(data);
// Continue sequence // Continue sequence
postCommandSequence(reply->commandSequence); postCommandSequence(reply->commandSequence);
} else { } else {
...@@ -1514,15 +1505,14 @@ void CdbEngine::updateLocals(bool forNewStackFrame) ...@@ -1514,15 +1505,14 @@ void CdbEngine::updateLocals(bool forNewStackFrame)
QVariant(flags)); QVariant(flags));
} }
void CdbEngine::selectThread(int index) void CdbEngine::selectThread(ThreadId threadId)
{ {
if (index < 0 || index == threadsHandler()->currentThread()) if (!threadId.isValid() || threadId == threadsHandler()->currentThread())
return; return;
const int newThreadId = threadsHandler()->threads().at(index).id; threadsHandler()->setCurrentThread(threadId);
threadsHandler()->setCurrentThread(index);
const QByteArray cmd = '~' + QByteArray::number(newThreadId) + " s"; const QByteArray cmd = '~' + QByteArray::number(threadId.raw()) + " s";
postBuiltinCommand(cmd, 0, &CdbEngine::dummyHandler, CommandListStack); postBuiltinCommand(cmd, 0, &CdbEngine::dummyHandler, CommandListStack);
} }
...@@ -2179,7 +2169,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT ...@@ -2179,7 +2169,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
// Further examine stop and report to user // Further examine stop and report to user
QString message; QString message;
QString exceptionBoxMessage; QString exceptionBoxMessage;
int forcedThreadId = -1; ThreadId forcedThreadId;
const unsigned stopFlags = examineStopReason(stopReason, &message, &exceptionBoxMessage, const unsigned stopFlags = examineStopReason(stopReason, &message, &exceptionBoxMessage,
conditionalBreakPointTriggered); conditionalBreakPointTriggered);
// Do the non-blocking log reporting // Do the non-blocking log reporting
...@@ -2216,7 +2206,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT ...@@ -2216,7 +2206,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
if (stopFlags & StopInArtificialThread) { if (stopFlags & StopInArtificialThread) {
showMessage(tr("Switching to main thread..."), LogMisc); showMessage(tr("Switching to main thread..."), LogMisc);
postCommand("~0 s", 0); postCommand("~0 s", 0);
forcedThreadId = 0; forcedThreadId = ThreadId(0);
// Re-fetch stack again. // Re-fetch stack again.
postCommandSequence(CommandListStack); postCommandSequence(CommandListStack);
} else { } else {
...@@ -2232,7 +2222,9 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT ...@@ -2232,7 +2222,9 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
} }
const GdbMi threads = stopReason.findChild("threads"); const GdbMi threads = stopReason.findChild("threads");
if (threads.isValid()) { if (threads.isValid()) {
parseThreads(threads, forcedThreadId); threadsHandler()->updateThreads(threads);
if (forcedThreadId.isValid())
threadsHandler()->setCurrentThread(forcedThreadId);
} else { } else {
showMessage(QString::fromLatin1(stopReason.findChild("threaderror").data()), LogError); showMessage(QString::fromLatin1(stopReason.findChild("threaderror").data()), LogError);
} }
...@@ -2938,7 +2930,7 @@ void CdbEngine::postCommandSequence(unsigned mask) ...@@ -2938,7 +2930,7 @@ void CdbEngine::postCommandSequence(unsigned mask)
return; return;
} }
if (mask & CommandListRegisters) { if (mask & CommandListRegisters) {
QTC_ASSERT(threadsHandler()->currentThread() >= 0, return); QTC_ASSERT(threadsHandler()->currentThreadIndex() >= 0, return);
postExtensionCommand("registers", QByteArray(), 0, &CdbEngine::handleRegisters, mask & ~CommandListRegisters); postExtensionCommand("registers", QByteArray(), 0, &CdbEngine::handleRegisters, mask & ~CommandListRegisters);
return; return;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "debuggerengine.h" #include "debuggerengine.h"
#include "breakpoint.h" #include "breakpoint.h"
#include "threaddata.h"
#include <QSharedPointer> #include <QSharedPointer>
#include <QProcess> #include <QProcess>
...@@ -113,7 +114,7 @@ public: ...@@ -113,7 +114,7 @@ public:
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages); virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
virtual void activateFrame(int index); virtual void activateFrame(int index);
virtual void selectThread(int index); virtual void selectThread(ThreadId threadId);
virtual bool stateAcceptsBreakpointChanges() const; virtual bool stateAcceptsBreakpointChanges() const;
virtual bool acceptsBreakpoint(BreakpointModelId id) const; virtual bool acceptsBreakpoint(BreakpointModelId id) const;
...@@ -242,7 +243,6 @@ private: ...@@ -242,7 +243,6 @@ private:
int elapsedLogTime() const; int elapsedLogTime() const;
void addLocalsOptions(ByteArrayInputStream &s) const; void addLocalsOptions(ByteArrayInputStream &s) const;
unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto); unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto);
void parseThreads(const GdbMi &, int forceCurrentThreadId = -1);
const QByteArray m_creatorExtPrefix; const QByteArray m_creatorExtPrefix;
const QByteArray m_tokenPrefix; const QByteArray m_tokenPrefix;
......
...@@ -263,7 +263,7 @@ static inline bool parseThread(QByteArray line, ThreadData *thread, bool *curren ...@@ -263,7 +263,7 @@ static inline bool parseThread(QByteArray line, ThreadData *thread, bool *curren
thread->targetId = QLatin1String("0x") + QString::fromLatin1(pidTid.mid(dotPos + 1)); thread->targetId = QLatin1String("0x") + QString::fromLatin1(pidTid.mid(dotPos + 1));
} }
case 1: case 1:
thread->id = tokens.at(0).toInt(); thread->id = ThreadId(tokens.at(0).toInt());
break; break;
} // switch size } // switch size
return true; return true;
......
...@@ -1233,10 +1233,6 @@ void DebuggerEngine::setState(DebuggerState state, bool forced) ...@@ -1233,10 +1233,6 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
handler->notifyBreakpointReleased(id); handler->notifyBreakpointReleased(id);
} }
const bool running = d->m_state == InferiorRunOk;
if (running)
threadsHandler()->notifyRunning();
showMessage(msg, LogDebug); showMessage(msg, LogDebug);
updateViews(); updateViews();
...@@ -1586,10 +1582,6 @@ void DebuggerEngine::changeBreakpoint(BreakpointModelId id) ...@@ -1586,10 +1582,6 @@ void DebuggerEngine::changeBreakpoint(BreakpointModelId id)
QTC_CHECK(false); QTC_CHECK(false);
} }
void DebuggerEngine::selectThread(int)
{
}
void DebuggerEngine::assignValueInDebugger(const WatchData *, void DebuggerEngine::assignValueInDebugger(const WatchData *,
const QString &, const QVariant &) const QString &, const QVariant &)
{ {
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include "debugger_global.h" #include "debugger_global.h"
#include "debuggerconstants.h" #include "debuggerconstants.h"
#include "breakpoint.h" // For 'BreakpointId' #include "breakpoint.h" // For BreakpointModelId.
#include "threaddata.h" // For ThreadId.
#include <QObject> #include <QObject>
#include <QStringList> #include <QStringList>
...@@ -205,7 +206,7 @@ public: ...@@ -205,7 +206,7 @@ public:
virtual bool acceptsDebuggerCommands() const { return true; } virtual bool acceptsDebuggerCommands() const { return true; }
virtual void assignValueInDebugger(const Internal::WatchData *data, virtual void assignValueInDebugger(const Internal::WatchData *data,
const QString &expr, const QVariant &value); const QString &expr, const QVariant &value);
virtual void selectThread(int index); virtual void selectThread(Internal::ThreadId threadId) = 0;
virtual Internal::ModulesHandler *modulesHandler() const; virtual Internal::ModulesHandler *modulesHandler() const;
virtual Internal::RegisterHandler *registerHandler() const; virtual Internal::RegisterHandler *registerHandler() const;
......
...@@ -494,6 +494,7 @@ public: ...@@ -494,6 +494,7 @@ public:
bool hasCapability(unsigned cap) const; bool hasCapability(unsigned cap) const;
bool acceptsBreakpoint(BreakpointModelId) const { return false; } bool acceptsBreakpoint(BreakpointModelId) const { return false; }
bool acceptsDebuggerCommands() const { return false; } bool acceptsDebuggerCommands() const { return false; }
void selectThread(ThreadId) {}
}; };
bool DummyEngine::hasCapability(unsigned cap) const bool DummyEngine::hasCapability(unsigned cap) const
...@@ -781,7 +782,8 @@ public slots: ...@@ -781,7 +782,8 @@ public slots:
void selectThread(int index) void selectThread(int index)
{ {
currentEngine()->selectThread(index); ThreadId id = m_currentEngine->threadsHandler()->threadAt(index);
m_currentEngine->selectThread(id);
} }
void breakpointSetMarginActionTriggered() void breakpointSetMarginActionTriggered()
...@@ -2205,7 +2207,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) ...@@ -2205,7 +2207,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
QTC_ASSERT(m_returnWindow->model(), return); QTC_ASSERT(m_returnWindow->model(), return);
QTC_ASSERT(!engine->isSlaveEngine(), return); QTC_ASSERT(!engine->isSlaveEngine(), return);
m_threadBox->setCurrentIndex(engine->threadsHandler()->currentThread()); m_threadBox->setCurrentIndex(engine->threadsHandler()->currentThreadIndex());
engine->watchHandler()->updateWatchersWindow(); engine->watchHandler()->updateWatchersWindow();
const DebuggerState state = engine->state(); const DebuggerState state = engine->state();
......
...@@ -40,7 +40,7 @@ namespace Internal { ...@@ -40,7 +40,7 @@ namespace Internal {
QDataStream &operator<<(QDataStream &stream, const ThreadData &d) QDataStream &operator<<(QDataStream &stream, const ThreadData &d)
{ {
stream << (qint64)d.id; stream << d.id.raw();
stream << d.address; stream << d.address;
stream << d.function; stream << d.function;
stream << d.fileName; stream << d.fileName;
...@@ -54,7 +54,7 @@ QDataStream &operator>>(QDataStream &stream, ThreadData &d) ...@@ -54,7 +54,7 @@ QDataStream &operator>>(QDataStream &stream, ThreadData &d)
{ {
qint64 id; qint64 id;
stream >> id; stream >> id;
d.id = id; d.id = ThreadId(id);
stream >> d.address; stream >> d.address;
stream >> d.function; stream >> d.function;
stream >> d.fileName; stream >> d.fileName;
......
...@@ -467,6 +467,8 @@ void GdbEngine::handleResponse(const QByteArray &buff) ...@@ -467,6 +467,8 @@ void GdbEngine::handleResponse(const QByteArray &buff)
m_pendingLogStreamOutput.clear(); m_pendingLogStreamOutput.clear();
m_pendingConsoleStreamOutput.clear(); m_pendingConsoleStreamOutput.clear();
} else if (asyncClass == "running") { } else if (asyncClass == "running") {
GdbMi threads = result.findChild("thread-id");
threadsHandler()->notifyRunning(threads.data());
if (state() == InferiorRunOk || state() == InferiorSetupRequested) { if (state() == InferiorRunOk || state() == InferiorSetupRequested) {
// We get multiple *running after thread creation and in Windows terminals. // We get multiple *running after thread creation and in Windows terminals.
showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1."). showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1.").
...@@ -527,6 +529,10 @@ void GdbEngine::handleResponse(const QByteArray &buff) ...@@ -527,6 +529,10 @@ void GdbEngine::handleResponse(const QByteArray &buff)
//"{id="1",group-id="28902"}" //"{id="1",group-id="28902"}"
QByteArray id = result.findChild("id").data(); QByteArray id = result.findChild("id").data();
showStatusMessage(tr("Thread %1 created").arg(_(id)), 1000); showStatusMessage(tr("Thread %1 created").arg(_(id)), 1000);
ThreadData thread;
thread.id = ThreadId(id.toLong());
thread.groupId = result.findChild("group-id").data();
threadsHandler()->updateThread(thread);
} else if (asyncClass == "thread-group-exited") { } else if (asyncClass == "thread-group-exited") {
// Archer has "{id="28902"}" // Archer has "{id="28902"}"
QByteArray id = result.findChild("id").data(); QByteArray id = result.findChild("id").data();
...@@ -538,6 +544,7 @@ void GdbEngine::handleResponse(const QByteArray &buff) ...@@ -538,6 +544,7 @@ void GdbEngine::handleResponse(const QByteArray &buff)
QByteArray groupid = result.findChild("group-id").data(); QByteArray groupid = result.findChild("group-id").data();
showStatusMessage(tr("Thread %1 in group %2 exited") showStatusMessage(tr("Thread %1 in group %2 exited")
.arg(_(id)).arg(_(groupid)), 1000); .arg(_(id)).arg(_(groupid)), 1000);
threadsHandler()->removeThread(ThreadId(id.toLong()));
} else if (asyncClass == "thread-selected") { } else if (asyncClass == "thread-selected") {
QByteArray id = result.findChild("id").data(); QByteArray id = result.findChild("id").data();
showStatusMessage(tr("Thread %1 selected").arg(_(id)), 1000); showStatusMessage(tr("Thread %1 selected").arg(_(id)), 1000);
...@@ -1397,6 +1404,9 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1397,6 +1404,9 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
return; return;
} }
GdbMi threads = data.findChild("stopped-thread");
threadsHandler()->notifyStopped(threads.data());
const QByteArray reason = data.findChild("reason").data(); const QByteArray reason = data.findChild("reason").data();
if (isExitedReason(reason)) { if (isExitedReason(reason)) {
...@@ -1748,10 +1758,6 @@ void GdbEngine::handleStop2(const GdbMi &data) ...@@ -1748,10 +1758,6 @@ void GdbEngine::handleStop2(const GdbMi &data)
// Let the event loop run before deciding whether to update the stack. // Let the event loop run before deciding whether to update the stack.
m_stackNeeded = true; // setTokenBarrier() might reset this. m_stackNeeded = true; // setTokenBarrier() might reset this.
if (isStopperThread)
m_currentThreadId = 0;
else
m_currentThreadId = data.findChild("thread-id").data().toInt();
QTimer::singleShot(0, this, SLOT(handleStop2())); QTimer::singleShot(0, this, SLOT(handleStop2()));
} }
...@@ -3489,15 +3495,12 @@ void GdbEngine::reloadSourceFilesInternal() ...@@ -3489,15 +3495,12 @@ void GdbEngine::reloadSourceFilesInternal()
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void GdbEngine::selectThread(int index) void GdbEngine::selectThread(ThreadId threadId)
{ {
threadsHandler()->setCurrentThread(index); threadsHandler()->setCurrentThread(threadId);
Threads threads = threadsHandler()->threads();
QTC_ASSERT(index < threads.size(), return);
const int id = threads.at(index).id;
showStatusMessage(tr("Retrieving data for stack view thread 0x%1...") showStatusMessage(tr("Retrieving data for stack view thread 0x%1...")
.arg(id, 0, 16), 10000); .arg(threadId.raw(), 0, 16), 10000);
postCommand("-thread-select " + QByteArray::number(id), Discardable, postCommand("-thread-select " + QByteArray::number(threadId.raw()), Discardable,
CB(handleStackSelectThread)); CB(handleStackSelectThread));
} }
...@@ -3641,11 +3644,7 @@ void GdbEngine::handleStackSelectFrame(const GdbResponse &response) ...@@ -3641,11 +3644,7 @@ void GdbEngine::handleStackSelectFrame(const GdbResponse &response)
void GdbEngine::handleThreadInfo(const GdbResponse &response) void GdbEngine::handleThreadInfo(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
int currentThreadId; threadsHandler()->updateThreads(response.data);
const Threads threads =
ThreadsHandler::parseGdbmiThreads(response.data, &currentThreadId);
threadsHandler()->setThreads(threads);
threadsHandler()->setCurrentThreadId(currentThreadId);
updateViews(); // Adjust Threads combobox. updateViews(); // Adjust Threads combobox.
if (m_hasInferiorThreadList && debuggerCore()->boolSetting(ShowThreadNames)) { if (m_hasInferiorThreadList && debuggerCore()->boolSetting(ShowThreadNames)) {
postCommand("threadnames " + postCommand("threadnames " +
...@@ -3663,37 +3662,28 @@ void GdbEngine::handleThreadListIds(const GdbResponse &response) ...@@ -3663,37 +3662,28 @@ void GdbEngine::handleThreadListIds(const GdbResponse &response)
{ {
// "72^done,{thread-ids={thread-id="2",thread-id="1"},number-of-threads="2"} // "72^done,{thread-ids={thread-id="2",thread-id="1"},number-of-threads="2"}
// In gdb 7.1+ additionally: current-thread-id="1" // In gdb 7.1+ additionally: current-thread-id="1"
ThreadsHandler *handler = threadsHandler();
const QList<GdbMi> items = response.data.findChild("thread-ids").children(); const QList<GdbMi> items = response.data.findChild("thread-ids").children();
Threads threads;
for (int index = 0, n = items.size(); index != n; ++index) { for (int index = 0, n = items.size(); index != n; ++index) {
ThreadData thread; ThreadData thread;
thread.id = items.at(index).data().toInt(); thread.id = ThreadId(items.at(index).data().toInt());
threads.append(thread); handler->updateThread(thread);
} }
threadsHandler()->setThreads(threads);
threadsHandler()->setCurrentThreadId(m_currentThreadId);
} }
void GdbEngine::handleThreadNames(const GdbResponse &response) void GdbEngine::handleThreadNames(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
ThreadsHandler *handler = threadsHandler();
GdbMi names; GdbMi names;
names.fromString(response.consoleStreamOutput); names.fromString(response.consoleStreamOutput);
Threads threads = threadsHandler()->threads();
foreach (const GdbMi &name, names.children()) { foreach (const GdbMi &name, names.children()) {
int id = name.findChild("id").data().toInt(); ThreadData thread;
for (int index = 0, n = threads.size(); index != n; ++index) { thread.id = ThreadId(name.findChild("id").data().toInt());
ThreadData &thread = threads[index]; thread.name = decodeData(name.findChild("value").data(),
if (thread.id == quint64(id)) { name.findChild("valueencoded").data().toInt());
thread.name = decodeData(name.findChild("value").data(), handler->updateThread(thread);
name.findChild("valueencoded").data().toInt());
break;
}
}
} }
threadsHandler()->setThreads(threads);
updateViews(); updateViews();
} }
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "stackframe.h" #include "stackframe.h"
#include "watchhandler.h" #include "watchhandler.h"
#include "watchutils.h" #include "watchutils.h"
#include "threaddata.h"
#include <QByteArray> #include <QByteArray>
#include <QProcess> #include <QProcess>
...@@ -437,7 +438,7 @@ private: ////////// Inferior Management ////////// ...@@ -437,7 +438,7 @@ private: ////////// Inferior Management //////////
private: ////////// View & Data Stuff ////////// private: ////////// View & Data Stuff //////////
protected: protected:
void selectThread(int index); void selectThread(ThreadId threadId);
void activateFrame(int index); void activateFrame(int index);
void resetLocation(); void resetLocation();
...@@ -664,7 +665,6 @@ protected: ...@@ -664,7 +665,6 @@ protected:
// For short-circuiting stack and thread list evaluation. // For short-circuiting stack and thread list evaluation.
bool m_stackNeeded; bool m_stackNeeded;
int m_currentThreadId;
// //
// Qml // Qml
......
...@@ -208,7 +208,6 @@ void IPCEngineHost::executeJumpToLine(const ContextData &data) ...@@ -208,7 +208,6 @@ void IPCEngineHost::executeJumpToLine(const ContextData &data)
rpcCall(ExecuteJumpToLine, p); rpcCall(ExecuteJumpToLine, p);
} }
void IPCEngineHost::activateFrame(int index) void IPCEngineHost::activateFrame(int index)
{ {
resetLocation(); resetLocation();
...@@ -221,16 +220,15 @@ void IPCEngineHost::activateFrame(int index) ...@@ -221,16 +220,15 @@ void IPCEngineHost::activateFrame(int index)
rpcCall(ActivateFrame, p); rpcCall(ActivateFrame, p);
} }
void IPCEngineHost::selectThread(int index) void IPCEngineHost::selectThread(ThreadId id)
{ {
resetLocation(); resetLocation();
Threads threads = threadsHandler()->threads(); QTC_ASSERT(id.isValid(), return);
QTC_ASSERT(index < threads.size(), return);
QByteArray p; QByteArray p;
{ {
QDataStream s(&p, QIODevice::WriteOnly); QDataStream s(&p, QIODevice::WriteOnly);
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
s << quint64(threads.at(index).id); s << id.raw();
} }
rpcCall(SelectThread, p); rpcCall(SelectThread, p);
} }
...@@ -442,7 +440,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload) ...@@ -442,7 +440,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
quint64 token; quint64 token;
s >> token; s >> token;
threadsHandler()->setCurrentThreadId(token); threadsHandler()->setCurrentThread(ThreadId(token));
} }
break; break;
case IPCEngineGuest::ListFrames: case IPCEngineGuest::ListFrames:
......
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
void executeRunToFunction(const QString &functionName); void executeRunToFunction(const QString &functionName);
void executeJumpToLine(const ContextData &data); void executeJumpToLine(const ContextData &data);
void activateFrame(int index); void activateFrame(int index);
void selectThread(int index); void selectThread(ThreadId index);
void fetchDisassembler(DisassemblerAgent *); void fetchDisassembler(DisassemblerAgent *);
bool acceptsBreakpoint(BreakpointModelId) const { return true; } // FIXME bool acceptsBreakpoint(BreakpointModelId) const { return true; } // FIXME
void insertBreakpoint(BreakpointModelId id); void insertBreakpoint(BreakpointModelId id);
......
...@@ -321,9 +321,9 @@ void PdbEngine::activateFrame(int frameIndex) ...@@ -321,9 +321,9 @@ void PdbEngine::activateFrame(int frameIndex)
gotoLocation(handler->currentFrame()); gotoLocation(handler->currentFrame());
} }
void PdbEngine::selectThread(int index) void PdbEngine::selectThread(ThreadId threadId)
{ {
Q_UNUSED(index) Q_UNUSED(threadId)
} }
bool PdbEngine::acceptsBreakpoint(BreakpointModelId id) const bool PdbEngine::acceptsBreakpoint(BreakpointModelId id) const
......
...@@ -86,7 +86,7 @@ private: ...@@ -86,7 +86,7 @@ private:
void executeJumpToLine(const ContextData &data); void executeJumpToLine(const ContextData &data);
void activateFrame(int index); void activateFrame(int index);
void selectThread(int index); void selectThread(ThreadId threadId);
bool acceptsBreakpoint(BreakpointModelId id) const; bool acceptsBreakpoint(BreakpointModelId id) const;
void insertBreakpoint(BreakpointModelId id); void insertBreakpoint(BreakpointModelId id);
......
...@@ -267,9 +267,9 @@ bool QmlCppEngine::acceptsBreakpoint(BreakpointModelId id) const ...@@ -267,9 +267,9 @@ bool QmlCppEngine::acceptsBreakpoint(BreakpointModelId id) const
|| d->m_qmlEngine->acceptsBreakpoint(id); || d->m_qmlEngine->acceptsBreakpoint(id);
} }
void QmlCppEngine::selectThread(int index) void QmlCppEngine::selectThread(ThreadId threadId)
{