diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 752dac10..ed92e377 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,7 @@ jobs: rust_toolchain: x86_64-unknown-linux-gnu rust_targets: x86_64-unknown-linux-gnu platformid: linux-x64 + shell: bash - os: Linux image: ubuntu-latest @@ -51,6 +52,7 @@ jobs: rust_toolchain: x86_64-unknown-linux-gnu rust_targets: aarch64-unknown-linux-gnu platformid: linux-arm64 + shell: bash cross: true - os: Linux @@ -59,6 +61,7 @@ jobs: rust_toolchain: x86_64-unknown-linux-gnu rust_targets: armv7-unknown-linux-gnueabihf platformid: linux-armhf + shell: bash cross: true - os: MacOS @@ -67,6 +70,7 @@ jobs: rust_toolchain: x86_64-apple-darwin rust_targets: x86_64-apple-darwin platformid: darwin-x64 + shell: bash - os: MacOS image: macos-15 @@ -74,17 +78,35 @@ jobs: rust_toolchain: aarch64-apple-darwin rust_targets: aarch64-apple-darwin platformid: darwin-arm64 + shell: bash - os: Windows image: windows-latest lldb_triple: x86_64-windows-msvc - rust_toolchain: x86_64-pc-windows-gnu + rust_toolchain: x86_64-pc-windows-msvc rust_targets: x86_64-pc-windows-msvc platformid: win32-x64 + vctools: x86.x64 + vcvars: vcvars64 + shell: cmd + + - os: Windows + image: windows-11-vs2026-arm + lldb_triple: aarch64-windows-msvc + rust_toolchain: aarch64-pc-windows-msvc + rust_targets: aarch64-pc-windows-msvc + platformid: win32-arm64 + vctools: arm64 + vcvars: vcvarsarm64 + shell: cmd name: ${{ matrix.os }} ${{ matrix.platformid }} runs-on: ${{ matrix.image }} + defaults: + run: + shell: ${{ matrix.shell }} + steps: - name: Checkout uses: actions/checkout@v4 @@ -134,20 +156,27 @@ jobs: - name: Setup (Windows) if: ${{ matrix.os == 'Windows' }} - shell: cmd run: | - for /f "usebackq delims=" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find VC\Auxiliary\Build\vcvars64.bat`) do call "%%i" + for /f "usebackq delims=" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.${{ matrix.vctools }} -find VC\Auxiliary\Build\${{ matrix.vcvars }}.bat`) do call "%%i" set >> %GITHUB_ENV% - name: Download LLDB + shell: bash run: | + # This should go away once https://github.com/vadimcn/lldb-build/pull/3 lands + if [[ "${{ matrix.platformid }}" == "win32-arm64" ]]; then + LLDB_REPO_OWNER=saschanaz + else + LLDB_REPO_OWNER=vadimcn + fi export GH_TOKEN=${{ secrets.LLDB_BUILD_TOKEN }} gh release download ${{ env.lldb_release }} \ - --repo vadimcn/lldb-build \ + --repo $LLDB_REPO_OWNER/lldb-build \ --pattern "lldb--${{ matrix.lldb_triple }}.zip" \ --dir $RUNNER_TEMP - name: Configure + shell: bash run: | mkdir -p build cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ diff --git a/CMakeLists.txt b/CMakeLists.txt index e26153e5..9b854e51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,12 +274,19 @@ if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/debuggee ) else() + if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + set(ToolchainTripleGnu x86_64-windows-gnu) + set(ToolchainTripleMsvc x86_64-windows-msvc) + elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64") + set(ToolchainTripleGnu aarch64-windows-gnullvm) + set(ToolchainTripleMsvc aarch64-windows-msvc) + endif() # On Windows we want to check both GNU DWARF and MSVC PDB debug info kinds. message("Configuring debuggee") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/debuggee) execute_process( COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}/debuggee -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/toolchain-x86_64-windows-gnu.cmake + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/toolchain-${ToolchainTripleGnu}.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/debuggee COMMAND_ERROR_IS_FATAL ANY ) @@ -287,7 +294,7 @@ else() file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/debuggee-msvc) execute_process( COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}/debuggee -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/toolchain-x86_64-windows-msvc.cmake + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/toolchain-${ToolchainTripleMsvc}.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/debuggee-msvc COMMAND_ERROR_IS_FATAL ANY ) @@ -308,7 +315,11 @@ set(MochaTest ${NPM} run mocha -- ) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - set(TestTriples x86_64-pc-windows-gnu x86_64-pc-windows-msvc) + if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + set(TestTriples x86_64-pc-windows-gnu x86_64-pc-windows-msvc) + elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64") + set(TestTriples aarch64-pc-windows-gnullvm aarch64-pc-windows-msvc) + endif() elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") set(TestTriples x86_64-apple-darwin) else() diff --git a/adapter/CMakeLists.txt b/adapter/CMakeLists.txt index 9cbac2b4..2a88e877 100644 --- a/adapter/CMakeLists.txt +++ b/adapter/CMakeLists.txt @@ -3,7 +3,17 @@ include(ExternalProject) add_subdirectory(scripts) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - find_file(MSDIA msdia140.dll PATHS "${CMAKE_SOURCE_DIR}" "$ENV{VSINSTALLDIR}/DIA SDK/bin/amd64" NO_DEFAULT_PATH) + if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + set(_DIA_ARCH amd64) + set(_DIA_HEADER_ARCH x64) + elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64") + set(_DIA_ARCH arm64) + set(_DIA_HEADER_ARCH ARM64) + else() + message(FATAL_ERROR "Unsupported processor: ${CMAKE_SYSTEM_PROCESSOR}") + endif() + + find_file(MSDIA msdia140.dll PATHS "${CMAKE_SOURCE_DIR}" "$ENV{VSINSTALLDIR}/DIA SDK/bin/${_DIA_ARCH}" NO_DEFAULT_PATH) if (NOT MSDIA) # Search again with default paths find_file(MSDIA msdia140.dll) endif() @@ -12,11 +22,11 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") message(FATAL_ERROR "msdia140.dll not found") else() execute_process(COMMAND dumpbin "/headers" "${MSDIA}" OUTPUT_VARIABLE OUTPUT) - if (OUTPUT MATCHES ".*machine \\(x64\\).*") + if (OUTPUT MATCHES ".*machine \\(${_DIA_HEADER_ARCH}\\).*") message ("Found MSDIA at ${MSDIA}") add_copy_file(DIAFiles "${MSDIA}" ${CMAKE_CURRENT_BINARY_DIR}/msdia140.dll) else() - message(FATAL_ERROR "Found MSDIA at ${MSDIA}, but it isn't an x64 binary.") + message(FATAL_ERROR "Found MSDIA at ${MSDIA}, but it isn't an ${_DIA_ARCH} binary.") endif() endif() endif() diff --git a/cmake/toolchain-aarch64-windows-gnullvm.cmake b/cmake/toolchain-aarch64-windows-gnullvm.cmake new file mode 100644 index 00000000..ada342b5 --- /dev/null +++ b/cmake/toolchain-aarch64-windows-gnullvm.cmake @@ -0,0 +1,3 @@ +set(LLVM_TRIPLE aarch64-pc-windows-gnullvm) +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) diff --git a/cmake/toolchain-aarch64-windows-msvc.cmake b/cmake/toolchain-aarch64-windows-msvc.cmake new file mode 100644 index 00000000..6a3c81aa --- /dev/null +++ b/cmake/toolchain-aarch64-windows-msvc.cmake @@ -0,0 +1,3 @@ +set(LLVM_TRIPLE aarch64-pc-windows-msvc) +set(CMAKE_C_COMPILER cl) +set(CMAKE_CXX_COMPILER cl) diff --git a/package.json b/package.json index fb8e6f24..4adabf11 100644 --- a/package.json +++ b/package.json @@ -882,7 +882,8 @@ "darwin-x64": "codelldb-darwin-x64.vsix", "darwin-arm64": "codelldb-darwin-arm64.vsix", "win32-x64": "codelldb-win32-x64.vsix", - "win32-ia32": "codelldb-win32-x64.vsix" + "win32-ia32": "codelldb-win32-x64.vsix", + "win32-arm64": "codelldb-win32-arm64.vsix" } } }