只打破MacGDBp中的断点?

时间:2012-02-19 19:30:49

标签: php macos debugging gdb xdebug

MacGDBp有一个名为“Break on first line of execution”的设置,我关闭了..但它似乎没有做任何事情。它仍会捕获并中断每个查询,使其成为无用的应用程序。

有没有人使用知道解决方法的MacGDBp?我很乐意使用它,但在这一点上它不值得。

由于

1 个答案:

答案 0 :(得分:1)

我意识到这可能涉及更多,但这听起来就像你单步执行代码时发生的事情。

您点击了哪个按钮? “继续”按钮应跳转到下一个断点。

我抓住了这个:
Debugging your PHP Code: XDebug on MAMP with TextMate and MacGDBp Support

xdebug macgdbp buttons

从左到右,按钮为:

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

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

Step Over(跳过):这将跳过检查下一步。例如,如果当前行指向一个函数,并且您不希望看到函数execute,则可以使用此按钮跳过它。单击此按钮将前进到当前范围中的下一行。

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

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

使用这些按钮,您可以浏览脚本的执行。虽然这会在程序执行时为您提供详细的逐步分析,但它通常可能过度。通常,您只想分析脚本的一小部分。最好用断点来完成。

断点是一个标记,告诉调试器在到达位置时暂停。使用断点,您可以将调试器设置为播放大部分代码,仅在到达感兴趣的部分时暂停。

编辑:2012年2月26日

嗨Naatan,

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

xdebug.remote_log=/var/log/xdebug/xdebug.log

您可以确定MacGDBp是否正在发送任何断点,以及它是否正在发送运行命令或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>


2)“第一行执行突然”=开启且没有突发事件

  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>


3)“第一行执行突然”=开启,第一行有突破点

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>


4)“第一行执行突然”=开启,在第10行的断点上

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>


5)“第一行执行突然”=关闭,第一行有突发事项

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>


6)“第一行执行突然”=关闭,在第10行突发点

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>

好吧,