Skip to content

Commit

Permalink
Fix #16 - use gdb-multiarch for x86_64 linux
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed May 29, 2024
1 parent 5a47b72 commit 2fabaa3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions scripts/pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@

isMac = False
isWindows = False
isx86 = False
compilerPath = Path("/usr/bin/arm-none-eabi-gcc")

def relativeSDKPath(sdkVersion):
Expand Down Expand Up @@ -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"])
Expand Down Expand Up @@ -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('\\', '\\\\' ))
Expand Down

0 comments on commit 2fabaa3

Please sign in to comment.