OSDN Git Service

find executable relative to core location
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Tue, 20 Oct 2009 16:13:23 +0000 (18:13 +0200)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Tue, 20 Oct 2009 16:16:25 +0000 (18:16 +0200)
src/plugins/debugger/gdb/coregdbadapter.cpp

index 8c24daa..ee03042 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <utils/qtcassert.h>
 
+#include <QtCore/QDir>
 #include <QtCore/QFileInfo>
 #include <QtGui/QMessageBox>
 
@@ -138,12 +139,16 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
                 if (idx >= 0)
                     m_executable.truncate(idx);
                 if (!m_executable.isEmpty()) {
-                    // Finish extra round ...
-                    showStatusMessage(tr("Attached to core temporarily."));
-                    m_engine->postCommand(_("detach"));
-                    // ... and retry.
-                    loadExeAndSyms();
-                    return;
+                    m_executable = QFileInfo(startParameters().coreFile).absoluteDir()
+                                   .absoluteFilePath(m_executable);
+                    if (QFile::exists(m_executable)) {
+                        // Finish extra round ...
+                        showStatusMessage(tr("Attached to core temporarily."));
+                        m_engine->postCommand(_("detach"));
+                        // ... and retry.
+                        loadExeAndSyms();
+                        return;
+                    }
                 }
             }
             showMessageBox(QMessageBox::Warning, tr("Error Loading Symbols"),