forked from qt-creator/qt-creator
CDB: Pass referenced address in separate GDBMI field.
Use 'origaddr' as gdb does. Do not append address to watch value if it is already contained in the value. Fixes the currently grayed-out 'Open memory editor at referenced address'. Change-Id: I6f7cf5b7984f93606ad4bb0872348f51c73f9117 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -1066,8 +1066,25 @@ int SymbolGroupNode::dumpNode(std::ostream &str,
|
|||||||
const std::string watchExp = t.empty() ? aName : watchExpression(addr, t, m_dumperType, m_module);
|
const std::string watchExp = t.empty() ? aName : watchExpression(addr, t, m_dumperType, m_module);
|
||||||
SymbolGroupNode::dumpBasicData(str, aName, aFullIName, t, watchExp);
|
SymbolGroupNode::dumpBasicData(str, aName, aFullIName, t, watchExp);
|
||||||
|
|
||||||
if (addr)
|
std::wstring value = simpleDumpValue(ctx);
|
||||||
str << ",addr=\"" << std::hex << std::showbase << addr << std::noshowbase << std::dec << '"';
|
|
||||||
|
if (addr) {
|
||||||
|
ULONG64 referencedAddr = 0;
|
||||||
|
// Determine referenced address of pointers?
|
||||||
|
if (!value.compare(0, 2u, L"0x")) {
|
||||||
|
std::wistringstream str(value.substr(2u, value.size() - 2u));
|
||||||
|
str >> std::hex >> referencedAddr;
|
||||||
|
}
|
||||||
|
// Emulate gdb's behaviour of returning the referenced address
|
||||||
|
// for pointers.
|
||||||
|
str << std::hex << std::showbase;
|
||||||
|
if (referencedAddr) {
|
||||||
|
str << ",addr=\"" << referencedAddr << "\",origaddr=\"" << addr << '"';
|
||||||
|
} else {
|
||||||
|
str << ",addr=\"" << addr << '"';
|
||||||
|
}
|
||||||
|
str << std::noshowbase << std::dec;
|
||||||
|
}
|
||||||
const ULONG s = size();
|
const ULONG s = size();
|
||||||
if (s)
|
if (s)
|
||||||
str << ",size=\"" << s << '"';
|
str << ",size=\"" << s << '"';
|
||||||
@@ -1076,7 +1093,6 @@ int SymbolGroupNode::dumpNode(std::ostream &str,
|
|||||||
bool valueEnabled = !uninitialized;
|
bool valueEnabled = !uninitialized;
|
||||||
|
|
||||||
// Shall it be recoded?
|
// Shall it be recoded?
|
||||||
std::wstring value = simpleDumpValue(ctx);
|
|
||||||
int encoding = 0;
|
int encoding = 0;
|
||||||
if (dumpParameters.recode(t, aFullIName, ctx, addr, &value, &encoding)) {
|
if (dumpParameters.recode(t, aFullIName, ctx, addr, &value, &encoding)) {
|
||||||
str << ",valueencoded=\"" << encoding
|
str << ",valueencoded=\"" << encoding
|
||||||
|
@@ -955,9 +955,14 @@ QString WatchModel::display(const WatchItem *item, int col) const
|
|||||||
case 1:
|
case 1:
|
||||||
result = removeInitialNamespace(
|
result = removeInitialNamespace(
|
||||||
truncateValue(formattedValue(*item)));
|
truncateValue(formattedValue(*item)));
|
||||||
|
// Append referencing address unless the value contains it.
|
||||||
if (item->referencingAddress) {
|
if (item->referencingAddress) {
|
||||||
result += QLatin1String(" @");
|
if (result.startsWith(QLatin1String("0x"))) {
|
||||||
result += QString::fromLatin1(item->hexReferencingAddress());
|
result.prepend(QLatin1Char('@'));
|
||||||
|
} else {
|
||||||
|
result += QLatin1String(" @");
|
||||||
|
result += QString::fromLatin1(item->hexReferencingAddress());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
Reference in New Issue
Block a user