2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
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 +----------------------------------------------------------------------+
16 #ifndef incl_HHBBC_DEBUG_H_
17 #define incl_HHBBC_DEBUG_H_
19 #include "hphp/util/trace.h"
21 #include "hphp/hhbbc/misc.h"
22 #include "hphp/hhbbc/representation.h"
23 #include "hphp/hhbbc/unit-util.h"
25 namespace HPHP
{ namespace HHBBC
{
27 //////////////////////////////////////////////////////////////////////
30 * If the hhbbc_dump trace module is on, dump the entire program to a
31 * temporary directory as readable text.
33 void debug_dump_program(const Index
&, const php::Program
&);
36 * Utilities for printing the state of the program after various
40 inline void banner(const char* what
) {
42 FTRACE(2, "{:-^70}\n", what
);
45 inline void state_after(const char* when
, const php::Program
& program
) {
48 for (auto& u
: program
.units
) {
49 Trace::Bump bumper
{Trace::hhbbc
, kSystemLibBump
, is_systemlib_part(*u
)};
50 FTRACE(4, "{}", show(*u
));
55 //////////////////////////////////////////////////////////////////////