Php 在MacGDBp中仅中断断点?

Php 在MacGDBp中仅中断断点?,php,macos,debugging,gdb,xdebug,Php,Macos,Debugging,Gdb,Xdebug,MacGDBp有一个名为“执行第一行时中断”的设置,我将其关闭。。但它似乎没有任何作用。它仍然捕获并破坏每一个查询,使其成为一个无用的应用程序 有没有人使用MacGDBp来解决这个问题?我很想利用它,但现在不值得 谢谢我意识到这可能会涉及更多的内容,但这听起来像是在逐步完成代码时发生的事情 你在按哪个按钮?“继续”按钮应跳转到下一个断点 我从: 从左到右,按钮为: 单步执行:单击此按钮将使调试器前进一步,如有必要,可“进入”函数、类、文件等。通过反复单击此按钮,您可以单步执行流程的每个部分

MacGDBp有一个名为“执行第一行时中断”的设置,我将其关闭。。但它似乎没有任何作用。它仍然捕获并破坏每一个查询,使其成为一个无用的应用程序

有没有人使用MacGDBp来解决这个问题?我很想利用它,但现在不值得


谢谢

我意识到这可能会涉及更多的内容,但这听起来像是在逐步完成代码时发生的事情

你在按哪个按钮?“继续”按钮应跳转到下一个断点

我从:

从左到右,按钮为:

单步执行:单击此按钮将使调试器前进一步,如有必要,可“进入”函数、类、文件等。通过反复单击此按钮,您可以单步执行流程的每个部分

跳出:这将向上移动一个级别。例如,如果您正在完成一个函数的中途退出,调试器将前进到代码的下一部分,跳过函数的其余部分

跳过(Skip):这将跳过检查下一步。例如,如果当前行指向函数,而您不希望看到函数执行,则可以使用此按钮跳过它。单击此按钮将直接进入当前范围中的下一行

继续(播放):继续执行,直到下一个断点或脚本结束

重置:删除当前调试会话并等待来自服务器的下一个请求

使用这些按钮,您可以在脚本的执行过程中导航。虽然这会让您在程序执行时对其进行详细的逐步分析,但它通常可能有些过火。通常,您只需要分析脚本的一小部分。这最好通过断点来实现

断点是指示调试器在到达位置时暂停的标记。通过使用断点,您可以设置调试器以播放大部分代码,仅当调试器到达感兴趣的部分时才暂停

编辑:2012年2月26日

嗨,纳坦

您可以通过将这一行添加到php.ini文件中来查看xdebug日志:

xdebug.remote_log=/var/log/xdebug/xdebug.log
您可以确定MacGDBp是否正在发送任何断点,以及它是否正在发送run命令或step_into命令

以下是我对六种不同场景的看法。我去掉了大部分数据,因为它占用了很多空间,如果您需要查看特定行的数据,请告诉我

1)“执行第一行中断”=关闭且无断点

Log opened at 2012-02-26 22:27:47
-> <init

<- feature_set -i 2859 -n show_hidden -v 1
-> <response

<- feature_set -i 2860 -n max_depth -v 3
-> <response

<- feature_set -i 2861 -n max_children -v 30
-> <response

<- feature_get -i 2862 -n max_data
-> <response

<- eval -i 2863 --
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="2863"><property address=

<- run -i 2864
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="2864" status="stopping" reason="ok"></response>
  Log opened at 2012-02-26 22:35:39
  -> <init

  <- feature_set -i 2913 -n show_hidden -v 1
  -> <response

  <- feature_set -i 2914 -n max_depth -v 3
  -> <response

  <- feature_set -i 2915 -n max_children -v 30
  -> <response

  <- feature_get -i 2916 -n max_data
  -> <response

  <- eval -i 2917 --
  -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="2917"><property address=

  // 2a) STEP INTO CALLED BECAUSE "BREAK ON FIRST LINE OF EXECUTION" IS TURNED ON
  <- step_into -i 2918
  -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="2918" status="break" reason="ok"><xdebug:message filename="file:///var/www/application/html/index.php" lineno="2"></xdebug:message></response>

  <- stack_get -i 2919
  -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="2919"><stack where="{main}" level="0" type="file" filename="file:///var/www/application/html/index.php" lineno="2"></stack></response>

  <- context_names -i 2920
  -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="2920"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>

  <- context_get -i 2921 -c 0
  -> <response xmlns= // SHOWS "Locals" VARIABLES

  <- context_get -i 2922 -c 1
  -> <response xmlns= // SHOWS "Superglobals" VARIABLES

  // 2b) CLICK CONTINUE
  <- run -i 2923
  -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="2923" status="stopping" reason="ok"></response>
日志于2012-02-26 22:27:47打开
->日志于2012-02-27 00:46:23打开
-> 

谢谢Joe,我熟悉如何使用调试器。我的问题是,MacGDBp总是在执行的第一行中断,不管发生什么,即使我已经关闭了该设置。我不确定这是程序还是xDebug的问题。嗨,Naatan,我添加了一些关于xDebug日志条目的信息。嗨,Naatan,还有一些想法。MacGDBp的源代码是可用的,我看了一下,如果您有xcode ide,您可以将该设置更改为off并编译它(这是从mac应用商店免费下载的)。另一个选择是使用netbeans ide的mac版本。我使用的是windows版本,它与xdebug配合得很好。哇,令人印象深刻的工作乔,如果我找到解决方案,我一定会研究它并报告。我目前使用Komodo IDE进行调试,但我使用Sublime Text 2作为我的主IDE,因此使用像MacDBGp这样的轻量级程序进行调试将更加理想。顺便问一下,您使用了什么来记录这些xDebug查询?我一直在研究如何构建一个xDebug客户端,并且能够记录这样的查询将非常有用。谢谢您好,Naatan,您可以将xdebug.remote\u log=PATH/FILE\u NAME添加到您添加其他xdebug设置的php.ini文件中。我的服务器是linux,因此我可以在调试模式下使用“tail”命令查看日志,以在日志更新时查看日志。
Log opened at 2012-02-26 22:41:56
-> <init

<- feature_set -i 2936 -n show_hidden -v 1
-> <response

<- feature_set -i 2937 -n max_depth -v 3
-> <response

<- feature_set -i 2938 -n max_children -v 30
-> <response

<- feature_get -i 2939 -n max_data
-> <response

// 3a) LISTS ALL BREAKPOINTS THAT ARE SET
<- breakpoint_set -i 2940 -t line -s enabled -f file:///var/www/application/html/index.php -n 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2940" state="enabled" id="179940003"></response>

<- eval -i 2941 --
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="2941"><property address=

// 3b) STEP INTO CALLED BECAUSE "BREAK ON FIRST LINE OF EXECUTION" = ON
<- step_into -i 2942
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="2942" status="break" reason="ok"><xdebug:message filename="file:///var/www/application/html/index.php" lineno="2"></xdebug:message></response>

<- stack_get -i 2943
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="2943"><stack where="{main}" level="0" type="file" filename="file:///var/www/application/html/index.php" lineno="2"></stack></response>

<- context_names -i 2944
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="2944"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>

<- context_get -i 2945 -c 0
-> <response xmlns= // SHOWS "Locals" VARIABLES

<- context_get -i 2946 -c 1
-> <response xmlns= // SHOWS "Superglobals" VARIABLES

// 3c) CLICK CONTINUE
<- run -i 2947
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="2949" status="stopping" reason="ok"></response>
Log opened at 2012-02-27 00:29:26
-> <init

<- feature_set -i 3023 -n show_hidden -v 1
-> <response

<- feature_set -i 3024 -n max_depth -v 3
-> <response

<- feature_set -i 3025 -n max_children -v 30
-> <response

<- feature_get -i 3026 -n max_data
-> <response

// 4a) LISTS ALL BREAKPOINTS THAT ARE SET
<- breakpoint_set -i 3027 -t line -s enabled -f file:///var/www/application/html/index.php -n 10
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3027" state="enabled" id="180020001"></response>

<- eval -i 3028 --
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="3028"><property address=

// 4b) STEP INTO CALLED BECAUSE "BREAK ON FIRST LINE OF EXECUTION" = ON
<- step_into -i 3029
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="3029" status="break" reason="ok"><xdebug:message filename="file:///var/www/application/html/index.php" lineno="2"></xdebug:message></response>

<- stack_get -i 3030
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="3030"><stack where="{main}" level="0" type="file" filename="file:///var/www/application/html/index.php" lineno="2"></stack></response>

<- context_names -i 3031
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="3031"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>

<- context_get -i 3032 -c 0
-> <response xmlns= // SHOWS "Locals" VARIABLES

<- context_get -i 3033 -c 1
  -> <response xmlns= // SHOWS "Superglobals" VARIABLES

// 4c) CLICK CONTINUE - GOES TO BREAKPOINT ON LINE 10
<- run -i 3034
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="3034" status="break" reason="ok"><xdebug:message filename="file:///var/www/application/html/index.php" lineno="10"></xdebug:message></response>

<- stack_get -i 3035
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="3035"><stack where="{main}" level="0" type="file" filename="file:///var/www/application/html/index.php" lineno="10"></stack></response>

<- context_names -i 3036
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="3036"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>

<- context_get -i 3037 -c 0
-> <response xmlns= // SHOWS "Locals" VARIABLES

<- context_get -i 3038 -c 1
  -> <response xmlns= // SHOWS "Superglobals" VARIABLES

// 4d) CLICK CONTINUE
<- run -i 3039
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="2864" status="stopping" reason="ok"></response>
Log opened at 2012-02-26 22:49:46
-> <init

<- feature_set -i 2962 -n show_hidden -v 1
-> <response

<- feature_set -i 2963 -n max_depth -v 3
-> <response

<- feature_set -i 2964 -n max_children -v 30
-> <response

<- feature_get -i 2965 -n max_data
-> <response

// 5a) LISTS ALL BREAKPOINTS THAT ARE SET
<- breakpoint_set -i 2966 -t line -s enabled -f file:///var/www/application/html/index.php -n 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2966" state="enabled" id="180160005"></response>

<- eval -i 2967 --
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="2967"><property address="140734566267920" type="string" size="77" encoding="base64"><![CDATA[aHR0cDovL2RldmVsb3BtZW50Lm1hcmluYXMuY29tL2luZGV4LnBocD9YREVCVUdfU0VTU0lPTl9TVEFSVD1uZXRiZWFucy14ZGVidWc=]]></property></response>

<- run -i 2968
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="2968" status="break" reason="ok"><xdebug:message filename="file:///var/www/application/html/index.php" lineno="2"></xdebug:message></response>

<- stack_get -i 2969
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="2969"><stack where="{main}" level="0" type="file" filename="file:///var/www/application/html/index.php" lineno="2"></stack></response>

<- context_names -i 2970
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="2970"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>

<- context_get -i 2971 -c 0
-> <response xmlns= // SHOWS "Locals" VARIABLES

<- context_get -i 2972 -c 1
-> <response xmlns= // SHOWS "Superglobals" VARIABLES

// 5b) CLICK CONTINUE
<- run -i 2973
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="2973" status="stopping" reason="ok"></response>
Log opened at 2012-02-27 00:46:23
-> <init

<- feature_set -i 3052 -n show_hidden -v 1
-> <response

<- feature_set -i 3053 -n max_depth -v 3
-> <response

<- feature_set -i 3054 -n max_children -v 30
-> <response

<- feature_get -i 3055 -n max_data
-> <response

// 6a) LISTS ALL BREAKPOINTS THAT ARE SET
<- breakpoint_set -i 3056 -t line -s enabled -f file:///var/www/application/html/index.php -n 10
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3056" state="enabled" id="179990006"></response>

<- eval -i 3057 --
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="3057"><property address="140734566267920" type="string" size="77" encoding="base64"><![CDATA[aHR0cDovL2RldmVsb3BtZW50Lm1hcmluYXMuY29tL2luZGV4LnBocD9YREVCVUdfU0VTU0lPTl9TVEFSVD1uZXRiZWFucy14ZGVidWc=]]></property></response>

<- run -i 3058
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="3058" status="break" reason="ok"><xdebug:message filename="file:///var/www/application/html/index.php" lineno="10"></xdebug:message></response>

<- stack_get -i 3059
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="3059"><stack where="{main}" level="0" type="file" filename="file:///var/www/application/html/index.php" lineno="10"></stack></response>

<- context_names -i 3060
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="3060"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>

<- context_get -i 3061 -c 0
-> <response xmlns= // SHOWS "Locals" VARIABLES

<- context_get -i 3062 -c 1
-> <response xmlns= // SHOWS "Superglobals" VARIABLES

// 6b) CLICK CONTINUE
<- run -i 3063
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="3063" status="stopping" reason="ok"></response>