cdb: Use separate qtcreatorcdbext suffix for arm architecture

This would allow arm64 to coexist with amd64 on the same installation.

Change-Id: I578aab3d363bf93c2f61d4a7c93576ce19fba4b6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Cristian Adam
2022-06-20 19:51:16 +02:00
parent cb0ff08518
commit f4ea9e09ec
3 changed files with 23 additions and 12 deletions

View File

@@ -20,9 +20,13 @@ endif()
find_library(DbgEngLib dbgeng) find_library(DbgEngLib dbgeng)
set(ArchSuffix 32) set(ArchSuffix "32")
if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ArchSuffix 64) set(ArchSuffix "64")
endif()
if (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM")
set(ArchSuffix "arm${ArchSuffix}")
endif() endif()
add_qtc_library(qtcreatorcdbext SHARED add_qtc_library(qtcreatorcdbext SHARED

View File

@@ -56,6 +56,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagebox.h> #include <coreplugin/messagebox.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/taskhub.h> #include <projectexplorer/taskhub.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionmanager.h>
@@ -290,14 +291,13 @@ bool CdbEngine::canHandleToolTip(const DebuggerToolTipContext &context) const
} }
// Determine full path to the CDB extension library. // Determine full path to the CDB extension library.
QString CdbEngine::extensionLibraryName(bool is64Bit) QString CdbEngine::extensionLibraryName(bool is64Bit, bool isArm)
{ {
// Determine extension lib name and path to use // Determine extension lib name and path to use
QString rc; return QString("%1/lib/" QT_CREATOR_CDB_EXT "%2%3/" QT_CREATOR_CDB_EXT ".dll")
QTextStream(&rc) << QFileInfo(QCoreApplication::applicationDirPath()).path() .arg(QFileInfo(QCoreApplication::applicationDirPath()).path())
<< "/lib/" << (is64Bit ? QT_CREATOR_CDB_EXT "64" : QT_CREATOR_CDB_EXT "32") .arg(isArm ? "arm" : QString())
<< '/' << QT_CREATOR_CDB_EXT << ".dll"; .arg(is64Bit ? "64": "32");
return rc;
} }
int CdbEngine::elapsedLogTime() int CdbEngine::elapsedLogTime()
@@ -353,10 +353,17 @@ void CdbEngine::setupEngine()
return; return;
} }
bool cdbIs64Bit = is64BitWindowsBinary(sp.debugger.command.executable()); bool cdbIs64Bit = true;
if (!cdbIs64Bit) bool cdbIsArm = false;
Abis abisOfCdb = Abi::abisOfBinary(sp.debugger.command.executable());
if (abisOfCdb.size() == 1) {
Abi abi = abisOfCdb.at(0);
cdbIs64Bit = abi.wordWidth() == 64;
cdbIsArm = abi.architecture() == Abi::Architecture::ArmArchitecture;
}
if (!cdbIs64Bit || cdbIsArm)
m_wow64State = noWow64Stack; m_wow64State = noWow64Stack;
const QFileInfo extensionFi(CdbEngine::extensionLibraryName(cdbIs64Bit)); const QFileInfo extensionFi(CdbEngine::extensionLibraryName(cdbIs64Bit, cdbIsArm));
if (!extensionFi.isFile()) { if (!extensionFi.isFile()) {
handleSetupFailure(tr("Internal error: The extension %1 cannot be found.\n" handleSetupFailure(tr("Internal error: The extension %1 cannot be found.\n"
"If you have updated %2 via Maintenance Tool, you may " "If you have updated %2 via Maintenance Tool, you may "

View File

@@ -101,7 +101,7 @@ public:
void loadAdditionalQmlStack() override; void loadAdditionalQmlStack() override;
void listBreakpoints(); void listBreakpoints();
static QString extensionLibraryName(bool is64Bit); static QString extensionLibraryName(bool is64Bit, bool isArm = false);
private: private:
void readyReadStandardOut(); void readyReadStandardOut();