-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
automatically add a breakpoint that breaks on postgres errors #7279
Conversation
629bd3a
to
44f25af
Compare
Codecov Report
@@ Coverage Diff @@
## main #7279 +/- ##
=======================================
Coverage ? 93.21%
=======================================
Files ? 275
Lines ? 59532
Branches ? 7416
=======================================
Hits ? 55492
Misses ? 4040
Partials ? 0 |
.devcontainer/.gdbinit
Outdated
# Lastly the breakpoint doesn't show up in vscode :(, to remove the breakpoint | ||
# you can use the command `-exec delete <id>` in the vscode debug console. The | ||
# id is the number in the first column of the breakpoint list which you can | ||
# show with the command `-exec info break`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to print (some of) this info, so that people can remove it even if they don't read .gdbinit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, do you have any idea on how to do so?
I expect you want to print this in the gdb console. The console is pretty verbose when attaching to a running citus backend due to many .so files being loaded.
We van have a look together later today to understand the value of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cbb3bc0
to
8c860df
Compare
8c860df
to
8323e53
Compare
When debugging postgres it is quite hard to get to the source for `errfinish` in `elog.c`. Instead of relying on the developer to set a breakpoint in the `elog.c` file for `errfinish` for `elevel == ERROR`, this change adds the breakpoint to `.gdbinit`. This makes sure that whenever a debugger is attached to a postgres backend it will break on postgres errors. When attaching the debugger a small banner is printed that explains how to disable the breakpoint.
When debugging postgres it is quite hard to get to the source for
errfinish
inelog.c
. Instead of relying on the developer to set a breakpoint in theelog.c
file forerrfinish
forelevel == ERROR
, this change adds the breakpoint to.gdbinit
. This makes sure that whenever a debugger is attached to a postgres backend it will break on postgres errors.When attaching the debugger a small banner is printed that explains how to disable the breakpoint.