1 #include "art_defs.h"
2 #ifdef ART_DEBUG
3 #include "art_struct.h"
4 #include "art_dump_tool.h" // bool2yn()
5 
6 #ifdef _WIN32
7 #include <stddef.h> /* size_t */
8 #else
9 #include <unistd.h> /* size_t, ssize_t */
10 #endif
11 
12 #include <iostream>
13 
dump(size_t ntabs)14 void CExpr::dump(size_t ntabs){
15     size_t t;
16     string tabs;
17     for(t = 0; t < ntabs; t++) tabs += '\t';
18 
19     cout << tabs << "oper = " << oper << endl;
20     cout << tabs << "type = " << type << endl;
21     cout << tabs << "value = " << value << endl;
22 }
23 
dump(size_t ntabs)24 void CArg::dump(size_t ntabs){
25     size_t t;
26     string tabs;
27     for(t = 0; t < ntabs; t++) tabs += '\t';
28 
29     cout << tabs << "type = " << type << endl;
30     cout << tabs << "name = " << name << endl;
31 }
32 
dump(size_t ntabs)33 void CTor::dump(size_t ntabs){
34     size_t t, size;
35     string tabs;
36     for(t = 0; t < ntabs; t++) tabs += '\t';
37 
38     cout << tabs << "name = " << name << endl;
39     for(t = 0, size = args.size(); t < size; t++){
40         cout << tabs << "(CArg)args[" << t << "]:" << endl;
41         args[t].dump(ntabs + 1);
42     }
43     cout << tabs << "float_arg_n1 = " << float_arg_n1 << endl;
44     cout << tabs << "float_arg_n2 = " << float_arg_n2 << endl;
45     cout << tabs << "validateDom_before:" << endl;
46     for(t = 0, size = validateDom_before.size(); t < size; t++){
47         cout << tabs << "[" << t << "] ";
48         cout << validateDom_before[t] << endl;
49     }
50     if(!is_handle_arg_out){
51         cout << tabs << "handle_arg_out = n/a" << endl;
52     }
53     else    {
54         cout << tabs << "handle_arg_out = " <<  handle_arg_out << endl;
55     }
56     cout << tabs << "badRetCode:" << endl;
57     badRetCode.dump(ntabs + 1);
58     cout << tabs << "cpp_alias: " << cpp_alias << endl;
59 }
60 
dump(size_t ntabs)61 void CDomain::dump(size_t ntabs){
62     size_t t, size;
63     string tabs;
64     for(t = 0; t < ntabs; t++) tabs += '\t';
65 
66     cout << tabs << "name = " << handle << endl;
67     cout << tabs << "float_handle = " << bool2yn(float_handle) << endl;
68     cout << tabs << "handle = " << handle << endl;
69     cout << tabs << "(CExpr)bad_handle:" << endl;
70     bad_handle.dump(ntabs + 1);
71     cout << tabs << "includes:" << endl;
72     for(t = 0, size = includes.size(); t < size; t++){
73         cout << tabs << "[" << t << "] ";
74         cout << includes[t] << endl;
75     }
76     for(t = 0, size = allocators.size(); t < size; t++){
77         cout << tabs << "allocators[" << t << "]:" << endl;
78         allocators[t].dump(ntabs + 1);
79     }
80     for(t = 0, size = deallocators.size(); t < size; t++){
81         cout << tabs << "deallocators[" << t << "]:" << endl;
82         deallocators[t].dump(ntabs + 1);
83     }
84     for(t = 0, size = reallocators.size(); t < size; t++){
85         cout << tabs << "reallocators[" << t << "]:" << endl;
86         reallocators[t].dump(ntabs + 1);
87     }
88     for(t = 0, size = operators.size(); t < size; t++){
89         cout << tabs << "operators[" << t << "]:" << endl;
90         operators[t].dump(ntabs + 1);
91     }
92 }
93 
dump(void)94 void CTemplate::dump(void){
95     size_t t, size;
96     cout << "name = " << name << endl;
97     cout << "art_prefix = " << prefix << endl;
98     cout << "errlogmode = " << errlogmode << endl;
99     cout << "trap_on_io_err = " << bool2yn(trap_on_io_err) << endl;
100     cout << "remote_mode = " << bool2yn(remote_mode) << endl;
101     cout << "force_flush = " << bool2yn(force_flush) << endl;
102     cout << "multithreaded = " << bool2yn(multithreaded) << endl;
103     cout << "threading = " << threading << endl;
104     cout << "compiler_type = " << compiler_type << endl;
105     cout << "trace_target = " << trace_target << endl;
106     for(t = 0, size = domains.size(); t < size; t++){
107         cout << "domains[" << t << "]:" << endl;
108         domains[t].dump(1);
109     }
110     for(t = 0, size = specialTors.size(); t < size; t++){
111         cout << "specialTor[" << t << "]:" << endl;
112         specialTors[t].dump(1);
113     }
114 }
115 #endif
116