microsoft / microsoft/vscode-cpptools

Unable to launch external console on MacOS when using GDB

Open
#3,652 4 comments 1 reaction 1 assignee View on GitHub

@WardenGnaw is already working on this.

Since May 15, 2019.

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

Description

Type: Debugger

Describe the bug

  • OS and Version: MacOS Mojave
  • VS Code Version: 1.33.1
  • C/C++ Extension Version:0.23.1
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

When trying to debug on macOS using gdb instead of lldb external console is not started, even when "externalConsole": true is set in launch.json.

To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:

  1. Create simple hello world program like one below:
#include <iostream>
#include <string>
using namespace std;

int main()
{
	string name;
	cin >> name;
	cout << "Hello " + name << endl;
	return 0;
}
  1. Create launch.json like the one here:
	{
		"name": "(gdb) Launch Mac",
		"type": "cppdbg",
		"request": "launch",
		"program": "${fileDirname}/${fileBasenameNoExtension}.out",
		"args": [],
		"stopAtEntry": false,
		"cwd": "${fileDirname}",
		"environment": [],
		"externalConsole": true,
		"MIMode": "gdb",
		"setupCommands": [
			{
				"description": "Enable pretty-printing for gdb",
				"text": "-enable-pretty-printing",
				"ignoreFailures": true
			}
		]
	}
  1. Launch debugger.
  2. No external input console is started, disabling user to enter name when debugging.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.