]>
Commit | Line | Data |
---|---|---|
ba4ad400 DM |
1 | Consider compiling test.c, with this content: |
2 | VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV | |
3 | #include "test.h" | |
4 | ||
5 | int | |
6 | main (int argc, char **argv) | |
7 | { | |
8 | int a = PLUS (1,2); | |
9 | int b = PLUS (3,4); | |
10 | return 0; | |
11 | } | |
12 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
13 | ||
14 | ...where test.h has this content: | |
15 | VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV | |
16 | extern int foo (); | |
17 | ||
18 | #define PLUS(A, B) A + B | |
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
20 | ||
21 | ||
22 | The undocumented -fdump-internal-locations option outputs this information | |
23 | to stderr, showing what each source_location value means. Source code | |
24 | lines are quoted, showing both per-line source_location values and | |
25 | per-line&column source_location values (written vertically under the | |
26 | corresponding character of source code). | |
27 | ||
28 | VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV | |
29 | RESERVED LOCATIONS | |
30 | source_location interval: 0 <= loc < 2 | |
31 | ||
32 | ORDINARY MAP: 0 | |
ebedc9a3 | 33 | source_location interval: 32 <= loc < 64 |
ba4ad400 DM |
34 | file: test.c |
35 | starting at line: 1 | |
ebedc9a3 DM |
36 | column bits: 12 |
37 | range bits: 5 | |
38 | test.c: 1|loc: 32|#include "test.h" | |
39 | |69269258258148147 | |
40 | |46802468024680246 | |
ba4ad400 DM |
41 | |
42 | ORDINARY MAP: 1 | |
ebedc9a3 | 43 | source_location interval: 64 <= loc < 96 |
ba4ad400 DM |
44 | file: <built-in> |
45 | starting at line: 0 | |
46 | column bits: 0 | |
ebedc9a3 | 47 | range bits: 0 |
ba4ad400 DM |
48 | |
49 | ORDINARY MAP: 2 | |
ebedc9a3 | 50 | source_location interval: 96 <= loc < 128 |
ba4ad400 DM |
51 | file: <command-line> |
52 | starting at line: 0 | |
53 | column bits: 0 | |
ebedc9a3 | 54 | range bits: 0 |
ba4ad400 DM |
55 | |
56 | ORDINARY MAP: 3 | |
ebedc9a3 | 57 | source_location interval: 128 <= loc < 160128 |
ba4ad400 DM |
58 | file: /usr/include/stdc-predef.h |
59 | starting at line: 1 | |
ebedc9a3 DM |
60 | column bits: 12 |
61 | range bits: 5 | |
ba4ad400 DM |
62 | (contents of /usr/include/stdc-predef.h snipped for brevity) |
63 | ||
64 | ORDINARY MAP: 4 | |
ebedc9a3 | 65 | source_location interval: 160128 <= loc < 160160 |
ba4ad400 | 66 | file: <command-line> |
ebedc9a3 DM |
67 | starting at line: 32 |
68 | column bits: 12 | |
69 | range bits: 5 | |
ba4ad400 DM |
70 | |
71 | ORDINARY MAP: 5 | |
ebedc9a3 | 72 | source_location interval: 160160 <= loc < 164256 |
ba4ad400 DM |
73 | file: test.c |
74 | starting at line: 1 | |
ebedc9a3 DM |
75 | column bits: 12 |
76 | range bits: 5 | |
77 | test.c: 1|loc:160160|#include "test.h" | |
ba4ad400 | 78 | |00000000000000000 |
ebedc9a3 DM |
79 | |12223334445556667 |
80 | |92582581481470470 | |
81 | |24680246802468024 | |
ba4ad400 DM |
82 | |
83 | ORDINARY MAP: 6 | |
ebedc9a3 | 84 | source_location interval: 164256 <= loc < 173280 |
ba4ad400 DM |
85 | file: test.h |
86 | starting at line: 1 | |
ebedc9a3 DM |
87 | column bits: 12 |
88 | range bits: 5 | |
89 | test.h: 1|loc:164256|extern int foo (); | |
90 | |444444444444444444 | |
91 | |233344455566677788 | |
92 | |825814814704703603 | |
93 | |802468024680246802 | |
94 | test.h: 2|loc:168352| | |
ba4ad400 DM |
95 | | |
96 | | | |
97 | | | |
98 | | | |
ebedc9a3 DM |
99 | test.h: 3|loc:172448|#define PLUS(A, B) A + B |
100 | |222222222222222223333333 | |
101 | |455566677788889990001112 | |
102 | |814704703603692692582581 | |
103 | |024680246802468024680246 | |
ba4ad400 DM |
104 | |
105 | ORDINARY MAP: 7 | |
ebedc9a3 | 106 | source_location interval: 173280 <= loc < 202016 |
ba4ad400 DM |
107 | file: test.c |
108 | starting at line: 2 | |
ebedc9a3 DM |
109 | column bits: 12 |
110 | range bits: 5 | |
111 | test.c: 2|loc:173280| | |
ba4ad400 DM |
112 | | |
113 | | | |
114 | | | |
115 | | | |
ebedc9a3 DM |
116 | test.c: 3|loc:177376|int |
117 | |777 | |
ba4ad400 | 118 | |444 |
ebedc9a3 DM |
119 | |047 |
120 | |802 | |
121 | test.c: 4|loc:181472|main (int argc, char **argv) | |
122 | |1111111111111111222222222222 | |
123 | |5556666777888999000111222333 | |
124 | |0360369269258258148147047036 | |
125 | |4680246802468024680246802468 | |
126 | test.c: 5|loc:185568|{ | |
ba4ad400 | 127 | |5 |
ba4ad400 | 128 | |6 |
ebedc9a3 DM |
129 | |0 |
130 | |0 | |
131 | test.c: 6|loc:189664| int a = PLUS (1,2); | |
132 | |999999999900000000000 | |
133 | |677788899900011122233 | |
134 | |926925825814814704703 | |
135 | |680246802468024680246 | |
136 | test.c: 7|loc:193760| int b = PLUS (3,4); | |
137 | |333333344444444444444 | |
138 | |788899900011122233344 | |
139 | |925825814814704703603 | |
140 | |246802468024680246802 | |
141 | test.c: 8|loc:197856| return 0; | |
142 | |77778888888 | |
143 | |89990001112 | |
144 | |82581481470 | |
145 | |80246802468 | |
146 | test.c: 9|loc:201952|} | |
ba4ad400 | 147 | |1 |
ebedc9a3 DM |
148 | |9 |
149 | |8 | |
150 | |4 | |
ba4ad400 DM |
151 | |
152 | UNALLOCATED LOCATIONS | |
ebedc9a3 | 153 | source_location interval: 202016 <= loc < 2147483633 |
ba4ad400 DM |
154 | |
155 | MACRO 1: PLUS (7 tokens) | |
156 | source_location interval: 2147483633 <= loc < 2147483640 | |
ebedc9a3 | 157 | test.c:7:11: note: expansion point is location 194115 |
ba4ad400 | 158 | int b = PLUS (3,4); |
ebedc9a3 DM |
159 | ^~~~ |
160 | ||
ba4ad400 DM |
161 | map->start_location: 2147483633 |
162 | macro_locations: | |
ebedc9a3 DM |
163 | 0: 194304, 173088 |
164 | test.c:7:17: note: token 0 has x-location == 194304 | |
ba4ad400 DM |
165 | int b = PLUS (3,4); |
166 | ^ | |
ebedc9a3 DM |
167 | |
168 | test.c:7:17: note: token 0 has y-location == 173088 | |
169 | 1: 173152, 173152 | |
ba4ad400 | 170 | In file included from test.c:1:0: |
ebedc9a3 | 171 | test.h:3:22: note: token 1 has x-location == y-location == 173152 |
ba4ad400 DM |
172 | #define PLUS(A, B) A + B |
173 | ^ | |
ebedc9a3 DM |
174 | |
175 | 2: 194368, 173216 | |
176 | test.c:7:19: note: token 2 has x-location == 194368 | |
ba4ad400 DM |
177 | int b = PLUS (3,4); |
178 | ^ | |
ebedc9a3 DM |
179 | |
180 | test.c:7:19: note: token 2 has y-location == 173216 | |
ba4ad400 DM |
181 | 3: 0, 2947526575 |
182 | cc1: note: token 3 has x-location == 0 | |
183 | cc1: note: token 3 has y-location == 2947526575 | |
184 | 4: 2947526575, 2947526575 | |
185 | x-location == y-location == 2947526575 encodes token # 800042942 | |
186 | 5: 2947526575, 2947526575 | |
187 | x-location == y-location == 2947526575 encodes token # 800042942 | |
188 | 6: 2947526575, 2947526575 | |
189 | x-location == y-location == 2947526575 encodes token # 800042942 | |
190 | ||
191 | MACRO 0: PLUS (7 tokens) | |
192 | source_location interval: 2147483640 <= loc < 2147483647 | |
ebedc9a3 | 193 | test.c:6:11: note: expansion point is location 190019 |
ba4ad400 | 194 | int a = PLUS (1,2); |
ebedc9a3 DM |
195 | ^~~~ |
196 | ||
ba4ad400 DM |
197 | map->start_location: 2147483640 |
198 | macro_locations: | |
ebedc9a3 DM |
199 | 0: 190208, 173088 |
200 | test.c:6:17: note: token 0 has x-location == 190208 | |
ba4ad400 DM |
201 | int a = PLUS (1,2); |
202 | ^ | |
ebedc9a3 DM |
203 | |
204 | test.c:6:17: note: token 0 has y-location == 173088 | |
205 | 1: 173152, 173152 | |
ba4ad400 | 206 | In file included from test.c:1:0: |
ebedc9a3 | 207 | test.h:3:22: note: token 1 has x-location == y-location == 173152 |
ba4ad400 DM |
208 | #define PLUS(A, B) A + B |
209 | ^ | |
ebedc9a3 DM |
210 | |
211 | 2: 190272, 173216 | |
212 | test.c:6:19: note: token 2 has x-location == 190272 | |
ba4ad400 DM |
213 | int a = PLUS (1,2); |
214 | ^ | |
ebedc9a3 DM |
215 | |
216 | test.c:6:19: note: token 2 has y-location == 173216 | |
ba4ad400 DM |
217 | 3: 0, 2947526575 |
218 | cc1: note: token 3 has x-location == 0 | |
219 | cc1: note: token 3 has y-location == 2947526575 | |
220 | 4: 2947526575, 2947526575 | |
221 | x-location == y-location == 2947526575 encodes token # 800042935 | |
222 | 5: 2947526575, 2947526575 | |
223 | x-location == y-location == 2947526575 encodes token # 800042935 | |
224 | 6: 2947526575, 2947526575 | |
225 | x-location == y-location == 2947526575 encodes token # 800042935 | |
226 | ||
227 | MAX_SOURCE_LOCATION | |
228 | source_location interval: 2147483647 <= loc < 2147483648 | |
229 | ||
230 | AD-HOC LOCATIONS | |
231 | source_location interval: 2147483648 <= loc < 4294967295 | |
232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |