2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
12 #define Purify_Begincode _start
14 void Purify_Init (void)
16 extern void Purify_Begincode (void);
17 extern void Purify_Endcode (void);
18 extern int Purify_Beginrodata
;
19 extern int Purify_Endrodata
;
20 extern int Purify_Beginbss
;
21 extern int Purify_Endbss
;
22 extern int Purify_Begindata
;
23 extern int Purify_Enddata
;
24 extern int * Purify_Beginstaticdata
;
25 extern int * Purify_Endstaticdata
;
31 printf ("Purify active\n");
34 Purify_Functionname
= "_start";
37 ptr
= (&Purify_Beginrodata
)+1;
38 size
= (long)(&Purify_Endrodata
) - (long)(&Purify_Beginrodata
) - 4;
42 node
= Purify_AddMemory (ptr
44 , PURIFY_MemFlag_Readable
48 node
->data
= "rodata";
51 ptr
= (&Purify_Beginbss
)+1;
52 size
= (long)(&Purify_Endbss
) - (long)(&Purify_Beginbss
) - 4;
56 node
= Purify_AddMemory (ptr
58 , PURIFY_MemFlag_Readable
59 | PURIFY_MemFlag_Writable
66 ptr
= (&Purify_Begindata
)+1;
67 size
= (long)(&Purify_Enddata
) - (long)(&Purify_Begindata
) - 4;
71 node
= Purify_AddMemory (ptr
73 , PURIFY_MemFlag_Readable
74 | PURIFY_MemFlag_Writable
81 size
= (long)(Purify_Endstaticdata
) - (long)(Purify_Beginstaticdata
) - 4;
85 node
= Purify_AddMemory (Purify_Beginstaticdata
+1
87 , PURIFY_MemFlag_Readable
88 | PURIFY_MemFlag_Writable
92 node
->data
= "static data";
95 size
= (long)Purify_Endcode
- (long)Purify_Begincode
;
99 node
= Purify_AddMemory (Purify_Begincode
101 , PURIFY_MemFlag_Readable
102 , PURIFY_MemType_Code
108 node
= Purify_AddMemory (__ctype_b
109 , sizeof(__ctype_b
[0])*256
110 , PURIFY_MemFlag_Readable
111 , PURIFY_MemType_Data
114 node
->data
= "ctype array";
116 node
= Purify_AddMemory (__ctype_tolower
117 , sizeof(__ctype_tolower
[0])*256
118 , PURIFY_MemFlag_Readable
119 , PURIFY_MemType_Data
122 node
->data
= "tolower array";
124 node
= Purify_AddMemory (__ctype_toupper
125 , sizeof(__ctype_toupper
[0])*256
126 , PURIFY_MemFlag_Readable
127 , PURIFY_MemType_Data
130 node
->data
= "toupper array";
132 #define ADDGLOBAL(var,name) \
133 node = Purify_AddMemory (&(var) \
135 , PURIFY_MemFlag_Readable|PURIFY_MemFlag_Writable \
136 , PURIFY_MemType_Data \
141 ADDGLOBAL(errno
,"errno");
143 node
= Purify_AddMemory (stdin
145 , PURIFY_MemFlag_Readable
146 , PURIFY_MemType_Data
149 node
->data
= "stdin";
151 node
= Purify_AddMemory (stdout
153 , PURIFY_MemFlag_Readable
154 , PURIFY_MemType_Data
157 node
->data
= "stdout";
159 Purify_PrintMemory ();
162 void Purify_Exit (void)
164 printf ("Purify finished\n");
166 Purify_MemoryExit ();