forked from qt-creator/qt-creator
Debugger: Update executable filename from core if possible
Task-number: QTCREATORBUG-10219 Change-Id: Ib17c23c7e8bfdad4f1dbcaf7757fdb130fba2abf Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -89,20 +89,19 @@ void GdbCoreEngine::setupEngine()
|
||||
unpackCoreIfNeeded();
|
||||
}
|
||||
|
||||
QString GdbCoreEngine::readExecutableNameFromCore(bool *isCore)
|
||||
QString readExecutableNameFromCore(const QString &debuggerCommand, const QString &coreFile, bool *isCore)
|
||||
{
|
||||
#if 0
|
||||
ElfReader reader(coreFileName());
|
||||
return QString::fromLocal8Bit(reader.readCoreName(isCore));
|
||||
#else
|
||||
const DebuggerStartParameters &sp = startParameters();
|
||||
QStringList args;
|
||||
args.append(QLatin1String("-nx"));
|
||||
args.append(QLatin1String("-batch"));
|
||||
args.append(QLatin1String("-c"));
|
||||
args.append(coreFileName());
|
||||
args.append(coreFile);
|
||||
QProcess proc;
|
||||
proc.start(sp.debuggerCommand, args);
|
||||
proc.start(debuggerCommand, args);
|
||||
if (proc.waitForFinished()) {
|
||||
QByteArray ba = proc.readAllStandardOutput();
|
||||
// Core was generated by `/data/dev/creator-2.6/bin/qtcreator'.
|
||||
@@ -134,7 +133,9 @@ void GdbCoreEngine::continueSetupEngine()
|
||||
if (isCore && m_executable.isEmpty()) {
|
||||
// Read executable from core.
|
||||
isCore = false;
|
||||
m_executable = readExecutableNameFromCore(&isCore);
|
||||
m_executable = readExecutableNameFromCore(
|
||||
startParameters().debuggerCommand,
|
||||
coreFileName(), &isCore);
|
||||
|
||||
if (isCore) {
|
||||
// Strip off command line arguments. FIXME: make robust.
|
||||
|
||||
Reference in New Issue
Block a user