comparison libcpp/location-example.txt @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
18 #define PLUS(A, B) A + B 18 #define PLUS(A, B) A + B
19 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 19 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 20
21 21
22 The undocumented -fdump-internal-locations option outputs this information 22 The undocumented -fdump-internal-locations option outputs this information
23 to stderr, showing what each source_location value means. Source code 23 to stderr, showing what each location_t value means. Source code
24 lines are quoted, showing both per-line source_location values and 24 lines are quoted, showing both per-line location_t values and
25 per-line&column source_location values (written vertically under the 25 per-line&column location_t values (written vertically under the
26 corresponding character of source code). 26 corresponding character of source code).
27 27
28 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 28 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
29 RESERVED LOCATIONS 29 RESERVED LOCATIONS
30 source_location interval: 0 <= loc < 2 30 location_t interval: 0 <= loc < 2
31 31
32 ORDINARY MAP: 0 32 ORDINARY MAP: 0
33 source_location interval: 32 <= loc < 64 33 location_t interval: 32 <= loc < 64
34 file: test.c 34 file: test.c
35 starting at line: 1 35 starting at line: 1
36 column bits: 12 36 column and range bits: 12
37 range bits: 5 37 column bits: 7
38 range bits: 5
39 reason: 0 (LC_ENTER)
40 included from location: 0
38 test.c: 1|loc: 32|#include "test.h" 41 test.c: 1|loc: 32|#include "test.h"
39 |69269258258148147 42 |69269258258148147
40 |46802468024680246 43 |46802468024680246
41 44
42 ORDINARY MAP: 1 45 ORDINARY MAP: 1
43 source_location interval: 64 <= loc < 96 46 location_t interval: 64 <= loc < 96
44 file: <built-in> 47 file: <built-in>
45 starting at line: 0 48 starting at line: 0
49 column and range bits: 0
46 column bits: 0 50 column bits: 0
47 range bits: 0 51 range bits: 0
52 reason: 2 (LC_RENAME)
53 included from location: 0
48 54
49 ORDINARY MAP: 2 55 ORDINARY MAP: 2
50 source_location interval: 96 <= loc < 128 56 location_t interval: 96 <= loc < 128
51 file: <command-line> 57 file: <command-line>
52 starting at line: 0 58 starting at line: 0
59 column and range bits: 0
53 column bits: 0 60 column bits: 0
54 range bits: 0 61 range bits: 0
62 reason: 2 (LC_RENAME)
63 included from location: 0
55 64
56 ORDINARY MAP: 3 65 ORDINARY MAP: 3
57 source_location interval: 128 <= loc < 160128 66 location_t interval: 128 <= loc < 250240
58 file: /usr/include/stdc-predef.h 67 file: /usr/include/stdc-predef.h
59 starting at line: 1 68 starting at line: 1
60 column bits: 12 69 column and range bits: 12
61 range bits: 5 70 column bits: 7
71 range bits: 5
72 reason: 0 (LC_ENTER)
73 included from location: 127 (in ordinary map 2)
62 (contents of /usr/include/stdc-predef.h snipped for brevity) 74 (contents of /usr/include/stdc-predef.h snipped for brevity)
63 75
64 ORDINARY MAP: 4 76 ORDINARY MAP: 4
65 source_location interval: 160128 <= loc < 160160 77 location_t interval: 250240 <= loc < 250272
66 file: <command-line> 78 file: <command-line>
67 starting at line: 32 79 starting at line: 32
68 column bits: 12 80 column and range bits: 12
69 range bits: 5 81 column bits: 7
82 range bits: 5
83 reason: 1 (LC_LEAVE)
84 included from location: 0
70 85
71 ORDINARY MAP: 5 86 ORDINARY MAP: 5
72 source_location interval: 160160 <= loc < 164256 87 location_t interval: 250272 <= loc < 254368
73 file: test.c 88 file: test.c
74 starting at line: 1 89 starting at line: 1
75 column bits: 12 90 column and range bits: 12
76 range bits: 5 91 column bits: 7
77 test.c: 1|loc:160160|#include "test.h" 92 range bits: 5
78 |00000000000000000 93 reason: 2 (LC_RENAME)
79 |12223334445556667 94 included from location: 0
80 |92582581481470470 95 test.c: 1|loc:250272|#include "test.h"
81 |24680246802468024 96 |00000000000000000
97 |33344445556667778
98 |03603692692582581
99 |46802468024680246
82 100
83 ORDINARY MAP: 6 101 ORDINARY MAP: 6
84 source_location interval: 164256 <= loc < 173280 102 location_t interval: 254368 <= loc < 266720
85 file: test.h 103 file: test.h
86 starting at line: 1 104 starting at line: 1
87 column bits: 12 105 column and range bits: 12
88 range bits: 5 106 column bits: 7
89 test.h: 1|loc:164256|extern int foo (); 107 range bits: 5
90 |444444444444444444 108 reason: 0 (LC_ENTER)
91 |233344455566677788 109 included from location: 250272 (in ordinary map 5)
92 |825814814704703603 110 test.h: 1|loc:254368|extern int foo ();
93 |802468024680246802 111 |444444444444444444
94 test.h: 2|loc:168352| 112 |444455566677788899
95 | 113 |036926925825814814
96 | 114 |024680246802468024
97 | 115 test.h: 2|loc:258464|
98 | 116 |
99 test.h: 3|loc:172448|#define PLUS(A, B) A + B 117 |
100 |222222222222222223333333 118 |
101 |455566677788889990001112 119 |
102 |814704703603692692582581 120 test.h: 3|loc:262560|#define PLUS(A, B) A + B
103 |024680246802468024680246 121 |222222222222233333333333
122 |566677788899900011122223
123 |925825814814704703603692
124 |246802468024680246802468
125 test.h: 4|loc:266656|
126 |
127 |
128 |
129 |
104 130
105 ORDINARY MAP: 7 131 ORDINARY MAP: 7
106 source_location interval: 173280 <= loc < 202016 132 location_t interval: 266720 <= loc < 299520
107 file: test.c 133 file: test.c
108 starting at line: 2 134 starting at line: 2
109 column bits: 12 135 column and range bits: 12
110 range bits: 5 136 column bits: 7
111 test.c: 2|loc:173280| 137 range bits: 5
112 | 138 reason: 1 (LC_LEAVE)
113 | 139 included from location: 0
114 | 140 test.c: 2|loc:266720|
115 | 141 |
116 test.c: 3|loc:177376|int 142 |
117 |777 143 |
118 |444 144 |
119 |047 145 test.c: 3|loc:270816|int
120 |802 146 |000
121 test.c: 4|loc:181472|main (int argc, char **argv) 147 |889
122 |1111111111111111222222222222 148 |481
123 |5556666777888999000111222333 149 |802
124 |0360369269258258148147047036 150 test.c: 4|loc:274912|main (int argc, char **argv)
125 |4680246802468024680246802468 151 |4455555555555555555555555555
126 test.c: 5|loc:185568|{ 152 |9900011122223334445556667778
127 |5 153 |4704703603692692582581481470
128 |6 154 |4680246802468024680246802468
129 |0 155 test.c: 5|loc:279008|{
130 |0 156 |9
131 test.c: 6|loc:189664| int a = PLUS (1,2); 157 |0
132 |999999999900000000000 158 |4
133 |677788899900011122233 159 |0
134 |926925825814814704703 160 test.c: 6|loc:283104| int a = PLUS (1,2);
135 |680246802468024680246 161 |333333333333333333333
136 test.c: 7|loc:193760| int b = PLUS (3,4); 162 |112222333444555666777
137 |333333344444444444444 163 |360369269258258148147
138 |788899900011122233344 164 |680246802468024680246
139 |925825814814704703603 165 test.c: 7|loc:287200| int b = PLUS (3,4);
140 |246802468024680246802 166 |777777777777777777777
141 test.c: 8|loc:197856| return 0; 167 |222333444555666777888
142 |77778888888 168 |369269258258148147047
143 |89990001112 169 |246802468024680246802
144 |82581481470 170 test.c: 8|loc:291296| return 0;
145 |80246802468 171 |11111111111
146 test.c: 9|loc:201952|} 172 |33344455566
147 |1 173 |26925825814
148 |9 174 |80246802468
149 |8 175 test.c: 9|loc:295392|}
150 |4 176 |5
177 |4
178 |2
179 |4
180 test.c: 10|loc:299488|
181 |
182 |
183 |
184 |
151 185
152 UNALLOCATED LOCATIONS 186 UNALLOCATED LOCATIONS
153 source_location interval: 202016 <= loc < 2147483633 187 location_t interval: 299520 <= loc < 2147483632
154 188
155 MACRO 1: PLUS (7 tokens) 189 MACRO 3: PLUS (7 tokens)
156 source_location interval: 2147483633 <= loc < 2147483640 190 location_t interval: 2147483632 <= loc < 2147483639
157 test.c:7:11: note: expansion point is location 194115 191 test.c:7:11: note: expansion point is location 287555
158 int b = PLUS (3,4); 192 7 | int b = PLUS (3,4);
159 ^~~~ 193 | ^~~~
160 194 map->start_location: 2147483632
161 map->start_location: 2147483633 195 macro_locations:
162 macro_locations: 196 0: 287744, 263200
163 0: 194304, 173088 197 test.c:7:17: note: token 0 has x-location == 287744
164 test.c:7:17: note: token 0 has x-location == 194304 198 7 | int b = PLUS (3,4);
165 int b = PLUS (3,4); 199 | ^
166 ^ 200 test.c:7:17: note: token 0 has y-location == 263200
167 201 1: 263264, 263264
168 test.c:7:17: note: token 0 has y-location == 173088 202 In file included from test.c:1:
169 1: 173152, 173152 203 test.h:3:22: note: token 1 has x-location == y-location == 263264
170 In file included from test.c:1:0: 204 3 | #define PLUS(A, B) A + B
171 test.h:3:22: note: token 1 has x-location == y-location == 173152 205 | ^
172 #define PLUS(A, B) A + B 206 2: 287808, 263328
173 ^ 207 test.c:7:19: note: token 2 has x-location == 287808
174 208 7 | int b = PLUS (3,4);
175 2: 194368, 173216 209 | ^
176 test.c:7:19: note: token 2 has x-location == 194368 210 test.c:7:19: note: token 2 has y-location == 263328
177 int b = PLUS (3,4); 211 3: 0, 0
178 ^ 212 cc1: note: token 3 has x-location == y-location == 0
179 213 4: 0, 0
180 test.c:7:19: note: token 2 has y-location == 173216 214 cc1: note: token 4 has x-location == y-location == 0
181 3: 0, 2947526575 215 5: 0, 0
182 cc1: note: token 3 has x-location == 0 216 cc1: note: token 5 has x-location == y-location == 0
183 cc1: note: token 3 has y-location == 2947526575 217 6: 0, 0
184 4: 2947526575, 2947526575 218 cc1: note: token 6 has x-location == y-location == 0
185 x-location == y-location == 2947526575 encodes token # 800042942 219
186 5: 2947526575, 2947526575 220 MACRO 2: PLUS (7 tokens)
187 x-location == y-location == 2947526575 encodes token # 800042942 221 location_t interval: 2147483639 <= loc < 2147483646
188 6: 2947526575, 2947526575 222 test.c:6:11: note: expansion point is location 283459
189 x-location == y-location == 2947526575 encodes token # 800042942 223 6 | int a = PLUS (1,2);
190 224 | ^~~~
191 MACRO 0: PLUS (7 tokens) 225 map->start_location: 2147483639
192 source_location interval: 2147483640 <= loc < 2147483647 226 macro_locations:
193 test.c:6:11: note: expansion point is location 190019 227 0: 283648, 263200
194 int a = PLUS (1,2); 228 test.c:6:17: note: token 0 has x-location == 283648
195 ^~~~ 229 6 | int a = PLUS (1,2);
196 230 | ^
197 map->start_location: 2147483640 231 test.c:6:17: note: token 0 has y-location == 263200
198 macro_locations: 232 1: 263264, 263264
199 0: 190208, 173088 233 In file included from test.c:1:
200 test.c:6:17: note: token 0 has x-location == 190208 234 test.h:3:22: note: token 1 has x-location == y-location == 263264
201 int a = PLUS (1,2); 235 3 | #define PLUS(A, B) A + B
202 ^ 236 | ^
203 237 2: 283712, 263328
204 test.c:6:17: note: token 0 has y-location == 173088 238 test.c:6:19: note: token 2 has x-location == 283712
205 1: 173152, 173152 239 6 | int a = PLUS (1,2);
206 In file included from test.c:1:0: 240 | ^
207 test.h:3:22: note: token 1 has x-location == y-location == 173152 241 test.c:6:19: note: token 2 has y-location == 263328
208 #define PLUS(A, B) A + B 242 3: 0, 0
209 ^ 243 cc1: note: token 3 has x-location == y-location == 0
210 244 4: 0, 0
211 2: 190272, 173216 245 cc1: note: token 4 has x-location == y-location == 0
212 test.c:6:19: note: token 2 has x-location == 190272 246 5: 0, 0
213 int a = PLUS (1,2); 247 cc1: note: token 5 has x-location == y-location == 0
214 ^ 248 6: 0, 0
215 249 cc1: note: token 6 has x-location == y-location == 0
216 test.c:6:19: note: token 2 has y-location == 173216 250
217 3: 0, 2947526575 251 MACRO 1: __GCC_IEC_559_COMPLEX (1 tokens)
218 cc1: note: token 3 has x-location == 0 252 location_t interval: 2147483646 <= loc < 2147483647
219 cc1: note: token 3 has y-location == 2947526575 253 In file included from <command-line>:31:
220 4: 2947526575, 2947526575 254 /usr/include/stdc-predef.h:45:6: note: expansion point is location 180564
221 x-location == y-location == 2947526575 encodes token # 800042935 255 45 | # if __GCC_IEC_559_COMPLEX > 0
222 5: 2947526575, 2947526575 256 | ^~~~~~~~~~~~~~~~~~~~~
223 x-location == y-location == 2947526575 encodes token # 800042935 257 map->start_location: 2147483646
224 6: 2947526575, 2947526575 258 macro_locations:
225 x-location == y-location == 2947526575 encodes token # 800042935 259 0: 1, 1
226 260 <built-in>: note: token 0 has x-location == y-location == 1
227 MAX_SOURCE_LOCATION 261
228 source_location interval: 2147483647 <= loc < 2147483648 262 MACRO 0: __GCC_IEC_559 (1 tokens)
263 location_t interval: 2147483647 <= loc < 2147483648
264 /usr/include/stdc-predef.h:37:6: note: expansion point is location 147788
265 37 | # if __GCC_IEC_559 > 0
266 | ^~~~~~~~~~~~~
267 map->start_location: 2147483647
268 macro_locations:
269 0: 1, 1
270 <built-in>: note: token 0 has x-location == y-location == 1
271
272 MAX_LOCATION_T
273 location_t interval: 2147483647 <= loc < 2147483648
229 274
230 AD-HOC LOCATIONS 275 AD-HOC LOCATIONS
231 source_location interval: 2147483648 <= loc < 4294967295 276 location_t interval: 2147483648 <= loc < 4294967295
232 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 277 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^