Skip to content

Commit

Permalink
Merge branch 'xdebug_2_7'
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Mar 21, 2019
2 parents 2cf17c7 + e4341af commit 5e00da5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/bug01647.inc
@@ -0,0 +1,4 @@
<?php
$x=1;
$x+=1;
?>
32 changes: 32 additions & 0 deletions tests/bug01647.phpt
@@ -0,0 +1,32 @@
--TEST--
Test for bug #1647: Memory corruption when a conditional breakpoint is used
--SKIPIF--
<?php if (getenv("SKIP_DBGP_TESTS")) { exit("skip Excluding DBGp tests"); } ?>
--FILE--
<?php
require 'dbgp/dbgpclient.php';
$data = file_get_contents(dirname(__FILE__) . '/bug01647.inc');

$commands = array(
'step_into',
'breakpoint_set -t line -n 2 -- JGZkc2hmZGs=',
'run',
);

dbgpRun( $data, $commands );
?>
--EXPECTF--
<?xml version="1.0" encoding="iso-8859-1"?>
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///tmp/xdebug-dbgp-test.php" language="PHP" xdebug:language_version="" protocol_version="1.0" appid="" idekey=""><engine version=""><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://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="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="1" status="break" reason="ok"><xdebug:message filename="file:///tmp/xdebug-dbgp-test.php" lineno="2"></xdebug:message></response>

-> breakpoint_set -i 2 -t line -n 2 -- JGZkc2hmZGs=
<?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="2" id=""></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"></response>
2 changes: 1 addition & 1 deletion xdebug_handlers.c
Expand Up @@ -60,7 +60,7 @@ void xdebug_brk_info_dtor(xdebug_brk_info *brk_info)
xdfree(brk_info->file);
}
if (brk_info->condition) {
efree(brk_info->condition);
xdfree(brk_info->condition);
}
xdfree(brk_info);
}
Expand Down

0 comments on commit 5e00da5

Please sign in to comment.