Commit 739bde07 authored by David Schulz's avatar David Schulz Committed by Christian Stenger

Cdbext: Fix the expression returned for watchers.

Returning now the expression that was used to
add this watch, not a fixed up value in the
*(Type *) address format.

Change-Id: I7cb49b3f6370a6b25758c2a2240a004d1bc2f8a3
Task-number: QTCREATORBUG-12801
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 5930ded2
......@@ -638,6 +638,12 @@ std::string LocalsSymbolGroup::module() const
const char *WatchesSymbolGroup::watchInamePrefix = "watch";
bool WatchesSymbolGroup::isWatchIname(const std::string &iname)
{
static const size_t prefLen = std::strlen(WatchesSymbolGroup::watchInamePrefix);
return !iname.compare(0, prefLen, WatchesSymbolGroup::watchInamePrefix);
}
WatchesSymbolGroup::WatchesSymbolGroup(CIDebugSymbolGroup *sg) :
SymbolGroup(sg, SymbolParameterVector(), std::string(), WatchesSymbolGroup::watchInamePrefix)
{
......@@ -776,9 +782,8 @@ std::string WatchesSymbolGroup::fixWatchExpression(CIDebugSymbols *s, const std:
bool WatchesSymbolGroup::addWatch(CIDebugSymbols *s, std::string iname, const std::string &expression, std::string *errorMessage)
{
// "watch.0" -> "0"
const size_t prefLen = std::strlen(WatchesSymbolGroup::watchInamePrefix);
if (!iname.compare(0, prefLen, WatchesSymbolGroup::watchInamePrefix))
iname.erase(0, prefLen + 1);
if (isWatchIname(iname))
iname.erase(0, std::strlen(WatchesSymbolGroup::watchInamePrefix) + 1);
// Already in?
if (root()->childByIName(iname.c_str()))
return true;
......
......@@ -157,6 +157,7 @@ public:
typedef std::map<std::string, std::string> InameExpressionMap;
static const char *watchInamePrefix;
static bool isWatchIname(const std::string &iname);
// Add a symbol as 'watch.0' or '0' with expression
bool addWatch(CIDebugSymbols *s, std::string iname, const std::string &expression, std::string *errorMessage);
......
......@@ -196,8 +196,10 @@ void AbstractSymbolGroupNode::dumpBasicData(std::ostream &str, const std::string
str << "iname=\"" << aFullIname << "\",name=\"" << aName << '"';
if (!type.empty())
str << ",type=\"" << type << '"';
if (!expression.empty())
str << ",exp=\"" << expression << '"';
if (WatchesSymbolGroup::isWatchIname(aFullIname))
str << ",exp=\"" << aName << '"';
else if (!expression.empty())
str << ",exp=\"" << expression << '"';
}
void AbstractSymbolGroupNode::setParent(AbstractSymbolGroupNode *n)
......
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