Closed man-jai closed 4 years ago
But i have the launch.json. { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Launch",
"program": "test_priority_queue",
"args": [],
"cwd": "${workspaceFolder}"
}
// {
// "type": "lldb",
// "request": "launch",
// "name": "Launch Program",
// "program": "test_priority_queue",
// "cwd": "${workspaceRoot}"
// }
]
}
launch.json in .vscode direcotory.
workspace:
When I use debug: Then Select the LLDB This is the extension i installed. I have uninstalled the CodeLLDB : It shows this.
I reinstalled it. It's good now.
But when I restart the vscode. open the same code directory.
When I choose LLDB:
And it does not debug any more... But the file does not change.
What happend..
I just found the problem. You need to reload the project with some extension named reload.
@cxstdio
launch.json
- "type": "cppdbg" + "type": "lldb"
感谢大佬
lldb 类型不支持 需要装什么样的扩展吗
@cxstdio
launch.json
- "type": "cppdbg" + "type": "lldb"
感谢大佬
lldb 类型不支持 需要装什么样的扩展吗
Mac先要安装微软那个c/c++拓展。然后配置task和launch我目前是vscode最新版,没问题。我的lldb是xcode自带的。
just got hit by the same problem, Catalina 10.15.1 and Xcode 11.2 wonder what the 'official' recommendation for solving this problem is
here I see 2 different plugin as workaround suggested,
or, installing just lldb-mi ?
it would be extreme helpful to have just 1 way to follow, especially, if the C++ tools will be fixed some day, with a way to switch back
I've also been troubled by this issue in my exam week.....
I spent about three hours last night until 1 a.m. to solve this problem until I found that it is not my mistake here.
I'm using Catalina 10.15.1 and Xcode 11.2.
I've tried about the CodeLLVM extension this noon. It works fine and my breakpoints start to work again. but I've got a problem: How can I enable the external console if I want to input something in my program? There seem to exist some problem in my launch.json:
Besides, I also wonder the "official" recommendation as @a4z had mentioned.
I've also been troubled by this issue in my exam week..... I spent about three hours last night until 1 a.m. to solve this problem until I found that it is not my mistake here. I'm using Catalina 10.15.1 and Xcode 11.2.
I've tried about the CodeLLVM extension this noon. It works fine and my breakpoints start to work again. but I've got a problem: How can I enable the external console if I want to input something in my program? There seem to exist some problem in my launch.json: Besides, I also wonder the "official" recommendation as @a4z had mentioned.
"terminal": "external"
I've also been troubled by this issue in my exam week..... I spent about three hours last night until 1 a.m. to solve this problem until I found that it is not my mistake here. I'm using Catalina 10.15.1 and Xcode 11.2. I've tried about the CodeLLVM extension this noon. It works fine and my breakpoints start to work again. but I've got a problem: How can I enable the external console if I want to input something in my program? There seem to exist some problem in my launch.json: Besides, I also wonder the "official" recommendation as @a4z had mentioned.
"terminal": "external"
It works! Thanks very much.
BTW, could you please tell me how do you know we should use the "terminal:external" key-value in launch.json? Is there any documents?
I've also been troubled by this issue in my exam week..... I spent about three hours last night until 1 a.m. to solve this problem until I found that it is not my mistake here. I'm using Catalina 10.15.1 and Xcode 11.2. I've tried about the CodeLLVM extension this noon. It works fine and my breakpoints start to work again. but I've got a problem: How can I enable the external console if I want to input something in my program? There seem to exist some problem in my launch.json: Besides, I also wonder the "official" recommendation as @a4z had mentioned.
"terminal": "external"
It works! Thanks very much. BTW, could you please tell me how do you know we should use the "terminal:external" key-value in launch.json? Is there any documents?
MANUAL contains these informations. And I have a question. My output couldn't display in terminal when debugging like this:
I've also been troubled by this issue in my exam week..... I spent about three hours last night until 1 a.m. to solve this problem until I found that it is not my mistake here. I'm using Catalina 10.15.1 and Xcode 11.2. I've tried about the CodeLLVM extension this noon. It works fine and my breakpoints start to work again. but I've got a problem: How can I enable the external console if I want to input something in my program? There seem to exist some problem in my launch.json: Besides, I also wonder the "official" recommendation as @a4z had mentioned.
"terminal": "external"
It works! Thanks very much. BTW, could you please tell me how do you know we should use the "terminal:external" key-value in launch.json? Is there any documents?
MANUAL contains these informations. And I have a question. My output couldn't display in terminal when debugging like this:
Maybe you should go to your desktop to see if there is the terminal.app here....
I've also been troubled by this issue in my exam week..... I spent about three hours last night until 1 a.m. to solve this problem until I found that it is not my mistake here. I'm using Catalina 10.15.1 and Xcode 11.2. I've tried about the CodeLLVM extension this noon. It works fine and my breakpoints start to work again. but I've got a problem: How can I enable the external console if I want to input something in my program? There seem to exist some problem in my launch.json: Besides, I also wonder the "official" recommendation as @a4z had mentioned.
"terminal": "external"
It works! Thanks very much. BTW, could you please tell me how do you know we should use the "terminal:external" key-value in launch.json? Is there any documents?
MANUAL contains these informations. And I have a question. My output couldn't display in terminal when debugging like this:
Maybe you should go to your desktop to see if there is the terminal.app here....
可以弹出终端并正常调试,但是在调试的过程中我的代码中printf输出的内容不会显示在终端上,只有调试结束后内容才会显示在终端,不知道这是否算是正常?
I've also been troubled by this issue when I struggling in exam review. It really confused me. Really hope it will be fixed soon.
I was having this problem when I upgraded to Catalina. At that time, the solution above of finding the lldb-mi from an older Xcode, copying it to /Applications/Xcode.app/Contents/Developer/usr/bin/ and referencing that location as the "miDebuggerPath" was working.
They might have fixed in in the new version of cpptools? I found that the ~/.vscode/extensions/ms-vscode.cpptools/debugAdapter/lldb folder contains a copy of lldb-mi and using that as the miDebuggerPath is working for me. I'm using ms-vscode.cpptools v0.26.1.
@thekeels doesn't work. The path is ~/.vscode/extensions/ms-vscode.cpptools/debugAdapters/lldb (you forgot the s), but the breakpoints are still not hit
I tested with a clean install of code and the extension and it appears to work without any extra work. Going to test again tonight and document my steps. Didn’t expect it to work this time so didn’t keep a note of what I did sorry! Will comment again later.
please install anther extension to use lldb debug c++ app it's work
please install anther extension to use lldb debug c++ app it's work
CodeLLDB works in macos 10.15.1
On my MacOS 10.15.1 CodeLLDB started to work properly only after full macOS reinstall (with full disk wipe). However, clean install didn't make C/C++ extension debug working, as @satysin suggested.
Okay I followed the instructions at https://code.visualstudio.com/docs/cpp/config-clang-mac and everything appears to work as it should, at least in regards to breakpoints. I didn't test if watches, etc. work properly sorry. Below is a screenshot with it stopped at a breakpoint as expected.
Code version: 1.40.1 ms-vscode.cpptools version: 0.26.2-insiders2
And here are my json files
tasks.json
{ "version": "2.0.0", "tasks": [ { "label": "Build with Clang", "type": "shell", "command": "clang++", "args": [ "-std=c++17", "-stdlib=libc++", "helloworld.cpp", "-o", "helloworld.out", "--debug" ], "group": { "kind": "build", "isDefault": true } } ] }
launch.json
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(lldb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/helloworld.out", "args": [], "stopAtEntry": true, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "lldb" } ] }
c_cpp_properties.json
{ "configurations": [ { "name": "Mac", "includePath": [ "${workspaceFolder}/**" ], "defines": [], "macFrameworkPath": [ "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" ], "compilerPath": "/usr/bin/clang", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "${default}" } ], "version": 4 }
have the same problem , only codelldb can work on 10.15.1
I add miDebuggerPath
,but get this error
WARNING: Debugger executable '/Users/xxx/.vscode/extensions/ms-vscode.cpptools-0.26.2-insiders3/debugAdapters/lldb/bin/lldb-mi' is not signed. As a result, debugging may not work properly.
and still don't hit the breakpoint after I signed it
sudo codesign -fs lldb-mi-xi lldb-mi
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=thread-selected,id="1"
Same issue for Catalina reported here https://github.com/microsoft/vscode-cpptools/issues/4660
@satysin I had the same setup on a clean install but didn't work for me. Upgraded to 1.40.2 just in case, still didn't work.
Workaround of CodeLLDB worked though.
I have the same issue. debugger doesn't stop at breakpoints. OS: Catalina 10.15.1 VSCode: 1.40.2 C/C++ for Visual Studio Code: Version 0.26.2: December 2, 2019
launch.json
"configurations": [ { "name": "clang build and debug active file", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/runme", "args": ["1.test"], "stopAtEntry": true, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "lldb", // "preLaunchTask": "clang build active file" } ]
Also, after pushing F5 in DEBUG CONSOLE there are only:
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=thread-selected,id="1"
plus my binary's output and nothing more.
On other Mac with High Sierra OS the same operation outputs some additional information about loading different libraries.
CodeLLDB works fine.
cannot set break point in VSCode 1.40.2 on MacOS Catalina 10.15.1 tried to install CodeLLDB with no luck (may be it need to be configured?)
on top of that - this is my first time ever using VScode for C++ on Mac so I never saw it working and don't know if it even suppose to work)
please help!!!!!!!
I have one file helloworld.cpp
with
#include <iostream>
using namespace std;
int main()
{
cout << "hello break point? where are you???" << endl;
}
And here are my json files c_cpp_properties.json
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/helloworld.out",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"logging": {
"trace": true,
"traceResponse": true,
"engineLogging": true
}
}
]
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build with Clang",
"type": "shell",
"command": "clang++",
"args": [
"-std=c++17",
"-stdlib=libc++",
"helloworld.cpp",
"-o",
"helloworld.out",
"--debug"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
P.S. i used this tutorial https://code.visualstudio.com/docs/cpp/config-clang-mac
cannot set break point in VSCode 1.40.2 on MacOS Catalina 10.15.1 tried to install CodeLLDB with no luck (may be it need to be configured?) ...
it seems to be fixed by installing CodeLLDB
VSCode plugin
and replacing launch.json with this text
{
"name": "lldb123",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/helloworld.out",
"args": []
}
I lost console window though I don't see any output
it is very sad to see such popular product like VSCode have critical bug open since June
It's also sad that you have spent 3 hours to find the significative issue instead of the useless trash info on the Internet.
+1, with Xcode 11.3 out this issue is only getting worse. I am unable to debug at all using VS Code 1.41.1.
A workaround is to use gdb
instead of lldb
, which requires:
gdb
gdb
binary: https://sourceware.org/gdb/wiki/PermissionsDarwin"MIMode": "gdb"
in launch.json
I've tested this with gdb 8.3.1
. It works, but in some cases the debugger would not reach the first breakpoint. In such cases, stopping the debugger and relaunching was sufficient to reach the breakpoint.
I also could not use lldb to debug C++ on macOS. with Xcode Version 11.3 (11C29), macOS Catalina 10.15.2 (19C57) and VS code
Version: 1.41.1
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T14:57:51.166Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.2.0
So I spent some time trying to actually fix this. Here's some background:
-break-insert
command sent to lldb-mi: https://github.com/microsoft/MIEngine/issues/946So, I believe that this issue can be fixed by doing all of the following:
break-insert
processing: https://github.com/microsoft/MIEngine/issues/946miDebuggerPath
to point at a build of the latest lldb-mi code, or ideally including a build of the latest lldb-mi (https://github.com/lldb-tools/lldb-mi) in the macOS version of vscode-cpptools.Unfortunately, that requires the first 2 to happen before users can actually trigger breakpoints on macOS again.
@WardenGnaw if there is anything I can do to help make that happen, let me know.
So I spent some time trying to actually fix this. Here's some background:
- the version of lldb-mi bundled with the macOS version of vscode-cpptools no longer works. Breakpoints don't trigger. This was identified at the beginning of this thread.
- since then, lldb-mi has been removed from lldb source tree and moved to its own repository, but is still actively developed and maintained.
- I have proven that the latest builds of lldb-mi do work and do trigger breakpoints.
- however, they do not work with vscode-cpptools because of a no-longer-required workaround in MIEngine. A historical bug in lldb-mi has been fixed, but that has broken MIEngine's
-break-insert
command sent to lldb-mi: microsoft/MIEngine#946So, I believe that this issue can be fixed by doing all of the following:
- changing MIEngine to remove the workaround for lldb-mi having incorrect
break-insert
processing: microsoft/MIEngine#946- taking a fixed MIEngine into vscode-cpptools and bundling it up for macOS
- setting
miDebuggerPath
to point at a build of the latest lldb-mi code, or ideally including a build of the latest lldb-mi (https://github.com/lldb-tools/lldb-mi) in the macOS version of vscode-cpptools.Unfortunately, that requires the first 2 to happen before users can actually trigger breakpoints on macOS again.
@WardenGnaw if there is anything I can do to help make that happen, let me know.
man. you means that if we want to use lldb-mi again. we should wait they taking a fixed MIEngine into vscode-cpptools?
man. you means that if we want to use lldb-mi again. we should wait they taking a fixed MIEngine into vscode-cpptools?
Unless you can make the patch to MIEngine and build it yourself. I can't because it only builds on Windows.
I'm like N% certain that removing these lines will fix it.
Edit: Looks like @WardenGnaw committed that exact change :)
these lines
Thank you man, Are they going to solve the problem next or not? I see that line you remove,It is really handsome!
You can track this: https://github.com/microsoft/MIEngine/issues/946
Same problem. MacOS: 10.15.1 VSCode: 1.41.1
Same problem MacOS: 10.15.2 Vscode: 1.41.1 Tutorial: https://code.visualstudio.com/docs/cpp/config-clang-mac
Same problem MacOS: 10.15.2 Vscode: 1.41.1
Adding ‘same problem’ isn’t moving the needle on resolving this. The upstream change in MIEngine has been merged. Hopefully that means soon it will be possible to make this work with a custom built lldb-mi
Adding ‘same problem’ isn’t moving the needle on resolving this. The upstream change in MIEngine has been merged. Hopefully that means soon it will be possible to make this work with a custom built lldb-mi
given how old the problem is, it can not harm to show, and report, that many people have this problem, so IMHO even repetitions are a valid point to report.
but lets hope that after several month we will soon be able to use the debugger again, and users will not wast a lot of time to land here, and report this problem again ;-)
In this case surely the best response would be to simply upvote the original issue. Given that the problem has been tracked down, providing OS/VSCode versions won't help anyone. Adding comments to the thread disturbs everyone subscribed to the thread. In the case of a problem that is not being actively worked on, the community SHOULD disturb the repo, until someone fixes it. We can externally push priority levels on issues by making noise. However on this particular issue, as can be seen from the comments, @puremourning is in the process of crushing this one with @WardenGnaw . So I recommend we STFU and let them work their magick ;)
It would be great if repository maintainers were able to edit the original post for a particular issue, maintaining a "current-state/issue-summary/roadmap" so that newcomers can immediately see the state of play without having to piece it together from dozens of comments.
I guess with a very thorough workflow, repo maintenance staff could respond to the OP immediately and keep revising this initial response, so that it is always up-to-date. I wonder if anyone has thought of using GitHub issue-tracker this way...
@a4z One problem with having people continually report, "same here", type messages is that users (myself included) who are monitoring this bug to await a fix will get e-mailed every time someone posts a message. This does not happen if someone merely upvotes it.
same issue +1 macOS: 10.15.2 VS Code: 1.41.1 C/C++ version: 0.26.3-insiders3: January 8, 2020
I went through the same problem. My cpp code debugging started having problem right after I upgraded my macOS from Mojave to Catalina. I had a similar problem whenever I did the OS update. Sometimes I could fix the problem by reinstalling Xcode.
After a few hours of struggling, I finally got here. I thought maybe upgrading Xcode could get this working. But as mentioned above, it looks like upgrading Xcode is really not a good idea. Maybe better keep it as 10.3 ?
Anyways, thank you very much for introducing CodeLLDB. I never knew about CodeLLDB. and it works perfectly. thank you again!
Ping. Just wanted to mention that the problem persists with the latest Catalina Beta and Xcode11 "Gold Master" version, both pretty late in their release cycle, so I think that's not something that will be fixed on Apple's part.
Also the CodeLLDB extension doesn't have the problem.
Thank you very much for letting me know about CodeLLDB
I installed CodeLLDB and change launch.json as follow, then it works.
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/helloworld.out",
"args": [
"-arg1",
"-arg2"
]
}
]
}
Type: Debugger Input information below
Please review existing issues and our documentation at https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation prior to filing an issue.
Describe the bug
To Reproduce
launch.json
``` "version":"0.2.0", "configurations":[ { "type":"cppdbg", "request":"launch", "name":"Debug", "preLaunchTask":"build", "program":"${workspaceFolder}/debug/OpenGLTut.out", "args":[ ], "stopAtEntry":true, "cwd":"${workspaceFolder}", "environment":[ ], "externalConsole":true, "MIMode":"lldb", "internalConsoleOptions":"openOnSessionStart", "showDisplayString":false, "logging":{ "trace":true, "traceResponse":true, "engineLogging":true, "programOutput":true, } } ] ```tasks.json
``` "version":"2.0.0", "tasks":[ { "type":"shell", "label":"build", "command":"clang++", "args":[ "-g", "-std=c++17", "-stdlib=libc++", "-framework", "Cocoa", "-framework", "OpenGL", "-framework", "IOKit", "-framework", "CoreVideo", "-L", "/usr/local/include/", "-lglew", "-lglfw3", "${workspaceFolder}/src/Application.cpp", "-o", "${workspaceFolder}/debug/OpenGlTut.out", "--debug", ], "group":{ "kind":"build", "isDefault":true } } ] ```Steps to reproduce the behaviour: debug using the above tasks and launch files
Additional context If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your
launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.