Skip to content

Commit 2fabaa3

Browse files
committed
Fix #16 - use gdb-multiarch for x86_64 linux
1 parent 5a47b72 commit 2fabaa3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ On older images the requirements can be installed by running `sudo apt install o
4040
- Tar (in PATH)
4141
- Native C/C++ compiler (in PATH), supported compilers are: `gcc` and `clang`
4242
- Ninja in PATH (arm64 only)
43-
- \[Optional\] OpenOCD for debuging (Raspberry Pi OS only)
43+
- \[Optional\] OpenOCD for debugging (Raspberry Pi OS only)
44+
- \[Optional\] gdb-multiarch for debugging (x86_64 only)
4445

4546
## Extension Settings
4647

scripts/pico_project.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@
334334

335335
isMac = False
336336
isWindows = False
337+
isx86 = False
337338
compilerPath = Path("/usr/bin/arm-none-eabi-gcc")
338339

339340
def relativeSDKPath(sdkVersion):
@@ -379,9 +380,10 @@ def codeToolchainPath(toolchainVersion):
379380
return f"${{userHome}}{relativeToolchainPath(toolchainVersion)}"
380381

381382
def CheckPrerequisites():
382-
global isMac, isWindows
383+
global isMac, isWindows, isx86
383384
isMac = (platform.system() == 'Darwin')
384385
isWindows = (platform.system() == 'Windows')
386+
isx86 = (platform.machine().lower() in ['x86_64', 'amd64'])
385387

386388
# Do we have a compiler?
387389
return shutil.which(COMPILER_NAME, 1, os.environ["Path" if isWindows else "PATH"])
@@ -737,7 +739,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger,
737739
if debugger == "raspberrypi-swd.cfg":
738740
shutil.copyfile(sourcefolder + "/" + "raspberrypi-swd.cfg", projectPath / "raspberrypi-swd.cfg")
739741

740-
gdbPath = Path(codeToolchainPath(toolchainVersion)+"/bin/arm-none-eabi-gdb").as_posix() if isWindows or isMac else "gdb"
742+
gdbPath = Path(codeToolchainPath(toolchainVersion)+"/bin/arm-none-eabi-gdb").as_posix() if isWindows or isMac else ("gdb-multiarch" if isx86 else "gdb")
741743
# Need to escape windows files paths backslashes
742744
# TODO: env in currently not supported in compilerPath var
743745
#cPath = f"${{env:PICO_TOOLCHAIN_PATH_{envSuffix}}}" + os.path.sep + os.path.basename(str(compilerPath).replace('\\', '\\\\' ))

0 commit comments

Comments
 (0)