Install Xcode to use /Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi
Last active
July 15, 2019 13:51
-
-
Save graykode/359abd55b3613176717d0b1238cad77b to your computer and use it in GitHub Desktop.
Mac OS vscode debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Launch", | |
"type": "cppdbg", | |
"request": "launch", | |
"program": "${workspaceFolder}/a.out", | |
"args": [ | |
], | |
"stopAtEntry": false, | |
"cwd": "${workspaceFolder}", | |
"environment": [], | |
"externalConsole": false, | |
"osx": { | |
"program": "${workspaceFolder}/a.out", | |
"MIMode": "lldb", | |
"miDebuggerPath": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi" | |
}, | |
"preLaunchTask": "build_c++", | |
"setupCommands": [ | |
{ | |
"text": "settings set target.input-path ${workspaceFolder}/input.txt" | |
} | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /Users/graykode/Library/Application Support/Code/User/settings.json | |
{ | |
"window.zoomLevel": 0, | |
"editor.fontSize": 17, | |
"explorer.confirmDelete": false, | |
"C_Cpp.default.cStandard": "c11", | |
"editor.insertSpaces": true, | |
"editor.tabSize": 4, | |
"editor.detectIndentation": false, | |
"editor.tabCompletion": "on", | |
"editor.formatOnType": true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .vscode/tasks.json | |
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "build_c++", | |
"type": "shell", | |
"command": "g++", | |
"args": [ | |
"-g", | |
"${file}", | |
"-o", | |
"a.out", | |
"&&", | |
"./a.out", | |
"<", | |
"${workspaceFolder}/input.txt", | |
">", | |
"${workspaceFolder}/output.txt" | |
], | |
"group": { | |
"kind": "build", | |
"isDefault": true | |
}, | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
using namespace std; | |
int main(){ | |
vector<int> v; | |
for(int i=0; i<10; i++){ | |
v.push_back(i); | |
} | |
int n; cin >> n; | |
for(int i=0; i<10; i++){ | |
v.push_back(i); | |
cout << i + 1 << endl; | |
} | |
cout << n+1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment