gpt4 book ai didi

Is it possible to debug Apache AGE's make installcheck?(可以调试阿帕奇时代的Make Installcheck吗?)

转载 作者:bug小助手 更新时间:2023-10-25 10:36:27 27 4
gpt4 key购买 nike



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

我正在为阿帕奇时代进行开发,我使用命令make installcheck来测试我刚刚做的事情。


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.

我想知道是否有一种方法可以在gdb或任何其他工具中调试这个命令,并在我想要的地方设置断点。那会让我的生活轻松多了。


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

我尝试了gdb--args进行安装检查,但似乎不起作用。




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.

我已经知道如何使用gdb,我想知道的是,当我在apache age目录的根目录上发出命令make installcheck时,我是否可以调试所做的测试。


更多回答
优秀答案推荐

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.

以下是调试扩展的一种方法。首先,您需要启动postgres服务器(我假设您已经知道了),然后使用以下命令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.

找到指定postgres:空闲的进程,然后使用第二列中的数字:sudo gdb-p ,您就完成了!您可能希望阅读更多关于GDB调试器的内容,如设置断点、检查值等,这样您就可以更轻松地使用它。



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.

我相信make命令没有,但正如其他人所说,可以这样做的一种方法是运行postgres的一个实例,获取后端PID,将其附加到gdb,然后为回归测试正在调用的函数设置断点,然后从回归测试执行相同的查询。


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

您还可以阅读RESERVICATION/regression.Diffs,以查看测试文件和输出文件之间的变化。



As others have said, you could use GDB or read the regression.diffs file. Another thing you could do is to read the tests themselves. They're located in the regress/ folder. The way they are organized is that inside regress/ there are two folders: one is called sql and one is called expected. If you inspect them you'll notice that the files within them have mirrored names. This is because the files in expected/ contain the results of the queries in sql/, or what the queries should be if the tests passed. To debug make installcheck, you
could try adding your own queries inside one of the sql files and the expected result inside one of the .out files. The command make installcheck will check if they both match.

正如其他人所说,您可以使用gdb或读取regression.diffs文件。您可以做的另一件事是阅读测试本身。它们位于regress/文件夹中。它们的组织方式是,在regress/内部有两个文件夹:一个称为SQL,另一个称为Expect。如果您检查它们,您会注意到其中的文件具有镜像名称。这是因为Expect/中的文件包含SQL/中的查询结果,或者如果测试通过,查询应该是什么。要调试make installcheck,您可以尝试在一个SQL文件中添加您自己的查询,在一个.out文件中添加预期的结果。命令make installcheck将检查它们是否都匹配。



In order to check the errors in installcheck, you can check the regression.diff file which has all the differences between the expected results and the actual results. If you want to further debug the queries, you can copy the queries from expr.sql and then execute them in your postgres instance. This article mentions in detail regarding how to use gdb for agedb.

为了检查安装检查中的错误,您可以检查regression.diff文件,该文件具有预期结果和实际结果之间的所有差异。如果希望进一步调试查询,可以从expr.sql复制查询,然后在您的postgres实例中执行它们。本文详细介绍了如何将gdb用于agedb。



You need to attach gdb to with postgresql to carry out this task:

要执行此任务,您需要将gdb附加到带有PostgreSQL的:



  1. Start the age with debugging symbols.



./configure --enable-debug
make




  1. Initiate the postgreSQL Server with gdb debugger.



gdb --args postgres -D /path/to/data/directory -p




  1. Put the breakpoints and start running the tests.



break my_function



Start debugging the tests.

开始调试测试。



In order to debug Apache AGE's make installcheck, you can follow these steps:

为了调试Apacheage的make installcheck,您可以按照以下步骤操作:



  • Compiling the AGE with debug symbols like -g flag and start GDB using gdb command alone.

  • After starting GDB, you need to attach gdb to the make installcheck process with the process id of make installcheck. The command for attaching gdb will be:


attach PID


  • After this, you can use keywords like break and continue for debugging by setting breakpoints.


更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com