Commit a67d8205 authored by hjk's avatar hjk Committed by hjk

debugger: fix hex input when changing register values

Change-Id: I198e1631d488aff9250e3438ed2fade5aa89968b
Reviewed-on: http://codereview.qt-project.org/4888Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent ce9ea72c
......@@ -3611,14 +3611,7 @@ void GdbEngine::reloadRegisters()
void GdbEngine::setRegisterValue(int nr, const QString &value)
{
Register reg = registerHandler()->registers().at(nr);
//qDebug() << "NOT IMPLEMENTED: CHANGE REGISTER " << nr << reg.name << ":"
// << value;
postCommand("-var-delete \"R@\"");
postCommand("-var-create \"R@\" * $" + reg.name);
postCommand("-var-assign \"R@\" " + value.toLatin1());
postCommand("-var-delete \"R@\"");
//postCommand("-data-list-register-values d",
// Discardable, CB(handleRegisterListValues));
postCommand("set $" + reg.name + "=" + value.toLatin1());
reloadRegisters();
}
......
......@@ -111,7 +111,11 @@ public:
return;
IntegerWatchLineEdit *lineEdit = qobject_cast<IntegerWatchLineEdit*>(editor);
QTC_ASSERT(lineEdit, return);
currentEngine()->setRegisterValue(index.row(), lineEdit->text());
const int base = currentHandler()->numberBase();
QString value = lineEdit->text();
if (base == 16 && !value.startsWith("0x"))
value = "0x" + value;
currentEngine()->setRegisterValue(index.row(), value);
}
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
......
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