4 ms·
You can also use gdb to debug more than just C code. I used to know a DBA that had symbols installed on the production database server so he could attach a deb
by MichaelBurge 10y ago
You can also use gdb to debug more than just C code.
I used to know a DBA that had symbols installed on the production database server so he could attach a debugger to the running Postgres backend process, and use the backtrace to tell you what the query was doing and why it was running slowly.
Also, note that running strace on a production process can change its observed behavior. http://man7.org/linux/man-pages/man2/ptrace.2.html http://man7.org/linux/man-pages/man2/ptrace.2.html
- bch 10y agoMaybe I'm not following you, but isn't that just attaching gbd to C code?
- uabstraction 10y agoWell, yes... But it's probably being used to troubleshoot a bottleneck in postgres being triggered by a higher level language application.
- tonyarkles 10y agoThere's often macros you can use to help. In that case, sure, it's C code. Another "it's just C code" is debugging CPython: https://wiki.python.org/moin/DebuggingWithGdb https://wiki.python.org/moin/DebuggingWithGdb These macros let you inspect both the C stack and the Python stack, and some other stuff. Super super handy for rare cases where shit just gets weird.