diff --git a/README.md b/README.md index c61903ab..94008faf 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ On older images the requirements can be installed by running `sudo apt install o - Tar (in PATH) - Native C/C++ compiler (in PATH), supported compilers are: `gcc` and `clang` - Ninja in PATH (arm64 only) -- \[Optional\] OpenOCD for debuging (Raspberry Pi OS only) +- \[Optional\] OpenOCD for debugging (Raspberry Pi OS only) +- \[Optional\] gdb-multiarch for debugging (x86_64 only) ## Extension Settings diff --git a/scripts/pico_project.py b/scripts/pico_project.py index 7b41ae4d..1a6963a0 100644 --- a/scripts/pico_project.py +++ b/scripts/pico_project.py @@ -334,6 +334,7 @@ isMac = False isWindows = False +isx86 = False compilerPath = Path("/usr/bin/arm-none-eabi-gcc") def relativeSDKPath(sdkVersion): @@ -379,9 +380,10 @@ def codeToolchainPath(toolchainVersion): return f"${{userHome}}{relativeToolchainPath(toolchainVersion)}" def CheckPrerequisites(): - global isMac, isWindows + global isMac, isWindows, isx86 isMac = (platform.system() == 'Darwin') isWindows = (platform.system() == 'Windows') + isx86 = (platform.machine().lower() in ['x86_64', 'amd64']) # Do we have a compiler? return shutil.which(COMPILER_NAME, 1, os.environ["Path" if isWindows else "PATH"]) @@ -737,7 +739,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, if debugger == "raspberrypi-swd.cfg": shutil.copyfile(sourcefolder + "/" + "raspberrypi-swd.cfg", projectPath / "raspberrypi-swd.cfg") - gdbPath = Path(codeToolchainPath(toolchainVersion)+"/bin/arm-none-eabi-gdb").as_posix() if isWindows or isMac else "gdb" + gdbPath = Path(codeToolchainPath(toolchainVersion)+"/bin/arm-none-eabi-gdb").as_posix() if isWindows or isMac else ("gdb-multiarch" if isx86 else "gdb") # Need to escape windows files paths backslashes # TODO: env in currently not supported in compilerPath var #cPath = f"${{env:PICO_TOOLCHAIN_PATH_{envSuffix}}}" + os.path.sep + os.path.basename(str(compilerPath).replace('\\', '\\\\' ))