From: krakjoe Date: Mon, 25 Nov 2013 17:43:49 +0000 (+0000) Subject: swap PROMPT for phpdbg_get_prompt in help X-Git-Tag: php-5.6.0alpha1~110^2~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=781bd90de338c2542594a859f00c893c7e1d6b89;p=php swap PROMPT for phpdbg_get_prompt in help --- diff --git a/phpdbg_help.c b/phpdbg_help.c index 2dc4577fba..227f8414b9 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -43,8 +43,8 @@ PHPDBG_HELP(step) /* {{{ */ phpdbg_writeln("You can enable and disable stepping at any phpdbg prompt during execution"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sstepping 1", PROMPT); - phpdbg_writeln("\t%ss 1", PROMPT); + phpdbg_writeln("\t%sstepping 1", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%ss 1", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill enable stepping"); phpdbg_writeln(EMPTY); phpdbg_writeln("While stepping is enabled you are presented with a prompt after the execution of each opcode"); @@ -58,8 +58,8 @@ PHPDBG_HELP(next) /* {{{ */ phpdbg_write("Step back into the vm and execute the next opcode"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%snext", PROMPT); - phpdbg_writeln("\t%sn", PROMPT); + phpdbg_writeln("\t%snext", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sn", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill cause control to be passed back to the vm, continuing execution"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: is only useful while executing"); @@ -73,8 +73,8 @@ PHPDBG_HELP(until) /* {{{ */ phpdbg_writeln("Step back into the vm, skipping breakpoints until the next source line"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%suntil", PROMPT); - phpdbg_writeln("\t%su", PROMPT); + phpdbg_writeln("\t%suntil", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%su", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill cause control to be passed back to the vm, continuing execution"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: is only useful while executing"); @@ -88,8 +88,8 @@ PHPDBG_HELP(finish) /* {{{ */ phpdbg_writeln("Step back into the vm, skipping breakpoints until past the end of the current stack"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sfinish", PROMPT); - phpdbg_writeln("\t%sF", PROMPT); + phpdbg_writeln("\t%sfinish", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sF", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill cause control to be passed back to the vm, continuing execution"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: this allows all breakpoints that would otherwise break execution in the current scope to be skipped"); @@ -103,8 +103,8 @@ PHPDBG_HELP(leave) /* {{{ */ phpdbg_writeln("Step back into the vm, skipping breakpoints until the current stack is returning"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sleave", PROMPT); - phpdbg_writeln("\t%sL", PROMPT); + phpdbg_writeln("\t%sleave", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sL", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill cause a break when instructed to leave the current context"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: this allows inspection of the return value before it is returned"); @@ -119,8 +119,8 @@ PHPDBG_HELP(compile) /* {{{ */ phpdbg_writeln("The execution context must be set for compilation to succeed"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%scompile", PROMPT); - phpdbg_writeln("\t%sc", PROMPT); + phpdbg_writeln("\t%scompile", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sc", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill compile the current execution context, populating class/function/constant/etc tables"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: It is a good idea to clean the environment between each compilation"); @@ -135,32 +135,32 @@ PHPDBG_HELP(print) /* {{{ */ phpdbg_writeln("Other printing commands give access to instruction information"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sprint class \\my\\class", PROMPT); - phpdbg_writeln("\t%sp c \\my\\class", PROMPT); + phpdbg_writeln("\t%sprint class \\my\\class", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sp c \\my\\class", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the instructions for the methods in \\my\\class"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sprint method \\my\\class::method", PROMPT); - phpdbg_writeln("\t%sp m \\my\\class::method", PROMPT); + phpdbg_writeln("\t%sprint method \\my\\class::method", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sp m \\my\\class::method", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the instructions for \\my\\class::method"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sprint func .getSomething", PROMPT); - phpdbg_writeln("\t%sp f .getSomething", PROMPT); + phpdbg_writeln("\t%sprint func .getSomething", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sp f .getSomething", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the instructions for ::getSomething in the active scope"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sprint func my_function", PROMPT); - phpdbg_writeln("\t%sp f my_function", PROMPT); + phpdbg_writeln("\t%sprint func my_function", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sp f my_function", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the instructions for the global function my_function"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sprint opline", PROMPT); - phpdbg_writeln("\t%sp o", PROMPT); + phpdbg_writeln("\t%sprint opline", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sp o", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the instruction for the current opline"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sprint exec", PROMPT); - phpdbg_writeln("\t%sp e", PROMPT); + phpdbg_writeln("\t%sprint exec", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sp e", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the instructions for the execution context"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sprint stack", PROMPT); - phpdbg_writeln("\t%sp s", PROMPT); + phpdbg_writeln("\t%sprint stack", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sp s", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the instructions for the current stack"); phpdbg_writeln(EMPTY); phpdbg_writeln("Specific printers loaded are show below:"); @@ -186,8 +186,8 @@ PHPDBG_HELP(run) /* {{{ */ phpdbg_writeln("Execute the current context inside the phpdbg vm"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%srun", PROMPT); - phpdbg_writeln("\t%sr", PROMPT); + phpdbg_writeln("\t%srun", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sr", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill cause execution of the context, if it is set."); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: The execution context must be set, but not necessarily compiled before execution occurs"); @@ -201,12 +201,12 @@ PHPDBG_HELP(eval) /* {{{ */ phpdbg_writeln("Access to eval() allows you to change the environment during execution, careful though !!"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%seval $variable", PROMPT); - phpdbg_writeln("\t%sE $variable", PROMPT); + phpdbg_writeln("\t%seval $variable", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sE $variable", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print_r($variable) on the console, if it is defined"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%seval $variable = \"Hello phpdbg :)\"", PROMPT); - phpdbg_writeln("\t%sE $variable = \"Hello phpdbg :)\"", PROMPT); + phpdbg_writeln("\t%seval $variable = \"Hello phpdbg :)\"", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sE $variable = \"Hello phpdbg :)\"", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill set $variable in the current scope"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: eval() will always show the result; do not prefix the code with \"return\""); @@ -220,36 +220,36 @@ PHPDBG_HELP(break) /* {{{ */ phpdbg_writeln("Setting a breakpoint stops execution at a specific stage"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sbreak [file] test.php:1", PROMPT); - phpdbg_writeln("\t%sb [f] test.php:1", PROMPT); + phpdbg_writeln("\t%sbreak [file] test.php:1", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb [f] test.php:1", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill break execution on line 1 of test.php"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sbreak [func] my_function", PROMPT); - phpdbg_writeln("\t%sb [f] my_function", PROMPT); + phpdbg_writeln("\t%sbreak [func] my_function", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb [f] my_function", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill break execution on entry to my_function"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sbreak [method] \\my\\class::method", PROMPT); - phpdbg_writeln("\t%sb [m] \\my\\class::method", PROMPT); + phpdbg_writeln("\t%sbreak [method] \\my\\class::method", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb [m] \\my\\class::method", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill break execution on entry to \\my\\class::method"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sbreak [address] 0x7ff68f570e08", PROMPT); - phpdbg_writeln("\t%sb [a] 0x7ff68f570e08", PROMPT); + phpdbg_writeln("\t%sbreak [address] 0x7ff68f570e08", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb [a] 0x7ff68f570e08", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill break at the opline with the address provided (addresses are shown during execution)"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sbreak [lineno] 200", PROMPT); - phpdbg_writeln("\t%sb [l] 200", PROMPT); + phpdbg_writeln("\t%sbreak [lineno] 200", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb [l] 200", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill break at line 200 of the currently executing file"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sbreak on ($expression == true)", PROMPT); - phpdbg_writeln("\t%sb on ($expression == true)", PROMPT); + phpdbg_writeln("\t%sbreak on ($expression == true)", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb on ($expression == true)", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill break when the condition evaluates to true"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sbreak op ZEND_ADD", PROMPT); - phpdbg_writeln("\t%sb O ZEND_ADD", PROMPT); + phpdbg_writeln("\t%sbreak op ZEND_ADD", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb O ZEND_ADD", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill break on every occurence of the opcode provided"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%sbreak del 1", PROMPT); - phpdbg_writeln("\t%sb d 1", PROMPT); + phpdbg_writeln("\t%sbreak del 1", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sb d 1", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill remove the breakpoint with the given identifier"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: An address is only valid for the current compilation"); @@ -322,12 +322,12 @@ PHPDBG_HELP(quiet) /* {{{ */ phpdbg_writeln("Setting quietness on will stop the OPLINE output during execution"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%squiet 1", PROMPT); - phpdbg_writeln("\t%sQ 1", PROMPT); + phpdbg_writeln("\t%squiet 1", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sQ 1", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill silence OPLINE output, while"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%squiet 0", PROMPT); - phpdbg_writeln("\t%sQ 0", PROMPT); + phpdbg_writeln("\t%squiet 0", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sQ 0", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill enable OPLINE output again"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: Quietness is disabled automatically while stepping"); @@ -341,8 +341,8 @@ PHPDBG_HELP(back) /* {{{ */ phpdbg_writeln("The backtrace is built with the default debug backtrace functionality"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sback 5", PROMPT); - phpdbg_writeln("\t%st 5", PROMPT); + phpdbg_writeln("\t%sback 5", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%st 5", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill limit the number of frames to 5, the default is no limit"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: it is not necessary for an exception to be thrown to show a backtrace"); @@ -356,8 +356,8 @@ PHPDBG_HELP(frame) /* {{{ */ phpdbg_writeln("When viewing a backtrace, it is sometimes useful to jump to a frame in that trace"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sframe 2", PROMPT); - phpdbg_writeln("\t%sf 2", PROMPT); + phpdbg_writeln("\t%sframe 2", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sf 2", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill go to frame 2, temporarily affecting scope and allowing access to the variables in that frame"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: the current frame is restored when execution continues"); @@ -371,24 +371,24 @@ PHPDBG_HELP(list) /* {{{ */ phpdbg_writeln("The list command displays source code for the given argument"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%slist [lines] 2", PROMPT); - phpdbg_writeln("\t%sl [l] 2", PROMPT); + phpdbg_writeln("\t%slist [lines] 2", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sl [l] 2", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print next 2 lines from the current file"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%slist [func] my_function", PROMPT); - phpdbg_writeln("\t%sl [f] my_function", PROMPT); + phpdbg_writeln("\t%slist [func] my_function", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sl [f] my_function", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the source of the global function \"my_function\""); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%slist [func] .mine", PROMPT); - phpdbg_writeln("\t%sl [f] .mine", PROMPT); + phpdbg_writeln("\t%slist [func] .mine", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sl [f] .mine", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the source of the method \"mine\" from the active scope"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%slist [method] my::method", PROMPT); - phpdbg_writeln("\t%sl [m] my::method", PROMPT); + phpdbg_writeln("\t%slist [method] my::method", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sl [m] my::method", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the source of \"my::method\""); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%slist c myClass", PROMPT); - phpdbg_writeln("\t%sl c myClass", PROMPT); + phpdbg_writeln("\t%slist c myClass", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sl c myClass", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill print the source of \"myClass\""); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: before listing functions you must have a populated function table, try compile !!"); @@ -420,12 +420,12 @@ PHPDBG_HELP(oplog) /* {{{ */ phpdbg_writeln("The log includes a high resolution timestamp on each entry"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%soplog /path/to/my.oplog", PROMPT); - phpdbg_writeln("\t%sO /path/to/my.oplog", PROMPT); + phpdbg_writeln("\t%soplog /path/to/my.oplog", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sO /path/to/my.oplog", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill open the file /path/to/my.oplog for writing, creating it if it does not exist"); phpdbg_writeln(EMPTY); - phpdbg_writeln("\t%soplog 0", PROMPT); - phpdbg_writeln("\t%sO 0", PROMPT); + phpdbg_writeln("\t%soplog 0", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sO 0", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill close the currently open log file, disabling oplog"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: upon failure to open a new oplog, the last oplog is held open"); @@ -478,8 +478,8 @@ PHPDBG_HELP(register) /* {{{ */ phpdbg_writeln("Register any global function for use as a command in phpdbg console"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sregister scandir", PROMPT); - phpdbg_writeln("\t%sR scandir", PROMPT); + phpdbg_writeln("\t%sregister scandir", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%sR scandir", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill register the scandir function for use in phpdbg"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: arguments passed as strings, return (if present) print_r'd on console"); @@ -508,11 +508,11 @@ PHPDBG_HELP(source) /* {{{ */ phpdbg_writeln("The source command can also be used to export breakpoints to a phpdbginit file"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%ssource /my/init", PROMPT); - phpdbg_writeln("\t%s. /my/init", PROMPT); + phpdbg_writeln("\t%ssource /my/init", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%s. /my/init", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill execute the phpdbginit file at /my/init"); - phpdbg_writeln("\t%ssource export /my/init", PROMPT); - phpdbg_writeln("\t%s. export /my/init", PROMPT); + phpdbg_writeln("\t%ssource export /my/init", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%s. export /my/init", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill export breakpoints to /my/init in phpdbginit file format"); phpdbg_help_footer(); return SUCCESS; @@ -524,8 +524,8 @@ PHPDBG_HELP(shell) /* {{{ */ phpdbg_writeln("Direct access to shell commands saves having to switch windows/consoles"); phpdbg_writeln(EMPTY); phpdbg_notice("Examples"); - phpdbg_writeln("\t%sshell ls /usr/src/php-src", PROMPT); - phpdbg_writeln("\t%s- ls /usr/src/php-src", PROMPT); + phpdbg_writeln("\t%sshell ls /usr/src/php-src", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("\t%s- ls /usr/src/php-src", phpdbg_get_prompt(TSRMLS_C)); phpdbg_writeln("\tWill execute ls /usr/src/php-src, displaying the output in the console"); phpdbg_writeln(EMPTY); phpdbg_writeln("Note: read only commands please !");