From b4afce82a6ff5a2a31ae2792c9e5de56dc378c2e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 17 Aug 2011 09:06:59 +0200 Subject: [PATCH] Pass Abi when attaching debugger to application launched via 'Run'. Task-number: QTCREATORBUG-5808 Change-Id: Id35e13fd71f4de7912070e90cda6add07200c7ae Reviewed-on: http://codereview.qt.nokia.com/3069 Reviewed-by: Qt Sanity Bot Reviewed-by: hjk --- src/plugins/debugger/debuggerplugin.cpp | 3 +-- src/plugins/projectexplorer/runconfiguration.cpp | 7 +++++++ src/plugins/projectexplorer/runconfiguration.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 9093622ea8a..32d57cfa1a8 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1457,8 +1457,7 @@ void DebuggerPluginPrivate::attachExternalApplication(ProjectExplorer::RunContro sp.attachPID = rc->applicationProcessHandle().pid(); sp.displayName = tr("Debugger attached to %1").arg(rc->displayName()); sp.startMode = AttachExternal; - //sp.toolChainAbi = anyAbiOfBinary(sp.executable); - sp.toolChainAbi = ProjectExplorer::Abi::hostAbi(); // FIXME: Extract from RunControl? + sp.toolChainAbi = rc->abi(); if (DebuggerRunControl *rc = createDebugger(sp)) startDebugger(rc); } diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index c9c93a0ea10..6d66a03bca2 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -534,6 +534,13 @@ QString RunControl::displayName() const return m_displayName; } +Abi RunControl::abi() const +{ + if (const RunConfiguration *rc = m_runConfiguration.data()) + return rc->abi(); + return Abi(); +} + ProcessHandle RunControl::applicationProcessHandle() const { return m_applicationProcessHandle; diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index b5fb55f7714..ec1de471bab 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -232,6 +232,7 @@ public: ProcessHandle applicationProcessHandle() const; void setApplicationProcessHandle(const ProcessHandle &handle); + Abi abi() const; bool sameRunConfiguration(const RunControl *other) const;