Debugger: GDB: Append debug-file-location

Now the debug-file-location will not be replaced, but enhanced when new debug-file-locations are defined.

Change-Id: Ibabcd5814f281e5e378b29abcee1ac646b01cdcd
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
David Schulz
2012-05-10 16:22:06 +02:00
committed by hjk
parent 84b4b52aed
commit 12e7c26291
3 changed files with 24 additions and 2 deletions

View File

@@ -4831,6 +4831,7 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &settingsIdHint)
showMessage(_("GDB STARTED, INITIALIZING IT"));
postCommand("show version", CB(handleShowVersion));
//postCommand("-list-features", CB(handleListFeatures));
postCommand("show debug-file-directory", CB(handleDebugInfoLocation));
//postCommand("-enable-timings");
//postCommand("set print static-members off"); // Seemingly doesn't work.
@@ -5123,6 +5124,25 @@ void GdbEngine::finishInferiorSetup()
CB(handleNamespaceExtraction), fileName);
}
void GdbEngine::handleDebugInfoLocation(const GdbResponse &response)
{
#ifdef Q_OS_WIN
#define PATHSEP ';'
#else
#define PATHSEP ':'
#endif
if (response.resultClass == GdbResultDone) {
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);
}
}
#undef PATHSEP
}
void GdbEngine::handleNamespaceExtraction(const GdbResponse &response)
{
QFile file(response.cookie.toString());