forked from qt-creator/qt-creator
Debugger/Stack layout view: Exclude Dereferenced Pointers.
by WatchData::referencingAddress as they are outside the address range.
This commit is contained in:
@@ -217,6 +217,7 @@ enum ModelRoles
|
|||||||
LocalsTypeFormatRole, // Used to communicate alternative formats to the view
|
LocalsTypeFormatRole, // Used to communicate alternative formats to the view
|
||||||
LocalsIndividualFormatRole,
|
LocalsIndividualFormatRole,
|
||||||
LocalsAddressRole, // Memory address of variable as quint64
|
LocalsAddressRole, // Memory address of variable as quint64
|
||||||
|
LocalsReferencingAddressRole, // Address referencing for 'Automatically dereferenced pointer'
|
||||||
LocalsSizeRole, // Size of variable as quint
|
LocalsSizeRole, // Size of variable as quint
|
||||||
LocalsRawValueRole, // Unformatted value as string
|
LocalsRawValueRole, // Unformatted value as string
|
||||||
LocalsPointerValueRole, // Pointer value (address) as quint64
|
LocalsPointerValueRole, // Pointer value (address) as quint64
|
||||||
|
|||||||
@@ -748,6 +748,8 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
|
|||||||
|
|
||||||
case LocalsAddressRole:
|
case LocalsAddressRole:
|
||||||
return data.coreAddress();
|
return data.coreAddress();
|
||||||
|
case LocalsReferencingAddressRole:
|
||||||
|
return QVariant(data.referencingAddress);
|
||||||
case LocalsSizeRole:
|
case LocalsSizeRole:
|
||||||
return QVariant(data.size);
|
return QVariant(data.size);
|
||||||
|
|
||||||
|
|||||||
@@ -406,8 +406,11 @@ static inline void addStackLayoutMemoryView(DebuggerEngine *engine,
|
|||||||
quint64 start = 0xFFFFFFFFFFFFFFFF;
|
quint64 start = 0xFFFFFFFFFFFFFFFF;
|
||||||
quint64 end = 0;
|
quint64 end = 0;
|
||||||
const int rootItemCount = m->rowCount();
|
const int rootItemCount = m->rowCount();
|
||||||
for (int r = 0; r < rootItemCount; r++) { // Note: Unsorted by default
|
// Note: Unsorted by default. Exclude 'Automatically dereferenced
|
||||||
|
// pointer' items as they are outside the address range.
|
||||||
|
for (int r = 0; r < rootItemCount; r++) {
|
||||||
const QModelIndex idx = m->index(r, 0);
|
const QModelIndex idx = m->index(r, 0);
|
||||||
|
if (idx.data(LocalsReferencingAddressRole).toULongLong() == 0) {
|
||||||
const quint64 address = addressOf(idx);
|
const quint64 address = addressOf(idx);
|
||||||
if (address) {
|
if (address) {
|
||||||
if (address < start)
|
if (address < start)
|
||||||
@@ -417,12 +420,11 @@ static inline void addStackLayoutMemoryView(DebuggerEngine *engine,
|
|||||||
end = address + size;
|
end = address + size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Anything found and everything in a sensible range (static data in-between)?
|
// Anything found and everything in a sensible range (static data in-between)?
|
||||||
if (end <= start || end - start > 100 * 1024) {
|
if (end <= start || end - start > 100 * 1024) {
|
||||||
QMessageBox::information(parent, WatchWindow::tr("Cannot Display Stack Layout"),
|
QMessageBox::information(parent, WatchWindow::tr("Cannot Display Stack Layout"),
|
||||||
WatchWindow::tr("Could not determine a suitable address range. "
|
WatchWindow::tr("Could not determine a suitable address range."));
|
||||||
"Unchecking the option 'Automatically Dereference Pointers' "
|
|
||||||
"might help."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Take a look at the register values. Extend the range a bit if suitable
|
// Take a look at the register values. Extend the range a bit if suitable
|
||||||
|
|||||||
Reference in New Issue
Block a user