Skip to content

Commit a696840

Browse files
authored
launsh.json增加cppdbg (oceanbase#280)
### What problem were solved in this pull request? Problem: lldb 调试配置不能在某些linux平台中运行 ### What is changed and how it works? 增加cppdbg和lldb两种调试配置
1 parent a108c2b commit a696840

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.vscode/launch.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"type": "lldb",
8+
"type": "cppdbg",
99
"request": "launch",
1010
"name": "Debug",
1111
"program": "${workspaceFolder}/${defaultBuildTask}/bin/observer",
1212
"args": ["-f", "${workspaceFolder}/etc/observer.ini", "-P", "cli"],
13+
"cwd": "${workspaceFolder}/${defaultBuildTask}/",
14+
"stopAtEntry": true,
15+
"osx": {
16+
"MIMode": "lldb"
17+
}
18+
},
19+
{
20+
"type": "lldb",
21+
"request": "launch",
22+
"name": "LLDB",
23+
"program": "${workspaceFolder}/${defaultBuildTask}/bin/observer",
24+
"args": ["-f", "${workspaceFolder}/etc/observer.ini", "-P", "cli"],
1325
"cwd": "${workspaceFolder}/${defaultBuildTask}/"
1426
}
1527
]

docs/src/dev-env/miniob-how-to-debug.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,8 @@ LOG_CONSOLE_LEVEL=1
224224
Quit anyway? (y or n) y
225225
Detaching from program: /home/caizj/local/bin/observer, process 54699
226226
[Inferior 1 (process 54699) detached]
227-
```
227+
```
228+
229+
### Visual Studio Code 调试
230+
代码中已经为vscode配置了launch.json,可以直接启动调试。
231+
launch.json中有两个调试配置,一个是Debug,一个是LLDB。其中Debug使用cppdbg,会自动探测调试工具gdb或lldb,而LLDB会使用lldb调试工具。通常情况下,大家使用Debug就可以了,但是我在测试过程中发现cppdbg不能在macos上正常工作,因而增加了LLDB的配置,以便在macos上调试,如果使用macos的同学,可以使用LLDB配置启动调试程序。

0 commit comments

Comments
 (0)