VSCode 调试Postgresql配置

前提:

1、获取Postgre源码--从官网直接获取Postgresql Git仓库

2、安装VSCode--官网地址VSCode地址

(需要安装插件cpptools)

配置文件

1、tasks.json

{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "presentation" : { "reveal": "always" }, "tasks": [ { "label": "Configure", "type": "shell", "command": "./configure --prefix=/home/db/postgres/pg_dev --enable-depend --enable-cassert --enable-debug CFLAGS=\"-g -O0\"", "problemMatcher": [ "$eslint-compact" ] }, { "label": "Make All", "type": "shell", "command": "make -j4 all", "problemMatcher": [ "$eslint-compact" ] }, { "label": "Make Clean All", "type": "shell", "command": "make clean", "problemMatcher": [ "$eslint-compact" ] }, { "label": "Make Install", "type": "shell", "command": "make install", "problemMatcher": [ "$eslint-compact" ] } ]}

2、launch.json

{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(lldb) pg Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/src/backend/postgres", "args": ["-D", "/home/db/postgres/pgdata/data"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb" }, { "name": "(lldb) pg Launch help", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/src/backend/postgres", "args": ["--help", ""], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb" }, { "name": "(lldb) Launch", "type": "cppdbg", "request": "attach", "processId": 8096, "program": "${workspaceFolder}/src/backend/postgres", "MIMode": "gdb" } ]}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容