问题遇到的现象和发生背景
vscode调试postgresql,f5启动,要是lacuch模式就能进main里面的断点,可attach的时候,也能提示是否授权,选Y以后,就直接推出了,jobs stopped 。
如果不是调试模式,正常数据库操作都是可以的。
select * from t1;也进不了断点,报错正常的断点都进不去。
{
"name": "postgres --help",
"type": "cppdbg",
"request": "launch",
"program": "/usr/local/pgsql/bin/postgres",
"args": [
"--help"
],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "initdb",
"type": "cppdbg",
"request": "launch",
"program": "/usr/local/pgsql/bin/initdb",
"args": [
"-D",
"<datadir>"
],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "postgres backend",
"type": "cppdbg",
"request": "attach",
"program": "/usr/local/pgsql/bin/postgres",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
问题相关代码,请勿粘贴截图
运行结果及报错内容
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/gdb' as the super user
Authenticating as: ubuntt,,, (pg)
Password: [1] + Stopped (tty output) /usr/bin/pkexec "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-bxee44gi.4p3" 1>"/tmp/Microsoft-MIEngine-Out-yczbw40g.ttw"
You have stopped jobs.
我的解答思路和尝试过的方法
我想要达到的结果
怎么才能进planner.c里面的断点啊。