Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

process to debug AGE code using GDB debugger

I’m going through APACHE AGE repository and need to debug through the code to understand the workflow from querying to getting the result but I don’t know how to Connect AGE Code with GDB debugger

can someone please tell me the steps to do it.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

1st step: Start database server using:

pg_ctl -D DatabaseClusterName start

2nd step: Run psql utlity using:

psql postgres

3rd step: Find PID(process Id) of postgre instance as shown in following screenshot. You can use any utility for example ps -ef | grep postgres. I have used system monitor(Linux).
So PID is 618131

enter image description here

Step 4: Run GDB in another terminal using:

Sudo GDB

Step 5: In the same terminal use command:

attach 618131
to attach the PostgreSQL server to GDB.

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

For example:

dir /home/kamleshk/age_installation/age

Step 7: 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.

You can further look into step by step guide at the this link.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading