Commit 432ad0bf authored by hjk's avatar hjk

debugger: register view and disassembler window cosmetics

parent 3089667d
......@@ -4002,12 +4002,12 @@ static QByteArray parseLine(const GdbMi &line)
QByteArray ba;
ba.reserve(200);
QByteArray address = line.findChild("address").data();
QByteArray funcName = line.findChild("func-name").data();
QByteArray offset = line.findChild("offset").data();
//QByteArray funcName = line.findChild("func-name").data();
//QByteArray offset = line.findChild("offset").data();
QByteArray inst = line.findChild("inst").data();
ba += address + QByteArray(15 - address.size(), ' ');
ba += funcName + "+" + offset + " ";
ba += QByteArray(30 - funcName.size() - offset.size(), ' ');
//ba += funcName + "+" + offset + " ";
//ba += QByteArray(30 - funcName.size() - offset.size(), ' ');
ba += inst;
ba += '\n';
return ba;
......@@ -4044,7 +4044,7 @@ static QString parseDisassembler(const GdbMi &lines)
fileLoaded = true;
}
if (line >= 0 && line < fileContents.size())
ba += " " + fileContents.at(line) + '\n';
ba += " " + fileContents.at(line) + '\n';
GdbMi insn = child.findChild("line_asm_insn");
foreach (const GdbMi &line, insn.children())
......
......@@ -77,9 +77,10 @@ QVariant RegisterHandler::data(const QModelIndex &index, int role) const
const Register &reg = m_registers.at(index.row());
if (role == Qt::UserRole + 1) {
// return some address associated with the register
bool ok = true;
qulonglong value = reg.value.toULongLong(&ok, 0);
return QString::fromLatin1("0x") + QString::number(value, 16);
return ok ? QString::fromLatin1("0x") + QString::number(value, 16) : QVariant();
}
const QString padding = " ";
......@@ -89,7 +90,7 @@ QVariant RegisterHandler::data(const QModelIndex &index, int role) const
case 1: {
bool ok = true;
qulonglong value = reg.value.toULongLong(&ok, 0);
return padding + QString::number(value, m_base) + padding;
return ok ? padding + QString::number(value, m_base) + padding : reg.value;
}
}
}
......
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