com php-src: backtrace: phpdbg_prompt.c
| From: | Bob Weinand | Date: | Sun, 10 Nov 2013 15:16:45 +0000 |
| Subject: | com php-src: backtrace: phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75219@lists.php.net to get a copy of this message | ||
Commit: 2f9b34d4b639b79a82d75f4ed509bfbc0e72e9de
Author: krakjoe <joe.watkins@live.co.uk> Sun, 10 Nov 2013 15:16:45 +0000
Parents: ac5063468ae3fac6616ff929454641da050a9ec7
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2f9b34d4b639b79a82d75f4ed509bfbc0e72e9de
Log:
backtrace
Changed paths:
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index f61f8d4..3be2753 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -136,6 +136,21 @@ static PHPDBG_COMMAND(eval) { /* {{{ */
return SUCCESS;
} /* }}} */
+static PHPDBG_COMMAND(back) { /* {{{ */
+ if (EG(in_execution)) {
+ const zend_execute_data *current = EG(current_execute_data);
+ if (current) {
+ do {
+ printf("%d\n", current->opline->opcode);
+ } while ((current = current->prev_execute_data));
+ }
+ return SUCCESS;
+ } else {
+ printf("Not executing !\n");
+ return FAILURE;
+ }
+} /* }}} */
+
static PHPDBG_COMMAND(print) { /* {{{ */
if (!expr_len) {
printf("Showing Execution Context Information:\n");
@@ -213,6 +228,7 @@ static const phpdbg_command_t phpdbg_prompt_commands[] = {
PHPDBG_COMMAND_D(eval, "evaluate some code"),
PHPDBG_COMMAND_D(print, "print something"),
PHPDBG_COMMAND_D(break, "set breakpoint"),
+ PHPDBG_COMMAND_D(back, "show backtrace"),
PHPDBG_COMMAND_D(help, "show help menu"),
PHPDBG_COMMAND_D(quit, "exit phpdbg"),
{NULL, 0, 0}
@@ -267,9 +283,8 @@ int phpdbg_interactive(int argc, char **argv TSRMLS_DC) /* {{{ */
void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
{
- zend_bool original_in_execution;
+ zend_bool original_in_execution = EG(in_execution);
- original_in_execution = EG(in_execution);
EG(in_execution) = 1;
if (0) {