microsoft / microsoft/vscode-cpptools

macOS Sierra cannot debug c++ above vscode-cpptools 1.5.1 version

Open
#9,286 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: macOS Sierra(10.12.6)
  • VS Code: 1.67.0
  • C/C++ extension: 1.6.0~1.10.0
  • Xcode version: 9.2 (9C40b)
  • GDB / LLDB version:
    /usr/local/bin/gdb version 11.2
    /usr/bin/lldb --version lldb-900.0.64
Bug Summary and Steps to Reproduce

Bug Summary:

I use C/C++ extension 1.10.0 debug single C++ file with launch.json:

  "version": "0.2.0",
  "configurations": [
    {
			"name": "(lldb) 启动",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceFolder}/main",
			"args": [],
			"stopAtEntry": true,
			"cwd": "${fileDirname}",
			"environment": [],
			"externalConsole": false,
			"MIMode": "lldb",
			"miDebuggerPath": "/Users/witton/.vscode/extensions/ms-vscode.cpptools-1.10.0-darwin-x64/debugAdapters/lldb/bin/lldb-mi",
			"logging": {
				"trace": true,
				"engineLogging": true,
				"traceResponse": true,
			}
		}
  ]
}

but it does not work.

I set

"MIMode": "gdb",
"miDebuggerPath": "/usr/local/bin/gdb" 

still not work, the gdb installed by brew, version 11.2.

I reverse the cpptools version to 1.51 work well.
another related discussion

so, I think against lldb there is a problem with the debugAdapters version released for MacOS High Sierra and lower.

Debugger Configurations
tasks.json

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang++ 生成活动文件",
            "command": "/usr/bin/clang++",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ],
    "version": "2.0.0"
}

launch.json

{
	// 使用 IntelliSense 了解相关属性。 
	// 悬停以查看现有属性的描述。
	// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
	"version": "0.2.0",
	"configurations": [
		{
			"name": "(lldb) 启动",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceFolder}/main",
			"args": [],
			"stopAtEntry": true,
			"cwd": "${fileDirname}",
			"environment": [],
			"externalConsole": false,
			"MIMode": "lldb",
			"miDebuggerPath": "/Users/witton/.vscode/extensions/ms-vscode.cpptools-1.10.0-darwin-x64/debugAdapters/lldb/bin/lldb-mi",
			"logging": {
				"trace": true,
				"engineLogging": true,
				"traceResponse": true,
			}
		}
	]
}


### Debugger Logs

```shell
`Debug Console` output nothing.

`Output windows` tab `C/C++` output:


启动配置:
{
  "name": "(lldb) 启动",
  "type": "cppdbg",
  "request": "launch",
  "program": "/Users/witton/demo/main",
  "args": [],
  "stopAtEntry": true,
  "cwd": ".",
  "environment": [],
  "externalConsole": false,
  "MIMode": "lldb",
  "miDebuggerPath": "/Users/witton/.vscode/extensions/ms-vscode.cpptools-1.10.0-darwin-x64/debugAdapters/lldb/bin/lldb-mi",
  "logging": {
    "trace": true,
    "engineLogging": true,
    "traceResponse": true
  },
  "__configurationTarget": 5
}


### Other Extensions

_No response_

### Additional Information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the supplied tasks.json and launch.json on macOS Sierra, using the listed C/C++ extension, LLDB, and GDB versions. Compare the behavior with extension version 1.5.1 and inspect the C/C++ output and debugger logs; done means single-file C++ debugging works on the affected setup with a newer extension.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.