forked from qt-creator/qt-creator
		
	debugger: make 'watch' item work with new dumpers
This commit is contained in:
		@@ -3543,10 +3543,20 @@ void GdbEngine::updateLocals(const QVariant &cookie)
 | 
			
		||||
        m_processedNames.clear();
 | 
			
		||||
        manager()->watchHandler()->beginCycle();
 | 
			
		||||
        m_toolTipExpression.clear();
 | 
			
		||||
        QStringList expanded = m_manager->watchHandler()->expandedINames().toList();
 | 
			
		||||
        postCommand(_("-interpreter-exec console \"bb %1 0 %2\"")
 | 
			
		||||
        WatchHandler *handler = m_manager->watchHandler();
 | 
			
		||||
        QStringList expanded = handler->expandedINames().toList();
 | 
			
		||||
        QString watchers;
 | 
			
		||||
        foreach (QString item, handler->watchedExpressions()) {
 | 
			
		||||
            if (!watchers.isEmpty())
 | 
			
		||||
                watchers += _("$");
 | 
			
		||||
            //item.replace(_("\""), _("\\\""));
 | 
			
		||||
            watchers += item;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        postCommand(_("-interpreter-exec console \"bb %1 0 %2 %3\"")
 | 
			
		||||
                .arg(int(theDebuggerBoolSetting(UseDebuggingHelpers)))
 | 
			
		||||
                .arg(expanded.join(_(","))),
 | 
			
		||||
                .arg(expanded.join(_(",")))
 | 
			
		||||
                .arg(_(watchers.toLatin1().toBase64())),
 | 
			
		||||
            CB(handleStackFrame));
 | 
			
		||||
    } else {
 | 
			
		||||
        m_processedNames.clear();
 | 
			
		||||
 
 | 
			
		||||
@@ -644,7 +644,8 @@ static QString formattedValue(const WatchData &data,
 | 
			
		||||
 | 
			
		||||
bool WatchModel::canFetchMore(const QModelIndex &index) const
 | 
			
		||||
{
 | 
			
		||||
    return !m_inExtraLayoutChanged && index.isValid() && !m_fetchTriggered.contains(watchItem(index)->iname);
 | 
			
		||||
    return !m_inExtraLayoutChanged && index.isValid()
 | 
			
		||||
        && !m_fetchTriggered.contains(watchItem(index)->iname);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WatchModel::fetchMore(const QModelIndex &index)
 | 
			
		||||
@@ -1389,10 +1390,9 @@ void WatchHandler::loadWatchers()
 | 
			
		||||
    //reinitializeWatchersHelper();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WatchHandler::saveWatchers()
 | 
			
		||||
QStringList WatchHandler::watchedExpressions() const
 | 
			
		||||
{
 | 
			
		||||
    //qDebug() << "SAVE WATCHERS: " << m_watchers;
 | 
			
		||||
    // Filter out valid watchers.
 | 
			
		||||
    // Filter out invalid watchers.
 | 
			
		||||
    QStringList watcherNames;
 | 
			
		||||
    QHashIterator<QString, int> it(m_watcherNames);
 | 
			
		||||
    while (it.hasNext()) {
 | 
			
		||||
@@ -1401,7 +1401,13 @@ void WatchHandler::saveWatchers()
 | 
			
		||||
        if (!watcherName.isEmpty() && watcherName != watcherEditPlaceHolder())
 | 
			
		||||
            watcherNames.push_back(watcherName);
 | 
			
		||||
    }
 | 
			
		||||
    m_manager->setSessionValue("Watchers", QVariant(watcherNames));
 | 
			
		||||
    return watcherNames;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WatchHandler::saveWatchers()
 | 
			
		||||
{
 | 
			
		||||
    //qDebug() << "SAVE WATCHERS: " << m_watchers;
 | 
			
		||||
    m_manager->setSessionValue("Watchers", QVariant(watchedExpressions()));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WatchHandler::loadTypeFormats()
 | 
			
		||||
 
 | 
			
		||||
@@ -274,6 +274,7 @@ public:
 | 
			
		||||
        { return m_expandedINames.contains(iname); }
 | 
			
		||||
    QSet<QString> expandedINames() const
 | 
			
		||||
        { return m_expandedINames; }
 | 
			
		||||
    QStringList watchedExpressions() const;
 | 
			
		||||
 | 
			
		||||
    static QString watcherEditPlaceHolder();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user