jrgemignani opened a new issue, #313: URL: https://github.com/apache/age/issues/313
This task is to help you become familiar with the GDB debugger and how a command is processed in PostgreSQL. GDB is a full featured debugger with lots of capabilities. But, for most tasks, you only need to know a few commands and a basic instruction of how to use it. The GDB documentation is available online and if you have any questions. You can also comment here or message us if you have any questions. To debug a PostgreSQL session - 1. You will need to make sure that when you configured and built PostgreSQL, you did so with any debugging flags enabled. 2. PostgreSQL needs to be running. 3. The PostgreSQL session that you want to debug needs to be open. 4. Your GDB session needs to be in the **bin** directory for the PostgreSQL distribution that you are using. 5. You need to know the process of the **session** that you will be debugging. 6. You can then execute the command `gdb -tui postgres the_pid_number` 7. You will need to set one, or more, breakpoints (b) and then tell GDB to continue (c) The basic GDB commands are - - **b** for breakpoint, fx, `b exec_simple_query` or `b 930` - **c** for continue - continues to the next breakpoint - **n** for next line - **s** for step into - **p** for print, fx, `p *node` - **d** for delete all breakpoints - **q** for quit A good breakpoint for the start of a PostgreSQL session is `exec_simple_query`. Unless you know of a specific area or function that you need to look at. For this task, `exec_simple_query` is a good start. In this task you will use the debugger to trace the `SELECT 1;` statement from beginning to end (output). You do **not** need to worry about the planner (you'll know it when you see it). You do **not** need to worry about the details, just the general flow. It is **not** expected that you will completely understand most of what you see. However, it will help you get used to the debugger and a bit of how PostgreSQL processes commands. An example, to get you started -  The session will look something like the following -  From there you would enter in a break point and tell it to continue -  From your session enter the command `SELECT 1;` which is a good, and relatively simple one, to follow -  The debugger session will then break at `exec_simple_query ` -  -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
