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.

Can't debug in Visual Studio Code

See original GitHub issue

Brief Issue Summary

Can’t make the Visual Studio Code debugger work.

Expected:

  1. Run CMake Configuration
Screenshot 2019-12-10 at 4 01 19 PM

The result:

[cmake] Configuring done
[cmake] CMake Deprecation Warning:
[cmake]   The 'cmake-server(7)' is deprecated.  Please port clients to use the
[cmake]   'cmake-file-api(7)' instead.
[cmake] 
[cmake] 
[cmake] Generating done
  1. Select Clang 11.0
Screenshot 2019-12-10 at 4 15 43 PM
  1. Allow IntelliSense for this folder
Screenshot 2019-12-10 at 4 15 53 PM
  1. Build
Screenshot 2019-12-10 at 4 18 06 PM

The result:

[build] Starting build
[proc] Executing command: /usr/local/bin/cmake --build /Users/xxx/Desktop/cmake/hello/build --config Debug --target all -- -j 6
[build] Scanning dependencies of target say-hello
[build] [ 25%] Building CXX object CMakeFiles/say-hello.dir/hello.cpp.o
[build] [ 50%] Linking CXX static library libsay-hello.a
[build] [ 50%] Built target say-hello
[build] Scanning dependencies of target hello
[build] [ 75%] Building CXX object CMakeFiles/hello.dir/main.cpp.o
[build] [100%] Linking CXX executable hello
[build] [100%] Built target hello
[build] Build finished with exit code 0
  1. Set the break point and run Debug
Screenshot 2019-12-10 at 4 08 23 PM Screenshot 2019-12-10 at 4 19 44 PM

Apparent Behavior:

  1. It seems the editor hangs
  2. The information in Output
[build] Starting build
[proc] Executing command: /usr/local/bin/cmake --build /Users/xxx/Desktop/cmake/test/build --config Debug --target hello -- -j 6
[build] [ 50%] Built target say-hello
[build] [100%] Built target hello
[build] Build finished with exit code 0
[proc] Executing command: /usr/bin/lldb-mi --version
[proc] Executing command: /usr/bin/gdb --version
[proc] Executing command: /usr/bin/lldb --version
[proc] Executing command: /usr/bin/lldb --version

Platform and Versions

  • Operating System: macOS 10.15
  • CMake Version: 3.15.5
  • VSCode Version: 1.40.2
  • CMake Tools Extension Version: 1.2.3
  • Compiler/Toolchain: Xcode

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bobbrowcommented, Dec 27, 2019

FYI, miDebuggerPath can be set via the cmake.debugConfig setting:

    "cmake.debugConfig": {
        "miDebuggerPath": "/path/to/lldb-mi"
    },
0reactions
bobbrowcommented, Aug 29, 2022

I believe this issue was addressed but was never closed. If any of you are still having issues, we encourage you to open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging in Visual Studio Code
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and...
Read more >
Introduction to Debugging in Visual Studio Code
In this tutorial, we will show you how to run and debug a program in VS Code. We'll take a tour of the...
Read more >
Debug C++ in Visual Studio Code
You can debug Windows applications created using Cygwin or MinGW by using VS Code. To use Cygwin or MinGW debugging features, the debugger...
Read more >
Can't debug in VS Code - Stack Overflow
I'm new to VS Code, and is following the official tutorial to learn how to debug. However, it just won't work. First, the...
Read more >
i cant debug in vscode c# console - Microsoft Q&A
first, you can only debug C# .net core projects. Second you need a launch file. The s code c# extension should be able...
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