microsoft / microsoft/vscode-cmake-tools

OSX Problem to get debug from cache. Error: Unable to find GDB in default search path

Open
#514 13 comments 0 reactions 0 assignees View on GitHub
embedded Feature: configure Feature: debug/launch stale-exempt
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

On OSX with a cross compiler in $ARMGCC_DIR attempting to debug via jtag with cortex-debug yields the error:

"Problem to get debug from cache. Error: Unable to find GDB in default search path and /usr/local/opt/toolchain/lldb-arm-none-eabi/bin/arm-none-eabi-lldb."

from CMake Tools

this is with gdb installed in /usr/local/bin, the same place cmake is installed and cmake.cmakePath="/usr/local/bin/cmake"

I don't expect that an arm-none-eabi-lldb is required if my jtag is acting as a gdb server, so what do I do to get rid of this error so that CMake can see gdb?

### Expected:

1. configure CMake tools to create a CMakeCache that stores the location of gdb
2. click the "Debug" button
3. gdb launches and attaches

### Apparent Behavior:

CMake configure seems to not be aware of my PATH? or perhaps only the path to the debugger . I can compile fine, which requires access to environment variables and an updated PATH (to point to my cross-compiler) . what I am not getting is why "Unable to find GDB in default search path" is occuring

1. Push button
2. CMake tools reports Unable to find GDB

### CMake Tools Log

```
[build] [29/30 96% :: 0.520] Building C object CMakeFiles/.obj
[build] [30/30 100% :: 0.550] Linking C executable Debug/.elf
[driver] Run _refreshExpansions
[cms-driver] Run doRefreshExpansions
[driver] Run _refreshExpansions cb
[build] Build finished with exit code 0
[cache] Reading CMake cache file //build/CMakeCache.txt
[cache] Parsing CMake cache string
[proc] Executing command: /usr/local/opt/toolchain/lldb-arm-none-eabi/bin/arm-none-eabi-lldb --version
[cache] Reading CMake cache file //build/CMakeCache.txt
[main] Problem to get debug from cache. Error: Unable to find GDB in default search path and /usr/local/opt/toolchain/lldb-arm-none-eabi/bin/arm-none-eabi-lldb.
[extension] [3824] cmake.debugTarget finished (returned null)
[cache] Parsing CMake cache string
```

### Platform and Versions

- **Operating System**: macOS
- **CMake Version**: 3.12.0
- **VSCode Version**: 1.26.0
- **CMake Tools Extension Version**: 1.1.0
- **Compiler/Toolchain**: arm-none-eabi-gcc

Contributor guide

Open the contributing guide

Research direction

Start with the CMake Tools debug-from-cache flow and the logged command invoking arm-none-eabi-lldb, then inspect how the CMake cache and PATH are used to locate GDB on macOS. Done means the configured GDB is found, the Debug button launches it, and it attaches to the target as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript, vscode
Domain
developer-experience, devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.