Skip to content

Commit 6eafc5c

Browse files
committed
Merged pull request xdebug#1018
2 parents 4a93c2c + 46b5d40 commit 6eafc5c

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

src/debugger/handler_dbgp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ int xdebug_dbgp_break_on_line(xdebug_con *context, xdebug_brk_info *brk, zend_st
25942594
return 0;
25952595
}
25962596

2597-
if (zend_string_equals(brk->filename, resolved_filename)) {
2597+
if (zend_string_equals_ci(brk->filename, resolved_filename)) {
25982598
xdebug_log(XLOG_CHAN_DEBUG, XLOG_DEBUG, "F: File names match (%s).", ZSTR_VAL(brk->filename));
25992599

26002600
if (free_eval_filename) {

tests/debugger/bug02340.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
$one = 1;
3+
$two = 2;
4+
$three = 3;
5+
$four = 4;

tests/debugger/bug02340.phpt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--TEST--
2+
Test for bug #2340: Case-insensitive file name matches in line breakpoints
3+
--SKIPIF--
4+
<?php
5+
require __DIR__ . '/../utils.inc';
6+
check_reqs('dbgp');
7+
?>
8+
--FILE--
9+
<?php
10+
require 'dbgp/dbgpclient.php';
11+
$filename = dirname(__FILE__) . '/bug02340.inc';
12+
$ucFilename = strtoupper($filename);
13+
14+
$commands = array(
15+
'feature_set -n breakpoint_include_return_value -v 1',
16+
'step_into',
17+
"breakpoint_set -t line -f file://{$ucFilename} -n 4",
18+
'run',
19+
'stack_get',
20+
'detach',
21+
);
22+
23+
dbgpRunFile( $filename, $commands );
24+
?>
25+
--EXPECTF--
26+
<?xml version="1.0" encoding="iso-8859-1"?>
27+
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file://bug02340.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>
28+
29+
-> feature_set -i 1 -n breakpoint_include_return_value -v 1
30+
<?xml version="1.0" encoding="iso-8859-1"?>
31+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="breakpoint_include_return_value" success="1"></response>
32+
33+
-> step_into -i 2
34+
<?xml version="1.0" encoding="iso-8859-1"?>
35+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="2" status="break" reason="ok"><xdebug:message filename="file://bug02340.inc" lineno="2"></xdebug:message></response>
36+
37+
-> breakpoint_set -i 3 -t line -f file://%sBUG02340.INC -n 4
38+
<?xml version="1.0" encoding="iso-8859-1"?>
39+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3" id="{{PID}}0001"></response>
40+
41+
-> run -i 4
42+
<?xml version="1.0" encoding="iso-8859-1"?>
43+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="4" status="break" reason="ok"><xdebug:message filename="file://bug02340.inc" lineno="4"></xdebug:message></response>
44+
45+
-> stack_get -i 5
46+
<?xml version="1.0" encoding="iso-8859-1"?>
47+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="5"><stack where="{main}" level="0" type="file" filename="file://bug02340.inc" lineno="4"></stack></response>
48+
49+
-> detach -i 6
50+
<?xml version="1.0" encoding="iso-8859-1"?>
51+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="6" status="stopping" reason="ok"></response>

0 commit comments

Comments
 (0)