CLion Fails to Debug
cc_binary target on macOS
I've written a hello world
I've created a repository, dwtj/clwb-bugs-example, to demonstrate the problem. It includes analogous CMake and Bazel builds of this program.
When I use CLion+CMake, I can debug
The red popup error says:
Here, "Configure" is a link to CLion's "Preferences" > "Build, Execution, Deployment" > "Toolchains". Here's what that looks like for me:
There are three choices in the "Debugger" drop-down menu:
Note that there doesn't seem to be a "Custom LLDB" option. For varying reasons, all of these options fail in my CLion+Bazel project.
As described above, "Bundled LLDB" seems to work fine in CLion+CMake, but it fails with the red popup error in CLion+Bazel.
When I chose this option, I get "a file format not recognized error." This happens for both CLion+CMake and CLion+Bazel.
I guess this makes sense, since my Clang/LLVM toolchain is building the program in either case, and evidently GDB won't work on a Clang-built executable. Here's the image:
Custom GDB Executable:
I don't have GCC/GDB installed on my system, so I don't have a "Custom GDB Executable" to select.
However, if I try to use
My Testing Environment
The text was updated successfully, but these errors were encountered:
Also encountering this issue, same symptoms.
CLion version: 2018.3.4
The suggestion above to
The solution from #494 (comment) still works, you have to chmod the correct gdbserver.
if you're using CLion 2018.3.
if you're using CLion 2019.1.
@chaoren This issue is specifically for macOS. I think your solution applies only for Linux. On macOS the folders you are describing do not exist. The corresponding folder on macOS appears to be
I think there's still another issue with the plugin on macOS (separate from the red popup error which seems to have been fixed, and separate from bazel issue bazelbuild/bazel#6327).
There's a workaround discussed in bazelbuild/bazel#6327: adding
I'm using plugin version 2019.11.14.0.1 and I also tried the patched version in #494 (comment) above (same behavior). CLion does seem to be using LLDB because the Debug tool window includes a functioning LLDB shell.
I have a workaround which may be useful for others.