Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromphp/php-src

Commitf58cf8b

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
2 parents3fe1010 +417a8ef commitf58cf8b

File tree

9 files changed

+288
-254
lines changed

9 files changed

+288
-254
lines changed

‎sapi/phpdbg/phpdbg.c‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static void php_sapi_phpdbg_log_message(char *message, int syslog_type_int) /* {
866866
}
867867

868868
do {
869-
switch (phpdbg_interactive(1)) {
869+
switch (phpdbg_interactive(1,NULL)) {
870870
casePHPDBG_LEAVE:
871871
casePHPDBG_FINISH:
872872
casePHPDBG_UNTIL:
@@ -972,7 +972,7 @@ static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */
972972
}/* }}} */
973973

974974
/* copied from sapi/cli/php_cli.c cli_register_file_handles */
975-
staticvoidphpdbg_register_file_handles(void)/* {{{ */
975+
voidphpdbg_register_file_handles(void)/* {{{ */
976976
{
977977
zvalzin,zout,zerr;
978978
php_stream*s_in,*s_out,*s_err;
@@ -1004,18 +1004,21 @@ static void phpdbg_register_file_handles(void) /* {{{ */
10041004
ic.flags=CONST_CS;
10051005
ic.name=zend_string_init(ZEND_STRL("STDIN"),0);
10061006
ic.module_number=0;
1007+
zend_hash_del(EG(zend_constants),ic.name);
10071008
zend_register_constant(&ic);
10081009

10091010
oc.value=zout;
10101011
oc.flags=CONST_CS;
10111012
oc.name=zend_string_init(ZEND_STRL("STDOUT"),0);
10121013
oc.module_number=0;
1014+
zend_hash_del(EG(zend_constants),oc.name);
10131015
zend_register_constant(&oc);
10141016

10151017
ec.value=zerr;
10161018
ec.flags=CONST_CS;
10171019
ec.name=zend_string_init(ZEND_STRL("STDERR"),0);
10181020
ec.module_number=0;
1021+
zend_hash_del(EG(zend_constants),ec.name);
10191022
zend_register_constant(&ec);
10201023
}
10211024
/* }}} */
@@ -1344,6 +1347,7 @@ int main(int argc, char **argv) /* {{{ */
13441347
zend_boolini_ignore;
13451348
char*ini_override;
13461349
char*exec=NULL;
1350+
char*first_command=NULL;
13471351
char*init_file;
13481352
size_tinit_file_len;
13491353
zend_boolinit_file_default;
@@ -1813,7 +1817,6 @@ int main(int argc, char **argv) /* {{{ */
18131817
/* set default prompt */
18141818
phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT);
18151819

1816-
/* refactor to preserve run commands on force run command */
18171820
{
18181821
php_stream_wrapper*wrapper=zend_hash_str_find_ptr(php_stream_get_url_stream_wrappers_hash(),ZEND_STRL("php"));
18191822
PHPDBG_G(orig_url_wrap_php)=wrapper->wops->stream_opener;
@@ -1899,7 +1902,11 @@ int main(int argc, char **argv) /* {{{ */
18991902
PHPDBG_G(flags) |=PHPDBG_IS_INTERACTIVE;
19001903
}
19011904
zend_try {
1902-
PHPDBG_COMMAND_HANDLER(run)(NULL);
1905+
if (first_command) {
1906+
phpdbg_interactive(1,estrdup(first_command));
1907+
}else {
1908+
PHPDBG_COMMAND_HANDLER(run)(NULL);
1909+
}
19031910
}zend_end_try();
19041911
if (quit_immediately) {
19051912
/* if -r is on the command line more than once just quit */
@@ -1910,7 +1917,7 @@ int main(int argc, char **argv) /* {{{ */
19101917
}
19111918

19121919
CG(unclean_shutdown)=0;
1913-
phpdbg_interactive(1);
1920+
phpdbg_interactive(1,NULL);
19141921
}zend_catch {
19151922
if ((PHPDBG_G(flags)&PHPDBG_IS_CLEANING)) {
19161923
char*bp_tmp_str;
@@ -1968,6 +1975,11 @@ int main(int argc, char **argv) /* {{{ */
19681975
phpdbg_out:
19691976
#endif
19701977

1978+
if (first_command) {
1979+
free(first_command);
1980+
first_command=NULL;
1981+
}
1982+
19711983
if (cleaning <=0) {
19721984
PHPDBG_G(flags) &= ~PHPDBG_IS_CLEANING;
19731985
cleaning=-1;
@@ -2023,13 +2035,17 @@ int main(int argc, char **argv) /* {{{ */
20232035
settings->input_buflen=PHPDBG_G(input_buflen);
20242036
memcpy(settings->input_buffer,PHPDBG_G(input_buffer),settings->input_buflen);
20252037
settings->flags=PHPDBG_G(flags)&PHPDBG_PRESERVE_FLAGS_MASK;
2038+
first_command=PHPDBG_G(cur_command);
20262039
}else {
20272040
if (PHPDBG_G(prompt)[0]) {
20282041
free(PHPDBG_G(prompt)[0]);
20292042
}
20302043
if (PHPDBG_G(prompt)[1]) {
20312044
free(PHPDBG_G(prompt)[1]);
20322045
}
2046+
if (PHPDBG_G(cur_command)) {
2047+
free(PHPDBG_G(cur_command));
2048+
}
20332049
}
20342050

20352051
if (exit_status==0) {

‎sapi/phpdbg/phpdbg.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ int phpdbg_do_parse(phpdbg_param_t *stack, char *input);
235235
}
236236

237237

238+
voidphpdbg_register_file_handles(void);
239+
238240
/* {{{ structs */
239241
ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
240242
HashTablebp[PHPDBG_BREAK_TABLES];/* break points */
@@ -245,6 +247,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
245247
phpdbg_frame_tframe;/* frame */
246248
uint32_tlast_line;/* last executed line */
247249

250+
char*cur_command;/* current command */
248251
phpdbg_lexer_datalexer;/* lexer data */
249252
phpdbg_param_t*parser_stack;/* param stack during lexer / parser phase */
250253

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp