mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
Merge branch 'master' of https://github.com/krakjoe/phpdbg
This commit is contained in:
commit
feaec0ec73
2 changed files with 19 additions and 4 deletions
22
phpdbg.c
22
phpdbg.c
|
@ -552,6 +552,7 @@ int main(int argc, char **argv) /* {{{ */
|
|||
long cleaning = 0;
|
||||
int run = 0;
|
||||
int step = 0;
|
||||
char *bp_tmp_file;
|
||||
|
||||
#ifdef ZTS
|
||||
void ***tsrm_ls;
|
||||
|
@ -571,6 +572,13 @@ int main(int argc, char **argv) /* {{{ */
|
|||
#endif
|
||||
|
||||
phpdbg_main:
|
||||
if (!cleaning) {
|
||||
bp_tmp_file = malloc(L_tmpnam);
|
||||
tmpnam(bp_tmp_file);
|
||||
if (bp_tmp_file == NULL) {
|
||||
phpdbg_error("Unable to create temporary file");
|
||||
}
|
||||
}
|
||||
ini_entries = NULL;
|
||||
ini_entries_len = 0;
|
||||
ini_ignore = 0;
|
||||
|
@ -772,9 +780,8 @@ phpdbg_main:
|
|||
/* initialize from file */
|
||||
zend_try {
|
||||
PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING;
|
||||
phpdbg_init(
|
||||
init_file, init_file_len,
|
||||
init_file_default TSRMLS_CC);
|
||||
phpdbg_init(init_file, init_file_len, init_file_default TSRMLS_CC);
|
||||
phpdbg_try_file_init(bp_tmp_file, strlen(bp_tmp_file), 0 TSRMLS_CC);
|
||||
PHPDBG_G(flags) &= ~PHPDBG_IS_INITIALIZING;
|
||||
} zend_catch {
|
||||
PHPDBG_G(flags) &= ~PHPDBG_IS_INITIALIZING;
|
||||
|
@ -803,9 +810,14 @@ phpdbg_main:
|
|||
phpdbg_interactive(TSRMLS_C);
|
||||
} zend_catch {
|
||||
if ((PHPDBG_G(flags) & PHPDBG_IS_CLEANING)) {
|
||||
FILE *bp_tmp_fp = fopen(bp_tmp_file, "w");
|
||||
phpdbg_export_breakpoints(bp_tmp_fp TSRMLS_CC);
|
||||
fclose(bp_tmp_fp);
|
||||
cleaning = 1;
|
||||
goto phpdbg_out;
|
||||
} else cleaning = 0;
|
||||
} else {
|
||||
cleaning = 0;
|
||||
}
|
||||
|
||||
if (PHPDBG_G(flags) & PHPDBG_IS_QUITTING) {
|
||||
goto phpdbg_out;
|
||||
|
@ -855,6 +867,8 @@ phpdbg_out:
|
|||
/* bugggy */
|
||||
/* tsrm_shutdown(); */
|
||||
#endif
|
||||
|
||||
free(bp_tmp_file);
|
||||
|
||||
return 0;
|
||||
} /* }}} */
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
/* {{{ */
|
||||
void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC);
|
||||
void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC);
|
||||
int phpdbg_interactive(TSRMLS_D);
|
||||
int phpdbg_compile(TSRMLS_D);
|
||||
void phpdbg_clean(zend_bool full TSRMLS_DC); /* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue