summaryrefslogtreecommitdiff
path: root/phpdbg_set.c
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2013-11-25 19:39:17 -0200
committerFelipe Pena <felipensp@gmail.com>2013-11-25 19:39:17 -0200
commitd50e2546c73380cb811cbdc44472bcc5bf94acd0 (patch)
tree1205206f9240841d7afdaea7e9750cfe13a85628 /phpdbg_set.c
parent2be5a1e3da05caee88bc92f2abec223cc999c1f0 (diff)
downloadphp-git-d50e2546c73380cb811cbdc44472bcc5bf94acd0.tar.gz
- Added command "set breakpoint <on|off>"
Diffstat (limited to 'phpdbg_set.c')
-rw-r--r--phpdbg_set.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/phpdbg_set.c b/phpdbg_set.c
index b604822d69..7c73192007 100644
--- a/phpdbg_set.c
+++ b/phpdbg_set.c
@@ -41,16 +41,38 @@ PHPDBG_SET(prompt) /* {{{ */
return SUCCESS;
} /* }}} */
+PHPDBG_SET(breakpoint) /* {{{ */
+{
+ switch (param->type) {
+ case EMPTY_PARAM:
+ phpdbg_writeln("%s",
+ PHPDBG_G(flags) & PHPDBG_IS_BP_ENABLED ? "on" : "off");
+ break;
+
+ case STR_PARAM:
+ if (strncasecmp(param->str, PHPDBG_STRL("on")) == 0) {
+ PHPDBG_G(flags) |= PHPDBG_IS_BP_ENABLED;
+ } else if (strncasecmp(param->str, PHPDBG_STRL("off")) == 0) {
+ PHPDBG_G(flags) ^= PHPDBG_IS_BP_ENABLED;
+ }
+ break;
+
+ phpdbg_default_switch_case();
+ }
+
+ return SUCCESS;
+} /* }}} */
+
PHPDBG_SET(color) /* {{{ */
{
if ((param->type == STR_PARAM) && (input->argc == 3)) {
const phpdbg_color_t *color = phpdbg_get_color(
input->argv[2]->string, input->argv[2]->length TSRMLS_CC);
int element = PHPDBG_COLOR_INVALID;
-
+
if (color) {
- if (phpdbg_argv_is(1, "prompt")) {
- phpdbg_notice(
+ if (phpdbg_argv_is(1, "prompt")) {
+ phpdbg_notice(
"setting prompt color to %s (%s)", color->name, color->code);
element = PHPDBG_COLOR_PROMPT;
if (PHPDBG_G(prompt)[1]) {
@@ -58,16 +80,16 @@ PHPDBG_SET(color) /* {{{ */
PHPDBG_G(prompt)[1]=NULL;
}
} else if (phpdbg_argv_is(1, "error")) {
- phpdbg_notice(
+ phpdbg_notice(
"setting error color to %s (%s)", color->name, color->code);
element = PHPDBG_COLOR_ERROR;
-
+
} else if (phpdbg_argv_is(1, "notice")) {
- phpdbg_notice(
+ phpdbg_notice(
"setting notice color to %s (%s)", color->name, color->code);
element = PHPDBG_COLOR_NOTICE;
-
- } else goto usage;
+
+ } else goto usage;
/* set color for element */
phpdbg_set_color(element, color TSRMLS_CC);