Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
|
||
function phpErrorCatcher($no = 0, $str = null, $file = null, $line = 0) { | ||
throw new Exception($str); | ||
} | ||
|
||
set_error_handler("phpErrorCatcher", E_ALL); | ||
|
||
function my_exception_handler() { | ||
xdebug_break(); | ||
} | ||
|
||
set_exception_handler("my_exception_handler"); | ||
|
||
|
||
|
||
function causeError() { | ||
echo $undefined; | ||
} | ||
|
||
|
||
|
||
causeError(); | ||
?> |
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,36 @@ | ||
--TEST-- | ||
Test for bug #1083: Segfault while retrieving information about uninitiased var. | ||
--FILE-- | ||
<?php | ||
require 'dbgp/dbgpclient.php'; | ||
|
||
$data = file_get_contents(dirname(__FILE__) . '/bug01083.inc'); | ||
|
||
$commands = array( | ||
'step_into', | ||
'breakpoint_set -t exception -x Exception', | ||
'run', | ||
'context_get -d 1 -c 0', | ||
); | ||
|
||
dbgpRun( $data, $commands ); | ||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///tmp/xdebug-dbgp-test.php" language="PHP" protocol_version="1.0" appid="" idekey=""><engine version=""><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2099 by Derick Rethans]]></copyright></init> | ||
|
||
-> step_into -i 1 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="1" status="break" reason="ok"><xdebug:message filename="file:///tmp/xdebug-dbgp-test.php" lineno="4"></xdebug:message></response> | ||
|
||
-> breakpoint_set -i 2 -t exception -x Exception | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id=""></response> | ||
|
||
-> run -i 3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="3" status="break" reason="ok"><xdebug:message filename="file:///tmp/xdebug-dbgp-test.php" lineno="5" exception="Exception"><![CDATA[Undefined variable: undefined]]></xdebug:message></response> | ||
|
||
-> context_get -i 4 -d 1 -c 0 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="4" context="0"><property name="$undefined" fullname="$undefined" type="uninitialized"></property></response> |