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

debugger: handle decimal and hex output for address values

Change-Id: Ieed0cf78ab65fe94355159df173e200a1c195765
Reviewed-on: http://codereview.qt.nokia.com/1311Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent fdcd6dc2
......@@ -276,7 +276,7 @@ void WatchData::setAddress(const quint64 &a)
void WatchData::setHexAddress(const QByteArray &a)
{
bool ok;
const qint64 av = a.toULongLong(&ok, 16);
const qint64 av = a.toULongLong(&ok, 0);
if (ok) {
address = av;
} else {
......
......@@ -366,7 +366,7 @@ static inline QString formattedValue(const WatchData &data, int format)
return data.value;
// Evil hack, covers 'unsigned' as well as quint64.
if (data.type.contains('u'))
return reformatInteger(data.value.toULongLong(), format);
return reformatInteger(data.value.toULongLong(0, 0), format);
return reformatInteger(data.value.toLongLong(), format);
}
......@@ -412,16 +412,11 @@ static inline QString formattedValue(const WatchData &data, int format)
// "0x00000000`000003fd "Hallo"", or check gdb formatting of characters.
static inline quint64 pointerValue(QString data)
{
if (data.isEmpty() || !data.startsWith(QLatin1String("0x")))
return 0;
data.remove(0, 2);
const int blankPos = data.indexOf(QLatin1Char(' '));
if (blankPos != -1)
data.truncate(blankPos);
data.remove(QLatin1Char('`'));
bool ok;
const quint64 address = data.toULongLong(&ok, 16);
return ok ? address : quint64(0);
return data.toULongLong(0, 0);
}
// Return the type used for editing
......@@ -769,7 +764,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
}
case LocalsAddressRole:
return data.coreAddress();
return QVariant(data.coreAddress());
case LocalsReferencingAddressRole:
return QVariant(data.referencingAddress);
case LocalsSizeRole:
......
......@@ -739,7 +739,7 @@ static void setWatchDataExpression(WatchData &data, const GdbMi &mi)
data.exp = mi.data();
}
static void setWatchDataAddress(WatchData &data, quint64 address , quint64 origAddress = 0)
static void setWatchDataAddress(WatchData &data, quint64 address, quint64 origAddress = 0)
{
if (origAddress) { // Gdb dumpers reports the dereferenced address as origAddress
data.address = origAddress;
......
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