You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "Munmud (via GitHub)" <gi...@apache.org> on 2023/06/13 08:00:11 UTC

[GitHub] [age] Munmud opened a new issue, #986: How to use gdb to debug AGE source code ?

Munmud opened a new issue, #986:
URL: https://github.com/apache/age/issues/986

   I wanted to take help of GDB to get to know the workflow of the code for some function of AGE. How can we do it ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani commented on issue #986: How to use gdb to debug AGE source code ?

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #986:
URL: https://github.com/apache/age/issues/986#issuecomment-1589483901

   Just an FYI: If you have correctly set up PostgreSQL in a development directory, not under root, you do not need to use the root account or sudo for any commands.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Munmud closed issue #986: How to use gdb to debug AGE source code ?

Posted by "Munmud (via GitHub)" <gi...@apache.org>.
Munmud closed issue #986: How to use gdb to debug AGE source code ?
URL: https://github.com/apache/age/issues/986


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Amr-Shams commented on issue #986: How to use gdb to debug AGE source code ?

Posted by "Amr-Shams (via GitHub)" <gi...@apache.org>.
Amr-Shams commented on issue #986:
URL: https://github.com/apache/age/issues/986#issuecomment-1589002746

   Using the tree recursion principle here can be beneficial, where you try to find a function and follow the calls of the function throughout the code. However, keep in mind that sometimes it can be challenging to follow a large codebase with a complex structure, as in our case. To make this process more manageable, you can write down the function and its subsequent calls. This may take some time, but doing so with GDB will provide insights into the results of each function, which you might not be aware of otherwise.
   
   By employing the tree recursion principle along with GDB, you can systematically explore the code and gain a deeper understanding of the function's workflow, even in the context of a complex codebase.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Zainab-Saad commented on issue #986: How to use gdb to debug AGE source code ?

Posted by "Zainab-Saad (via GitHub)" <gi...@apache.org>.
Zainab-Saad commented on issue #986:
URL: https://github.com/apache/age/issues/986#issuecomment-1588775250

   For using gdb to debug AGE, you need to attach the process of postgres running instance to gdb. You can find the PID in psql interface using:
   `SELECT pg_backend_pid();`
   In a new terminal, use
   `sudo gdb`
   Then when a gdb interface is launched, attach the process by using the PID found above
   `attach <pid>`
   The process has been attached but you need to give the path to AGE source code files as
   `dir <path_to>/age`
   
   Now, you can use standard gdb commands to debug code. For example, set a breakpoint at a function as:
   `b <function_name>`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] sarmadmm commented on issue #986: How to use gdb to debug AGE source code ?

Posted by "sarmadmm (via GitHub)" <gi...@apache.org>.
sarmadmm commented on issue #986:
URL: https://github.com/apache/age/issues/986#issuecomment-1589001884

   Found this [blog](https://dev.to/moeedk/set-up-apache-age-for-development-installing-and-modifying-the-source-5889) helpful to setting up the environment or development and debugging for apacheAge, section 3 refers to the usage of debugging tools like GDB which you want to use.
   You can refer to the [GDB](https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_toc.html) documentation as well to gain more insight into this.
   I hope this helps you! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Zeesh-an commented on issue #986: How to use gdb to debug AGE source code ?

Posted by "Zeesh-an (via GitHub)" <gi...@apache.org>.
Zeesh-an commented on issue #986:
URL: https://github.com/apache/age/issues/986#issuecomment-1589113226

   To use GDB (GNU Debugger) to debug AGE source code, follow following steps:
   
   1. Open a new terminal and find the PID of the PostgreSQL (PGSQL) process connected to the 'postgres' database using the command: ```ps -ef | grep postgres```. Look for the process ID (PID) associated with the 'postgres' database.
   2. Start GDB by running ```sudo gdb``` in the terminal.
   3. Attach GDB to the PGSQL process using the PID you found in step 1. In GDB, run the command: ```attach <PID>```, replacing <PID> with the actual process ID.
   4. Update GDB's search path for the source files. Determine the directory where the AGE source files are located, and in GDB, use the command: ```dir <source_directory>```, replacing <source_directory> with the actual path to the source files.
   Familiarize yourself with GDB commands:
           b <function>: Set a breakpoint at a specific function.
           c: Continue execution until the next breakpoint.
           n: Execute the next line of code.
           s: Step into a function.
           p <variable>: Print the value of a variable.
           bt: Display the current call stack.
           d: Delete all breakpoints.
           list: Show the context (source code) around the current line.
           q: Quit GDB.
   
   Set a breakpoint at the 'parse_cypher' function in the 'cypher_parser.c' file using the command: b parse_cypher.
   
   For detailed explanation, [documentation](https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_toc.html) can help.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org