com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_cmd.c phpdbg_prompt.c
| From: | Bob Weinand | Date: | Tue, 19 Nov 2013 21:58:03 +0000 |
| Subject: | com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_cmd.c phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74786@lists.php.net to get a copy of this message | ||
Commit: 3709ea995c0563fdc7dd77f75185acc677a36cc5
Author: krakjoe <joe.watkins@live.co.uk> Tue, 19 Nov 2013 21:58:03 +0000
Parents: b65cef950a0a34d31208ff87beb9223bde1aebc7 dace704d152240a4681a6cfc87d3a303f0defa1a
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3709ea995c0563fdc7dd77f75185acc677a36cc5
Log:
Merge branch 'master' of https://github.com/krakjoe/phpdbg
Changed paths:
MM phpdbg_cmd.c
MM phpdbg_prompt.c
Diff:
diff --cc phpdbg_cmd.c
index 13356f4,fca4af3..6e03d5b
--- a/phpdbg_cmd.c
+++ b/phpdbg_cmd.c
@@@ -326,39 -313,23 +313,39 @@@ int phpdbg_do_cmd_ex(const phpdbg_comma
if (input->argc > 0) {
while (command && command->name && command->handler) {
- if (((command->name_len == input->argv[0]->length) &&
+ if (((command->name_len == input->argv[0]->length) &&
(memcmp(command->name, input->argv[0]->string, command->name_len) == SUCCESS)) ||
(command->alias &&
- (input->argv[0]->length == 1) &&
+ (input->argv[0]->length == 1) &&
(command->alias == *input->argv[0]->string))) {
- if (command->subs && input->argc > 1) {
- phpdbg_input_t sub;
+
+ phpdbg_param_t param;
+
+ param.type = EMPTY_PARAM;
- sub.argc = input->argc-1;
- sub.argv = &input->argv[1];
+ if (input->argc > 1) {
+ if (command->subs) {
+ phpdbg_input_t sub;
- return phpdbg_do_cmd_ex(command->subs, &sub TSRMLS_CC);
+ sub.argc = input->argc-1;
+ sub.argv = &input->argv[1];
+
+ phpdbg_debug(
+ "trying sub commands in \"%s\" for \"%s\" with %d arguments",
+ command->name, sub.argv[0]->string, sub.argc-1);
+
+ return phpdbg_do_cmd_ex(command->subs, &sub TSRMLS_CC);
+ } else {
+ phpdbg_parse_param(
+ input->argv[1]->string,
+ input->argv[1]->length,
+ ¶m TSRMLS_CC);
- }
++ }
}
+
phpdbg_debug(
- "found command \"%s\" for \"%s\" have %d arguments",
+ "found command %s for %s with %d arguments",
command->name, input->argv[0]->string, input->argc-1);
-#ifdef PHPDBG_DEBUG
{
int arg;
for (arg=1; arg<input->argc; arg++) {
@@@ -369,14 -340,7 +356,13 @@@
input->argv[arg]->length);
}
}
-#endif
+
+ PHPDBG_G(lcmd) = (phpdbg_command_t*) command;
+ phpdbg_clear_param(
+ &PHPDBG_G(lparam) TSRMLS_CC);
+ PHPDBG_G(lparam) = param;
+
+ rc = command->handler(¶m TSRMLS_CC);
-
break;
}
command++;
diff --cc phpdbg_prompt.c
index 2fc29dd,2136f17..468cd63
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@@ -978,10 -969,12 +978,10 @@@ int phpdbg_interactive(TSRMLS_D) /* {{
int ret = SUCCESS;
phpdbg_input_t* input = phpdbg_read_input(TSRMLS_C);
-
+
if (input && input->length > 0L) {
do {
- phpdbg_do_cmd_ex(phpdbg_prompt_commands, input TSRMLS_CC);
-
- switch (ret = phpdbg_do_cmd(phpdbg_prompt_commands, input->string, input->length
TSRMLS_CC)) {
+ switch (ret = phpdbg_do_cmd_ex(phpdbg_prompt_commands, input TSRMLS_CC)) {
case FAILURE:
if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
if (phpdbg_call_register(input TSRMLS_CC) == FAILURE) {