New PHP5 APC - version 3.0.19, using PHP5 5.2.0-8+etch11,
[php5-apc.git] / apc_debug.c
1 /*
2   +----------------------------------------------------------------------+
3   | APC                                                                  |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 2008 The PHP Group                                     |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP 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.php.net/license/3_01.txt                                  |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Authors: Daniel Cowgill <dcowgill@communityconnect.com>              |
16   |          Arun C. Murthy <arunc@yahoo-inc.com>                        |
17   |          Gopal Vijayaraghavan <gopalv@yahoo-inc.com>                 |
18   +----------------------------------------------------------------------+
19
20    This software was contributed to PHP by Community Connect Inc. in 2002
21    and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
22    Future revisions and derivatives of this source code must acknowledge
23    Community Connect Inc. as the original contributor of this module by
24    leaving this note intact in the source code.
25
26    All other licensing and usage conditions are those of the PHP Group.
27 */
28
29 /* $Id: apc_debug.c,v 3.6.2.1 2008/05/11 18:57:00 rasmus Exp $ */
30 #include "apc.h"
31 #include <stdio.h>
32 #include "zend_compile.h"
33
34 #ifdef __DEBUG_APC__
35
36 #include <dlfcn.h>
37
38 /* keep track of vld_dump_oparray() signature */
39 typedef void (*vld_dump_f) (zend_op_array * TSRMLS_DC);
40
41 #endif
42
43 void dump(zend_op_array *op_array TSRMLS_DC)
44 {
45 #ifdef __DEBUG_APC__
46         vld_dump_f dump_op_array = dlsym(NULL, "vld_dump_oparray");
47
48         if(dump_op_array)
49         {
50                 dump_op_array(op_array TSRMLS_CC); 
51         }
52         else
53         {
54                 apc_wprint("vld is not installed or something even worse.");
55         }
56 #endif
57 }