昨天折腾了很久才配置好,这里简单记录下。
打开lauch.json
菜单 View -> Command Palette,输入launch,选择 Debug: Open launch.json
选择 C++ (GDB/LLDB)
编辑 launch.json 文件
注意:根据你的PG环境,修改相关的路径(建议写成绝对路径)
GDB配置:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 附加",
"type": "cppdbg",
"request": "attach",
"program": "/home/postgres/test/bin/postgres",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
LLDB配置: