forked from qt-creator/qt-creator
Fixes: debugger: also show the original address in a tooltip when
auto-dereferencing contents
This commit is contained in:
@@ -798,6 +798,7 @@ static void qDumpInnerValueOrPointer(QDumper &d,
|
||||
if (strippedtype) {
|
||||
if (deref(addr)) {
|
||||
P(d, "addr", deref(addr));
|
||||
P(d, "saddr", deref(addr));
|
||||
P(d, "type", strippedtype);
|
||||
qDumpInnerValueHelper(d, strippedtype, deref(addr));
|
||||
} else {
|
||||
@@ -1224,6 +1225,7 @@ static void qDumpQList(QDumper &d)
|
||||
P(d, "name", i);
|
||||
if (innerTypeIsPointer) {
|
||||
void *p = ldata.d->array + i + pdata->begin;
|
||||
P(d, "saddr", p);
|
||||
if (p) {
|
||||
//P(d, "value","@" << p);
|
||||
qDumpInnerValue(d, strippedInnerType.data(), deref(p));
|
||||
|
||||
@@ -2991,6 +2991,12 @@ static void setWatchDataAddress(WatchData &data, const GdbMi &mi)
|
||||
}
|
||||
}
|
||||
|
||||
static void setWatchDataSAddress(WatchData &data, const GdbMi &mi)
|
||||
{
|
||||
if (mi.isValid())
|
||||
data.saddr = mi.data();
|
||||
}
|
||||
|
||||
static bool extractTemplate(const QString &type, QString *tmplate, QString *inner)
|
||||
{
|
||||
// Input "Template<Inner1,Inner2,...>::Foo" will return "Template::Foo" in
|
||||
@@ -3729,6 +3735,7 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
|
||||
setWatchDataValue(data, contents.findChild("value"),
|
||||
contents.findChild("valueencoded").data().toInt());
|
||||
setWatchDataAddress(data, contents.findChild("addr"));
|
||||
setWatchDataSAddress(data, contents.findChild("saddr"));
|
||||
setWatchDataChildCount(data, contents.findChild("numchild"));
|
||||
setWatchDataValueToolTip(data, contents.findChild("valuetooltip"));
|
||||
setWatchDataValueDisabled(data, contents.findChild("valuedisabled"));
|
||||
@@ -3777,6 +3784,7 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
|
||||
setWatchDataValue(data1, item.findChild("value"),
|
||||
item.findChild("valueencoded").data().toInt());
|
||||
setWatchDataAddress(data1, item.findChild("addr"));
|
||||
setWatchDataSAddress(data1, item.findChild("saddr"));
|
||||
setWatchDataValueToolTip(data1, item.findChild("valuetooltip"));
|
||||
setWatchDataValueDisabled(data1, item.findChild("valuedisabled"));
|
||||
if (!qq->watchHandler()->isExpandedIName(data1.iname))
|
||||
@@ -4035,6 +4043,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
|
||||
setWatchDataType(data, item.findChild("type"));
|
||||
setWatchDataValue(data, item.findChild("value"));
|
||||
setWatchDataAddress(data, item.findChild("addr"));
|
||||
setWatchDataSAddress(data, item.findChild("saddr"));
|
||||
data.setChildCount(0);
|
||||
insertData(data);
|
||||
} else if (parent.iname.endsWith('.')) {
|
||||
@@ -4056,6 +4065,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
|
||||
setWatchDataType(data, item.findChild("type"));
|
||||
setWatchDataValue(data, item.findChild("value"));
|
||||
setWatchDataAddress(data, item.findChild("addr"));
|
||||
setWatchDataSAddress(data, item.findChild("saddr"));
|
||||
setWatchDataChildCount(data, item.findChild("numchild"));
|
||||
if (!qq->watchHandler()->isExpandedIName(data.iname))
|
||||
data.setChildrenUnneeded();
|
||||
|
||||
@@ -476,8 +476,10 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const
|
||||
//else
|
||||
tt += "<tr><td>value</td><td> : </td><td>";
|
||||
tt += htmlQuote(data.value) + "</td></tr>";
|
||||
tt += "<tr><td>addr</td><td> : </td><td>";
|
||||
tt += "<tr><td>object addr</td><td> : </td><td>";
|
||||
tt += htmlQuote(data.addr) + "</td></tr>";
|
||||
tt += "<tr><td>stored addr</td><td> : </td><td>";
|
||||
tt += htmlQuote(data.saddr) + "</td></tr>";
|
||||
tt += "<tr><td>iname</td><td> : </td><td>";
|
||||
tt += htmlQuote(data.iname) + "</td></tr>";
|
||||
tt += "</table>";
|
||||
|
||||
@@ -113,6 +113,7 @@ public:
|
||||
QString type; // displayed type
|
||||
QString variable; // name of internal Gdb variable if created
|
||||
QString addr; // displayed adress
|
||||
QString saddr; // stored address (pointer in container)
|
||||
QString framekey; // key for type cache
|
||||
QScriptValue scriptValue; // if needed...
|
||||
int childCount;
|
||||
|
||||
@@ -285,6 +285,11 @@ void testQList()
|
||||
li.append(102);
|
||||
li.append(102);
|
||||
|
||||
QList<int *> lpi;
|
||||
lpi.append(new int(1));
|
||||
lpi.append(new int(2));
|
||||
lpi.append(new int(3));
|
||||
|
||||
|
||||
for (int i = 0; i != 3; ++i) {
|
||||
lu.append(i);
|
||||
|
||||
Reference in New Issue
Block a user