mirror of
https://github.com/php/php-src.git
synced 2026-04-23 07:58:20 +02:00
Added help
This commit is contained in:
+32
-2
@@ -334,6 +334,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
|
||||
" **finish** continue up to end of the current execution frame" CR
|
||||
" **leave** continue up to end of the current execution frame and halt after the calling instruction" CR
|
||||
" **break** set a breakpoint at the specified target" CR
|
||||
" **watch"" set a watchpoint on $variable" CR
|
||||
" **ev** evaluate some code" CR
|
||||
" **clear** clear one or all breakpoints" CR
|
||||
" **clean** clean the execution environment" CR CR
|
||||
@@ -838,8 +839,8 @@ phpdbg_help_text_t phpdbg_help_text[] = {
|
||||
" Set the prompt to a bold >" CR CR
|
||||
|
||||
" $P S c error red-bold" CR
|
||||
" Use red bold for errors" CR
|
||||
" " CR
|
||||
" Use red bold for errors" CR CR
|
||||
|
||||
" $P S b 4 off" CR
|
||||
" Temporarily disable breakpoint 4. This can be subsequently reenabled by a **s b 4 on**." CR
|
||||
//*********** check oplog syntax
|
||||
@@ -903,6 +904,35 @@ phpdbg_help_text_t phpdbg_help_text[] = {
|
||||
|
||||
"Note **until** will trigger a \"not executing\" error if not executing."
|
||||
|
||||
},
|
||||
{"watch",
|
||||
"Sets watchpoints on variables as long as they are defined" CR
|
||||
"Passing no parameter to **watch**, lists all actually active watchpoints" CR
|
||||
"Subcommands of **watch**:" CR CR
|
||||
|
||||
" **Type** **Alias** **Purpose**" CR
|
||||
" **array** **a** Sets watchpoint on array/object to observe if an entry is added or removed" CR
|
||||
" **recursive** **r** Watches variable recursively and automatically adds watchpoints if some entry is added to an array/object" CR
|
||||
" **delete** **d** Removes watchpoint" CR CR
|
||||
|
||||
"Note when **recursive** watchpoints are removed, watchpoints on all the children are removed too"
|
||||
|
||||
"**Examples**" CR CR
|
||||
" $P watch $array" CR
|
||||
" Set watchpoint on $array" CR CR
|
||||
|
||||
" $P watch" CR
|
||||
" $array" CR CR
|
||||
|
||||
" $P w r $obj" CR
|
||||
" Set recursive watchpoint on $obj" CR CR
|
||||
|
||||
" $P w d $obj" CR
|
||||
" Removed watchpoint $obj" CR CR
|
||||
|
||||
"Technical note: If using this feature with a debugger, you will get many segmentation faults, each time when a memory page containing a watched address is hit." CR
|
||||
" You then you can continue, phpdbg will remove the write protection, so that the program can continue." CR
|
||||
" If phpdbg could not handle that segfault, the same segfault is triggered again and this time phpdbg will abort."
|
||||
},
|
||||
{NULL, NULL /* end of table marker */}
|
||||
}; /* }}} */
|
||||
|
||||
+3
-1
@@ -1006,7 +1006,9 @@ PHPDBG_COMMAND(watch) /* {{{ */
|
||||
phpdbg_list_watchpoints(TSRMLS_C);
|
||||
} else switch (param->type) {
|
||||
case STR_PARAM:
|
||||
phpdbg_create_var_watchpoint(param->str, param->len TSRMLS_CC);
|
||||
if (phpdbg_create_var_watchpoint(param->str, param->len TSRMLS_CC) != FAILURE) {
|
||||
phpdbg_notice("Set watchpoint on %.*s", (int)param->len, param->str);
|
||||
}
|
||||
break;
|
||||
|
||||
phpdbg_default_switch_case();
|
||||
|
||||
+10
-4
@@ -392,6 +392,8 @@ PHPDBG_WATCH(delete) /* {{{ */
|
||||
case STR_PARAM:
|
||||
if (phpdbg_delete_var_watchpoint(param->str, param->len TSRMLS_CC) == FAILURE) {
|
||||
phpdbg_error("Nothing was deleted, no corresponding watchpoint found");
|
||||
} else {
|
||||
phpdbg_notice("Removed watchpoint %.*s", (int)param->len, param->str);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -409,7 +411,9 @@ PHPDBG_WATCH(recursive) /* {{{ */
|
||||
|
||||
switch (param->type) {
|
||||
case STR_PARAM:
|
||||
phpdbg_watchpoint_parse_input(param->str, param->len, EG(active_symbol_table), 0, phpdbg_create_recursive_watchpoint TSRMLS_CC);
|
||||
if (phpdbg_watchpoint_parse_input(param->str, param->len, EG(active_symbol_table), 0, phpdbg_create_recursive_watchpoint TSRMLS_CC) != FAILURE) {
|
||||
phpdbg_notice("Set recursive watchpoint on %.*s", (int)param->len, param->str);
|
||||
}
|
||||
break;
|
||||
|
||||
phpdbg_default_switch_case();
|
||||
@@ -426,7 +430,9 @@ PHPDBG_WATCH(array) /* {{{ */
|
||||
|
||||
switch (param->type) {
|
||||
case STR_PARAM:
|
||||
phpdbg_watchpoint_parse_input(param->str, param->len, EG(active_symbol_table), 0, phpdbg_create_array_watchpoint TSRMLS_CC);
|
||||
if (phpdbg_watchpoint_parse_input(param->str, param->len, EG(active_symbol_table), 0, phpdbg_create_array_watchpoint TSRMLS_CC) != FAILURE) {
|
||||
phpdbg_notice("Set array watchpoint on %.*s", (int)param->len, param->str);
|
||||
}
|
||||
break;
|
||||
|
||||
phpdbg_default_switch_case();
|
||||
@@ -460,7 +466,7 @@ void phpdbg_watch_HashTable_dtor(zval **zv) {
|
||||
|
||||
int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC) {
|
||||
if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) {
|
||||
return SUCCESS;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
return phpdbg_watchpoint_parse_input(input, len, EG(active_symbol_table), 0, phpdbg_create_watchpoint TSRMLS_CC);
|
||||
@@ -468,7 +474,7 @@ int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC) {
|
||||
|
||||
int phpdbg_delete_var_watchpoint(char *input, size_t len TSRMLS_DC) {
|
||||
if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) {
|
||||
return SUCCESS;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
return phpdbg_watchpoint_parse_input(input, len, EG(active_symbol_table), 0, phpdbg_delete_watchpoint TSRMLS_CC);
|
||||
|
||||
Reference in New Issue
Block a user