DEV Community

Muhammad Farooq
Muhammad Farooq

Posted on

1

process to connect AGE code to GDB debugger in linux

1. go to the directory where you have installed postgres from source code.

2. start the server using following command:
bin/pg_ctl -D [db cluster name] -l [logfile (optional)] start
for example
bin/pg_ctl -D demo -l logfile start

3.now run psql utility using command:
bin/psql [db name]
for example
bin/psql demodb

4. now find the pid (process id) of the running postgres instance.

  • use system monitor and search for postgres as show in the fig below

Image description

  • or use command: ps -ef | grep postgres

5. open new terminal and run command: sudo gdb

6. now use command attach [pid] pid is process id for postgres that you have found in step 4

for example attach 8024

7. Attach the directory of AGE repository to GDB, so that GDB can find the code of AGE using:

For example:

dir /home/ununtu/age_installation/age

8. Now you can add breakpoints at required functions using:
for example:

b parse_cypher

Now when you pass a query through psql to postgres server, the query will stop at the breakpoints and you can move around the code using standard GDB commands.

I hope you have learnt something from this
if you have any question you can ask.

Visit for more about Apache AGE:

official website: https://age.apache.org/

Github: https://github.com/apache/age/

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay