Debugger: Add a flexible widget for source path substitutions.

Add a new widget to edit the mappings. Rework common options
page to use the standard pattern to allow for complex data types,
introduce GlobalOptions class.
This commit is contained in:
Friedemann Kleint
2011-03-04 16:21:57 +01:00
parent b97165329a
commit 2d9de93361
11 changed files with 685 additions and 120 deletions

View File

@@ -4564,22 +4564,19 @@ void GdbEngine::notifyInferiorSetupFailed()
void GdbEngine::handleInferiorPrepared()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
const QByteArray qtInstallPath =
debuggerCore()->action(QtSourcesLocation)->value().toString().toLocal8Bit();
if (!qtInstallPath.isEmpty()) {
QByteArray qtBuildPath;
#if defined(Q_OS_WIN)
qtBuildPath = "C:/qt-greenhouse/Trolltech/Code_less_create_more/"
"Trolltech/Code_less_create_more/Troll/4.6/qt";
postCommand("set substitute-path " + qtBuildPath + ' ' + qtInstallPath);
qtBuildPath = "C:/iwmake/build_mingw_opensource";
postCommand("set substitute-path " + qtBuildPath + ' ' + qtInstallPath);
qtBuildPath = "C:/ndk_buildrepos/qt-desktop/src";
postCommand("set substitute-path " + qtBuildPath + ' ' + qtInstallPath);
#elif defined(Q_OS_UNIX) && !defined (Q_OS_MAC)
qtBuildPath = "/var/tmp/qt-src";
postCommand("set substitute-path " + qtBuildPath + ' ' + qtInstallPath);
#endif
// 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) {
QByteArray command = "set substitute-path ";
command += it.key().toLocal8Bit();
command += ' ';
command += it.value().toLocal8Bit();
postCommand(command);
}
}
// Initial attempt to set breakpoints.