microsoft / microsoft/vscode-cpptools

Difficulties configuring debugger as a first-time user

Open
#11,507 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Brief Issue Summary

I found it difficult to work out how to enable C++ debugging when I first started using VS Code a couple of weeks ago.

On both macOS and Windows my experience was as follows:

  • installed VS code
  • installed recommended C/C++ extensions (C/C++, CMake, CMake Tools, C/C++ themes)
  • loaded a folder containing a CMakeLists.txt file
  • built the project

Then I choose the Run & Debug option in the UI, and could see it wasn't configured. Fair enough, so I clicked on the option to Create a launch.json file.

This popped up a menu in the command palette offering only "Node.js" and two entries for "Web App", but nothing related to C/C++.

I couldn't for the life of me see how to configure a C/C++ debugger on either platform, despite reading a lot of documentation.

In the end I stumbled upon it; I choose to create a launch json for Node.js (even though this isn't what I wanted for C/C++).

Now that I had a launch.json created, I noticed a blue button bottom right, "Add Config".

When I clicked this button, I finally got the options to configure a C/C++ debugger (different ones according to whether I was trying this on macOS and Windows).

I then just needed to delete the entry in launch.json for Node.js to leave things correctly configured.

My feedback is that I very nearly gave up on this software due to the above and that the extensions I installed should have allowed me to directly create the correct json file.

CMake Tools Diagnostics

No response

Debug Log

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

Reproduce the reported workflow on macOS and Windows: install the C/C++ and CMake extensions, open a folder with CMakeLists.txt, build it, and use Run & Debug to create launch.json. Compare the initial Create a launch.json options with the later Add Config options; done means a first-time C++ user can directly configure the appropriate debugger without creating and deleting a Node.js entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.