DEV Community

Ahmed Mohamed
Ahmed Mohamed

Posted on

Debugging Session for AGE using GDB

After have Postgres configured with enabling debugging flags and a running Postgres instance. An open session running and age extension is loaded

  • Get PID of the current session

SELECT pg_backend_pid();

  • Open new terminal tab and run sudo gdb to run the debugger
  • Attach gdb to to the PID that we got from the previous step e.g. PID: 123

(gdb) attach 123

  • Add a break point to a specific line or function at some where

(gdb) b <function_name>

The following are The basic GDB commands:

  • b for breakpoint, (b )
  • c for continue - continues to the next breakpoint
  • n for next line
  • s for step into
  • p for print, (p *) for pointers
  • d for delete all breakpoints
  • q for quit

Ref:
apache age repo
GDB Docs

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay