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
Hey I have created an article about how to debug your added function through VSCode through GDB the steps are as the following:
DEMO:
You can check the blog entry also:
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 thegdb
debugger like setting breakpoints, examining values etc. so you can be more comfortable.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.