From 094327b12b62cf33f8b00935a03767455f1811e8 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 2 Dec 2019 12:51:10 +0100
Subject: v2.8.1

---
 0654240f24f6f619074c205462dbefe9b175c122.patch |  46 ++++++
 PHPINFO                                        |  77 +++++----
 REFLECTION                                     | 210 ++++++++++++-------------
 php-pecl-xdebug.spec                           |  11 +-
 4 files changed, 198 insertions(+), 146 deletions(-)
 create mode 100644 0654240f24f6f619074c205462dbefe9b175c122.patch

diff --git a/0654240f24f6f619074c205462dbefe9b175c122.patch b/0654240f24f6f619074c205462dbefe9b175c122.patch
new file mode 100644
index 0000000..1eb280e
--- /dev/null
+++ b/0654240f24f6f619074c205462dbefe9b175c122.patch
@@ -0,0 +1,46 @@
+From 0654240f24f6f619074c205462dbefe9b175c122 Mon Sep 17 00:00:00 2001
+From: Derick Rethans <github@derickrethans.nl>
+Date: Sat, 30 Nov 2019 17:23:53 +0000
+Subject: [PATCH] Fix key generation on 32 bit platforms
+
+---
+ xdebug_code_coverage.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/xdebug_code_coverage.c b/xdebug_code_coverage.c
+index d7a2027fe..bd2a5f343 100644
+--- a/xdebug_code_coverage.c
++++ b/xdebug_code_coverage.c
+@@ -1047,18 +1047,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(visited_classes), key, 16, (void*) &dummy)) {
++	if (xdebug_hash_find(XG(visited_classes), key, XDEBUG_PTR_KEY_LEN, (void*) &dummy)) {
+ 		already_visited = 1;
+ 	} else {
+-		xdebug_hash_add(XG(visited_classes), key, 16, NULL);
++		xdebug_hash_add(XG(visited_classes), key, XDEBUG_PTR_KEY_LEN, NULL);
+ 	}
+ 
+ 	return already_visited;
diff --git a/PHPINFO b/PHPINFO
index a4d3595..6b83d4c 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,41 +2,23 @@
 xdebug
 
 xdebug support => enabled
-Version => 2.8.0
+Version => 2.8.1
 IDE Key => remi
-
-Support Xdebug on Patreon: https://www.patreon.com/bePatron?u=7864328
+Support Xdebug on Patreon, GitHub, or as a business: https://xdebug.org/support
 
 Supported protocols
 DBGp - Common DeBuGger Protocol
 
 Directive => Local Value => Master Value
 xdebug.auto_trace => Off => Off
-xdebug.trace_enable_trigger => Off => Off
-xdebug.trace_enable_trigger_value => no value => no value
-xdebug.trace_output_dir => /tmp => /tmp
-xdebug.trace_output_name => trace.%c => trace.%c
-xdebug.trace_format => 0 => 0
-xdebug.trace_options => 0 => 0
-xdebug.coverage_enable => On => On
+xdebug.cli_color => 0 => 0
+xdebug.collect_assignments => Off => Off
 xdebug.collect_includes => On => On
 xdebug.collect_params => 0 => 0
 xdebug.collect_return => Off => Off
 xdebug.collect_vars => Off => Off
-xdebug.collect_assignments => Off => Off
+xdebug.coverage_enable => On => On
 xdebug.default_enable => On => On
-xdebug.file_link_format => no value => no value
-xdebug.filename_format => no value => no value
-xdebug.force_display_errors => Off => Off
-xdebug.force_error_reporting => 0 => 0
-xdebug.halt_level => 0 => 0
-xdebug.max_nesting_level => 256 => 256
-xdebug.max_stack_frames => -1 => -1
-xdebug.overload_var_dump => 2 => 2
-xdebug.show_error_trace => Off => Off
-xdebug.show_exception_trace => Off => Off
-xdebug.show_local_vars => Off => Off
-xdebug.show_mem_delta => Off => Off
 xdebug.dump.COOKIE => no value => no value
 xdebug.dump.ENV => no value => no value
 xdebug.dump.FILES => no value => no value
@@ -48,31 +30,48 @@ xdebug.dump.SESSION => no value => no value
 xdebug.dump_globals => On => On
 xdebug.dump_once => On => On
 xdebug.dump_undefined => Off => Off
+xdebug.file_link_format => no value => no value
+xdebug.filename_format => no value => no value
+xdebug.force_display_errors => Off => Off
+xdebug.force_error_reporting => 0 => 0
+xdebug.gc_stats_enable => Off => Off
+xdebug.gc_stats_output_dir => /tmp => /tmp
+xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
+xdebug.halt_level => 0 => 0
+xdebug.idekey => no value => no value
+xdebug.max_nesting_level => 256 => 256
+xdebug.max_stack_frames => -1 => -1
+xdebug.overload_var_dump => 2 => 2
+xdebug.profiler_aggregate => Off => Off
+xdebug.profiler_append => Off => Off
 xdebug.profiler_enable => Off => Off
-xdebug.profiler_output_dir => /tmp => /tmp
-xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
 xdebug.profiler_enable_trigger => Off => Off
 xdebug.profiler_enable_trigger_value => no value => no value
-xdebug.profiler_append => Off => Off
-xdebug.profiler_aggregate => Off => Off
+xdebug.profiler_output_dir => /tmp => /tmp
+xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
+xdebug.remote_addr_header => no value => no value
+xdebug.remote_autostart => Off => Off
+xdebug.remote_connect_back => Off => Off
+xdebug.remote_cookie_expire_time => 3600 => 3600
 xdebug.remote_enable => Off => Off
 xdebug.remote_handler => dbgp => dbgp
 xdebug.remote_host => localhost => localhost
-xdebug.remote_mode => req => req
-xdebug.remote_port => 9000 => 9000
-xdebug.remote_autostart => Off => Off
-xdebug.remote_connect_back => Off => Off
 xdebug.remote_log => no value => no value
 xdebug.remote_log_level => 7 => 7
-xdebug.idekey => no value => no value
-xdebug.remote_cookie_expire_time => 3600 => 3600
-xdebug.remote_addr_header => no value => no value
+xdebug.remote_mode => req => req
+xdebug.remote_port => 9000 => 9000
 xdebug.remote_timeout => 200 => 200
+xdebug.scream => Off => Off
+xdebug.show_error_trace => Off => Off
+xdebug.show_exception_trace => Off => Off
+xdebug.show_local_vars => Off => Off
+xdebug.show_mem_delta => Off => Off
+xdebug.trace_enable_trigger => Off => Off
+xdebug.trace_enable_trigger_value => no value => no value
+xdebug.trace_format => 0 => 0
+xdebug.trace_options => 0 => 0
+xdebug.trace_output_dir => /tmp => /tmp
+xdebug.trace_output_name => trace.%c => trace.%c
 xdebug.var_display_max_children => 128 => 128
 xdebug.var_display_max_data => 512 => 512
 xdebug.var_display_max_depth => 3 => 3
-xdebug.cli_color => 0 => 0
-xdebug.scream => Off => Off
-xdebug.gc_stats_enable => Off => Off
-xdebug.gc_stats_output_dir => /tmp => /tmp
-xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
diff --git a/REFLECTION b/REFLECTION
index 9fbc3b9..4dab41e 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,30 +1,15 @@
-Extension [ <persistent> extension #202 xdebug version 2.8.0 ] {
+Extension [ <persistent> extension #189 xdebug version 2.8.1 ] {
 
   - INI {
     Entry [ xdebug.auto_trace <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.trace_enable_trigger <PERDIR,SYSTEM> ]
-      Current = '0'
-    }
-    Entry [ xdebug.trace_enable_trigger_value <PERDIR,SYSTEM> ]
-      Current = ''
-    }
-    Entry [ xdebug.trace_output_dir <ALL> ]
-      Current = '/tmp'
-    }
-    Entry [ xdebug.trace_output_name <ALL> ]
-      Current = 'trace.%c'
-    }
-    Entry [ xdebug.trace_format <ALL> ]
+    Entry [ xdebug.cli_color <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.trace_options <ALL> ]
+    Entry [ xdebug.collect_assignments <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.coverage_enable <SYSTEM> ]
-      Current = '1'
-    }
     Entry [ xdebug.collect_includes <ALL> ]
       Current = '1'
     }
@@ -37,48 +22,12 @@ Extension [ <persistent> extension #202 xdebug version 2.8.0 ] {
     Entry [ xdebug.collect_vars <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.collect_assignments <ALL> ]
-      Current = '0'
+    Entry [ xdebug.coverage_enable <SYSTEM> ]
+      Current = '1'
     }
     Entry [ xdebug.default_enable <ALL> ]
       Current = '1'
     }
-    Entry [ xdebug.file_link_format <ALL> ]
-      Current = ''
-    }
-    Entry [ xdebug.filename_format <ALL> ]
-      Current = ''
-    }
-    Entry [ xdebug.force_display_errors <SYSTEM> ]
-      Current = '0'
-    }
-    Entry [ xdebug.force_error_reporting <SYSTEM> ]
-      Current = '0'
-    }
-    Entry [ xdebug.halt_level <ALL> ]
-      Current = '0'
-    }
-    Entry [ xdebug.max_nesting_level <ALL> ]
-      Current = '256'
-    }
-    Entry [ xdebug.max_stack_frames <ALL> ]
-      Current = '-1'
-    }
-    Entry [ xdebug.overload_var_dump <ALL> ]
-      Current = '2'
-    }
-    Entry [ xdebug.show_error_trace <ALL> ]
-      Current = '0'
-    }
-    Entry [ xdebug.show_exception_trace <ALL> ]
-      Current = '0'
-    }
-    Entry [ xdebug.show_local_vars <ALL> ]
-      Current = '0'
-    }
-    Entry [ xdebug.show_mem_delta <ALL> ]
-      Current = '0'
-    }
     Entry [ xdebug.dump.COOKIE <ALL> ]
       Current = ''
     }
@@ -112,14 +61,50 @@ Extension [ <persistent> extension #202 xdebug version 2.8.0 ] {
     Entry [ xdebug.dump_undefined <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.profiler_enable <PERDIR,SYSTEM> ]
+    Entry [ xdebug.file_link_format <ALL> ]
+      Current = ''
+    }
+    Entry [ xdebug.filename_format <ALL> ]
+      Current = ''
+    }
+    Entry [ xdebug.force_display_errors <SYSTEM> ]
       Current = '0'
     }
-    Entry [ xdebug.profiler_output_dir <PERDIR,SYSTEM> ]
+    Entry [ xdebug.force_error_reporting <SYSTEM> ]
+      Current = '0'
+    }
+    Entry [ xdebug.gc_stats_enable <PERDIR,SYSTEM> ]
+      Current = '0'
+    }
+    Entry [ xdebug.gc_stats_output_dir <PERDIR,SYSTEM> ]
       Current = '/tmp'
     }
-    Entry [ xdebug.profiler_output_name <PERDIR,SYSTEM> ]
-      Current = 'cachegrind.out.%p'
+    Entry [ xdebug.gc_stats_output_name <PERDIR,SYSTEM> ]
+      Current = 'gcstats.%p'
+    }
+    Entry [ xdebug.halt_level <ALL> ]
+      Current = '0'
+    }
+    Entry [ xdebug.idekey <ALL> ]
+      Current = ''
+    }
+    Entry [ xdebug.max_nesting_level <ALL> ]
+      Current = '256'
+    }
+    Entry [ xdebug.max_stack_frames <ALL> ]
+      Current = '-1'
+    }
+    Entry [ xdebug.overload_var_dump <ALL> ]
+      Current = '2'
+    }
+    Entry [ xdebug.profiler_aggregate <PERDIR,SYSTEM> ]
+      Current = '0'
+    }
+    Entry [ xdebug.profiler_append <PERDIR,SYSTEM> ]
+      Current = '0'
+    }
+    Entry [ xdebug.profiler_enable <PERDIR,SYSTEM> ]
+      Current = '0'
     }
     Entry [ xdebug.profiler_enable_trigger <PERDIR,SYSTEM> ]
       Current = '0'
@@ -127,12 +112,24 @@ Extension [ <persistent> extension #202 xdebug version 2.8.0 ] {
     Entry [ xdebug.profiler_enable_trigger_value <PERDIR,SYSTEM> ]
       Current = ''
     }
-    Entry [ xdebug.profiler_append <PERDIR,SYSTEM> ]
+    Entry [ xdebug.profiler_output_dir <PERDIR,SYSTEM> ]
+      Current = '/tmp'
+    }
+    Entry [ xdebug.profiler_output_name <PERDIR,SYSTEM> ]
+      Current = 'cachegrind.out.%p'
+    }
+    Entry [ xdebug.remote_addr_header <ALL> ]
+      Current = ''
+    }
+    Entry [ xdebug.remote_autostart <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.profiler_aggregate <PERDIR,SYSTEM> ]
+    Entry [ xdebug.remote_connect_back <ALL> ]
       Current = '0'
     }
+    Entry [ xdebug.remote_cookie_expire_time <ALL> ]
+      Current = '3600'
+    }
     Entry [ xdebug.remote_enable <PERDIR,SYSTEM> ]
       Current = '0'
     }
@@ -142,35 +139,53 @@ Extension [ <persistent> extension #202 xdebug version 2.8.0 ] {
     Entry [ xdebug.remote_host <ALL> ]
       Current = 'localhost'
     }
+    Entry [ xdebug.remote_log <ALL> ]
+      Current = ''
+    }
+    Entry [ xdebug.remote_log_level <ALL> ]
+      Current = '7'
+    }
     Entry [ xdebug.remote_mode <ALL> ]
       Current = 'req'
     }
     Entry [ xdebug.remote_port <ALL> ]
       Current = '9000'
     }
-    Entry [ xdebug.remote_autostart <ALL> ]
+    Entry [ xdebug.remote_timeout <ALL> ]
+      Current = '200'
+    }
+    Entry [ xdebug.scream <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.remote_connect_back <ALL> ]
+    Entry [ xdebug.show_error_trace <ALL> ]
       Current = '0'
     }
-    Entry [ xdebug.remote_log <ALL> ]
-      Current = ''
+    Entry [ xdebug.show_exception_trace <ALL> ]
+      Current = '0'
     }
-    Entry [ xdebug.remote_log_level <ALL> ]
-      Current = '7'
+    Entry [ xdebug.show_local_vars <ALL> ]
+      Current = '0'
     }
-    Entry [ xdebug.idekey <ALL> ]
-      Current = ''
+    Entry [ xdebug.show_mem_delta <ALL> ]
+      Current = '0'
     }
-    Entry [ xdebug.remote_cookie_expire_time <ALL> ]
-      Current = '3600'
+    Entry [ xdebug.trace_enable_trigger <PERDIR,SYSTEM> ]
+      Current = '0'
     }
-    Entry [ xdebug.remote_addr_header <ALL> ]
+    Entry [ xdebug.trace_enable_trigger_value <PERDIR,SYSTEM> ]
       Current = ''
     }
-    Entry [ xdebug.remote_timeout <ALL> ]
-      Current = '200'
+    Entry [ xdebug.trace_format <ALL> ]
+      Current = '0'
+    }
+    Entry [ xdebug.trace_options <ALL> ]
+      Current = '0'
+    }
+    Entry [ xdebug.trace_output_dir <ALL> ]
+      Current = '/tmp'
+    }
+    Entry [ xdebug.trace_output_name <ALL> ]
+      Current = 'trace.%c'
     }
     Entry [ xdebug.var_display_max_children <ALL> ]
       Current = '128'
@@ -181,39 +196,24 @@ Extension [ <persistent> extension #202 xdebug version 2.8.0 ] {
     Entry [ xdebug.var_display_max_depth <ALL> ]
       Current = '3'
     }
-    Entry [ xdebug.cli_color <ALL> ]
-      Current = '0'
-    }
-    Entry [ xdebug.scream <ALL> ]
-      Current = '0'
-    }
-    Entry [ xdebug.gc_stats_enable <PERDIR,SYSTEM> ]
-      Current = '0'
-    }
-    Entry [ xdebug.gc_stats_output_dir <PERDIR,SYSTEM> ]
-      Current = '/tmp'
-    }
-    Entry [ xdebug.gc_stats_output_name <PERDIR,SYSTEM> ]
-      Current = 'gcstats.%p'
-    }
   }
 
   - Constants [15] {
-    Constant [ integer XDEBUG_TRACE_APPEND ] { 1 }
-    Constant [ integer XDEBUG_TRACE_COMPUTERIZED ] { 2 }
-    Constant [ integer XDEBUG_TRACE_HTML ] { 4 }
-    Constant [ integer XDEBUG_TRACE_NAKED_FILENAME ] { 8 }
-    Constant [ integer XDEBUG_CC_UNUSED ] { 1 }
-    Constant [ integer XDEBUG_CC_DEAD_CODE ] { 2 }
-    Constant [ integer XDEBUG_CC_BRANCH_CHECK ] { 4 }
-    Constant [ integer XDEBUG_STACK_NO_DESC ] { 1 }
-    Constant [ integer XDEBUG_FILTER_TRACING ] { 256 }
-    Constant [ integer XDEBUG_FILTER_CODE_COVERAGE ] { 512 }
-    Constant [ integer XDEBUG_FILTER_NONE ] { 0 }
-    Constant [ integer XDEBUG_PATH_WHITELIST ] { 1 }
-    Constant [ integer XDEBUG_PATH_BLACKLIST ] { 2 }
-    Constant [ integer XDEBUG_NAMESPACE_WHITELIST ] { 17 }
-    Constant [ integer XDEBUG_NAMESPACE_BLACKLIST ] { 18 }
+    Constant [ int XDEBUG_TRACE_APPEND ] { 1 }
+    Constant [ int XDEBUG_TRACE_COMPUTERIZED ] { 2 }
+    Constant [ int XDEBUG_TRACE_HTML ] { 4 }
+    Constant [ int XDEBUG_TRACE_NAKED_FILENAME ] { 8 }
+    Constant [ int XDEBUG_CC_UNUSED ] { 1 }
+    Constant [ int XDEBUG_CC_DEAD_CODE ] { 2 }
+    Constant [ int XDEBUG_CC_BRANCH_CHECK ] { 4 }
+    Constant [ int XDEBUG_STACK_NO_DESC ] { 1 }
+    Constant [ int XDEBUG_FILTER_TRACING ] { 256 }
+    Constant [ int XDEBUG_FILTER_CODE_COVERAGE ] { 512 }
+    Constant [ int XDEBUG_FILTER_NONE ] { 0 }
+    Constant [ int XDEBUG_PATH_WHITELIST ] { 1 }
+    Constant [ int XDEBUG_PATH_BLACKLIST ] { 2 }
+    Constant [ int XDEBUG_NAMESPACE_WHITELIST ] { 17 }
+    Constant [ int XDEBUG_NAMESPACE_BLACKLIST ] { 18 }
   }
 
   - Functions {
diff --git a/php-pecl-xdebug.spec b/php-pecl-xdebug.spec
index bed6071..c922400 100644
--- a/php-pecl-xdebug.spec
+++ b/php-pecl-xdebug.spec
@@ -19,11 +19,11 @@
 
 %global pecl_name   xdebug
 %global with_zts    0%{!?_without_zts:%{?__ztsphp:1}}
-%global gh_commit   1a7976906e8b003645d32a54dbd059ca7e2ed513
+%global gh_commit   cb3a3a4fdf841c53f36548237e81b81c8a57cdf1
 %global gh_short    %(c=%{gh_commit}; echo ${c:0:7})
 #global gh_date     20190614
 %global with_tests  0%{!?_without_tests:1}
-%global upstream_version 2.8.0
+%global upstream_version 2.8.1
 #global upstream_prever  beta2
 #global upstream_lower   beta2
 
@@ -45,6 +45,8 @@ License:        BSD
 URL:            https://xdebug.org/
 Source0:        https://github.com/%{pecl_name}/%{pecl_name}/archive/%{gh_commit}/%{pecl_name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz
 
+Patch0:         https://github.com/xdebug/xdebug/commit/0654240f24f6f619074c205462dbefe9b175c122.patch
+
 BuildRequires:  %{?dtsprefix}gcc
 BuildRequires:  %{?scl_prefix}php-devel > 7
 BuildRequires:  %{?scl_prefix}php-pear
@@ -143,6 +145,8 @@ mv NTS/package.xml .
 %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
 
 cd NTS
+%patch0 -p1
+
 # Check extension version
 ver=$(sed -n '/XDEBUG_VERSION/{s/.* "//;s/".*$//;p}' php_xdebug.h)
 if test "$ver" != "%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then
@@ -301,6 +305,9 @@ fi
 
 
 %changelog
+* Mon Dec  2 2019 Remi Collet <remi@remirepo.net> - 2.8.1-1
+- update to 2.8.1
+
 * Thu Oct 31 2019 Remi Collet <remi@remirepo.net> - 2.8.0-1
 - update to 2.8.0
 
-- 
cgit