2 * Defines of debug / trace /info prints
3 * to make the actual code more readable
5 * COtest prints are just debug
6 * RTAprint prints are trace /info prints
10 #include "parseRTstats.h"
13 #define XTAPRINTcallgraph1 if(pWhenMarked>=1) \
14 {printf("\n XTA Added to Call Graph #%i:", \
16 printf("\t <used flags c/m> <%i/%i> %i\t", \
17 submeth->class->classUsed, \
18 submeth->methodUsed, \
20 printf(" method name ="); \
21 utf_display(submeth->class->name);printf("."); \
22 method_display(submeth);fflush(stdout);}
24 #define XTAPRINTcallgraph2 if(pWhenMarked>=1) { \
25 printf("\n XTA Added to Call Graph #%i:", \
27 printf(" method name ="); fflush(stdout);\
28 utf_display(mi->class->name);printf(".");fflush(stdout); \
29 method_display(mi);fflush(stdout); \
32 #define RTAPRINTcallgraph1 if(pWhenMarked>=1) \
33 {printf("\n Added to Call Graph #%i:", \
35 printf("\t <used flags c/m> <%i/%i> %i\t", \
36 meth->class->classUsed, \
39 printf(" method name ="); \
40 utf_display(meth->class->name);printf("."); \
41 method_display(meth);fflush(stdout);}
44 #define RTAPRINTmarkMethod1 if (pWhenMarked >= 2) { \
45 printf("<%i> Just Marking Method - class: <index=%i>\n", \
46 submeth->methodUsed, \
47 submeth->class->index); \
48 utf_display(submeth->class->name); \
49 method_display(submeth); \
52 #define RTAPRINTmarkMethod1aa if (pWhenMarked >= 2) { \
53 printf("Top Method/Class Abstract -- init found\n"); \
54 method_display(submeth); \
57 #define RTAPRINTmarkMethod1A if (pWhenMarked >= 2) { \
58 printf("Top Method/Class Abstract -- Marking Method & init - & marking class used <%i>\n",class->index); \
59 method_display(submeth); \
62 #define RTAPRINTmarkMethod2 if (pWhenMarked >= 2) { \
63 printf("Class marked Used by Subtype :");utf_display(submeth->name);printf("\n");}
65 #define RTAPRINTmarkSubs1 if (pWhenMarked>=3) { \
66 utf *name = topmethod -> name; \
67 printf("markMethod: "); utf_display(class->name); \
68 printf(".");utf_display(name); printf("\n");}
70 #define RTAPRINTmarkSubs2 if (pWhenMarked>=3) { \
71 printf("markSubs: "); utf_display(subs->name);printf("."); \
72 utf_display(name); printf("\n");}
74 #define RTAPRINT01method if ((pOpcodes == 1) || (pOpcodes == 3)) \
75 {printf("*********************************\n"); fflush(stdout); \
76 printf("PARSE RT method name = <%i/%i>",rt_method->class->classUsed,rt_method->methodUsed); fflush(stdout);\
77 utf_display(rt_method->class->name);printf(".");fflush(stdout); \
78 utf_display(rt_method->name);printf("\n\n"); fflush(stdout);\
79 method_display(rt_method); printf(">\n\n");fflush(stdout);}
81 #define RTAPRINT02opcode if ((pOpcodes == 1) || (pOpcodes == 3)) \
82 {printf("Parse RT p=%i<%i< opcode=<%i> %s\n", \
83 p,rt_jcodelength,opcode,opcode_names[opcode]); \
86 #define RTAPRINT03putstatic1 if (pWhenMarked >= 1) { \
87 class_showconstanti(rt_class,i); \
90 #define RTAPRINT03putstatic1o_OLD if (pWhenMarked >= 1) { \
91 class_showconstanti(rt_class,i); \
92 printf("FMIref = "); \
93 utf_display ( fr->class->name ); \
95 utf_display ( fr->name); \
97 utf_display ( fr->descriptor ); \
98 printf("\n Field ="); \
100 printf(" in class.field =");utf_display(ci->name); printf("."); \
101 utf_display(fr->name);printf("\tPUT/GET STATIC\n"); fflush(stdout); \
102 printf("For %s:",ci->name->text);fflush(stdout); \
103 printf("#methods=%i\n",ci->methodscount); fflush(stdout); \
106 #define RTAPRINT04invokestatic1 if (((pOpcodes == 1) ||(pOpcodes == 3)) || (pWhenMarked >= 2)) { \
107 printf(" method name ="); \
108 utf_display(mi->class->name); printf("."); \
109 utf_display(mi->name);printf("\t<%i>INVOKE STATIC\n",mi->methodUsed); \
112 #define RTAPRINT05invokestatic2 if (pWhenMarked >= 2) { \
113 printf("Class marked Used :"); \
114 utf_display(rt_class->name); \
115 printf("INVOKESTATIC\n"); fflush(stdout);}
118 #define RTAPRINT06Ainvoke_spec_super1 if (pWhenMarked >= 1) { \
119 printf("class flags:"); fflush(stdout); \
120 utf_display(ci->name); \
121 printflags(ci->flags); \
122 printf("\n"); fflush(stdout); \
123 printf("method flags:"); fflush(stdout); \
124 utf_display(mi->name); \
125 printflags(mi->flags); \
126 printf("\n"); fflush(stdout); \
129 #define RTAPRINT06Binvoke_spec_super2 if (pWhenMarked >= 1) { \
130 printf("SUPERRRRRRRRRRRRRRR"); \
131 utf_display(mi->descriptor); \
132 printf(" class super ="); fflush(stdout); \
133 utf_display(rt_class->super->name); fflush(stdout); \
134 printf("\t ==? "); fflush(stdout); \
135 printf(" class =");fflush(stdout); \
136 utf_display(mi->class->name); fflush(stdout); \
137 printf("\n"); fflush(stdout); \
138 printf("Ainterface count = "); fflush(stdout); \
139 printf(" %i\n", ci -> interfacescount); \
143 #define RTAPRINT06Binvoke_spec_init if (pWhenMarked >= 1) { \
144 printf("Binterface count = "); fflush(stdout); \
145 printf(" %i\n", ci -> interfacescount); \
149 #define RTAPRINT06CXTAinvoke_spec_init1 if (pWhenMarked >= 1) { \
150 printf("\n XTA Added to Call Graph #%i:", \
152 printf(" method name ="); \
153 utf_display(mi->class->name);printf("."); \
154 method_display(mi);fflush(stdout); \
158 #define RTAPRINT06invoke_spec_virt1 if ((pOpcodes == 1) ||(pOpcodes == 3) || (pWhenMarked >= 2)) { \
159 printf("INVOKE method name <%i/%i> =",mi->class->classUsed,mi->methodUsed); \
160 utf_display(mi->class->name); printf("."); \
161 method_display(mi); \
164 #define RTAPRINT07invoke_spec_virt2 if ((pOpcodes == 1) ||(pOpcodes == 3) || (pWhenMarked >= 1)) { \
165 utf_display(mi->class->name);printf("."); \
166 method_display(mi); }
168 #define RTAPRINT08AinvokeInterface0 if (pWhenMarked >= 2) { \
169 utf_display(mi->class->name); \
170 method_display(mi); printf("\n");} \
171 if (pWhenMarked >= 1) { \
172 printf("INTERFACE CLASS <");fflush(stdout); \
173 utf_display(mi->class->name); fflush(stdout); \
174 printf("> used flag=%i\n", mi->class->classUsed); \
176 method_display(mi); \
180 #define RTAPRINT08invokeInterface1 if (pWhenMarked >= 1) { \
181 printf("Implemented By classes :\n"); \
183 if (subs == NULL) printf(" \tNOT IMPLEMENTED !!!\n"); \
187 #define RTAPRINT09invokeInterface2 if (pWhenMarked >= 3) { \
188 printf("\t");utf_display(isubs->name); printf(" <%i>\n",isubs->classUsed); \
191 #define RTAPRINT10new if (pWhenMarked >= 2) { \
192 printf("NEW Class marked Used :"); fflush(stdout);\
193 utf_display(ci->name); \
196 #define RTAPRINT10newXTA if (pWhenMarked >= 1) { \
197 utf_display(ci->name);printf(" XTA_NEW\n"); \
198 printSet(rt_method->xta->XTAclassSet->head); \
201 #define RTAPRINT11addedtoCallgraph if (pWhenMarked >= 1){ \
202 printf("\n<Added to Call Graph #%i:",methRTlast); \
204 printf(" method name =");utf_display(m->class->name); printf("."); \
205 utf_display(m->name);printf("\n"); \
208 #define RTAPRINT11addedtoCallgraph2 if (pWhenMarked >= 1){ \
209 utf_display(ci->name); printf("."); \
210 method_display(m); printf("\t\t"); \
211 printf("<init> W/O new -- Add marked methods...\n<"); \
214 #define RTAPRINT12aNative if (pWhenMarked >= 1) { \
215 printf("Native = "); fflush(stdout); \
216 utf_display(rt_class->name); printf("."); fflush(stdout); \
217 utf_display(rt_method->name); printf(" "); fflush(stdout); \
218 utf_display(rt_descriptor); fflush(stdout); printf("\n"); \
221 #define RTAPRINT12bAbstractNative if (pOpcodes == 1) { \
222 printf("\nPROCESS_abstract or native\n"); \
223 utf_display(rt_method->class->name); printf("."); \
224 method_display(rt_method); printf("\n"); fflush(stdout); \
227 #define RTAPRINT12Callgraph if (pCallgraph >= 3) { \
228 printf("RTA Callgraph after RTA Call\n"); \
232 #define RTAPRINT13Heirarchy if (pClassHeir >= 3) { \
233 printf("RTA Classheirarchy after RTA Call\n"); \
234 printRThierarchyInfo(m); \
237 #define RTAPRINT14CallgraphLast if (pCallgraph >= 2) { \
238 printf("RTA Callgraph after last method in callgraph - so far >888888888888888888\n"); \
242 #define RTAPRINT15HeirarchyiLast if (pClassHeir >= 2) { \
243 printf("RTA Classheirarchy after last method in callgraph - so far >888888888888888888\n"); \
244 printRThierarchyInfo(m); \
247 #define RTAPRINT16stats1 if (pStats == 2) { \
248 printf("OBJECT SUBS ARE_THERE 1\n"); \
249 printObjectClassHeirarchy(class_java_lang_Object); \