Skip to content
Permalink
Browse files

Rename the settings for the 'base' module from 'core' to 'base'

  • Loading branch information...
derickr committed Sep 26, 2019
1 parent 1e3a7da commit 0e7ab67d08f699a97cde82f4804a0c47c145cf47
@@ -44,7 +44,7 @@ int xdebug_is_stack_frame_filtered(int filter_type, function_stack_entry *fse)
int xdebug_is_top_stack_frame_filtered(int filter_type)
{
function_stack_entry *fse;
fse = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG_CORE(stack)));
fse = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG_BASE(stack)));
return xdebug_is_stack_frame_filtered(filter_type, fse);
}

@@ -164,21 +164,21 @@ void xdebug_filter_run_tracing(function_stack_entry *fse)
{
fse->filtered_tracing = 0;

if (XG_CORE(filter_type_tracing) != XDEBUG_FILTER_NONE) {
xdebug_filter_run_internal(fse, XDEBUG_FILTER_TRACING, &fse->filtered_tracing, XG_CORE(filter_type_tracing), XG_CORE(filters_tracing));
if (XG_BASE(filter_type_tracing) != XDEBUG_FILTER_NONE) {
xdebug_filter_run_internal(fse, XDEBUG_FILTER_TRACING, &fse->filtered_tracing, XG_BASE(filter_type_tracing), XG_BASE(filters_tracing));
}
}

void xdebug_filter_run_code_coverage(zend_op_array *op_array)
{
op_array->reserved[XG_COV(dead_code_analysis_tracker_offset)] = 0;

if (XG_CORE(filter_type_code_coverage) != XDEBUG_FILTER_NONE) {
if (XG_BASE(filter_type_code_coverage) != XDEBUG_FILTER_NONE) {
function_stack_entry tmp_fse;

tmp_fse.filename = STR_NAME_VAL(op_array->filename);
xdebug_build_fname_from_oparray(&tmp_fse.function, op_array TSRMLS_CC);
xdebug_filter_run_internal(&tmp_fse, XDEBUG_FILTER_CODE_COVERAGE, &tmp_fse.filtered_code_coverage, XG_CORE(filter_type_code_coverage), XG_CORE(filters_code_coverage));
xdebug_filter_run_internal(&tmp_fse, XDEBUG_FILTER_CODE_COVERAGE, &tmp_fse.filtered_code_coverage, XG_BASE(filter_type_code_coverage), XG_BASE(filters_code_coverage));
op_array->reserved[XG_COV(code_coverage_filter_offset)] = (void*) tmp_fse.filtered_code_coverage;
}
}
@@ -198,13 +198,13 @@ PHP_FUNCTION(xdebug_set_filter)

switch (filter_group) {
case XDEBUG_FILTER_TRACING:
filter_list = &XG_CORE(filters_tracing);
XG_CORE(filter_type_tracing) = XDEBUG_FILTER_NONE;
filter_list = &XG_BASE(filters_tracing);
XG_BASE(filter_type_tracing) = XDEBUG_FILTER_NONE;
break;

case XDEBUG_FILTER_CODE_COVERAGE:
filter_list = &XG_CORE(filters_code_coverage);
XG_CORE(filter_type_code_coverage) = XDEBUG_FILTER_NONE;
filter_list = &XG_BASE(filters_code_coverage);
XG_BASE(filter_type_code_coverage) = XDEBUG_FILTER_NONE;
if (filter_type == XDEBUG_NAMESPACE_WHITELIST || filter_type == XDEBUG_NAMESPACE_BLACKLIST) {
php_error(E_WARNING, "The code coverage filter (XDEBUG_FILTER_CODE_COVERAGE) only supports the XDEBUG_PATH_WHITELIST, XDEBUG_PATH_BLACKLIST, and XDEBUG_FILTER_NONE filter types");
return;
@@ -225,11 +225,11 @@ PHP_FUNCTION(xdebug_set_filter)
) {
switch (filter_group) {
case XDEBUG_FILTER_TRACING:
XG_CORE(filter_type_tracing) = filter_type;
XG_BASE(filter_type_tracing) = filter_type;
break;

case XDEBUG_FILTER_CODE_COVERAGE:
XG_CORE(filter_type_code_coverage) = filter_type;
XG_BASE(filter_type_code_coverage) = filter_type;
break;
}
} else {
@@ -66,7 +66,7 @@ void xdebug_function_monitor_record(char *func_name, char *filename, int lineno
xdebug_monitored_function_entry *record;

record = xdebug_monitored_function_init(func_name, filename, lineno);
xdebug_llist_insert_next(XG_CORE(monitored_functions_found), XDEBUG_LLIST_TAIL(XG_CORE(monitored_functions_found)), record);
xdebug_llist_insert_next(XG_BASE(monitored_functions_found), XDEBUG_LLIST_TAIL(XG_BASE(monitored_functions_found)), record);
}

PHP_FUNCTION(xdebug_start_function_monitor)
@@ -77,28 +77,28 @@ PHP_FUNCTION(xdebug_start_function_monitor)
return;
}

if (XG_CORE(do_monitor_functions) == 1) {
if (XG_BASE(do_monitor_functions) == 1) {
php_error(E_NOTICE, "Function monitoring was already started");
}

/* Clean and store list of functions to monitor */
if (XG_CORE(functions_to_monitor)) {
xdebug_hash_destroy(XG_CORE(functions_to_monitor));
if (XG_BASE(functions_to_monitor)) {
xdebug_hash_destroy(XG_BASE(functions_to_monitor));
}

/* We add "1" here so that we don't alloc a 0-slot hash table */
XG_CORE(functions_to_monitor) = xdebug_hash_alloc(zend_hash_num_elements(functions_to_monitor) + 1, (xdebug_hash_dtor_t) xdebug_hash_function_monitor_dtor);
init_function_monitor_hash(XG_CORE(functions_to_monitor), functions_to_monitor);
XG_BASE(functions_to_monitor) = xdebug_hash_alloc(zend_hash_num_elements(functions_to_monitor) + 1, (xdebug_hash_dtor_t) xdebug_hash_function_monitor_dtor);
init_function_monitor_hash(XG_BASE(functions_to_monitor), functions_to_monitor);

XG_CORE(do_monitor_functions) = 1;
XG_BASE(do_monitor_functions) = 1;
}

PHP_FUNCTION(xdebug_stop_function_monitor)
{
if (XG_CORE(do_monitor_functions) == 0) {
if (XG_BASE(do_monitor_functions) == 0) {
php_error(E_NOTICE, "Function monitoring was not started");
}
XG_CORE(do_monitor_functions) = 0;
XG_BASE(do_monitor_functions) = 0;
}

PHP_FUNCTION(xdebug_get_monitored_functions)
@@ -112,7 +112,7 @@ PHP_FUNCTION(xdebug_get_monitored_functions)
}

array_init(return_value);
for (le = XDEBUG_LLIST_HEAD(XG_CORE(monitored_functions_found)); le != NULL; le = XDEBUG_LLIST_NEXT(le)) {
for (le = XDEBUG_LLIST_HEAD(XG_BASE(monitored_functions_found)); le != NULL; le = XDEBUG_LLIST_NEXT(le)) {
zval *entry;

mfe = XDEBUG_LLIST_VALP(le);
@@ -129,8 +129,8 @@ PHP_FUNCTION(xdebug_get_monitored_functions)
}

if (clear) {
xdebug_llist_destroy(XG_CORE(monitored_functions_found), NULL);
XG_CORE(monitored_functions_found) = xdebug_llist_alloc(xdebug_monitored_function_dtor);
xdebug_llist_destroy(XG_BASE(monitored_functions_found), NULL);
XG_BASE(monitored_functions_found) = xdebug_llist_alloc(xdebug_monitored_function_dtor);
}
}
/* }}} */

0 comments on commit 0e7ab67

Please sign in to comment.
You can’t perform that action at this time.