Debugger: Fix order of setting debug-file-directory

Change-Id: Ie4032edd4eebc1e3a79fbe15c0bc1292b4a3292a
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
David Schulz
2012-05-14 14:10:59 +02:00
committed by hjk
parent 77fd3ef796
commit 991157accf

View File

@@ -5066,10 +5066,6 @@ void GdbEngine::setupInferior()
postCommand("set substitute-path " + it.key().toLocal8Bit()
+ " " + it.value().toLocal8Bit());
const QByteArray debugInfoLocation = sp.debugInfoLocation.toLocal8Bit();
if (!debugInfoLocation.isEmpty())
postCommand("set debug-file-directory " + debugInfoLocation);
// Spaces just will not work.
foreach (const QString &src, sp.debugSourceLocation)
postCommand("directory " + src.toLocal8Bit());
@@ -5127,20 +5123,20 @@ void GdbEngine::finishInferiorSetup()
void GdbEngine::handleDebugInfoLocation(const GdbResponse &response)
{
#ifdef Q_OS_WIN
#define PATHSEP ';'
const char pathSep = ';';
#else
#define PATHSEP ':'
const char pathSep = ':';
#endif
if (response.resultClass == GdbResultDone) {
QByteArray debugInfoLocation = startParameters().debugInfoLocation.toLocal8Bit();
const QByteArray debugInfoLocation = startParameters().debugInfoLocation.toLocal8Bit();
if (QFile::exists(QString::fromLocal8Bit(debugInfoLocation))) {
const QByteArray curDebugInfoLocations = response.consoleStreamOutput.split('"').value(1);
startParameters().debugInfoLocation = curDebugInfoLocations.isEmpty() ?
QString::fromLocal8Bit(debugInfoLocation) :
QString::fromLocal8Bit(debugInfoLocation + PATHSEP + curDebugInfoLocations);
if (curDebugInfoLocations.isEmpty())
postCommand("set debug-file-directory " + debugInfoLocation);
else
postCommand("set debug-file-directory " + debugInfoLocation + pathSep + curDebugInfoLocations);
}
}
#undef PATHSEP
}
void GdbEngine::handleNamespaceExtraction(const GdbResponse &response)