skip to Main Content

I am developing for Apache AGE and I use the command make installcheck a lot to test the things I just did.

I was wondering if there’s a way to debug this command under GDB or any other tool, and set breakpoints where I want. That would make my life much easier.

I tried gdb --args make installcheck but it didn’t seem to work.


Edit:

I already know how to use GDB, what I want to know is if I can debug the tests that are made when I give the command make installcheck on the root of Apache AGE directory.

3

Answers


  1. Hey I have created an article about how to debug your added function through VSCode through GDB the steps are as the following:

    1. START postgres server
    2. CONNECT through psql session
    3. GET THE pid of that backend process through
    SELECT pg_backend_pid();
    
    1. SET your breakpoints on your function or anywhere you want
    2. Get start with the debugging on VS code through click on F5 and write the process id you got from the psql session
    3. Write commands to the psql session (call your function to get into that and reach the break points you have set
    4. Have a good debugging day <3

    DEMO:
    img

    You can check the blog entry also:

    Login or Signup to reply.
  2. Here is a way to debug the extension. First you want to start the postgres server (which i assume you know that already) and then use the following command ps aux | grep postgres.

    Find the process that says postgres: idle, then use the number in the second column here: sudo gdb -p <insert number here> and you are done! You may want to read more about the gdb debugger like setting breakpoints, examining values etc. so you can be more comfortable.

    Login or Signup to reply.
  3. I believe with the make command there isn’t, but one way you could do it is to, as other said, have an instance of postgres running, get the backend pid, attach it to gdb, then set a breakpoint to the function that the regression test is calling and then execute the same queries from the regression tests.

    You can also read the regression/regression.diffs to see what are the changes between the tests and also the output files.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search