php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_vm_trace_lines.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.00 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.zend.com/license/2_00.txt. |
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Dmitry Stogov <dmitry@php.net> |
16 +----------------------------------------------------------------------+
17*/
18
19#include "zend_sort.h"
20
21#define VM_TRACE(op) zend_vm_trace(execute_data, opline);
22#define VM_TRACE_START() zend_vm_trace_init();
23#define VM_TRACE_END() zend_vm_trace_finish();
24
25static FILE *vm_trace_file;
26
27static void zend_vm_trace(const zend_execute_data *execute_data, const zend_op *opline)
28{
29 if (EX(func) && EX(func)->op_array.filename) {
30 fprintf(vm_trace_file, "%s:%d\n", ZSTR_VAL(EX(func)->op_array.filename), opline->lineno);
31 }
32}
33
34static void zend_vm_trace_finish(void)
35{
36 fclose(vm_trace_file);
37}
38
39static void zend_vm_trace_init(void)
40{
41 vm_trace_file = fopen("zend_vm_trace.log", "w+");
42}
fprintf($stream, string $format, mixed ... $values)
fclose($stream)
fopen(string $filename, string $mode, bool $use_include_path=false, $context=null)
uint32_t lineno
execute_data func
struct _zend_op zend_op
#define EX(element)
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
struct _zend_execute_data zend_execute_data
Definition zend_types.h:91
execute_data