size_t exec_len; /* size of exec */
zend_op_array *ops; /* op_array */
zval *retval; /* return value */
- zend_bool stepping; /* stepping */
+ int stepping; /* stepping */
int vmret; /* return from last opcode handler execution */
zend_bool has_file_bp; /* file-based breakpoint has been set */
+ zend_bool quitting; /* quitting flag */
ZEND_END_MODULE_GLOBALS(phpdbg)
#include "phpdbg_prompt.h"
zend_try {
zend_execute(EG(active_op_array) TSRMLS_CC);
} zend_catch {
- printf("Caught excetion in VM\n");
- return FAILURE;
+ if (!PHPDBG_G(quitting)) {
+ printf("Caught excetion in VM\n");
+ return FAILURE;
+ } else return SUCCESS;
} zend_end_try();
return SUCCESS;
static PHPDBG_COMMAND(quit) /* {{{ */
{
+ PHPDBG_G(quitting)=1;
+
zend_bailout();
return SUCCESS;
printf("phpdbg> ");
- while (fgets(cmd, PHPDBG_MAX_CMD, stdin) != NULL) {
+ while (!PHPDBG_G(quitting) &&
+ fgets(cmd, PHPDBG_MAX_CMD, stdin) != NULL) {
size_t cmd_len = strlen(cmd) - 1;
while (cmd[cmd_len] == '\n') {