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.

Is it possible to debug clang build?

See original GitHub issue

Hi, sorry if this is duplication, I tried to read similar issues but still can’t get it. I used gcc kit, build/debug worked perfectly. Now I’m using Clang 10 kit, build is OK but I can’t debug it. First attempt was without any changes to project, log:

[proc] Executing command: /usr/bin/lldb-mi-10 --version
[proc] Executing command: /usr/bin/gdb-10 --version  <--- gdb-10 o_0 ??
[proc] Executing command: /usr/bin/lldb-10 --version
[proc] Executing command: /usr/bin/lldb-10 --version

And then it hangs with output:

warning: ignoring unknown option: --interpreter=mi
warning: ignoring unknown option: --tty=/dev/pts/2

I guessed that lldb is not supported at atll and I tried to use “cmake.debugConfig”: {“miDebuggerPath”: “/usr/bin/gdb” and it didn’t work.

  1. Is it ever possible to use lldb out of the box?
  2. Is it possible to build with clang and debug with gdb?
  • Operating System: Ubuntu 18.04
  • CMake Version: 3.16
  • VSCode Version: 1.44.2
  • CMake Tools Extension Version: 1.3.1
  • Compiler/Toolchain: Clang 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Phi-Licommented, Sep 2, 2020

I am on version 1.4.1 and can still reproduce this with lldb 10. I tried to set:

"cmake.debugConfig": {
    "MIMode": "lldb",
    "miDebuggerPath": "/usr/bin/lldb-10"
}

then come the error:

[debugger] Unable to automatically determine debugger corresponding to compiler: /bin/clang++-10
[main] Failed to generate debugger configuration
1reaction
bobbrowcommented, Apr 27, 2020

Duplicate of #1060

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging C with Clang compiler and LLDB - Developer files
Just an easy and quick tutorial about how to debug C code using clang. I am using Mac OS X 10.11.1 “El Capitan”...
Read more >
Debugging Clang
There's comprehensive high-level documentation for LLVM and Clang. However, the further down you dig the more difficult things get.
Read more >
How to debug clang for learning? - Beginners - LLVM Discourse
The clang driver will fork itself into a subprocess. You have two ways to achieve what you want: Disable the forking behavior by...
Read more >
Hacking on clang
Debugging · Many LLVM and Clang data structures provide a dump() method which will print a description of the data structure to stderr....
Read more >
Suggestions to debug a forever running clang compile ...
Not related to debugging, but just fwiw, D120295 fixes the specific clang command hangs. barrelshifter February 22, 2022, 6:14pm ...
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