Commit c8862ad4 authored by hjk's avatar hjk
Browse files

Debugger: Simplify thread parsing code.



Change-Id: Idad3a54305e5da6cd81555815c17c1bd66aa7388
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent f1fb879e
...@@ -431,22 +431,21 @@ void ThreadsHandler::updateThreads(const GdbMi &data) ...@@ -431,22 +431,21 @@ void ThreadsHandler::updateThreads(const GdbMi &data)
const QList<GdbMi> items = data["threads"].children(); const QList<GdbMi> items = data["threads"].children();
const int n = items.size(); const int n = items.size();
for (int index = 0; index != n; ++index) { for (int index = 0; index != n; ++index) {
bool ok = false;
const GdbMi item = items.at(index); const GdbMi item = items.at(index);
const GdbMi frame = item["frame"]; const GdbMi frame = item["frame"];
ThreadData thread; ThreadData thread;
thread.id = ThreadId(item["id"].toInt()); thread.id = ThreadId(item["id"].toInt());
thread.targetId = QString::fromLatin1(item["target-id"].data()); thread.targetId = item["target-id"].toLatin1();
thread.details = QString::fromLatin1(item["details"].data()); thread.details = item["details"].toLatin1();
thread.core = QString::fromLatin1(item["core"].data()); thread.core = item["core"].toLatin1();
thread.state = QString::fromLatin1(item["state"].data()); thread.state = item["state"].toLatin1();
thread.address = frame["addr"].data().toULongLong(&ok, 0); thread.address = frame["addr"].toAddress();
thread.function = QString::fromLatin1(frame["func"].data()); thread.function = frame["func"].toLatin1();
thread.fileName = QString::fromLatin1(frame["fullname"].data()); thread.fileName = frame["fullname"].toLatin1();
thread.lineNumber = frame["line"].toInt(); thread.lineNumber = frame["line"].toInt();
thread.module = QString::fromLocal8Bit(frame["from"].data()); thread.module = QString::fromLocal8Bit(frame["from"].data());
thread.stopped = true; thread.stopped = true;
thread.name = QString::fromLatin1(item["name"].data()); thread.name = item["name"].toLatin1();
if (thread.state == QLatin1String("running")) if (thread.state == QLatin1String("running"))
thread.stopped = false; thread.stopped = false;
if (thread.id == currentId) if (thread.id == currentId)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment