前提:
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" } ]}