question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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/<output_thing>.obj
[build] [30/30 100% :: 0.550] Linking C executable Debug/<arm_executable>.elf
[driver] Run _refreshExpansions
[cms-driver] Run doRefreshExpansions
[driver] Run _refreshExpansions cb
[build] Build finished with exit code 0
[cache] Reading CMake cache file /<project_root>/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 /<project_root>/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

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andreeiscommented, Dec 7, 2020

In your project .vscode/settings.json you can write this:

"cmake.debugConfig": {
    "miDebuggerPath": "define/your/path/here"
}
0reactions
tjayrushcommented, Dec 5, 2020

@andreeis How does one “Set cmake.debugConfig - miDebuggerPath”?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Debug HelloWorld with vsCode - Onethinx Forum
[main] Problem getting debug configuration from cache. Error: Unable to find GDB in default search path and gdb. Any ideas?
Read more >
Unable to configure C++, GDB, & VS Code harmoniously ...
This answer addresses improperly configured C++ projects that are being developed inside of the V.S. Code editor. Some of the issues that arise ......
Read more >
lldb fails to launch process: "Not allowed to attach to process"
Reproduce the problem. · Run log collect. · Open the resulting .logarchive with Console. · Search for debugserver entries. · Search backwards from...
Read more >
vscode-cmake-tools/Lobby - Gitter
... to debug an executable but for some reason I'm running into this error: Unable to find GDB in default search path and...
Read more >
Configure launch.json for C/C++ debugging in Visual Studio ...
When only the executable is specified, it will search the operating system's PATH variable for a debugger (GDB on Linux and Windows, LLDB...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found