summaryrefslogtreecommitdiff
path: root/phpdbg_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'phpdbg_set.c')
-rw-r--r--phpdbg_set.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/phpdbg_set.c b/phpdbg_set.c
index 10c73aff00..1c6d3bef3c 100644
--- a/phpdbg_set.c
+++ b/phpdbg_set.c
@@ -21,6 +21,7 @@
#include "phpdbg_cmd.h"
#include "phpdbg_set.h"
#include "phpdbg_utils.h"
+#include "phpdbg_bp.h"
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
@@ -51,15 +52,33 @@ PHPDBG_SET(break) /* {{{ */
case STR_PARAM:
if (strncasecmp(param->str, PHPDBG_STRL("on")) == 0) {
- PHPDBG_G(flags) |= PHPDBG_IS_BP_ENABLED;
+ phpdbg_enable_breakpoints(TSRMLS_C);
} else if (strncasecmp(param->str, PHPDBG_STRL("off")) == 0) {
- PHPDBG_G(flags) &= ~PHPDBG_IS_BP_ENABLED;
+ phpdbg_disable_breakpoints(TSRMLS_C);
}
break;
+
+ case NUMERIC_PARAM: {
+ if (input->argc > 2) {
+ if (phpdbg_argv_is(2, "on")) {
+ phpdbg_enable_breakpoint(param->num TSRMLS_CC);
+ } else if (phpdbg_argv_is(2, "off")) {
+ phpdbg_disable_breakpoint(param->num TSRMLS_CC);
+ }
+ } else {
+ phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num TSRMLS_CC);
+ if (brake) {
+ phpdbg_writeln(
+ "%s", brake->disabled ? "off" : "on");
+ } else {
+ phpdbg_error("Failed to find breakpoint #%lx", param->num);
+ }
+ }
+ } break;
default:
phpdbg_error(
- "set break used incorrectly: set break <on|off>");
+ "set break used incorrectly: set break [id] <on|off>");
}
return SUCCESS;
@@ -130,9 +149,8 @@ PHPDBG_SET(colors) /* {{{ */
default:
phpdbg_error(
- "set colors used incorrectly: set colors <on|off>");
+ "set colors used incorrectly: set colors <on|off>");
}
-
done:
return SUCCESS;