summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg/phpdbg_prompt.c')
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c258
1 files changed, 129 insertions, 129 deletions
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 0ab5b4d230..b49049969e 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -89,7 +89,7 @@ const phpdbg_command_t phpdbg_prompt_commands[] = {
PHPDBG_END_COMMAND
}; /* }}} */
-static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ */
+static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */
{
phpdbg_param_t *name = NULL;
@@ -113,7 +113,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ *
ZVAL_STRINGL(&fci.function_name, lc_name, name->len);
fci.size = sizeof(zend_fcall_info);
fci.function_table = &PHPDBG_G(registered);
- fci.symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ fci.symbol_table = zend_rebuild_symbol_table();
fci.object = NULL;
fci.retval = &fretval;
fci.no_separation = 1;
@@ -171,19 +171,19 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ *
next = next->next;
}
- zend_fcall_info_args(&fci, &params TSRMLS_CC);
+ zend_fcall_info_args(&fci, &params);
} else {
fci.params = NULL;
fci.param_count = 0;
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
phpdbg_debug("created %d params from arguments", fci.param_count);
- if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) {
- zend_print_zval_r(&fretval, 0 TSRMLS_CC);
+ if (zend_call_function(&fci, NULL) == SUCCESS) {
+ zend_print_zval_r(&fretval, 0);
phpdbg_out("\n");
zval_ptr_dtor(&fretval);
}
@@ -208,7 +208,7 @@ struct phpdbg_init_state {
const char *init_file;
};
-static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_DC) {
+static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state) {
size_t cmd_len = strlen(cmd);
state->line++;
@@ -228,7 +228,7 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D
if (memcmp(cmd, ":>", sizeof(":>")-1) == SUCCESS) {
state->in_code = 0;
state->code[state->code_len] = '\0';
- zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code" TSRMLS_CC);
+ zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code");
free(state->code);
state->code = NULL;
return;
@@ -252,33 +252,33 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D
}
zend_try {
- char *input = phpdbg_read_input(cmd TSRMLS_CC);
+ char *input = phpdbg_read_input(cmd);
phpdbg_param_t stack;
phpdbg_init_param(&stack, STACK_PARAM);
- phpdbg_activate_err_buf(1 TSRMLS_CC);
+ phpdbg_activate_err_buf(1);
- if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) {
- switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */ TSRMLS_CC)) {
+ if (phpdbg_do_parse(&stack, input) <= 0) {
+ switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */)) {
case FAILURE:
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- if (phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) {
+ phpdbg_activate_err_buf(0);
+ if (phpdbg_call_register(&stack) == FAILURE) {
if (state->init_file) {
- phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!" TSRMLS_CC, state->init_file, state->line, input);
+ phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!", state->init_file, state->line, input);
} else {
- phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!" TSRMLS_CC, state->line, input);
+ phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!", state->line, input);
}
}
break;
}
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
phpdbg_stack_free(&stack);
- phpdbg_destroy_input(&input TSRMLS_CC);
+ phpdbg_destroy_input(&input);
} zend_catch {
PHPDBG_G(flags) &= ~(PHPDBG_IS_RUNNING | PHPDBG_IS_CLEANING);
if (PHPDBG_G(flags) & PHPDBG_IS_QUITTING) {
@@ -289,12 +289,12 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D
}
-void phpdbg_string_init(char *buffer TSRMLS_DC) {
+void phpdbg_string_init(char *buffer) {
struct phpdbg_init_state state = {0};
char *str = strtok(buffer, "\n");
while (str) {
- phpdbg_line_init(str, &state TSRMLS_CC);
+ phpdbg_line_init(str, &state);
str = strtok(NULL, "\n");
}
@@ -304,7 +304,7 @@ void phpdbg_string_init(char *buffer TSRMLS_DC) {
}
}
-void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC) /* {{{ */
+void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init) /* {{{ */
{
zend_stat_t sb;
@@ -317,7 +317,7 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_
state.init_file = init_file;
while (fgets(cmd, PHPDBG_MAX_CMD, fp) != NULL) {
- phpdbg_line_init(cmd, &state TSRMLS_CC);
+ phpdbg_line_init(cmd, &state);
}
if (state.code) {
@@ -335,13 +335,13 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_
}
} /* }}} */
-void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC) /* {{{ */
+void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /* {{{ */
{
if (!init_file && use_default) {
char *scan_dir = getenv("PHP_INI_SCAN_DIR");
int i;
- phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0 TSRMLS_CC);
+ phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0);
if (!scan_dir) {
scan_dir = PHP_CONFIG_FILE_SCAN_DIR;
@@ -359,16 +359,16 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS
}
asprintf(&init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME);
- phpdbg_try_file_init(init_file, strlen(init_file), 1 TSRMLS_CC);
+ phpdbg_try_file_init(init_file, strlen(init_file), 1);
if (i == -1) {
break;
}
scan_dir += i + 1;
}
- phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0 TSRMLS_CC);
+ phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0);
} else {
- phpdbg_try_file_init(init_file, init_file_len, 1 TSRMLS_CC);
+ phpdbg_try_file_init(init_file, init_file_len, 1);
}
}
@@ -378,12 +378,12 @@ PHPDBG_COMMAND(exec) /* {{{ */
if (VCWD_STAT(param->str, &sb) != FAILURE) {
if (sb.st_mode & (S_IFREG|S_IFLNK)) {
- char *res = phpdbg_resolve_path(param->str TSRMLS_CC);
+ char *res = phpdbg_resolve_path(param->str);
size_t res_len = strlen(res);
if ((res_len != PHPDBG_G(exec_len)) || (memcmp(res, PHPDBG_G(exec), res_len) != SUCCESS)) {
if (PHPDBG_G(in_execution)) {
- if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?" TSRMLS_CC) == FAILURE) {
+ if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?") == FAILURE) {
return FAILURE;
}
}
@@ -397,7 +397,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
if (PHPDBG_G(ops)) {
phpdbg_notice("exec", "type=\"unsetops\"", "Destroying compiled opcodes");
- phpdbg_clean(0 TSRMLS_CC);
+ phpdbg_clean(0);
}
PHPDBG_G(exec) = res;
@@ -406,15 +406,15 @@ PHPDBG_COMMAND(exec) /* {{{ */
VCWD_CHDIR_FILE(res);
*SG(request_info).argv = PHPDBG_G(exec);
- php_hash_environment(TSRMLS_C);
+ php_hash_environment();
phpdbg_notice("exec", "type=\"set\" context=\"%s\"", "Set execution context: %s", PHPDBG_G(exec));
if (PHPDBG_G(in_execution)) {
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
}
- phpdbg_compile(TSRMLS_C);
+ phpdbg_compile();
} else {
phpdbg_notice("exec", "type=\"unchanged\"", "Execution context not changed");
}
@@ -427,7 +427,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
return SUCCESS;
} /* }}} */
-int phpdbg_compile(TSRMLS_D) /* {{{ */
+int phpdbg_compile(void) /* {{{ */
{
zend_file_handle fh;
@@ -436,9 +436,9 @@ int phpdbg_compile(TSRMLS_D) /* {{{ */
return FAILURE;
}
- if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC) == SUCCESS) {
- PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE TSRMLS_CC);
- zend_destroy_file_handle(&fh TSRMLS_CC);
+ if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE) == SUCCESS) {
+ PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE);
+ zend_destroy_file_handle(&fh);
phpdbg_notice("compile", "context=\"%s\"", "Successful compilation of %s", PHPDBG_G(exec));
@@ -487,7 +487,7 @@ PHPDBG_COMMAND(until) /* {{{ */
return PHPDBG_UNTIL;
} /* }}} */
-static void phpdbg_seek_to_end(TSRMLS_D) {
+static void phpdbg_seek_to_end(void) {
const zend_op *opline = EG(current_execute_data)->opline;
const zend_op_array *op_array = &EG(current_execute_data)->func->op_array - 1;
@@ -513,7 +513,7 @@ PHPDBG_COMMAND(finish) /* {{{ */
}
PHPDBG_G(flags) |= PHPDBG_IN_FINISH;
- phpdbg_seek_to_end(TSRMLS_C);
+ phpdbg_seek_to_end();
return PHPDBG_FINISH;
} /* }}} */
@@ -526,7 +526,7 @@ PHPDBG_COMMAND(leave) /* {{{ */
}
PHPDBG_G(flags) |= PHPDBG_IN_LEAVE;
- phpdbg_seek_to_end(TSRMLS_C);
+ phpdbg_seek_to_end();
return PHPDBG_LEAVE;
} /* }}} */
@@ -536,20 +536,20 @@ PHPDBG_COMMAND(frame) /* {{{ */
if (!param) {
phpdbg_notice("frame", "id=\"%d\"", "Currently in frame #%d", PHPDBG_G(frame).num);
} else {
- phpdbg_switch_frame(param->num TSRMLS_CC);
+ phpdbg_switch_frame(param->num);
}
return SUCCESS;
} /* }}} */
-static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */
+static inline void phpdbg_handle_exception(void) /* }}} */
{
zend_fcall_info fci;
zval trace;
/* get filename and linenumber before unsetting exception */
- const char *filename = zend_get_executed_filename(TSRMLS_C);
- uint32_t lineno = zend_get_executed_lineno(TSRMLS_C);
+ const char *filename = zend_get_executed_filename();
+ uint32_t lineno = zend_get_executed_lineno();
/* call __toString */
ZVAL_STRINGL(&fci.function_name, "__tostring", sizeof("__tostring") - 1);
@@ -561,7 +561,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */
fci.param_count = 0;
fci.params = NULL;
fci.no_separation = 1;
- if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) {
+ if (zend_call_function(&fci, NULL) == SUCCESS) {
phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!\n%.*s", EG(exception)->ce->name->val, Z_STRLEN(trace), Z_STRVAL(trace));
zval_ptr_dtor(&trace);
@@ -573,7 +573,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */
phpdbg_writeln("exception", "opline=\"%p\" file=\"%s\" line=\"%u\"", "Stack entered at %p in %s on line %u", EG(current_execute_data)->func->op_array.opcodes, filename, lineno);
zval_dtor(&fci.function_name);
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} /* }}} */
PHPDBG_COMMAND(run) /* {{{ */
@@ -583,15 +583,15 @@ PHPDBG_COMMAND(run) /* {{{ */
zend_bool restore = 1;
if (PHPDBG_G(in_execution)) {
- if (phpdbg_ask_user_permission("Do you really want to restart execution?" TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_ask_user_permission("Do you really want to restart execution?") == SUCCESS) {
phpdbg_startup_run++;
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
}
return SUCCESS;
}
if (!PHPDBG_G(ops)) {
- if (phpdbg_compile(TSRMLS_C) == FAILURE) {
+ if (phpdbg_compile() == FAILURE) {
phpdbg_error("compile", "type=\"compilefailure\" context=\"%s\"", "Failed to compile %s, cannot run", PHPDBG_G(exec));
goto out;
}
@@ -601,7 +601,7 @@ PHPDBG_COMMAND(run) /* {{{ */
if (ex && ex->symbol_table) {
zend_hash_clean(&ex->symbol_table->ht);
} else {
- zend_rebuild_symbol_table(TSRMLS_C);
+ zend_rebuild_symbol_table();
}
/* clean seek state */
@@ -609,7 +609,7 @@ PHPDBG_COMMAND(run) /* {{{ */
zend_hash_clean(&PHPDBG_G(seek));
/* reset hit counters */
- phpdbg_reset_breakpoints(TSRMLS_C);
+ phpdbg_reset_breakpoints();
if (param && param->type != EMPTY_PARAM && param->len != 0) {
char **argv = emalloc(5 * sizeof(char *));
@@ -633,13 +633,13 @@ PHPDBG_COMMAND(run) /* {{{ */
SG(request_info).argv = erealloc(argv, ++argc * sizeof(char *));
SG(request_info).argc = argc;
- php_hash_environment(TSRMLS_C);
+ php_hash_environment();
}
zend_try {
PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE;
PHPDBG_G(flags) |= PHPDBG_IS_RUNNING;
- zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval) TSRMLS_CC);
+ zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval));
PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE;
} zend_catch {
PHPDBG_G(in_execution) = 0;
@@ -661,11 +661,11 @@ PHPDBG_COMMAND(run) /* {{{ */
if (restore) {
if (EG(exception)) {
- phpdbg_handle_exception(TSRMLS_C);
+ phpdbg_handle_exception();
}
}
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING;
} else {
@@ -677,10 +677,10 @@ out:
return SUCCESS;
} /* }}} */
-int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv TSRMLS_DC) {
+int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv) {
phpdbg_notice("eval", "variable=\"%.*s\"", "Printing variable %.*s", (int) len, name);
phpdbg_xml("<eval %r>");
- zend_print_zval_r(zv, 0 TSRMLS_CC);
+ zend_print_zval_r(zv, 0);
phpdbg_xml("</eval>");
phpdbg_out("\n");
@@ -705,7 +705,7 @@ PHPDBG_COMMAND(ev) /* {{{ */
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
phpdbg_try_access {
- phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0 TSRMLS_CC);
+ phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0);
} phpdbg_catch_access {
phpdbg_error("signalsegv", "", "Could not fetch data, invalid data source");
} phpdbg_end_try_access();
@@ -721,13 +721,13 @@ PHPDBG_COMMAND(ev) /* {{{ */
/* disable stepping while eval() in progress */
PHPDBG_G(flags) |= PHPDBG_IN_EVAL;
zend_try {
- if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code" TSRMLS_CC) == SUCCESS) {
+ if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code") == SUCCESS) {
phpdbg_xml("<eval %r>");
if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) {
zval *zvp = &retval;
- phpdbg_xml_var_dump(zvp TSRMLS_CC);
+ phpdbg_xml_var_dump(zvp);
}
- zend_print_zval_r(&retval, 0 TSRMLS_CC);
+ zend_print_zval_r(&retval, 0);
phpdbg_xml("</eval>");
phpdbg_out("\n");
zval_ptr_dtor(&retval);
@@ -761,9 +761,9 @@ PHPDBG_COMMAND(back) /* {{{ */
}
if (!param) {
- phpdbg_dump_backtrace(0 TSRMLS_CC);
+ phpdbg_dump_backtrace(0);
} else {
- phpdbg_dump_backtrace(param->num TSRMLS_CC);
+ phpdbg_dump_backtrace(param->num);
}
return SUCCESS;
@@ -827,42 +827,42 @@ PHPDBG_COMMAND(break) /* {{{ */
{
if (!param) {
phpdbg_set_breakpoint_file(
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
+ zend_get_executed_filename(),
+ zend_get_executed_lineno());
} else switch (param->type) {
case ADDR_PARAM:
- phpdbg_set_breakpoint_opline(param->addr TSRMLS_CC);
+ phpdbg_set_breakpoint_opline(param->addr);
break;
case NUMERIC_PARAM:
if (PHPDBG_G(exec)) {
- phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC);
+ phpdbg_set_breakpoint_file(phpdbg_current_file(), param->num);
} else {
phpdbg_error("inactive", "type=\"noexec\"", "Execution context not set!");
}
break;
case METHOD_PARAM:
- phpdbg_set_breakpoint_method(param->method.class, param->method.name TSRMLS_CC);
+ phpdbg_set_breakpoint_method(param->method.class, param->method.name);
break;
case NUMERIC_METHOD_PARAM:
- phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num TSRMLS_CC);
+ phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num);
break;
case NUMERIC_FUNCTION_PARAM:
- phpdbg_set_breakpoint_function_opline(param->str, param->num TSRMLS_CC);
+ phpdbg_set_breakpoint_function_opline(param->str, param->num);
break;
case FILE_PARAM:
- phpdbg_set_breakpoint_file(param->file.name, param->file.line TSRMLS_CC);
+ phpdbg_set_breakpoint_file(param->file.name, param->file.line);
break;
case NUMERIC_FILE_PARAM:
- phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line TSRMLS_CC);
+ phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line);
break;
case COND_PARAM:
- phpdbg_set_breakpoint_expression(param->str, param->len TSRMLS_CC);
+ phpdbg_set_breakpoint_expression(param->str, param->len);
break;
case STR_PARAM:
- phpdbg_set_breakpoint_symbol(param->str, param->len TSRMLS_CC);
+ phpdbg_set_breakpoint_symbol(param->str, param->len);
break;
case OP_PARAM:
- phpdbg_set_breakpoint_opcode(param->str, param->len TSRMLS_CC);
+ phpdbg_set_breakpoint_opcode(param->str, param->len);
break;
phpdbg_default_switch_case();
@@ -884,17 +884,17 @@ PHPDBG_COMMAND(sh) /* {{{ */
return SUCCESS;
} /* }}} */
-static int add_module_info(zend_module_entry *module TSRMLS_DC) {
+static int add_module_info(zend_module_entry *module) {
phpdbg_write("module", "name=\"%s\"", "%s\n", module->name);
return 0;
}
-static int add_zendext_info(zend_extension *ext TSRMLS_DC) {
+static int add_zendext_info(zend_extension *ext) {
phpdbg_write("extension", "name=\"%s\"", "%s\n", ext->name);
return 0;
}
-PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name TSRMLS_DC) {
+PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) {
DL_HANDLE handle;
char *extension_dir;
@@ -963,7 +963,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name
*name = new_extension->name;
- zend_register_extension(new_extension, handle TSRMLS_CC);
+ zend_register_extension(new_extension, handle);
if (new_extension->startup) {
if (new_extension->startup(new_extension) != SUCCESS) {
@@ -1004,20 +1004,20 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name
module_entry->module_number = zend_next_free_module();
module_entry->handle = handle;
- if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) {
+ if ((module_entry = zend_register_module_ex(module_entry)) == NULL) {
phpdbg_error("dl", "type=\"registerfailure\" module=\"%s\"", "Unable to register module %s", module_entry->name);
goto quit;
}
- if (zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) {
+ if (zend_startup_module_ex(module_entry) == FAILURE) {
phpdbg_error("dl", "type=\"startupfailure\" module=\"%s\"", "Unable to startup module %s", module_entry->name);
goto quit;
}
if (module_entry->request_startup_func) {
- if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number TSRMLS_CC) == FAILURE) {
+ if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number) == FAILURE) {
phpdbg_error("dl", "type=\"initfailure\" module=\"%s\"", "Unable to initialize module %s", module_entry->name);
goto quit;
@@ -1041,24 +1041,24 @@ PHPDBG_COMMAND(dl) /* {{{ */
if (!param || param->type == EMPTY_PARAM) {
phpdbg_notice("dl", "extensiontype=\"Zend extension\"", "Zend extensions");
- zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info TSRMLS_CC);
+ zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info);
phpdbg_out("\n");
phpdbg_notice("dl", "extensiontype=\"module\"", "Modules");
- zend_hash_apply(&module_registry, (apply_func_t) add_module_info TSRMLS_CC);
+ zend_hash_apply(&module_registry, (apply_func_t) add_module_info);
} else switch (param->type) {
case STR_PARAM:
#ifdef HAVE_LIBDL
path = estrndup(param->str, param->len);
- phpdbg_activate_err_buf(1 TSRMLS_CC);
- if ((type = phpdbg_load_module_or_extension(&path, &name TSRMLS_CC)) == NULL) {
+ phpdbg_activate_err_buf(1);
+ if ((type = phpdbg_load_module_or_extension(&path, &name)) == NULL) {
phpdbg_error("dl", "path=\"%s\" %b", "Could not load %s, not found or invalid zend extension / module: %b", path);
efree(name);
} else {
phpdbg_notice("dl", "extensiontype=\"%s\" name=\"%s\" path=\"%s\"", "Successfully loaded the %s %s at path %s", type, name, path);
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
efree(path);
#else
phpdbg_error("dl", "type=\"unsupported\" path=\"%.*s\"", "Cannot dynamically load %.*s - dynamic modules are not supported", (int) param->len, param->str);
@@ -1076,7 +1076,7 @@ PHPDBG_COMMAND(source) /* {{{ */
zend_stat_t sb;
if (VCWD_STAT(param->str, &sb) != -1) {
- phpdbg_try_file_init(param->str, param->len, 0 TSRMLS_CC);
+ phpdbg_try_file_init(param->str, param->len, 0);
} else {
phpdbg_error("source", "type=\"notfound\" file=\"%s\"", "Failed to stat %s, file does not exist", param->str);
}
@@ -1089,7 +1089,7 @@ PHPDBG_COMMAND(export) /* {{{ */
FILE *handle = VCWD_FOPEN(param->str, "w+");
if (handle) {
- phpdbg_export_breakpoints(handle TSRMLS_CC);
+ phpdbg_export_breakpoints(handle);
fclose(handle);
} else {
phpdbg_error("export", "type=\"openfailure\" file=\"%s\"", "Failed to open or create %s, check path and permissions", param->str);
@@ -1136,7 +1136,7 @@ PHPDBG_COMMAND(quit) /* {{{ */
PHPDBG_COMMAND(clean) /* {{{ */
{
if (PHPDBG_G(in_execution)) {
- if (phpdbg_ask_user_permission("Do you really want to clean your current environment?" TSRMLS_CC) == FAILURE) {
+ if (phpdbg_ask_user_permission("Do you really want to clean your current environment?") == FAILURE) {
return SUCCESS;
}
}
@@ -1151,7 +1151,7 @@ PHPDBG_COMMAND(clean) /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING;
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
phpdbg_xml("</cleaninfo>");
@@ -1172,7 +1172,7 @@ PHPDBG_COMMAND(clear) /* {{{ */
phpdbg_writeln("clear", "methodoplines=\"%d\"", "Method oplines %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE]));
phpdbg_writeln("clear", "eval=\"%d\"", "Conditionals %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]));
- phpdbg_clear_breakpoints(TSRMLS_C);
+ phpdbg_clear_breakpoints();
phpdbg_xml("</clearinfo>");
@@ -1191,7 +1191,7 @@ PHPDBG_COMMAND(list) /* {{{ */
return PHPDBG_LIST_HANDLER(lines)(PHPDBG_COMMAND_ARGS);
case STR_PARAM:
- phpdbg_list_function_byname(param->str, param->len TSRMLS_CC);
+ phpdbg_list_function_byname(param->str, param->len);
break;
case METHOD_PARAM:
@@ -1206,10 +1206,10 @@ PHPDBG_COMMAND(list) /* {{{ */
PHPDBG_COMMAND(watch) /* {{{ */
{
if (!param || param->type == EMPTY_PARAM) {
- phpdbg_list_watchpoints(TSRMLS_C);
+ phpdbg_list_watchpoints();
} else switch (param->type) {
case STR_PARAM:
- if (phpdbg_create_var_watchpoint(param->str, param->len TSRMLS_CC) != FAILURE) {
+ if (phpdbg_create_var_watchpoint(param->str, param->len) != FAILURE) {
phpdbg_notice("watch", "variable=\"%.*s\"", "Set watchpoint on %.*s", (int) param->len, param->str);
}
break;
@@ -1220,7 +1220,7 @@ PHPDBG_COMMAND(watch) /* {{{ */
return SUCCESS;
} /* }}} */
-int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
+int phpdbg_interactive(zend_bool allow_async_unsafe) /* {{{ */
{
int ret = SUCCESS;
char *input = NULL;
@@ -1233,15 +1233,15 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
zend_bailout();
}
- if (!(input = phpdbg_read_input(NULL TSRMLS_CC))) {
+ if (!(input = phpdbg_read_input(NULL))) {
break;
}
phpdbg_init_param(&stack, STACK_PARAM);
- if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) {
- phpdbg_activate_err_buf(1 TSRMLS_CC);
+ if (phpdbg_do_parse(&stack, input) <= 0) {
+ phpdbg_activate_err_buf(1);
#ifdef PHP_WIN32
#define PARA ((phpdbg_param_t *)stack.next)->type
@@ -1249,11 +1249,11 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
sigio_watcher_start();
}
#endif
- switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe TSRMLS_CC)) {
+ switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe)) {
case FAILURE:
if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
- if (!allow_async_unsafe || phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) {
- phpdbg_output_err_buf(NULL, "%b", "%b" TSRMLS_CC);
+ if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) {
+ phpdbg_output_err_buf(NULL, "%b", "%b");
}
}
break;
@@ -1262,8 +1262,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
case PHPDBG_FINISH:
case PHPDBG_UNTIL:
case PHPDBG_NEXT: {
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
if (!PHPDBG_G(in_execution) && !(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
phpdbg_error("command", "type=\"noexec\"", "Not running");
}
@@ -1271,8 +1271,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
}
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
#ifdef PHP_WIN32
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE && (RUN_PARAM == PARA || EVAL_PARAM == PARA)) {
sigio_watcher_stop();
@@ -1282,33 +1282,33 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
}
phpdbg_stack_free(&stack);
- phpdbg_destroy_input(&input TSRMLS_CC);
+ phpdbg_destroy_input(&input);
PHPDBG_G(req_id) = 0;
input = NULL;
}
if (input) {
phpdbg_stack_free(&stack);
- phpdbg_destroy_input(&input TSRMLS_CC);
+ phpdbg_destroy_input(&input);
PHPDBG_G(req_id) = 0;
}
if (PHPDBG_G(in_execution)) {
- phpdbg_restore_frame(TSRMLS_C);
+ phpdbg_restore_frame();
}
PHPDBG_G(flags) &= ~PHPDBG_IS_INTERACTIVE;
- phpdbg_print_changed_zvals(TSRMLS_C);
+ phpdbg_print_changed_zvals();
return ret;
} /* }}} */
-void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */
+void phpdbg_clean(zend_bool full) /* {{{ */
{
/* this is implicitly required */
if (PHPDBG_G(ops)) {
- destroy_op_array(PHPDBG_G(ops) TSRMLS_CC);
+ destroy_op_array(PHPDBG_G(ops));
efree(PHPDBG_G(ops));
PHPDBG_G(ops) = NULL;
}
@@ -1322,13 +1322,13 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */
#define DO_INTERACTIVE(allow_async_unsafe) do { \
if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { \
- const char *file_char = zend_get_executed_filename(TSRMLS_C); \
+ const char *file_char = zend_get_executed_filename(); \
zend_string *file = zend_string_init(file_char, strlen(file_char), 0); \
- phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C)-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); \
+ phpdbg_list_file(file, 3, zend_get_executed_lineno()-1, zend_get_executed_lineno()); \
efree(file); \
} \
\
- switch (phpdbg_interactive(allow_async_unsafe TSRMLS_CC)) { \
+ switch (phpdbg_interactive(allow_async_unsafe)) { \
case PHPDBG_LEAVE: \
case PHPDBG_FINISH: \
case PHPDBG_UNTIL: \
@@ -1338,7 +1338,7 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */
} \
} while (0)
-void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
+void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
{
zend_bool original_in_execution = PHPDBG_G(in_execution);
HashTable vars;
@@ -1354,7 +1354,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
while (1) {
if ((PHPDBG_G(flags) & PHPDBG_BP_RESOLVE_MASK)) {
/* resolve nth opline breakpoints */
- phpdbg_resolve_op_array_breaks(&execute_data->func->op_array TSRMLS_CC);
+ phpdbg_resolve_op_array_breaks(&execute_data->func->op_array);
}
#ifdef ZEND_WIN32
@@ -1403,8 +1403,8 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IN_LEAVE;
zend_hash_clean(&PHPDBG_G(seek));
phpdbg_notice("breakpoint", "id=\"leave\" file=\"%s\" line=\"%u\"", "Breaking for leave at %s:%u",
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C)
+ zend_get_executed_filename(),
+ zend_get_executed_lineno()
);
DO_INTERACTIVE(1);
} else {
@@ -1415,7 +1415,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
}
/* not while in conditionals */
- phpdbg_print_opline_ex(execute_data, &vars, 0 TSRMLS_CC);
+ phpdbg_print_opline_ex(execute_data, &vars, 0);
if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && (PHPDBG_G(flags) & PHPDBG_STEP_OPCODE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING;
@@ -1424,7 +1424,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
/* check if some watchpoint was hit */
{
- if (phpdbg_print_changed_zvals(TSRMLS_C) == SUCCESS) {
+ if (phpdbg_print_changed_zvals() == SUCCESS) {
DO_INTERACTIVE(1);
}
}
@@ -1434,9 +1434,9 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
phpdbg_breakbase_t *brake;
if ((PHPDBG_G(flags) & PHPDBG_BP_MASK)
- && (brake = phpdbg_find_breakpoint(execute_data TSRMLS_CC))
+ && (brake = phpdbg_find_breakpoint(execute_data))
&& (brake->type != PHPDBG_BREAK_FILE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
- phpdbg_hit_breakpoint(brake, 1 TSRMLS_CC);
+ phpdbg_hit_breakpoint(brake, 1);
DO_INTERACTIVE(1);
}
}
@@ -1457,7 +1457,7 @@ next:
if (execute_data->opline->opcode == ZEND_DO_FCALL && execute_data->func->type == ZEND_USER_FUNCTION) {
zend_execute_ex = execute_ex;
}
- PHPDBG_G(vmret) = execute_data->opline->handler(execute_data TSRMLS_CC);
+ PHPDBG_G(vmret) = execute_data->opline->handler(execute_data);
zend_execute_ex = phpdbg_execute_ex;
if (PHPDBG_G(vmret) != 0) {
@@ -1474,7 +1474,7 @@ next:
} /* }}} */
/* only if *not* interactive and while executing */
-void phpdbg_force_interruption(TSRMLS_D) {
+void phpdbg_force_interruption(void) {
zend_execute_data *data = EG(current_execute_data); /* should be always readable if not NULL */
PHPDBG_G(flags) |= PHPDBG_IN_SIGNAL_HANDLER;
@@ -1505,7 +1505,7 @@ PHPDBG_COMMAND(eol) /* {{{ */
phpdbg_notice("eol", "argument required", "argument required");
} else switch (param->type) {
case STR_PARAM:
- if (FAILURE == phpdbg_eol_global_update(param->str TSRMLS_CC)) {
+ if (FAILURE == phpdbg_eol_global_update(param->str)) {
phpdbg_notice("eol", "unknown EOL name '%s', give crlf, lf, cr", "unknown EOL name '%s', give crlf, lf, cr", param->str);
}
break;