Merge sapi/phpdbg into PHP-5.6

This commit is contained in:
Bob Weinand 2014-06-04 02:18:39 +02:00
commit 848df6fcbe
5 changed files with 28 additions and 19 deletions

View File

@ -159,8 +159,6 @@ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], 8, NULL, php_phpdbg_destroy_bp_condition, 0);
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], 8, NULL, NULL, 0);
phpdbg_setup_watchpoints(TSRMLS_C);
zend_hash_init(&PHPDBG_G(seek), 8, NULL, NULL, 0);
zend_hash_init(&PHPDBG_G(registered), 8, NULL, php_phpdbg_destroy_registered, 0);
@ -1256,10 +1254,12 @@ phpdbg_main:
mm_heap->use_zend_alloc = 0;
}
zend_activate(TSRMLS_C);
PHPDBG_G(original_free_function) = mm_heap->_free;
mm_heap->_free = phpdbg_watch_efree;
zend_activate(TSRMLS_C);
phpdbg_setup_watchpoints(TSRMLS_C);
#if defined(ZEND_SIGNALS) && !defined(_WIN32)
zend_try {

View File

@ -9,7 +9,6 @@
# setting notice color
# Failed to find breakpoint #0
# oplog disabled
# not enabled
# opened oplog test.log
# nothing
#################################################
@ -19,5 +18,4 @@ set color notice none
set prompt promot>
set break 0
set oplog
set oplog 0
set oplog test.log

View File

@ -7,15 +7,15 @@
#[Registered test_function]
#array(5) {
# [0]=>
# string(1) "1"
# int(1)
# [1]=>
# string(1) "2"
# int(2)
# [2]=>
# string(1) "3"
# int(3)
# [3]=>
# string(1) "4"
# int(4)
# [4]=>
# string(1) "5"
# int(5)
#}
#################################################
<:

View File

@ -14,6 +14,5 @@ define('OUT',
file_put_contents(OUT, "<?php echo \"Hello World\"; ?>");
phpdbg_exec(OUT);
:>
compile
run
quit

View File

@ -284,6 +284,8 @@ namespace phpdbg\testing {
$test->purpose,
$result ? "PASS" : "FAIL",
PHP_EOL);
return $result;
}
protected $config;
@ -426,7 +428,7 @@ namespace phpdbg\testing {
*/
public function getResult() {
$options = sprintf(
'-i%s -qb', $this->file);
'-i%s -nqb', $this->file);
if ($this->options) {
$options = sprintf(
@ -492,13 +494,18 @@ namespace phpdbg\testing {
*
*/
protected function writeDiff() {
$diff = sprintf(
'%s/%s.diff',
dirname($this->file), basename($this->file));
if (count($this->diff['wants'])) {
if (!in_array('nodiff', $this->config['flags'])) {
if (($diff = fopen($diff, 'w+'))) {
if (!$this->config->hasFlag('nodiff')) {
if ($this->config->hasFlag('diff2stdout')) {
$difffile = "php://stdout";
file_put_contents($difffile, "====DIFF====\n");
} else {
$difffile = sprintf(
'%s/%s.diff',
dirname($this->file), basename($this->file));
}
if (($diff = fopen($difffile, 'w+'))) {
foreach ($this->diff['wants'] as $line => $want) {
$got = $this->diff['gets'][$line];
@ -552,6 +559,9 @@ namespace {
$cwd = dirname(__FILE__);
$cmd = $_SERVER['argv'];
$retval = 0;
{
$config = new TestsConfiguration(array(
'exec' => realpath(array_shift($cmd)),
@ -571,7 +581,7 @@ namespace {
$tests->logPath($path);
foreach ($tests->findTests($path) as $test) {
$tests->logTest($path, $test);
$retval |= !$tests->logTest($path, $test);
}
$tests->logPathStats($path);
@ -579,5 +589,7 @@ namespace {
$tests->logStats();
}
die($retval);
}
?>