-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
23 changed files
with
436 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
--TEST-- | ||
{{test_name}}: {{test_intro}} | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('yasd')) { | ||
echo 'skip not install yasd extension'; | ||
} | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
use Yasd\DbgpClient; | ||
|
||
require dirname(__DIR__, {{dir_deep}}) . '/Include/bootstrap.php'; | ||
|
||
$basename = basename(__FILE__, '.php'); | ||
$filename = realpath(dirname(__FILE__) . "/{$basename}.inc"); | ||
|
||
$commands = [ | ||
'run', | ||
'stop', | ||
]; | ||
|
||
$client = (new DbgpClient())->setCommands($commands)->setTestFile($filename)->start(); | ||
|
||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri=%s language="PHP" xdebug:language_version=%s protocol_version="1.0" appid=%s idekey=%s><engine version=%s><![CDATA[Yasd]]></engine><author><![CDATA[Codinghuang]]></author><url><![CDATA[https://github.com/swoole/yasd]]></url><copyright><![CDATA[Copyright (c) 2020-2021 by Codinghuang]]></copyright></init> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--TEST-- | ||
Check stop cmd | ||
issue: 41 | ||
--SKIPIF-- | ||
--FILE-- | ||
<?php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
remote_mode: breakpoint_list | ||
--SKIPIF-- | ||
--FILE-- | ||
<?php | ||
|
||
use Yasd\DbgpClient; | ||
|
||
require dirname(__DIR__, 2) . '/Include/bootstrap.php'; | ||
|
||
$basename = basename(__FILE__, '.php'); | ||
$filename = realpath(dirname(__FILE__) . "/{$basename}.inc"); | ||
|
||
$commands = [ | ||
'breakpoint_list', | ||
'run', | ||
'stop', | ||
]; | ||
|
||
$client = (new DbgpClient())->setCommands($commands)->setTestFile($filename)->start(); | ||
|
||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri=%s language="PHP" xdebug:language_version=%s protocol_version="1.0" appid=%s idekey=%s><engine version=%s><![CDATA[Yasd]]></engine><author><![CDATA[Codinghuang]]></author><url><![CDATA[https://github.com/swoole/yasd]]></url><copyright><![CDATA[Copyright (c) 2020-2021 by Codinghuang]]></copyright></init> | ||
|
||
-> breakpoint_list -i 1 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"/> | ||
|
||
-> run -i 2 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="2" status="stopping" reason="ok"/> | ||
|
||
-> stop -i 3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="3" status="stopped" reason="ok"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
$a = 1; | ||
$b = 3; | ||
$k = []; | ||
|
||
$k = [1, 2, 3]; | ||
echo $a; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--TEST-- | ||
remote_mode: breakpoint_set | ||
--SKIPIF-- | ||
--FILE-- | ||
<?php | ||
|
||
use Yasd\DbgpClient; | ||
|
||
require dirname(__DIR__, 2) . '/Include/bootstrap.php'; | ||
|
||
$basename = basename(__FILE__, '.php'); | ||
$filename = realpath(dirname(__FILE__) . "/{$basename}.inc"); | ||
|
||
$commands = [ | ||
"breakpoint_set -t line -f file://{$filename} -n 3", | ||
'run', | ||
'run', | ||
'stop', | ||
]; | ||
|
||
$client = (new DbgpClient())->setCommands($commands)->setTestFile($filename)->start(); | ||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri=%s language="PHP" xdebug:language_version=%s protocol_version="1.0" appid=%s idekey=%s><engine version=%s><![CDATA[Yasd]]></engine><author><![CDATA[Codinghuang]]></author><url><![CDATA[https://github.com/swoole/yasd]]></url><copyright><![CDATA[Copyright (c) 2020-2021 by Codinghuang]]></copyright></init> | ||
|
||
-> breakpoint_set -i 1 -t line -f file://%s -n 3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1" id=%s/> | ||
|
||
-> run -i 2 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="2" status="break" reason="ok"><xdebug:message filename="file://%s" lineno="3"/></response> | ||
|
||
-> run -i 3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="3" status="stopping" reason="ok"/> | ||
|
||
-> stop -i 4 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="4" status="stopped" reason="ok"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
$a = 1; | ||
$b = 3; | ||
$k = []; | ||
|
||
$k = [1, 2, 3]; | ||
echo $a; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--TEST-- | ||
remote_mode: context_get | ||
--SKIPIF-- | ||
--FILE-- | ||
<?php | ||
|
||
use Yasd\DbgpClient; | ||
|
||
require dirname(__DIR__, 2) . '/Include/bootstrap.php'; | ||
|
||
$basename = basename(__FILE__, '.php'); | ||
$filename = realpath(dirname(__FILE__) . "/{$basename}.inc"); | ||
|
||
$commands = [ | ||
"breakpoint_set -t line -f file://{$filename} -n 8", | ||
'run', | ||
'context_get -d 0 -c 0', | ||
'run', | ||
'stop', | ||
]; | ||
|
||
$client = (new DbgpClient())->setCommands($commands)->setTestFile($filename)->start(); | ||
|
||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri=%s language="PHP" xdebug:language_version=%s protocol_version="1.0" appid=%s idekey=%s><engine version=%s><![CDATA[Yasd]]></engine><author><![CDATA[Codinghuang]]></author><url><![CDATA[https://github.com/swoole/yasd]]></url><copyright><![CDATA[Copyright (c) 2020-2021 by Codinghuang]]></copyright></init> | ||
|
||
-> breakpoint_set -i 1 -t line -f file://%s -n 8 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1" id="%s"/> | ||
|
||
-> run -i 2 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="2" status="break" reason="ok"><xdebug:message filename="file://%s" lineno="8"/></response> | ||
|
||
-> context_get -i 3 -d 0 -c 0 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="3" context="0"><property type="int" name="$a" fullname="a"><![CDATA[1]]></property><property type="int" name="$b" fullname="b"><![CDATA[3]]></property><property type="array" name="$k" fullname="k" children="1" numchildren="3"><property type="int" name="0" fullname="k[0]"><![CDATA[1]]></property><property type="int" name="1" fullname="k[1]"><![CDATA[2]]></property><property type="int" name="2" fullname="k[2]"><![CDATA[3]]></property></property></response> | ||
|
||
-> run -i 4 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="4" status="stopping" reason="ok"/> | ||
|
||
-> stop -i 5 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="5" status="stopped" reason="ok"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
$a = 1; | ||
$b = 3; | ||
$k = []; | ||
|
||
$k = [1, 2, 3]; | ||
echo $a; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--TEST-- | ||
remote_mode: context_names | ||
--SKIPIF-- | ||
--FILE-- | ||
<?php | ||
|
||
use Yasd\DbgpClient; | ||
|
||
require dirname(__DIR__, 2) . '/Include/bootstrap.php'; | ||
|
||
$basename = basename(__FILE__, '.php'); | ||
$filename = realpath(dirname(__FILE__) . "/{$basename}.inc"); | ||
|
||
$commands = [ | ||
"breakpoint_set -t line -f file://{$filename} -n 8", | ||
'run', | ||
'context_names', | ||
'run', | ||
'stop', | ||
]; | ||
|
||
$client = (new DbgpClient())->setCommands($commands)->setTestFile($filename)->start(); | ||
|
||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri=%s language="PHP" xdebug:language_version=%s protocol_version="1.0" appid=%s idekey=%s><engine version=%s><![CDATA[Yasd]]></engine><author><![CDATA[Codinghuang]]></author><url><![CDATA[https://github.com/swoole/yasd]]></url><copyright><![CDATA[Copyright (c) 2020-2021 by Codinghuang]]></copyright></init> | ||
|
||
-> breakpoint_set -i 1 -t line -f file://%s -n 8 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1" id="%s"/> | ||
|
||
-> run -i 2 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="2" status="break" reason="ok"><xdebug:message filename="file://%s" lineno="8"/></response> | ||
|
||
-> context_names -i 3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="3" id="%s"><context name="Locals" id="0"/><context name="Superglobals" id="1"/><context name="User defined constants" id="2"/></response> | ||
|
||
-> run -i 4 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="4" status="stopping" reason="ok"/> | ||
|
||
-> stop -i 5 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="5" status="stopped" reason="ok"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--TEST-- | ||
remote_mode: eval | ||
--SKIPIF-- | ||
--FILE-- | ||
<?php | ||
|
||
use Yasd\DbgpClient; | ||
|
||
require dirname(__DIR__, 2) . '/Include/bootstrap.php'; | ||
|
||
$basename = basename(__FILE__, '.php'); | ||
$filename = realpath(dirname(__FILE__) . "/{$basename}.inc"); | ||
|
||
$code = base64_encode("ini_get('yasd.debug_mode');"); | ||
|
||
$commands = [ | ||
"eval -- {$code}", | ||
'run', | ||
'stop', | ||
]; | ||
|
||
$client = (new DbgpClient())->setCommands($commands)->setTestFile($filename)->start(); | ||
|
||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file://%s" language="PHP" xdebug:language_version="%s" protocol_version="1.0" appid="%s" idekey="hantaohuang"><engine version="%s"><![CDATA[Yasd]]></engine><author><![CDATA[Codinghuang]]></author><url><![CDATA[https://github.com/swoole/yasd]]></url><copyright><![CDATA[Copyright (c) 2020-2021 by Codinghuang]]></copyright></init> | ||
|
||
-> eval -i 1 -- aW5pX2dldCgneWFzZC5kZWJ1Z19tb2RlJyk7 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="1"><property type="string" name="" fullname=""><![CDATA[remote]]></property></response> | ||
|
||
-> run -i 2 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="2" status="stopping" reason="ok"/> | ||
|
||
-> stop -i 3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="3" status="stopped" reason="ok"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
?> |
Oops, something went wrong.