Skip to content
Permalink
Browse files

Merge branch 'xdebug_2_8'

  • Loading branch information
derickr committed Dec 1, 2019
2 parents 33f9a96 + 9aa05e5 commit 122625ca6d85b6a3379303316b4d7ab3585ac1bc
Showing with 15 additions and 5 deletions.
  1. +1 −1 .xdebugci/test-all.sh
  2. +14 −4 src/coverage/code_coverage.c
@@ -1,6 +1,6 @@
#!/bin/bash

PATTERN=${1:-'^7.3.*'}
PATTERN=${1:-'^7.[34].*'}

PHP=`which php`
if [[ "${PHP}" == "" ]]; then
@@ -544,18 +544,28 @@ static int prefill_from_function_table(zend_op_array *opa)
return ZEND_HASH_APPLY_KEEP;
}

/* Set correct int format to use */
#if SIZEOF_ZEND_LONG == 4
# define XDEBUG_PTR_KEY_LEN 8
# define XDEBUG_PTR_KEY_FMT "%08X"
#else
# define XDEBUG_PTR_KEY_LEN 16
# define XDEBUG_PTR_KEY_FMT "%016lX"
#endif


static int mark_class_as_visited(zend_class_entry *ce)
{
int already_visited = 0;
void *dummy; /* we only care about key existence, not value */
char key[17];
char key[XDEBUG_PTR_KEY_LEN + 1];

snprintf(key, 17, "%016lX", (uintptr_t) ce);
snprintf(key, XDEBUG_PTR_KEY_LEN + 1, XDEBUG_PTR_KEY_FMT, (uintptr_t) ce);

if (xdebug_hash_find(XG_COV(visited_classes), key, 16, (void*) &dummy)) {
if (xdebug_hash_find(XG_COV(visited_classes), key, XDEBUG_PTR_KEY_LEN, (void*) &dummy)) {
already_visited = 1;
} else {
xdebug_hash_add(XG_COV(visited_classes), key, 16, NULL);
xdebug_hash_add(XG_COV(visited_classes), key, XDEBUG_PTR_KEY_LEN, NULL);
}

return already_visited;

0 comments on commit 122625c

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