Fixed dtrace support

This commit is contained in:
Dmitry Stogov 2014-07-22 11:12:49 +04:00
parent 6cc487df2c
commit ea17b018d8
2 changed files with 10 additions and 6 deletions

View file

@ -26,8 +26,13 @@
/* PHP DTrace probes {{{ */
static inline const char *dtrace_get_executed_filename(TSRMLS_D)
{
if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
return EG(current_execute_data)->op_array->filename;
zend_execute_data *ex = EG(current_execute_data);
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
ex = ex->prev_execute_data;
}
if (ex) {
return ex->func->op_array.filename->val;
} else {
return zend_get_executed_filename(TSRMLS_C);
}

View file

@ -88,12 +88,11 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
{
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
const char *classname;
zend_uint name_len;
zend_string *classname;
if (exception != NULL) {
zend_get_object_classname(Z_OBJ_P(exception), &classname, &name_len TSRMLS_CC);
DTRACE_EXCEPTION_THROWN((char *)classname);
classname = zend_get_object_classname(Z_OBJ_P(exception) TSRMLS_CC);
DTRACE_EXCEPTION_THROWN(classname->val);
} else {
DTRACE_EXCEPTION_THROWN(NULL);
}