Skip to content

Commit

Permalink
Merge branch 'xdebug_3_1'
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Oct 8, 2021
2 parents 624ede5 + 03e9f3b commit 70cfc9d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/base/base_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ typedef struct _xdebug_base_globals_t {
xdebug_llist *filters_code_coverage;
xdebug_llist *filters_stack;
xdebug_llist *filters_tracing;

/* PHP versions */
const char *php_version_compile_time;
const char *php_version_run_time;
} xdebug_base_globals_t;

typedef struct _xdebug_base_settings_t {
Expand Down
4 changes: 2 additions & 2 deletions src/debugger/handler_dbgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ DBGP_FUNC(feature_get)
XDEBUG_STR_CASE_END

XDEBUG_STR_CASE("language_version")
xdebug_xml_add_text(*retval, xdstrdup(PHP_VERSION));
xdebug_xml_add_text(*retval, xdstrdup(XG_BASE(php_version_run_time)));
xdebug_xml_add_attribute(*retval, "supported", "1");
XDEBUG_STR_CASE_END

Expand Down Expand Up @@ -2388,7 +2388,7 @@ int xdebug_dbgp_init(xdebug_con *context, int mode)
xdebug_xml_add_attribute_ex(response, "fileuri", xdebug_path_to_url(context->program_name), 0, 1);
}
xdebug_xml_add_attribute_ex(response, "language", "PHP", 0, 0);
xdebug_xml_add_attribute_ex(response, "xdebug:language_version", PHP_VERSION, 0, 0);
xdebug_xml_add_attribute_ex(response, "xdebug:language_version", XG_BASE(php_version_run_time), 0, 0);
xdebug_xml_add_attribute_ex(response, "protocol_version", DBGP_VERSION, 0, 0);
xdebug_xml_add_attribute_ex(response, "appid", xdebug_sprintf(ZEND_ULONG_FMT, xdebug_get_pid()), 0, 1);

Expand Down
3 changes: 2 additions & 1 deletion src/lib/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ static void xdebug_print_php_section(void)
php_info_print_table_colspan_header(2, (char*) "PHP");

php_info_print_table_colspan_header(2, (char*) "Build Configuration");
php_info_print_table_row(2, "Version", PHP_VERSION);
php_info_print_table_row(2, "Version (Run Time)", XG_BASE(php_version_run_time));
php_info_print_table_row(2, "Version (Compile Time)", XG_BASE(php_version_compile_time));
#if ZEND_DEBUG
php_info_print_table_row(2, "Debug Build", "yes");
#else
Expand Down
2 changes: 1 addition & 1 deletion src/profiler/profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static void profiler_write_header(xdebug_file *file, char *script_name)
if (XINI_PROF(profiler_append)) {
xdebug_file_printf(file, "\n==== NEW PROFILING FILE ==============================================\n");
}
xdebug_file_printf(file, "version: 1\ncreator: xdebug %s (PHP %s)\n", XDEBUG_VERSION, PHP_VERSION);
xdebug_file_printf(file, "version: 1\ncreator: xdebug %s (PHP %s)\n", XDEBUG_VERSION, XG_BASE(php_version_run_time));
xdebug_file_printf(file, "cmd: %s\npart: 1\npositions: line\n\n", script_name);
xdebug_file_printf(file, "events: Time_(10ns) Memory_(bytes)\n\n");
xdebug_file_flush(file);
Expand Down
10 changes: 8 additions & 2 deletions xdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,13 @@ static void xdebug_init_base_globals(xdebug_base_globals_t *xg)
xg->filters_stack = NULL;
xg->filters_tracing = NULL;

xg->php_version_compile_time = PHP_VERSION;
xg->php_version_run_time = zend_get_module_version("standard");

xdebug_nanotime_init(xg);
}


static void php_xdebug_init_globals(zend_xdebug_globals *xg)
{
memset(&xg->globals, 0, sizeof(xg->globals));
Expand Down Expand Up @@ -431,9 +435,11 @@ static void php_xdebug_init_globals(zend_xdebug_globals *xg)
}
}

static void php_xdebug_shutdown_globals (zend_xdebug_globals *xg)
static void php_xdebug_shutdown_globals(zend_xdebug_globals *xg)
{
xdebug_deinit_develop_globals(&xg->globals.develop);
if (XDEBUG_MODE_IS(XDEBUG_MODE_DEVELOP)) {
xdebug_deinit_develop_globals(&xg->globals.develop);
}
}


Expand Down

0 comments on commit 70cfc9d

Please sign in to comment.