}
phpdbg_write("cleaninfo", "classes=\"%d\" functions=\"%d\" constants=\"%d\" includes=\"%d\"",
- "Classes %d\n"
- "Functions %d\n"
- "Constants %d\n"
- "Includes %d\n",
+ "Classes %d" PHP_EOL
+ "Functions %d" PHP_EOL
+ "Constants %d" PHP_EOL
+ "Includes %d" PHP_EOL,
zend_hash_num_elements(EG(class_table)),
zend_hash_num_elements(EG(function_table)),
zend_hash_num_elements(EG(zend_constants)),
sapi_startup(phpdbg);
phpdbg->startup(phpdbg);
printf(
- "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2014 The PHP Group\n%s",
+ "phpdbg %s (built: %s %s)" PHP_EOL "PHP %s, Copyright (c) 1997-2014 The PHP Group" PHP_EOL "%s",
PHPDBG_VERSION,
__DATE__,
__TIME__,
HashPosition position;
phpdbg_breaksymbol_t *brake;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("Function Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("Function Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], &position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], (void**) &brake, &position) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], &position)) {
zend_uint class_len = 0;
zend_ulong class_idx = 0L;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("Method Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("Method Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], &position[0]);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], (void**) &class_table, &position[0]) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], &position[0])) {
HashPosition position[2];
HashTable *points;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("File Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("File Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], &position[0]);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], (void**) &points, &position[0]) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], &position[0])) {
HashPosition position;
phpdbg_breakline_t *brake;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("Opline Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("Opline Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], &position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (void**) &brake, &position) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], &position)) {
zend_uint class_len = 0, method_len = 0;
zend_ulong class_idx = 0L, method_idx = 0L;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("Method opline Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("Method opline Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], &position[0]);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], (void**) &class_table, &position[0]) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], &position[0])) {
zend_uint function_len = 0;
zend_ulong function_idx = 0L;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("Function opline Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("Function opline Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE], &position[0]);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE], (void**) &function_table, &position[0]) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE], &position[0])) {
zend_uint file_len = 0;
zend_ulong file_idx = 0L;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("File opline Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("File opline Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE], &position[0]);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE], (void**) &file_table, &position[0]) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE], &position[0])) {
HashPosition position;
phpdbg_breakcond_t *brake;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("Conditional Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("Conditional Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], &position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], (void**) &brake, &position) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], &position)) {
HashPosition position;
phpdbg_breakop_t *brake;
- phpdbg_out(SEPARATE "\n");
- phpdbg_out("Opcode Breakpoints:\n");
+ phpdbg_out(SEPARATE PHP_EOL);
+ phpdbg_out("Opcode Breakpoints:" PHP_EOL);
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], &position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], (void**) &brake, &position) == SUCCESS;
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], &position)) {
phpdbg_out("frame #%d: ", i++);
phpdbg_xml("<frame %r id=\"%d\" file=\"%s\" line=\"%d\"", i, Z_STRVAL_PP(file), Z_LVAL_PP(line));
phpdbg_dump_prototype(tmp TSRMLS_CC);
- phpdbg_out(" at %s:%ld\n", Z_STRVAL_PP(file), Z_LVAL_PP(line));
+ phpdbg_out(" at %s:%ld" PHP_EOL, Z_STRVAL_PP(file), Z_LVAL_PP(line));
} else {
phpdbg_out(" => ");
phpdbg_xml("<frame %r id=\"%d\" internal=\"internal\"", i);
phpdbg_dump_prototype(tmp TSRMLS_CC);
- phpdbg_out(" (internal function)\n");
+ phpdbg_out(" (internal function)" PHP_EOL);
}
}
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
phpdbg_xml("</backtrace>");
zval_dtor(&zbacktrace);
phpdbg_error("help", "overrun=\"%lu\"", "Output overrun of %lu bytes", ((q - new) - size));
}
- phpdbg_out("%s\n", new);
+ phpdbg_out("%s" PHP_EOL, new);
efree(new);
} /* }}} */
void summary_print(phpdbg_command_t const * const cmd TSRMLS_DC)
{
char *summary;
- spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**\n", cmd->name, cmd->alias, cmd->tip);
+ spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**" PHP_EOL, cmd->name, cmd->alias, cmd->tip);
pretty_print(summary TSRMLS_CC);
efree(summary);
}
/* Print out aliases for help as this one comes last, with the added text on how aliases are used */
get_command("h", 1, &c, phpdbg_prompt_commands TSRMLS_CC);
- phpdbg_writeln("aliasinfo", "alias=\"%c\" name=\"%s\" tip=\"%s\"", " %c %-20s %s\n", c->alias, c->name, c->tip);
+ phpdbg_writeln("aliasinfo", "alias=\"%c\" name=\"%s\" tip=\"%s\"", " %c %-20s %s" PHP_EOL, c->alias, c->name, c->tip);
phpdbg_xml("<helpaliases>");
if (fretval) {
zend_print_zval_r(fretval, 0 TSRMLS_CC);
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
}
zval_dtor(&fname);
zend_call_function(&fci, NULL TSRMLS_CC);
if (trace) {
- phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!\n%.*s", Z_OBJCE(exception)->name, Z_STRLEN_P(trace), Z_STRVAL_P(trace));
+ phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!" PHP_EOL "%.*s", Z_OBJCE(exception)->name, Z_STRLEN_P(trace), Z_STRVAL_P(trace));
zval_ptr_dtor(&trace);
} else {
phpdbg_xml("<eval %r>");
zend_print_zval_r(*zv, 0 TSRMLS_CC);
phpdbg_xml("</eval>");
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
efree(name);
efree(keyname);
phpdbg_xml("<eval %r>");
zend_print_zval_r(&retval, 0 TSRMLS_CC);
phpdbg_xml("</eval>");
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
zval_dtor(&retval);
}
} zend_end_try();
PHPDBG_COMMAND(print) /* {{{ */
{
- phpdbg_out("Execution Context Information\n\n");
+ phpdbg_out("Execution Context Information" PHP_EOL PHP_EOL);
phpdbg_xml("<printinfo %r>");
#ifdef HAVE_LIBREADLINE
phpdbg_writeln("print", "readline=\"yes\"", "Readline yes");
} /* }}} */
static int add_module_info(zend_module_entry *module TSRMLS_DC) {
- phpdbg_write("module", "name=\"%s\"", "%s\n", module->name);
+ phpdbg_write("module", "name=\"%s\"", "%s" PHP_EOL, module->name);
return 0;
}
static int add_zendext_info(zend_extension *ext TSRMLS_DC) {
- phpdbg_write("extension", "name=\"%s\"", "%s\n", ext->name);
+ phpdbg_write("extension", "name=\"%s\"", "%s" PHP_EOL, ext->name);
return 0;
}
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);
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
phpdbg_notice("dl", "extensiontype=\"module\"", "Modules");
zend_hash_apply(&module_registry, (apply_func_t) add_module_info TSRMLS_CC);
} else switch (param->type) {
return SUCCESS;
}
- phpdbg_out("Cleaning Execution Environment\n");
+ phpdbg_out("Cleaning Execution Environment" PHP_EOL);
phpdbg_xml("<cleaninfo %r>");
phpdbg_writeln("clean", "classes=\"%d\"", "Classes %d", zend_hash_num_elements(EG(class_table)));
PHPDBG_COMMAND(clear) /* {{{ */
{
- phpdbg_out("Clearing Breakpoints\n");
+ phpdbg_out("Clearing Breakpoints" PHP_EOL);
phpdbg_xml("<clearinfo %r>");
phpdbg_writeln("clear", "files=\"%d\"", "File %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]));
if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) {
PHPDBG_G(flags) &= ~PHPDBG_IS_SIGNALED;
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
phpdbg_notice("signal", "type=\"SIGINT\"", "Program received signal SIGINT");
DO_INTERACTIVE(1);
}
phpdbg_xml("<watchvalue %r type=\"old\">");
zend_print_flat_zval_r((zval *) oldPtr TSRMLS_CC);
phpdbg_xml("</watchvalue>");
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
}
}
if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS && (removed || show_ref)) {
phpdbg_xml("<watchvalue %r type=\"new\">");
zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC);
phpdbg_xml("</watchvalue>");
- phpdbg_out("\n");
+ phpdbg_out(PHP_EOL);
}
if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS && show_ref) {
phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\" isref=\"%d\"", "New refcount: %d; New is_ref: %d", watch->addr.zv->refcount__gc, watch->addr.zv->is_ref__gc);