Debugger: Always add Qt install source mappings for gdb.

As it fails for MinGW.

Task-number: QTCREATORBUG-4132
Reviewed-by: hjk
This commit is contained in:
Friedemann Kleint
2011-03-18 10:02:07 +01:00
parent d87f03825d
commit 8ff480881a
6 changed files with 43 additions and 5 deletions

View File

@@ -67,6 +67,7 @@
#include "stackhandler.h"
#include "threadshandler.h"
#include "watchhandler.h"
#include "debuggersourcepathmappingwidget.h"
#ifdef Q_OS_WIN
# include "dbgwinutils.h"
@@ -4614,14 +4615,18 @@ void GdbEngine::notifyInferiorSetupFailed()
void GdbEngine::handleInferiorPrepared()
{
typedef GlobalDebuggerOptions::SourcePathMap SourcePathMap;
typedef SourcePathMap::const_iterator SourcePathMapIterator;
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
// Apply source path mappings from global options.
const QSharedPointer<GlobalDebuggerOptions> globalOptions = debuggerCore()->globalDebuggerOptions();
if (!globalOptions->sourcePathMap.isEmpty()) {
typedef GlobalDebuggerOptions::SourcePathMap::const_iterator SourcePathMapIterator;
const SourcePathMapIterator cend = globalOptions->sourcePathMap.constEnd();
for (SourcePathMapIterator it = globalOptions->sourcePathMap.constBegin(); it != cend; ++it) {
const SourcePathMap sourcePathMap =
DebuggerSourcePathMappingWidget::mergePlatformQtPath(startParameters().qtInstallPath,
debuggerCore()->globalDebuggerOptions()->sourcePathMap);
if (!sourcePathMap.isEmpty()) {
const SourcePathMapIterator cend = sourcePathMap.constEnd();
for (SourcePathMapIterator it = sourcePathMap.constBegin(); it != cend; ++it) {
QByteArray command = "set substitute-path ";
command += it.key().toLocal8Bit();
command += ' ';