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
11 #define XTAPRINTcallgraph1 if(pWhenMarked>=1) \
12 {printf("\n XTA Added to Call Graph #%i:", \
14 printf("\t <used flags c/m> <%i/%i> %i\t", \
15 submeth->class->classUsed, \
16 submeth->methodUsed, \
18 printf(" method name ="); \
19 utf_display(submeth->class->name);printf("."); \
20 method_display(submeth);fflush(stdout);}
22 #define XTAPRINTcallgraph2 if(pWhenMarked>=1) { \
23 printf("\n XTA Added to Call Graph #%i:", \
25 printf(" method name ="); fflush(stdout);\
26 utf_display(mi->class->name);printf(".");fflush(stdout); \
27 method_display(mi);fflush(stdout); \
30 #define RTAPRINTcallgraph1 if(pWhenMarked>=1) \
31 {printf("\n Added to Call Graph #%i:", \
33 printf("\t <used flags c/m> <%i/%i> %i\t", \
34 meth->class->classUsed, \
37 printf(" method name ="); \
38 utf_display(meth->class->name);printf("."); \
39 method_display(meth);fflush(stdout);}
42 #define RTAPRINTmarkMethod1 if (pWhenMarked >= 2) { \
43 printf("<%i> Just Marking Method - class: <index=%i>\n", \
44 submeth->methodUsed, \
45 submeth->class->index); \
46 utf_display(submeth->class->name); \
47 method_display(submeth); \
50 #define RTAPRINTmarkMethod1aa if (pWhenMarked >= 2) { \
51 printf("Top Method/Class Abstract -- init found\n"); \
52 method_display(submeth); \
55 #define RTAPRINTmarkMethod1A if (pWhenMarked >= 2) { \
56 printf("Top Method/Class Abstract -- Marking Method & init - & marking class used <%i>\n",class->index); \
57 method_display(submeth); \
60 #define RTAPRINTmarkMethod2 if (pWhenMarked >= 2) { \
61 printf("Class marked Used by Subtype :");utf_display(submeth->name);printf("\n");}
63 #define RTAPRINTmarkSubs1 if (pWhenMarked>=3) { \
64 utf *name = topmethod -> name; \
65 printf("markMethod: "); utf_display(class->name); \
66 printf(".");utf_display(name); printf("\n");}
68 #define RTAPRINTmarkSubs2 if (pWhenMarked>=3) { \
69 printf("markSubs: "); utf_display(subs->name);printf("."); \
70 utf_display(name); printf("\n");}
72 #define RTAPRINT01method if ((pOpcodes == 1) || (pOpcodes == 3)) \
73 {printf("*********************************\n"); \
74 printf("PARSE RT method name = <%i/%i>",rt_method->class->classUsed,rt_method->methodUsed); \
75 utf_display(rt_method->class->name);printf("."); \
76 utf_display(rt_method->name);printf("\n\n"); \
77 method_display(rt_method); printf(">\n\n");fflush(stdout);}
79 #define RTAPRINT02opcode if ((pOpcodes == 1) || (pOpcodes == 3)) \
80 {printf("Parse RT p=%i<%i< opcode=<%i> %s\n", \
81 p,rt_jcodelength,opcode,opcode_names[opcode]); \
84 #define RTAPRINT03putstatic1 if (pWhenMarked >= 1) { \
85 class_showconstanti(rt_class,i); \
88 #define RTAPRINT03putstatic1o_OLD if (pWhenMarked >= 1) { \
89 class_showconstanti(rt_class,i); \
90 printf("FMIref = "); \
91 utf_display ( fr->class->name ); \
93 utf_display ( fr->name); \
95 utf_display ( fr->descriptor ); \
96 printf("\n Field ="); \
98 printf(" in class.field =");utf_display(ci->name); printf("."); \
99 utf_display(fr->name);printf("\tPUT/GET STATIC\n"); fflush(stdout); \
100 printf("For %s:",ci->name->text);fflush(stdout); \
101 printf("#methods=%i\n",ci->methodscount); fflush(stdout); \
104 #define RTAPRINT04invokestatic1 if (((pOpcodes == 1) ||(pOpcodes == 3)) || (pWhenMarked >= 2)) { \
105 printf(" method name ="); \
106 utf_display(mi->class->name); printf("."); \
107 utf_display(mi->name);printf("\t<%i>INVOKE STATIC\n",mi->methodUsed); \
110 #define RTAPRINT05invokestatic2 if (pWhenMarked >= 2) { \
111 printf("Class marked Used :"); \
112 utf_display(rt_class->name); \
113 printf("INVOKESTATIC\n"); fflush(stdout);}
116 #define RTAPRINT06Ainvoke_spec_super1 if (pWhenMarked >= 1) { \
117 printf("class flags:"); fflush(stdout); \
118 utf_display(ci->name); \
119 printflags(ci->flags); \
120 printf("\n"); fflush(stdout); \
121 printf("method flags:"); fflush(stdout); \
122 utf_display(mi->name); \
123 printflags(mi->flags); \
124 printf("\n"); fflush(stdout); \
127 #define RTAPRINT06Binvoke_spec_super2 if (pWhenMarked >= 1) { \
128 printf("SUPERRRRRRRRRRRRRRR"); \
129 utf_display(mi->descriptor); \
130 printf(" class super ="); fflush(stdout); \
131 utf_display(rt_class->super->name); fflush(stdout); \
132 printf("\t ==? "); fflush(stdout); \
133 printf(" class =");fflush(stdout); \
134 utf_display(mi->class->name); fflush(stdout); \
135 printf("\n"); fflush(stdout); \
136 printf("Ainterface count = "); fflush(stdout); \
137 printf(" %i\n", ci -> interfacescount); \
141 #define RTAPRINT06Binvoke_spec_init if (pWhenMarked >= 1) { \
142 printf("Binterface count = "); fflush(stdout); \
143 printf(" %i\n", ci -> interfacescount); \
147 #define RTAPRINT06CXTAinvoke_spec_init1 if (pWhenMarked >= 1) { \
148 printf("\n XTA Added to Call Graph #%i:", \
150 printf(" method name ="); \
151 utf_display(mi->class->name);printf("."); \
152 method_display(mi);fflush(stdout); \
156 #define RTAPRINT06invoke_spec_virt1 if ((pOpcodes == 1) ||(pOpcodes == 3) || (pWhenMarked >= 2)) { \
157 printf("INVOKE method name <%i/%i> =",mi->class->classUsed,mi->methodUsed); \
158 utf_display(mi->class->name); printf("."); \
159 method_display(mi); \
162 #define RTAPRINT07invoke_spec_virt2 if (pWhenMarked >= 1) { \
163 printf("Calling MarkSubs from SPECIAL/VIRTUAL :"); \
164 utf_display(mi->class->name);printf(".V."); \
165 method_display(mi); }
167 #define RTAPRINT08AinvokeInterface0 if (pWhenMarked >= 2) { \
168 utf_display(mi->class->name); \
169 method_display(mi); printf("\n");} \
170 if (pWhenMarked >= 1) { \
171 printf("INTERFACE CLASS <");fflush(stdout); \
172 utf_display(mi->class->name); fflush(stdout); \
173 printf("> used flag=%i\n", mi->class->classUsed); \
175 method_display(mi); \
177 printf("AAAAA\n");fflush(stdout); \
180 #define RTAPRINT08invokeInterface1 if (pWhenMarked >= 1) { \
181 printf("Implemented By classes :\n"); \
183 if (subs == NULL) printf(" \tNOT IMPLEMENTED !!!\n"); \
184 printf("ZZZZZ\n");fflush(stdout); \
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 unRTclassHeirCnt=0; \
251 printObjectClassHeirarchy(class_java_lang_Object); \
252 printf("\n END of unanalysed Class Heirarchy: #%i classes / #%i methods\n\n", \
253 unRTclassHeirCnt,unRTmethodCnt); \