Skip to content

Configuring VSCode Debugging for C

Rafael Pintar Alevato edited this page Sep 27, 2018 · 1 revision

C Language

Configuring Compilation

Press 'Ctrl + shift + B' on windows/linux to “Configure Task Runner”.

Select “Others” after clicking to “Configure Task Runner”. It will create tasks.json file.

Change the following fields:

  • "label": "Compile C",
  • "command": "gcc -g my_c_file.c",
    • Optional: add -o output_name to command

Add the following field after "command" to make 'Ctrl + shift + B' build this by default:

"group": {
    "kind": "build",
    "isDefault": true
}

Configuring Debugging

  1. First install the following extensions:
  • C/C++
  • C++ Intellisense
  1. Install LLDB on the computer
  2. Choose a folder with C files to debug
  3. Click to start debugging then choose C/C++
  4. Change the following fields:
  • "name": "C Launch",
  • "program": "enter program name, for example ${workspaceFolder}/a.out",
  • "externalConsole": false,
  • "MIMode": "lldb",
  1. Go to debug task and start C Launch

Clone this wiki locally