|
| 1 | +--TEST-- |
| 2 | +Test for bug #2348: Breakpoints in property hooks are not resolved |
| 3 | +--SKIPIF-- |
| 4 | +<?php |
| 5 | +require __DIR__ . '/../utils.inc'; |
| 6 | +check_reqs('PHP >= 8.4; dbgp'); |
| 7 | +?> |
| 8 | +--FILE-- |
| 9 | +<?php |
| 10 | +require 'dbgp/dbgpclient.php'; |
| 11 | +$filename = dirname(__FILE__) . '/bug02348.inc'; |
| 12 | + |
| 13 | +$commands = array( |
| 14 | + 'feature_set -n resolved_breakpoints -v 1', |
| 15 | + "breakpoint_set -t line -f file://{$filename} -n 7", |
| 16 | + 'run', |
| 17 | + 'detach', |
| 18 | +); |
| 19 | + |
| 20 | +$xdebugLogFileName = sys_get_temp_dir() . '/' . getenv('UNIQ_RUN_ID') . getenv('TEST_PHP_WORKER') . 'remote-log-2343.txt'; |
| 21 | +@unlink( $xdebugLogFileName ); |
| 22 | + |
| 23 | +dbgpRunFile( $filename, $commands, [ 'xdebug.log' => $xdebugLogFileName, 'xdebug.log_level' => 10 ] ); |
| 24 | + |
| 25 | +echo file_get_contents( $xdebugLogFileName ); |
| 26 | +@unlink( $xdebugLogFileName ); |
| 27 | +?> |
| 28 | +--EXPECTF-- |
| 29 | +<?xml version="1.0" encoding="iso-8859-1"?> |
| 30 | +<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file://bug02348.inc" language="PHP" xdebug:language_version="" protocol_version="1.0" appid=""><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> |
| 31 | + |
| 32 | +-> feature_set -i 1 -n resolved_breakpoints -v 1 |
| 33 | +<?xml version="1.0" encoding="iso-8859-1"?> |
| 34 | +<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="resolved_breakpoints" success="1"></response> |
| 35 | + |
| 36 | +-> breakpoint_set -i 2 -t line -f file://bug02348.inc -n 7 |
| 37 | +<?xml version="1.0" encoding="iso-8859-1"?> |
| 38 | +<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="{{PID}}0001" resolved="resolved"></response> |
| 39 | + |
| 40 | +-> run -i 3 |
| 41 | +<?xml version="1.0" encoding="iso-8859-1"?> |
| 42 | +<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="3" status="break" reason="ok"><xdebug:message filename="file://bug02348.inc" lineno="7"></xdebug:message></response> |
| 43 | + |
| 44 | +-> detach -i 4 |
| 45 | +<?xml version="1.0" encoding="iso-8859-1"?> |
| 46 | +<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="4" status="stopping" reason="ok"></response> |
| 47 | + |
| 48 | +[%d] Log opened at %s |
| 49 | +[%d] [Step Debug] INFO: Connecting to configured address/port: 127.0.0.1:%d. |
| 50 | +[%d] [Step Debug] INFO: Connected to debugging client: 127.0.0.1:%d (through xdebug.client_host/xdebug.client_port). |
| 51 | +[%d] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="%sbug02348.inc" language="PHP" xdebug:language_version="%s" protocol_version="1.0" appid="%d"><engine version="%s"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[%s]]></copyright></init> |
| 52 | + |
| 53 | +[%d] [Step Debug] <- feature_set -i 1 -n resolved_breakpoints -v 1 |
| 54 | +[%d] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="resolved_breakpoints" success="1"></response> |
| 55 | + |
| 56 | +[%d] [Step Debug] <- breakpoint_set -i 2 -t line -f %sbug02348.inc -n 7 |
| 57 | +[%d] [Step Debug] DEBUG: R: Line number (7) out of range (3-3). |
| 58 | +[%d] [Step Debug] DEBUG: R: Line number (7) out of range (9-9). |
| 59 | +[%d] [Step Debug] DEBUG: R: Line number (7) in smallest range of range (6-8). |
| 60 | +[%d] [Step Debug] DEBUG: F: Breakpoint line (7) found in set of executable lines. |
| 61 | +[%d] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="%d" resolved="resolved"></response> |
| 62 | + |
| 63 | +[%d] [Step Debug] <- run -i 3 |
| 64 | +[%d] [Step Debug] DEBUG: Setting 'has_line_breakpoints on {main} (%sbug02348.inc:0) |
| 65 | +[%d] [Step Debug] DEBUG: Checking whether to break on %sbug02348.inc:7. |
| 66 | +[%d] [Step Debug] DEBUG: I: Current location: %sbug02348.inc:2. |
| 67 | +[%d] [Step Debug] DEBUG: I: Matching breakpoint '%sbug02348.inc:7' against location '%sbug02348.inc:2'. |
| 68 | +[%d] [Step Debug] DEBUG: R: Line number (2) doesn't match with breakpoint (7). |
| 69 | +[%d] [Step Debug] DEBUG: Checking whether to break on %sbug02348.inc:7. |
| 70 | +[%d] [Step Debug] DEBUG: I: Current location: %sbug02348.inc:13. |
| 71 | +[%d] [Step Debug] DEBUG: I: Matching breakpoint '%sbug02348.inc:7' against location '%sbug02348.inc:13'. |
| 72 | +[%d] [Step Debug] DEBUG: R: Line number (13) doesn't match with breakpoint (7). |
| 73 | +[%d] [Step Debug] DEBUG: Setting 'has_line_breakpoints on $datetime::get (%sbug02348.inc:13) |
| 74 | +[%d] [Step Debug] DEBUG: Checking whether to break on %sbug02348.inc:7. |
| 75 | +[%d] [Step Debug] DEBUG: I: Current location: %sbug02348.inc:7. |
| 76 | +[%d] [Step Debug] DEBUG: I: Matching breakpoint '%sbug02348.inc:7' against location '%sbug02348.inc:7'. |
| 77 | +[%d] [Step Debug] DEBUG: F: File names match (%sbug02348.inc). |
| 78 | +[%d] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="3" status="break" reason="ok"><xdebug:message filename="%sbug02348.inc" lineno="7"></xdebug:message></response> |
| 79 | + |
| 80 | +[%d] [Step Debug] <- detach -i 4 |
| 81 | +[%d] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="4" status="stopping" reason="ok"></response> |
| 82 | + |
| 83 | +[%d] Log closed at %s |
0 commit comments