Skip to content

Commit

Permalink
- Use PG(html_errors) instead of checking for CLI.
Browse files Browse the repository at this point in the history
- Cleaned up compilation warnings.
- Fixed a bug in get_zval_synopsis() which was still using xdebug_var_export().

SVN Rev: 2072
  • Loading branch information
derickr committed Oct 7, 2006
1 parent c641c94 commit 170b02f
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 69 deletions.
2 changes: 1 addition & 1 deletion tests/local_vars_in_error.phpt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Fatal error: Call to undefined function do_f() in /%s/local_vars_in_error.php on


Call Stack: Call Stack:
%w%f %w%d 1. {main}() /%s/local_vars_in_error.php:0 %w%f %w%d 1. {main}() /%s/local_vars_in_error.php:0
%w%f %w%d 2. a(5, 6) /%s/local_vars_in_error.php:8 %w%f %w%d 2. a(long, long) /%s/local_vars_in_error.php:8




Variables in local scope (#2): Variables in local scope (#2):
Expand Down
8 changes: 4 additions & 4 deletions tests/test6.phpt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ xdebug.var_display_max_depth=3
Warning: Missing argument 3 for foo2()%sin /%s/test6.php on line 2 Warning: Missing argument 3 for foo2()%sin /%s/test6.php on line 2


Call Stack: Call Stack:
%f %d 1. {main}() /%s/test6.php:0 %w%f %w%d 1. {main}() /%s/test6.php:0
%f %d 2. foo2(4, array (0 => array (0 => 'blaat', 1 => 5, 2 => FALSE))) /%s/test6.php:7 %w%f %w%d 2. foo2(long, array (1)) /%s/test6.php:7




Variables in local scope: Variables in local scope:
Expand All @@ -35,8 +35,8 @@ Variables in local scope:
Fatal error: Call to undefined function%sfoo() in /%s/test6.php on line 4 Fatal error: Call to undefined function%sfoo() in /%s/test6.php on line 4


Call Stack: Call Stack:
%f %d 1. {main}() /%s/test6.php:0 %w%f %w%d 1. {main}() /%s/test6.php:0
%f %d 2. foo2(4, array (0 => array (0 => 'blaat', 1 => 5, 2 => FALSE))) /%s/test6.php:7 %w%f %w%d 2. foo2(long, array(1)) /%s/test6.php:7




Variables in local scope: Variables in local scope:
Expand Down
3 changes: 2 additions & 1 deletion usefulstuff.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "xdebug_mm.h" #include "xdebug_mm.h"
#include "xdebug_str.h" #include "xdebug_str.h"
#include "usefulstuff.h" #include "usefulstuff.h"
#include "ext/standard/php_lcg.h"


#define READ_BUFFER_SIZE 128 #define READ_BUFFER_SIZE 128


Expand Down Expand Up @@ -394,7 +395,7 @@ static FILE *xdebug_open_file(char *fname, char *mode, char *extension, char **n


FILE *xdebug_fopen(char *fname, char *mode, char *extension, char **new_fname) FILE *xdebug_fopen(char *fname, char *mode, char *extension, char **new_fname)
{ {
int fd, r; int r;
FILE *fh; FILE *fh;
struct stat buf; struct stat buf;
char *tmp_fname; char *tmp_fname;
Expand Down
63 changes: 36 additions & 27 deletions xdebug.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1292,11 +1292,13 @@ void xdebug_execute(zend_op_array *op_array TSRMLS_DC)
/* Remove session cookie if requested */ /* Remove session cookie if requested */
if ( if (
( (
PG(http_globals)[TRACK_VARS_GET] && (
zend_hash_find(PG(http_globals)[TRACK_VARS_GET]->value.ht, "XDEBUG_SESSION_STOP", sizeof("XDEBUG_SESSION_STOP"), (void **) &dummy) == SUCCESS PG(http_globals)[TRACK_VARS_GET] &&
) || ( zend_hash_find(PG(http_globals)[TRACK_VARS_GET]->value.ht, "XDEBUG_SESSION_STOP", sizeof("XDEBUG_SESSION_STOP"), (void **) &dummy) == SUCCESS
PG(http_globals)[TRACK_VARS_POST] && ) || (
zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_SESSION_STOP", sizeof("XDEBUG_SESSION_STOP"), (void **) &dummy) == SUCCESS PG(http_globals)[TRACK_VARS_POST] &&
zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_SESSION_STOP", sizeof("XDEBUG_SESSION_STOP"), (void **) &dummy) == SUCCESS
)
) )
&& !SG(headers_sent) && !SG(headers_sent)
) { ) {
Expand Down Expand Up @@ -1337,13 +1339,15 @@ void xdebug_execute(zend_op_array *op_array TSRMLS_DC)
XG(profiler_enable) XG(profiler_enable)
|| ||
( (
XG(profiler_enable_trigger) && XG(profiler_enable_trigger) &&
( (
PG(http_globals)[TRACK_VARS_GET] && (
zend_hash_find(PG(http_globals)[TRACK_VARS_GET]->value.ht, "XDEBUG_PROFILE", sizeof("XDEBUG_PROFILE"), (void **) &dummy) == SUCCESS PG(http_globals)[TRACK_VARS_GET] &&
) || ( zend_hash_find(PG(http_globals)[TRACK_VARS_GET]->value.ht, "XDEBUG_PROFILE", sizeof("XDEBUG_PROFILE"), (void **) &dummy) == SUCCESS
PG(http_globals)[TRACK_VARS_POST] && ) || (
zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_PROFILE", sizeof("XDEBUG_PROFILE"), (void **) &dummy) == SUCCESS PG(http_globals)[TRACK_VARS_POST] &&
zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_PROFILE", sizeof("XDEBUG_PROFILE"), (void **) &dummy) == SUCCESS
)
) )
) )
) )
Expand Down Expand Up @@ -1608,7 +1612,7 @@ static void log_stack(const char *error_type_str, char *buffer, const char *erro


/* Printing vars */ /* Printing vars */
for (j = 0; j < i->varc; j++) { for (j = 0; j < i->varc; j++) {
char *tmp_varname, *tmp_value, *tmp_fancy_value; char *tmp_varname, *tmp_value;


if (c) { if (c) {
xdebug_str_addl(&log_buffer, ", ", 2, 0); xdebug_str_addl(&log_buffer, ", ", 2, 0);
Expand All @@ -1630,21 +1634,16 @@ static void log_stack(const char *error_type_str, char *buffer, const char *erro
} }
} }


static char* get_printable_stack(int html, const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno, int log_only TSRMLS_DC) static char* get_printable_stack(int html, const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno TSRMLS_DC)
{ {
char *error_format, *error_string;
xdebug_llist_element *le; xdebug_llist_element *le;
function_stack_entry *i; function_stack_entry *i;
int len, dummy; int len;
char **formats; char **formats;
xdebug_str str = {0, 0, NULL}; xdebug_str str = {0, 0, NULL};


log_stack(error_type_str, buffer, error_filename, error_lineno TSRMLS_CC); log_stack(error_type_str, buffer, error_filename, error_lineno TSRMLS_CC);


if (log_only) {
return;
}

if (html) { if (html) {
formats = html_formats; formats = html_formats;
} else { } else {
Expand Down Expand Up @@ -1712,8 +1711,13 @@ static char* get_printable_stack(int html, const char *error_type_str, char *buf
xdebug_str_add(&str, xdebug_sprintf(formats[5], i->filename, i->lineno), 1); xdebug_str_add(&str, xdebug_sprintf(formats[5], i->filename, i->lineno), 1);
} }


if (XG(dump_globals)) { if (XG(dump_globals) && !(XG(dump_once) && XG(dumped))) {
xdebug_str_add(&str, xdebug_get_printable_superglobals(html TSRMLS_CC), 1); char *tmp = xdebug_get_printable_superglobals(html TSRMLS_CC);

if (tmp) {
xdebug_str_add(&str, tmp, 1);
}
XG(dumped) = 1;
} }


if (XG(show_local_vars) && XG(stack) && XDEBUG_LLIST_TAIL(XG(stack))) { if (XG(show_local_vars) && XG(stack) && XDEBUG_LLIST_TAIL(XG(stack))) {
Expand All @@ -1735,11 +1739,11 @@ static char* get_printable_stack(int html, const char *error_type_str, char *buf
return str.d; return str.d;
} }


static void print_stack(int html, const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno, int log_only TSRMLS_DC) static void print_stack(int html, const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno TSRMLS_DC)
{ {
char *printable_stack; char *printable_stack;


printable_stack = get_printable_stack(html, error_type_str, buffer, error_filename, error_lineno, log_only TSRMLS_CC); printable_stack = get_printable_stack(html, error_type_str, buffer, error_filename, error_lineno TSRMLS_CC);
php_printf("%s", printable_stack); php_printf("%s", printable_stack);
xdfree(printable_stack); xdfree(printable_stack);
} }
Expand Down Expand Up @@ -1925,7 +1929,6 @@ void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
zval *message, *file, *line; zval *message, *file, *line;
zend_class_entry *default_ce, *exception_ce; zend_class_entry *default_ce, *exception_ce;
xdebug_brk_info *extra_brk_info; xdebug_brk_info *extra_brk_info;
int do_exception = 0;


if (!exception) { if (!exception) {
return; return;
Expand All @@ -1943,7 +1946,10 @@ void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
line = zend_read_property(default_ce, exception, "line", sizeof("line")-1, 0 TSRMLS_CC); line = zend_read_property(default_ce, exception, "line", sizeof("line")-1, 0 TSRMLS_CC);


if (XG(show_ex_trace)) { if (XG(show_ex_trace)) {
print_stack(!(strcmp("cli", sapi_module.name) == 0), exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line), !PG(display_errors) TSRMLS_CC); log_stack(exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line) TSRMLS_CC);
if (PG(display_errors)) {
print_stack(PG(html_errors), exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line) TSRMLS_CC);
}
} }


/* Start JIT if requested and not yet enabled */ /* Start JIT if requested and not yet enabled */
Expand Down Expand Up @@ -2052,7 +2058,10 @@ void xdebug_error_cb(int type, const char *error_filename, const uint error_line
} }


if ((EG(error_reporting) & type)) { /* Otherwise print the default stack trace */ if ((EG(error_reporting) & type)) { /* Otherwise print the default stack trace */
print_stack(!(strcmp("cli", sapi_module.name) == 0), error_type_str, buffer, error_filename, error_lineno, !PG(display_errors) TSRMLS_CC); log_stack(error_type_str, buffer, error_filename, error_lineno TSRMLS_CC);
if (PG(display_errors)) {
print_stack(PG(html_errors), error_type_str, buffer, error_filename, error_lineno TSRMLS_CC);
}
} }


/* Check for the pseudo exceptions to allow breakpoints on PHP error statusses */ /* Check for the pseudo exceptions to allow breakpoints on PHP error statusses */
Expand Down Expand Up @@ -2197,7 +2206,7 @@ PHP_FUNCTION(xdebug_print_function_stack)
function_stack_entry *i; function_stack_entry *i;


i = xdebug_get_stack_frame(0 TSRMLS_CC); i = xdebug_get_stack_frame(0 TSRMLS_CC);
print_stack(!(strcmp("cli", sapi_module.name) == 0), "Xdebug", "user triggered", i->filename, i->lineno, 0 TSRMLS_CC); print_stack(PG(html_errors), "Xdebug", "user triggered", i->filename, i->lineno TSRMLS_CC);
} }
/* }}} */ /* }}} */


Expand Down
8 changes: 2 additions & 6 deletions xdebug_code_coverage.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static zend_brk_cont_element* xdebug_find_brk_cont(zval *nest_levels_zval, int a
return jmp_to; return jmp_to;
} }


static int xdebug_find_jump(zend_op_array *opa, unsigned int position, unsigned int *jmp1, unsigned int *jmp2) static int xdebug_find_jump(zend_op_array *opa, unsigned int position, int *jmp1, int *jmp2)
{ {
zend_uint base_address = (zend_uint) &(opa->opcodes[0]); zend_uint base_address = (zend_uint) &(opa->opcodes[0]);


Expand Down Expand Up @@ -151,7 +151,6 @@ static int xdebug_find_jump(zend_op_array *opa, unsigned int position, unsigned


static void xdebug_analyse_branch(zend_op_array *opa, unsigned int position, xdebug_set *set) static void xdebug_analyse_branch(zend_op_array *opa, unsigned int position, xdebug_set *set)
{ {
unsigned int jump_found = 0;
int jump_pos1 = -1; int jump_pos1 = -1;
int jump_pos2 = -1; int jump_pos2 = -1;


Expand Down Expand Up @@ -205,7 +204,6 @@ static void xdebug_analyse_branch(zend_op_array *opa, unsigned int position, xde
static void prefil_from_oparray(function_stack_entry *fse, char *fn, zend_op_array *opa TSRMLS_DC) static void prefil_from_oparray(function_stack_entry *fse, char *fn, zend_op_array *opa TSRMLS_DC)
{ {
unsigned int i; unsigned int i;
zend_uint base_address = (zend_uint) &(opa->opcodes[0]);
xdebug_set *set = NULL; xdebug_set *set = NULL;


#ifdef ZEND_ENGINE_2 #ifdef ZEND_ENGINE_2
Expand Down Expand Up @@ -237,7 +235,6 @@ static void prefil_from_oparray(function_stack_entry *fse, char *fn, zend_op_arr
static int prefil_from_function_table(zend_op_array *opa, int num_args, va_list args, zend_hash_key *hash_key) static int prefil_from_function_table(zend_op_array *opa, int num_args, va_list args, zend_hash_key *hash_key)
{ {
char *new_filename; char *new_filename;
unsigned int i;
TSRMLS_FETCH(); TSRMLS_FETCH();


new_filename = va_arg(args, char*); new_filename = va_arg(args, char*);
Expand Down Expand Up @@ -275,12 +272,11 @@ static int prefil_from_class_table(zend_class_entry *class_entry, int num_args,


void xdebug_prefil_code_coverage(function_stack_entry *fse, zend_op_array *op_array TSRMLS_DC) void xdebug_prefil_code_coverage(function_stack_entry *fse, zend_op_array *op_array TSRMLS_DC)
{ {
unsigned int i;
char cache_key[64]; char cache_key[64];
int cache_key_len; int cache_key_len;
void *dummy; void *dummy;


cache_key_len = snprintf(&cache_key, 63, "%X", op_array); cache_key_len = snprintf(cache_key, sizeof(cache_key) - 1, "%p", op_array);
if (xdebug_hash_find(XG(code_coverage_op_array_cache), cache_key, cache_key_len, (void*) &dummy)) { if (xdebug_hash_find(XG(code_coverage_op_array_cache), cache_key, cache_key_len, (void*) &dummy)) {
return; return;
} }
Expand Down
12 changes: 6 additions & 6 deletions xdebug_handler_dbgp.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ DBGP_FUNC(breakpoint_set)


/* Perhaps we have a break condition */ /* Perhaps we have a break condition */
if (CMD_OPTION('-')) { if (CMD_OPTION('-')) {
brk_info->condition = xdebug_base64_decode(CMD_OPTION('-'), strlen(CMD_OPTION('-')), &new_length); brk_info->condition = (char*) xdebug_base64_decode((unsigned char*) CMD_OPTION('-'), strlen(CMD_OPTION('-')), &new_length);
} }


tmp_name = xdebug_sprintf("%s$%lu", brk_info->file, brk_info->lineno); tmp_name = xdebug_sprintf("%s$%lu", brk_info->file, brk_info->lineno);
Expand Down Expand Up @@ -1139,7 +1139,7 @@ DBGP_FUNC(breakpoint_set)
xdebug_xml_add_attribute_ex(*retval, "id", xdebug_sprintf("%d", brk_id), 0, 1); xdebug_xml_add_attribute_ex(*retval, "id", xdebug_sprintf("%d", brk_id), 0, 1);
} }


static int _xdebug_do_eval(unsigned char *eval_string, zval *ret_zval TSRMLS_DC) static int _xdebug_do_eval(char *eval_string, zval *ret_zval TSRMLS_DC)
{ {
int old_error_reporting; int old_error_reporting;
int res; int res;
Expand All @@ -1161,7 +1161,7 @@ static int _xdebug_do_eval(unsigned char *eval_string, zval *ret_zval TSRMLS_DC)


DBGP_FUNC(eval) DBGP_FUNC(eval)
{ {
unsigned char *eval_string; char *eval_string;
xdebug_xml_node *ret_xml; xdebug_xml_node *ret_xml;
zval ret_zval; zval ret_zval;
int new_length; int new_length;
Expand All @@ -1175,7 +1175,7 @@ DBGP_FUNC(eval)
options = (xdebug_var_export_options*) context->options; options = (xdebug_var_export_options*) context->options;


/* base64 decode eval string */ /* base64 decode eval string */
eval_string = xdebug_base64_decode(CMD_OPTION('-'), strlen(CMD_OPTION('-')), &new_length); eval_string = (char*) xdebug_base64_decode((unsigned char*) CMD_OPTION('-'), strlen(CMD_OPTION('-')), &new_length);


res = _xdebug_do_eval(eval_string, &ret_zval TSRMLS_CC); res = _xdebug_do_eval(eval_string, &ret_zval TSRMLS_CC);


Expand Down Expand Up @@ -1624,7 +1624,7 @@ DBGP_FUNC(property_set)
} }


/* base64 decode eval string */ /* base64 decode eval string */
new_value = xdebug_base64_decode(data, strlen(data), &new_length); new_value = (char*) xdebug_base64_decode((unsigned char*) data, strlen(data), &new_length);
eval_string = xdebug_sprintf("%s = %s", name, new_value); eval_string = xdebug_sprintf("%s = %s", name, new_value);
res = _xdebug_do_eval(eval_string, &ret_zval TSRMLS_CC); res = _xdebug_do_eval(eval_string, &ret_zval TSRMLS_CC);


Expand Down Expand Up @@ -2061,7 +2061,7 @@ int xdebug_dbgp_parse_option(xdebug_con *context, char* line, int flags, xdebug_


char *xdebug_dbgp_get_revision(void) char *xdebug_dbgp_get_revision(void)
{ {
return "$Revision: 1.98 $"; return "$Revision: 1.99 $";
} }


int xdebug_dbgp_cmdloop(xdebug_con *context TSRMLS_DC) int xdebug_dbgp_cmdloop(xdebug_con *context TSRMLS_DC)
Expand Down
2 changes: 1 addition & 1 deletion xdebug_profiler.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static int xdebug_print_aggr_entry(void *pDest, void *argument TSRMLS_DC)
#endif #endif
if (strcmp(xae->function, "{main}") == 0) { if (strcmp(xae->function, "{main}") == 0) {
#if HAVE_PHP_MEMORY_USAGE #if HAVE_PHP_MEMORY_USAGE
fprintf(fp, "\nsummary: %lu %u\n\n", (unsigned long) (xae->time_inclusive * 10000000), (xae->mem_used)); fprintf(fp, "\nsummary: %lu %lu\n\n", (unsigned long) (xae->time_inclusive * 10000000), (xae->mem_used));
#else #else
fprintf(fp, "\nsummary: %lu\n\n", (unsigned long) (xae->time_inclusive * 10000000), (xae->mem_used)); fprintf(fp, "\nsummary: %lu\n\n", (unsigned long) (xae->time_inclusive * 10000000), (xae->mem_used));
#endif #endif
Expand Down
16 changes: 8 additions & 8 deletions xdebug_set.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
| Authors: Derick Rethans <derick@xdebug.org> | | Authors: Derick Rethans <derick@xdebug.org> |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id: xdebug_set.c,v 1.1 2006-09-25 20:20:01 derick Exp $ */ /* $Id: xdebug_set.c,v 1.2 2006-10-07 23:10:32 derick Exp $ */


#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
Expand All @@ -41,9 +41,9 @@ void xdebug_set_free(xdebug_set *set)


void xdebug_set_add(xdebug_set *set, unsigned int position) void xdebug_set_add(xdebug_set *set, unsigned int position)
{ {
char *byte; unsigned char *byte;
unsigned int bit; unsigned int bit;

byte = &(set->setinfo[position / 8]); byte = &(set->setinfo[position / 8]);
bit = position % 8; bit = position % 8;


Expand All @@ -52,8 +52,8 @@ void xdebug_set_add(xdebug_set *set, unsigned int position)


void xdebug_set_remove(xdebug_set *set, unsigned int position) void xdebug_set_remove(xdebug_set *set, unsigned int position)
{ {
char *byte; unsigned char *byte;
unsigned int bit; unsigned int bit;


byte = &(set->setinfo[position / 8]); byte = &(set->setinfo[position / 8]);
bit = position % 8; bit = position % 8;
Expand All @@ -63,8 +63,8 @@ void xdebug_set_remove(xdebug_set *set, unsigned int position)


int xdebug_set_in_ex(xdebug_set *set, unsigned int position, int noisy) int xdebug_set_in_ex(xdebug_set *set, unsigned int position, int noisy)
{ {
char *byte; unsigned char *byte;
unsigned int bit; unsigned int bit;


byte = &(set->setinfo[position / 8]); byte = &(set->setinfo[position / 8]);
bit = position % 8; bit = position % 8;
Expand Down
3 changes: 2 additions & 1 deletion xdebug_set.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
| Authors: Derick Rethans <derick@xdebug.org> | | Authors: Derick Rethans <derick@xdebug.org> |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id: xdebug_set.h,v 1.1 2006-09-25 20:20:01 derick Exp $ */ /* $Id: xdebug_set.h,v 1.2 2006-10-07 23:10:32 derick Exp $ */


#ifndef __XDEBUG_SET_H__ #ifndef __XDEBUG_SET_H__
#define __XDEBUG_SET_H__ #define __XDEBUG_SET_H__
Expand All @@ -31,5 +31,6 @@ void xdebug_set_remove(xdebug_set *set, unsigned int position);
#define xdebug_set_in(x,y) xdebug_set_in_ex(x,y,1) #define xdebug_set_in(x,y) xdebug_set_in_ex(x,y,1)
int xdebug_set_in_ex(xdebug_set *set, unsigned int position, int noisy); int xdebug_set_in_ex(xdebug_set *set, unsigned int position, int noisy);
void xdebug_set_dump(xdebug_set *set); void xdebug_set_dump(xdebug_set *set);
void xdebug_set_free(xdebug_set *set);


#endif #endif
8 changes: 0 additions & 8 deletions xdebug_superglobals.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ void xdebug_superglobals_dump_dtor(void *user, void *ptr)


static void dump_hash_elem(zval *z, char *name, long index, char *elem, int html, xdebug_str *str TSRMLS_DC) static void dump_hash_elem(zval *z, char *name, long index, char *elem, int html, xdebug_str *str TSRMLS_DC)
{ {
char buffer[1024];
int len; int len;


if (html) { if (html) {
Expand Down Expand Up @@ -155,12 +154,6 @@ char* xdebug_get_printable_superglobals(int html TSRMLS_DC)
{ {
xdebug_str str = {0, 0, NULL}; xdebug_str str = {0, 0, NULL};


if (XG(dump_once) && XG(dumped)) {
return;
}

XG(dumped) = 1;

dump_hash(&XG(server), "_SERVER", 8, html, &str TSRMLS_CC); dump_hash(&XG(server), "_SERVER", 8, html, &str TSRMLS_CC);
dump_hash(&XG(get), "_GET", 5, html, &str TSRMLS_CC); dump_hash(&XG(get), "_GET", 5, html, &str TSRMLS_CC);
dump_hash(&XG(post), "_POST", 6, html, &str TSRMLS_CC); dump_hash(&XG(post), "_POST", 6, html, &str TSRMLS_CC);
Expand Down Expand Up @@ -200,7 +193,6 @@ void xdebug_superglobals_dump_tok(xdebug_llist *l, char *str)


PHP_FUNCTION(xdebug_dump_superglobals) PHP_FUNCTION(xdebug_dump_superglobals)
{ {
int is_cli = (strcmp("cli", sapi_module.name) == 0);
int html = PG(html_errors); int html = PG(html_errors);


if (html) { if (html) {
Expand Down
Loading

0 comments on commit 170b02f

Please sign in to comment.