forked from qt-creator/qt-creator
Debugger: Use the code model to detect unitialized variables.
This should save debugger round trips and crashes in the debugging helpers. Add respective option to debugging helper option page, defaulting to true.On this occasion, make CDB detect shadowed variables correctly and display them as "<shadowed n>" as does the Gdb engine by reversing the direction in which CdbSymbolGroupContext::populateINameIndexMap works. Rubber-stamped-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
@@ -105,6 +105,7 @@ WatchData::WatchData() :
|
||||
generation(-1),
|
||||
valueEnabled(true),
|
||||
valueEditable(true),
|
||||
error(false),
|
||||
source(0),
|
||||
state(InitialState),
|
||||
changed(false)
|
||||
@@ -127,7 +128,8 @@ bool WatchData::isEqual(const WatchData &other) const
|
||||
&& framekey == other.framekey
|
||||
&& hasChildren == other.hasChildren
|
||||
&& valueEnabled == other.valueEnabled
|
||||
&& valueEditable == other.valueEditable;
|
||||
&& valueEditable == other.valueEditable
|
||||
&& error == other.error;
|
||||
}
|
||||
|
||||
void WatchData::setError(const QString &msg)
|
||||
@@ -137,6 +139,7 @@ void WatchData::setError(const QString &msg)
|
||||
setHasChildren(false);
|
||||
valueEnabled = false;
|
||||
valueEditable = false;
|
||||
error = true;
|
||||
}
|
||||
|
||||
void WatchData::setValue(const QString &value0)
|
||||
@@ -232,6 +235,8 @@ QString WatchData::toString() const
|
||||
str << "iname=\"" << iname << doubleQuoteComma;
|
||||
if (!name.isEmpty() && name != iname)
|
||||
str << "name=\"" << name << doubleQuoteComma;
|
||||
if (error)
|
||||
str << "error,";
|
||||
if (!addr.isEmpty())
|
||||
str << "addr=\"" << addr << doubleQuoteComma;
|
||||
if (!exp.isEmpty())
|
||||
@@ -310,6 +315,19 @@ QString WatchData::toToolTip() const
|
||||
return res;
|
||||
}
|
||||
|
||||
QString WatchData::msgNotInScope()
|
||||
{
|
||||
static const QString rc = QCoreApplication::translate("Debugger::Internal::WatchData", "<not in scope>");
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString WatchData::shadowedName(const QString &name, int seen)
|
||||
{
|
||||
if (seen <= 0)
|
||||
return name;
|
||||
return QCoreApplication::translate("Debugger::Internal::WatchData", "%1 <shadowed %2>").arg(name).arg(seen);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// WatchModel
|
||||
|
||||
Reference in New Issue
Block a user