forked from qt-creator/qt-creator
		
	Debugger: Add a field for source path map in DebuggerStartParameters
Change-Id: Ie79cdcd5c32a2204ac4b701c253d6d76bd271272 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
		@@ -4691,6 +4691,17 @@ static QString gdbBinary(const DebuggerStartParameters &sp)
 | 
			
		||||
    return sp.debuggerCommand;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GlobalDebuggerOptions::SourcePathMap mergeStartParametersSourcePathMap(
 | 
			
		||||
        const DebuggerStartParameters &sp, const GlobalDebuggerOptions::SourcePathMap &in)
 | 
			
		||||
{
 | 
			
		||||
    // Do not overwrite user settings.
 | 
			
		||||
    GlobalDebuggerOptions::SourcePathMap rc = sp.sourcePathMap;
 | 
			
		||||
    QMap<QString, QString>::const_iterator end = in.end();
 | 
			
		||||
    for (QMap<QString, QString>::const_iterator it = in.begin(); it != end; ++it)
 | 
			
		||||
        rc.insert(it.key(), it.value());
 | 
			
		||||
    return rc;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Starting up & shutting down
 | 
			
		||||
//
 | 
			
		||||
@@ -4829,8 +4840,10 @@ void GdbEngine::startGdb(const QStringList &args)
 | 
			
		||||
    const SourcePathMap sourcePathMap =
 | 
			
		||||
        DebuggerSourcePathMappingWidget::mergePlatformQtPath(sp,
 | 
			
		||||
                debuggerCore()->globalDebuggerOptions()->sourcePathMap);
 | 
			
		||||
    const SourcePathMapIterator cend = sourcePathMap.constEnd();
 | 
			
		||||
    SourcePathMapIterator it = sourcePathMap.constBegin();
 | 
			
		||||
    const SourcePathMap completeSourcePathMap =
 | 
			
		||||
            mergeStartParametersSourcePathMap(sp, sourcePathMap);
 | 
			
		||||
    const SourcePathMapIterator cend = completeSourcePathMap.constEnd();
 | 
			
		||||
    SourcePathMapIterator it = completeSourcePathMap.constBegin();
 | 
			
		||||
    for ( ; it != cend; ++it)
 | 
			
		||||
        postCommand("set substitute-path " + it.key().toLocal8Bit()
 | 
			
		||||
            + " " + it.value().toLocal8Bit());
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user