com php-src: improve debugability in TS debug builds: TSRM/TSRM.h

From: Date: Tue, 17 Feb 2015 18:15:22 +0000
Subject: com php-src: improve debugability in TS debug builds: TSRM/TSRM.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-84966@lists.php.net to get a copy of this message
Commit: d428bf2d4edab232690b64977aaf0a3b15585843 Author: Anatol Belski <ab@php.net> Tue, 17 Feb 2015 19:15:22 +0100 Parents: 31287f0317981ccd4ce38a6e0e128c6504fb1101 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d428bf2d4edab232690b64977aaf0a3b15585843 Log: improve debugability in TS debug builds gdb seems to be not always able to fetch the correct context for thread locals. Thus, the "if (TSRMLS_CACHE)" clause causes gdb to show crashes which aren't recognized neither with helgrind nor in release builds. This is reproducable by setting breakpoints on the exact line where PHP has a tsrm_get_ls_cache() call. Changed paths: M TSRM/TSRM.h Diff: diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index cdb6e87..859b3fa 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -170,7 +170,11 @@ TSRM_API void *tsrm_get_ls_cache(void); #define TSRMG_STATIC(id, type, element) (((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) #define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE #define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL +#if ZEND_DEBUG +#define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache() +#else #define TSRMLS_CACHE_UPDATE() if (!TSRMLS_CACHE) TSRMLS_CACHE = tsrm_get_ls_cache() +#endif #define TSRMLS_CACHE _tsrm_ls_cache /* BC only */

« previous php.cvs (#84966) next »