2 require(__DIR__
. '/common.inc');
4 $path = __DIR__
. "/step.php.test";
5 $GLOBALS["path"] = $path;
6 $GLOBALS["file"] = "step.php.test";
8 // Calibration mappings:
11 $GLOBALS['mapping'] = $mapping;
13 function verifyStopLine($frames, $line) {
16 $msg = json_decode(getNextVsDebugMessage(), true);
17 checkObjEqualRecursively($msg, array(
25 "command" => "stackTrace",
32 $msg = json_decode(getNextVsDebugMessage(), true);
33 checkObjEqualRecursively($msg, array(
35 "command" => "stackTrace",
39 "totalFrames" => $frames,
42 "source" => array("path" => $path, "name" => $path),
50 function stepCommand($cmd) {
55 "arguments" => array("threadId" => 1)));
56 $msg = json_decode(getNextVsDebugMessage(), true);
57 checkObjEqualRecursively($msg, array(
63 $msg = json_decode(getNextVsDebugMessage(), true);
64 checkObjEqualRecursively($msg, array(
66 "event" => "continued",
72 $setBreakpointsCommand = array(
73 "command" => "setBreakpoints",
80 "name" => "step.php.test"
84 array("line" => 9, "condition" => ""),
85 array("line" => 13, "condition" => "")
89 $setBreakpointsRepsponse = array(
91 "command" => "setBreakpoints",
95 "breakpoints" => array(
96 array("id" => 1, "verified" => false),
97 array("id" => 2, "verified" => false),
100 $testProcess = vsDebugLaunch(
101 __DIR__
. '/step.php.test',
103 [$setBreakpointsCommand],
106 $setBreakpointsRepsponse,
108 // New BP event for each breakpoint
109 bpEvent($path, 9, 1, "new", false),
110 bpEvent($path, 13, 1, "new", false),
112 // Resolved BP event for each bp
113 bpEvent($path, 9, 1, "changed", true),
114 bpEvent($path, 13, 1, "changed", true)
118 // Verify we resumed from loader break.
119 $msg = json_decode(getNextVsDebugMessage(), true);
120 checkObjEqualRecursively($msg, array(
122 "event" => "continued",
124 "allThreadsContinued" => false
127 $msg = json_decode(getNextVsDebugMessage(), true);
128 checkObjEqualRecursively($msg, array(
130 "event" => "continued",
132 "allThreadsContinued" => true,
136 // Verify we hit breakpoint 1.
141 verifyStopLine(1, 10);
144 stepCommand("stepIn");
145 verifyStopLine(2, 4);
149 verifyStopLine(2, 5);
152 stepCommand("stepOut");
153 verifyStopLine(1, 11);
155 // Step over function.
157 verifyStopLine(1, 12);
159 // Continue to location hits bp on the way to the target line.
161 "command" => "fb_continueToLocation",
167 "source" => array("path" => $path),
170 $msg = json_decode(getNextVsDebugMessage(), true);
171 checkObjEqualRecursively($msg, array(
175 "category" => "info",
178 $msg = json_decode(getNextVsDebugMessage(), true);
179 checkObjEqualRecursively($msg, array(
180 "type" => "response",
181 "command" => "fb_continueToLocation",
182 "request_seq" => 5));
184 $msg = json_decode(getNextVsDebugMessage(), true);
185 checkObjEqualRecursively($msg, array(
187 "event" => "continued"));
192 resumeAndCleanup($testProcess);