VS Code memo

launch.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "dbg a.out",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceRoot}/path/to/a.out",
			"args": [
				"-b",
				"sim"
			],
			"stopAtEntry": false,
			"cwd": "${workspaceRoot}/path/to/",
			"environment": [
				{
					"name": "LD_LIBRARY_PATH",
					"value": "./:${workspaceRoot}/path/to/:/usr/local/cuda-11.1/lib64"
				},
				{
					"name": "GST_DEBUG_DUMP_DOT_DIR",
					"value": "/home/work/tmp"
				}
			],
			"externalConsole": false,
			"MIMode": "gdb",
			"setupCommands": [
				{
					"description": "Enable pretty-printing for gdb",
					"text": "-enable-pretty-printing",
					"ignoreFailures": true
				}
			]
		},
		{
			"name": "C++ Attach (GDB)",
			"type": "cppdbg",
			"request": "attach",
			"targetArchitecture": "x64",
			"program": "${workspaceRoot}/path/to/a.out",
			"processId": "${command:pickProcess}"
		}
	]
}

Don't translate tab to spaces,

1
File -> Preferences -> Settings -> Text Editor -> Insert Spaces / Detect Indentation

Display std::string or std::vector content

1
-exec -enable-pretty-printing