Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 614 lines (421 sloc) 22.367 kB
27c6dcb @haiping added debugger doc
haiping authored
1
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
2 --------------------------- Abort Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
3
4 [a]bort aborts current PHP code input
5
6
7 You will have to type this command on a new line, while you're typing
8 ad-hoc PHP code to evaluate. In other words, it only works when you see
9 continuation prompt like ">>>>".
10
11
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
12 --------------------------- Break Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
13
14 [b]reak breaks at current line of code
15 [b]reak {exp} breaks at matching location
16 [b]reak [s]tart breaks at start of web request
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
17 {url}
27c6dcb @haiping added debugger doc
haiping authored
18 [b]reak [e]nd breaks at end of web request
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
19 {url}
27c6dcb @haiping added debugger doc
haiping authored
20 [b]reak [p]sp breaks at end of psp
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
21 {url}
27c6dcb @haiping added debugger doc
haiping authored
22
23 [b]reak [r]egex breaks at matching regex pattern
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
24 {above}
27c6dcb @haiping added debugger doc
haiping authored
25 [b]reak [o]nce breaks just once then disables it
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
26 {above}
27c6dcb @haiping added debugger doc
haiping authored
27
28 [b]reak {above} breaks if condition meets
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
29 if {php}
27c6dcb @haiping added debugger doc
haiping authored
30 [b]reak {above} breaks and evaluates an expression
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
31 && {php}
27c6dcb @haiping added debugger doc
haiping authored
32
33 [b]reak [l]ist lists all breakpoints
34 [b]reak [c]lear clears the n-th breakpoint on list
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
35 {index}
27c6dcb @haiping added debugger doc
haiping authored
36 [b]reak [c]lear clears all breakpoints
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
37 [a]ll
27c6dcb @haiping added debugger doc
haiping authored
38 [b]reak [c]lear clears current breakpoint
39 [b]reak [t]oggle toggles the n-th breakpoint on list
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
40 {index}
27c6dcb @haiping added debugger doc
haiping authored
41 [b]reak [t]oggle toggles all breakpoints
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
42 [a]ll
27c6dcb @haiping added debugger doc
haiping authored
43 [b]reak [t]oggle toggles current breakpoint
44
45
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
46 -------------------------- Where to break? --------------------------
27c6dcb @haiping added debugger doc
haiping authored
47
48 There are many ways to specify a source file location to set a
49 breakpoint, but it's ONE single string without whitespaces. The complete
50 format, though every field is optional, looks like this,
51
52 {file location}:{call}=>{call}()@{url}
53 {call}=>{call}():{file location}@{url}
54
55 file location: {file}:{line1}-{line2}
56 function call: {namespace}::{cls}::{func}
57 url matching: @{url}
58
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
59 1) Url has to be specified at end.
27c6dcb @haiping added debugger doc
haiping authored
60
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
61 2) Function calls can be 1, 2 or more, matching a call chain. If more
27c6dcb @haiping added debugger doc
haiping authored
62 than one function are specified, they don't have to be direct callers to
63 match. It will match any caller on the stack.
64
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
65 3) Pay attention to those delimiters, and they are required to tell what
66 a field should be interpreted as, unless it is a number, then it must be
67 line numbers. Otherwise, use them to indicate what the names are:
27c6dcb @haiping added debugger doc
haiping authored
68
69 {file}: filename
70 {line1}-{line2} any line between them (inclusive)
71 {line} single line, if without dashes around
72 {line}: needs colon if anything after
73 {namespace}::{cls}:: a class in specified namespace
74 {cls}:: a class in any namespace
75 {func}() function or method
76 {func}=>{func}() function called by specified function
77 {cls}::{method}() class method (static or instance)
78 @{url} breaks only when this URL is visited
79
80 For examples,
81
82 b mypage.php:123
83 b 456
84 b foo()
85 b MyClass::foo()
86 b mypage.php:foo()
87 b html/mypage.php:MyClass::foo()
88 b mypage.php:123@index.php
89
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
90 4) You may also use regular expressions to match any of these names,
27c6dcb @haiping added debugger doc
haiping authored
91 except line numbers. For examples,
92
93 b r Feed.*::on.*()
94
95 This may match FeedStory::onLoad(), FeedFilter::onclick(), etc.. Note
96 that it uses PCRE format, not shell format. So you will have to use ".*"
97 instead of just "*" for wildcard match.
98
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
99 ------------------------ Special Breakpoints ------------------------
27c6dcb @haiping added debugger doc
haiping authored
100
101 There are special breakpoints that can only be set by names:
102
103 start
104 end
105 psp
106
107 They represent different time points of a web request. "start" is at
108 beginning of a web request, when no PHP file is invoked yet, but query
109 strings and server variables are already prepared. "end" is at end of a
110 web request, but BEFORE post-send processing (psp). "psp" is at END of
111 psp, not beginning. To set a breakpoint at beginning of psp, use "end",
112 because end of a request is the same as beginning of psp.
113
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
114 -------------- Conditional Breakpoints and Watchpoints --------------
27c6dcb @haiping added debugger doc
haiping authored
115
116 Every breakpoint can specify a condition, which is an arbitrary PHP
117 expression that will be evaulated to TRUE or FALSE. When TRUE, it will
118 break. When FALSE, it will continue without break. "&&" is similar to
119 "if", except it will always break, regardless what the expression
120 returns. This is useful to watch variables at breakpoints. For example,
121
122 b mypage.php:123 && print $a
123
124 So every time it breaks at mypage.php line 123, it will print out $a.
125
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
126 --------------------- Breakpoint States and List ---------------------
27c6dcb @haiping added debugger doc
haiping authored
127
128 Every breakpoint has 3 states: ALWAYS, ONCE, DISABLED. Without keyword
129 "once", a breakpoint is in ALWAYS state. ONCE breakpoints will turn into
130 DISABLED after it's hit once. DISABLED breakpoints will not break, but
131 they are kept in the list, so one can run 'b l' command and 'b t'
132 command to toggle their states.
133
134 Use '[b]reak [l]ist' command to view indices of different breakpoints.
135 Then use those indices to clear or toggle their states. This list of
136 breakpoints and their states will remain the same when switching to
137 different machines, sandboxes and threads.
138
34a487f @haiping [hphpd] displaying source code while stepping
haiping authored
139 -------------------------- Hard Breakpoints --------------------------
140
141 From within PHP code, you can place a function call hphpd_break() to
142 embed a breakpoint. You may also specify a condition as the function's
143 parameter, so it breaks when the condition is met. Please read about
144 this function for more details with '[i]nfo hphpd_break'.
145
27c6dcb @haiping added debugger doc
haiping authored
146
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
147 -------------------------- Continue Command --------------------------
27c6dcb @haiping added debugger doc
haiping authored
148
149 [c]ontinue continues program execution
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
150 {count=1}
27c6dcb @haiping added debugger doc
haiping authored
151
152
153 Use this command at break to resume program execution. Specify a count
154 to repeat the same command many times.
155
156
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
157 ---------------------------- Down Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
158
159 [d]own {num=1} moves to inner frames (callees) on stacktrace
160
161
162 Use this command to walk down on stacktrace to find out inner callees of
163 current frame. By default it moves down by one level. Specify a number
164 to move down several levels a time.
165
166
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
167 ------------------------- Exception Command -------------------------
27c6dcb @haiping added debugger doc
haiping authored
168
169 [e]xception {cls} breaks if class of exception throws
170 [e]xception breaks if class of exception throws
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
171 {ns}::{cls}
b6f4739 @haiping [hphpd] fixed a couple of issues around the debugger
haiping authored
172 [e]xception error breaks on errors, warnings and notices
27c6dcb @haiping added debugger doc
haiping authored
173 [e]xception breaks only if url also matches
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
174 {above}@{url}
27c6dcb @haiping added debugger doc
haiping authored
175
176 [e]xception breaks at matching regex pattern
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
177 [r]egex {above}
27c6dcb @haiping added debugger doc
haiping authored
178 [e]xception breaks just once then disables it
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
179 [o]nce {above}
27c6dcb @haiping added debugger doc
haiping authored
180
181 [e]xception breaks if condition meets
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
182 {above} if {php}
27c6dcb @haiping added debugger doc
haiping authored
183 [e]xception breaks and evaluates an expression
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
184 {above} && {php}
27c6dcb @haiping added debugger doc
haiping authored
185
186
187 Exception command is similar to '[b]reak' command, except it's used to
188 specify how to break on (or catch) a throw of an exception. Program
189 stops right before the exception is about to throw. Resuming program
190 execution will continue to throw the exception as is.
191
192 Only a class name can be specified with an optional namespace. All
193 exceptions of the class or its sub-classes will be matched. To specify a
194 perfect match without sub-classing test, use '[e]xception [r]egex
195 ^{exact class name}$', although regex can match in a lot more different
196 ways.
197
198 An exception breakpoint can be listed, cleared or toggled with '[b]reak'
199 commands.
200
201
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
202 --------------------------- Frame Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
203
204 [f]rame {index} jumps to one particular frame
205
206
207 Use '[w]here' command to find out the frame number. Use 'f 0' to jump
208 back to the most recent frame or the innermost frame. Use 'f 999' or
209 some big number to jump to the outermost frame.
210
211
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
212 --------------------------- Global Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
213
214 [g]lobal lists all global variables
215 [g]lobal {text} full-text search global variables
216
217
218 This will print names and values of all global variables, if {text} is
219 not speified. Otherwise, it will print global variables that contain the
220 text in their names or values. The search is case-insensitive and
221 string-based.
222
223
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
224 ---------------------------- Help Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
225
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
226 [h]elp [s]tart displays material for getting started
27c6dcb @haiping added debugger doc
haiping authored
227 [h]elp [t]utorial changing tutorial modes
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
228 on|off|auto
27c6dcb @haiping added debugger doc
haiping authored
229
230
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
231 Please read "Getting Started" material with '[h]elp [s]tart' for first
232 time use to get yourself familiar with basics.
233
27c6dcb @haiping added debugger doc
haiping authored
234 Tutorial mode displays extra information when something didn't work as
235 you expected. "auto" mode will display the same information just once.
236 "on" mode will display it as long as you run into the same situation.
237 "off" mode completely turns off all tutorial texts.
238
239 To get detailed information of a command, type '{cmd} [h]elp' or '{cmd}
240 ?' or 'help {cmd}' or '? {cmd}'.
241
242
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
243 ---------------------------- Info Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
244
245 info displays current function's info
246 info {cls} displays declaration of this class
247 info {function} displays declaration of this function
248 info displays declaration of this method
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
249 {cls::method}
27c6dcb @haiping added debugger doc
haiping authored
250 info displays declaration of this constant
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
251 {cls::constant}
27c6dcb @haiping added debugger doc
haiping authored
252 info displays declaration of this property
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
253 {cls::$property}
27c6dcb @haiping added debugger doc
haiping authored
254
255
256 Use this command to display declaration of a symbol.
257
258
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
259 ---------------------------- Jump Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
260
261 [j]ump jumps over one expression
262 [j]ump {line} goto the specified line
263 [j]ump goto the specified line
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
264 {file}:{line}
27c6dcb @haiping added debugger doc
haiping authored
265 [j]ump {label} goto the specified label
266
267
268 This command changes program execution to the specified place without
269 executing remaining code on current line. When no label or source
270 location is specified, it jumps over just one expression without
271 evaluating it. This may be useful to not throw an exception when breaks
272 at a throw, for example.
273
274
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
275 -------------------------- Constant Command --------------------------
27c6dcb @haiping added debugger doc
haiping authored
276
277 [k]onstant lists all constants
278 [k]onstant {text} full-text search constants
279
280
281 This will print names and values of all constants, if {text} is not
282 speified. Otherwise, it will print names and values of all constants
283 that contain the text in their names or values. The search is
284 case-insensitive and string-based.
285
286
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
287 ---------------------------- List Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
288
289 list displays current block of source code
290 list {line} displays code around specified line
291 list displays specified block of source code
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
292 {line1}-{line2}
27c6dcb @haiping added debugger doc
haiping authored
293 list {line1}- displays code starting with the line
294 list -{line2} displays code ending with the line
295 list {file} displays beginning lines of the file
296 list displays code around specified file:line
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
297 {file}:{line}
27c6dcb @haiping added debugger doc
haiping authored
298 list displays specified block in the file
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
299 {file}:{l1}-{l2}
27c6dcb @haiping added debugger doc
haiping authored
300 list {file}:{l1}- displays specified block in the file
301 list {file}:-{l2} displays specified block in the file
90efa29 @haiping made compiled version debuggable
haiping authored
302 list {directory} sets PHP source root directory
27c6dcb @haiping added debugger doc
haiping authored
303
304
305 Use list command to display PHP source code. In remote debugging, this
306 is displaying source code on server side. When server side cannot find
307 the file, it will fall back to local files.
308
309 Hit return to display more lines of code after current display.
310
90efa29 @haiping made compiled version debuggable
haiping authored
311 When a directory name is specified, this will be set to root directory
312 for resolving relative paths of PHP files. Files with absolute paths
313 will not be affected by this setting. This directory will be stored in
314 configuration file for future sessions as well.
315
27c6dcb @haiping added debugger doc
haiping authored
316
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
317 -------------------------- Machine Command --------------------------
27c6dcb @haiping added debugger doc
haiping authored
318
94a4999 @haiping intercept
haiping authored
319 [m]achine debugging remote server natively
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
320 [c]onnect {host}
94a4999 @haiping intercept
haiping authored
321 [m]achine debugging remote server natively
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
322 [c]onnect
323 {host}:{port}
94a4999 @haiping intercept
haiping authored
324 [m]achine [r]pc debugging remote server with RPC
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
325 {host}
94a4999 @haiping intercept
haiping authored
326 [m]achine [r]pc debugging remote server with RPC
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
327 {host}:{port}
27c6dcb @haiping added debugger doc
haiping authored
328 [m]achine debugging local script
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
329 [d]isconnect
27c6dcb @haiping added debugger doc
haiping authored
330 [m]achine [l]ist list all sandboxes
331 [m]achine attach to a sandbox
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
332 [a]ttach {index}
47a2fee @haiping intercepting builtin functions as well
haiping authored
333 [m]achine attach to my sandbox by name
334 [a]ttach
335 {sandbox}
336 [m]achine attach to a sandbox by user and name
337 [a]ttach {user}
338 {sandbox}
27c6dcb @haiping added debugger doc
haiping authored
339
340
341 Use this command to switch between different machines or sandboxes.
342
343 If command prompt says "hphpd", all evaluation of PHP code happens
344 locally within the debugger. This is the mode when debugger is started
345 without a remote server name. No user libraries are pre-loaded in this
346 mode.
347
348 When connecting to a remote server, it will automatically attach to
349 "default" sandbox under current user. If "default" sandbox does not
350 exist, it will attach to a random sandbox under current user. In sandbox
351 mode, a file specified in server's configuration of
352 "Eval.Debugger.StartupDocument" is pre-loaded.
353
354 If there is no sandbox available, it will create a "dummy" sandbox and
355 attach to it.
356
357 When your sandbox is not available, please hit it at least once from
358 your browser. Then run '[m]achine [l]ist' command again.
359
94a4999 @haiping intercept
haiping authored
360 If a HipHop server has RPC port open, one can also debug the server in a
361 very special RPC mode. In this mode, one can type in PHP scripts to run,
362 but all functions will be executed on server through RPC. Because states
363 are still maintained locally and only functions are executed remotely,
364 it may not work with functions or scripts that depend on global
365 variables or low-level raw resource pointers. As a simple rule,
47a2fee @haiping intercepting builtin functions as well
haiping authored
366 stateless functions will work just fine. This is true to objects and
367 method calls as well, except classes will have to be loaded on client
368 side by '=include("file-containing-the-class.php")'.
94a4999 @haiping intercept
haiping authored
369
27c6dcb @haiping added debugger doc
haiping authored
370
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
371 ---------------------------- Next Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
372
373 [n]ext {count=1} steps over lines of code
374
375
376 Use this command at break to step over lines of code. Specify a count to
377 step over more than one line of code.
378
379
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
380 ---------------------------- Out Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
381
382 [o]ut {count=1} steps out function calls
383
384
385 Use this command at break to step out function calls. Specify a count to
386 step out more than one level of function calls.
387
388
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
389 --------------------------- Print Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
390
391 [p]rint {php} prints result of PHP code
392 [p]rint x {php} prints hex encoded string or number
393 [p]rint [h]ex prints hex encoded string or number
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
394 {php}
27c6dcb @haiping added debugger doc
haiping authored
395 [p]rint [o]ct prints octal encoded string or number
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
396 {php}
27c6dcb @haiping added debugger doc
haiping authored
397 [p]rint [d]ec prints as signed integer
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
398 {php}
27c6dcb @haiping added debugger doc
haiping authored
399 [p]rint prints as unsigned integer
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
400 [u]nsigned {php}
27c6dcb @haiping added debugger doc
haiping authored
401 [p]rint [t]ime converts between time and timestamp
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
402 {php}
27c6dcb @haiping added debugger doc
haiping authored
403
404 [p]rint [a]lways adds a watch expression at break
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
405 {above}
27c6dcb @haiping added debugger doc
haiping authored
406 [p]rint [l]ist lists watch expressions
407 [p]rint [c]lear clears a watch expression
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
408 {index}
27c6dcb @haiping added debugger doc
haiping authored
409 [p]rint [c]lear clears all watch expressions
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
410 [a]ll
27c6dcb @haiping added debugger doc
haiping authored
411
412
413 Prints result of an expression in certain format. If '[a]lways' is
414 specified, the expression will be added to a watch list. At every break,
415 either at a breakpoint or caused by step commands, these expressions
416 will be evaluated and printed out.
417
418
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
419 ---------------------------- Quit Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
420
421 [q]uit quits this program
422
423
424 After you type this command, you will not see me anymore.
425
426
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
427 ---------------------------- Run Command ----------------------------
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
428
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
429 [r]un restarts program
430 [r]un {file} starts a new program
431 {arg1} {arg2} ...
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
432
433
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
434 Aborts current execution and restarts program with specified arguments.
435 If no arguments are specified, it will reuse the PHP file and old
436 arguments. If arguments are to be changed, please include file name,
437 even if it is the same, as the first one.
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
438
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
439 In server mode, this command will simply abort current page handling
440 without restarting anything.
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
441
442
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
443 ---------------------------- Step Command ----------------------------
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
444
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
445 [s]tep {count=1} steps into lines of code
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
446
447
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
448 Use this command at break to step into lines of code. Specify a count to
449 step more than once.
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
450
451
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
452 --------------------------- Thread Command ---------------------------
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
453
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
454 [t]hread displays current thread's information
455 [t]hread [l]ist lists all threads at break
456 [t]hread {index} switches to the specified thread
457 [t]hread [n]ormal breaks all threads
458 [t]hread [s]ticky only send command to current thread
459 [t]hread only break current thread
460 [e]xclusive
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
461
462
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
463 Use '[t]hread' alone to display information of current thread.
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
464
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
465 When a thread is at break, you may specify how other threads should
466 behave if they also happen to hit some breakpoints. Normally, other
467 threads will also break, and they will interrupt debugger session with
468 their breakpoints. So breaks from different threads may interleave. If
469 '[t]hread [s]ticky' is specified, all other threads will wait until
470 current thread is finished. This will help debugging to focus on just
471 one thread without losing breaks from other threads. If there is no need
472 to hold up any other threads, use '[t]hread [e]xclusive'. Then other
473 threads will not break at all. This mode is useful for live debugging a
474 production server, without interrupting many threads at a time. Use
475 '[t]hread [n]ormal' to change thread mode back to normal.
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
476
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
477 Some debugging commands will automatically turn thread mode to sticky.
478 These include continue, step, next or out commands with a counter of
479 more than 1. Or a jump command. These commands imply non-interruption
480 from another thread. The mode will remain even after these commands
481 until '[t]hread [n]ormal' is issued.
482 When multple threads hit breakpoints at the same time, use '[t]hread
483 [l]ist' command to display their indices, which can be used to switch
484 between them with '[t]hread {index}'.
27c6dcb @haiping added debugger doc
haiping authored
485
486
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
487 ----------------------------- Up Command -----------------------------
27c6dcb @haiping added debugger doc
haiping authored
488
489 [u]p {num=1} moves to outer frames (callers) on stacktrace
490
491
492 Use this command to walk up on stacktrace to find out outer callers of
493 current frame. By default it moves up by one level. Specify a number to
494 move up several levels a time.
495
496
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
497 -------------------------- Variable Command --------------------------
27c6dcb @haiping added debugger doc
haiping authored
498
499 [v]ariable lists all local variables on stack
500 [v]ariable {text} full-text search local variables
501
502
503 This will print names and values of all variables that are currently
504 accessible by simple names. Use '[w]here', '[u]p {num}', '[d]own {num}',
505 '[f]rame {index}' commands to choose a different frame to view variables
506 at different level of the stack.
507
508 Specify some free text to print local variables that contain the text
509 either in their names or values. The search is case-insensitive and
510 string-based.
511
512
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
513 --------------------------- Where Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
514
515 [w]here displays current stacktrace
516 [w]here {num} displays number of innermost frames
517 [w]here -{num} displays number of outermost frames
518
519
520 Use '[u]p {num}' or '[d]own {num}' to walk up or down the stacktrace.
521 Use '[f]rame {index}' to jump to one particular frame. At any frame, use
522 '[v]ariable' command to display all local variables.
523
524
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
525 -------------------------- Extended Command --------------------------
27c6dcb @haiping added debugger doc
haiping authored
526
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
527 x {cmd} {arg1} invoke specified command
528 {arg2} ...
529 x{cmd} {arg1} invoke specified command
530 {arg2} ...
531
27c6dcb @haiping added debugger doc
haiping authored
532
533 where {cmd} can be:
534
535 [a]mple
536 [t]ension
537
538 Type 'x [h]elp|? {cmd} to read their usages.
539
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
540 ----------------------- User Extended Command -----------------------
27c6dcb @haiping added debugger doc
haiping authored
541
dab1e44 @haiping [hphpd] fixed eval() to use current frame instead of top frame
haiping authored
542 y {cmd} {arg1} invoke specified command
543 {arg2} ...
544 y{cmd} {arg1} invoke specified command
545 {arg2} ...
546
27c6dcb @haiping added debugger doc
haiping authored
547
548 These commands are implemented and installed in PHP by implementing
549 DebuggerCommand and calling hphpd_install_user_command(). For example
550
551 class MyCommand implements DebuggerCommand {
552 public function help($client) {
553 $client->helpTitle("Hello Command");
554 $client->helpCmds("y [h]ello", "prints welcome message");
555 return true;
556 }
557 public function onClient($client) {
558 $client->output("Hello, world!");
559 return true;
560 }
561 }
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
562
27c6dcb @haiping added debugger doc
haiping authored
563 hphpd_install_user_command('hello', 'MyCommand');
564
565 Type '[i]nfo DebuggerCommand' for complete DebuggerCommand interface.
566 Type '[i]nfo DebuggerClient' for complete DebuggerClient interface that
567 you can use when implementing those $client callbacks. Type '[i]nfo
568 DebuggerProxy' for complete DebuggerProxy interface that you can use
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
569 when implementing those $proxy callbacks.
27c6dcb @haiping added debugger doc
haiping authored
570
571
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
572 ---------------------------- Zend Command ----------------------------
27c6dcb @haiping added debugger doc
haiping authored
573
574 [z]end running the most recent code snippet in Zend PHP
575
576
577 This is mainly for comparing results from PHP vs. HipHop. After you type
578 in some PHP code, it will be evaluated immediately in HipHop. Then you
579 can type '[z]end' command to re-run the same script in Zend PHP. Please
580 note that only the most recent block of code you manually typed in was
581 evaluated, not any earlier ones, nor the ones from a PHP file.
582
583
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
584 --------------------------- Macro Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
585
586 & [s]tart starts recording of default macro
587 & [s]tart {name} starts recording of a named macro
588 & [e]nd stops and saves recorded macro
589 & [r]eplay replays default macro
590 & [r]eplay {name} replays a named macro
591 & [l]ist lists all macros
592 & [c]lear {index} deletes a macro
593
594
595 Macro command allows you to record a series of debugger command, so you
596 can replay later by its name. When name is not specified, it will use
597 "default" as the name.
598
599 There is also a special macro "startup" that will be replayed every time
600 when debugger is just started. Use startup macro to load certain PHP
601 files or perform certain debugging environment setup.
602
603 The space between & and command is not needed. '&s' works as well.
604
605
34675fe @haiping [hphpd] improved and fixed a couple of issues around info and list
haiping authored
606 --------------------------- Shell Command ---------------------------
27c6dcb @haiping added debugger doc
haiping authored
607
608 ! {cmd} {arg1} {arg2} ... remotely executes shell command
609
610 Executes the shell command on connected machine.
611
612 The space between ! and command is not needed. '!ls' works as well.
613
Something went wrong with that request. Please try again.