Skip to content

Commit aca0f34

Browse files
committed
coverage-dump: Dump filenames instead of global file IDs (and bless)
1 parent cfdf96b commit aca0f34

File tree

92 files changed

+307
-308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+307
-308
lines changed

src/tools/coverage-dump/src/covfun.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ pub(crate) fn dump_covfun_mappings(
5353
for i in 0..num_files {
5454
let global_file_id = parser.read_uleb128_usize()?;
5555
let &CovfunLineData { filenames_hash, .. } = line_data;
56-
#[expect(unused)] // Removed later in this PR.
5756
let Some(filename) = filename_tables.lookup(filenames_hash, global_file_id) else {
5857
bail!("couldn't resolve global file: {filenames_hash}, {global_file_id}");
5958
};
60-
println!("- file {i} => global file {global_file_id}");
59+
println!("- file {i} => {filename}");
6160
}
6261

6362
let num_expressions = parser.read_uleb128_u32()?;

tests/coverage/abort.cov-map

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Function name: abort::main
22
Raw bytes (83): 0x[01, 01, 07, 05, 01, 05, 0b, 01, 09, 05, 13, 01, 0d, 05, 1b, 01, 11, 0d, 01, 0d, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 19, 09, 00, 1a, 02, 0a, 06, 02, 09, 00, 0a, 02, 02, 0c, 00, 19, 0d, 00, 1a, 00, 31, 0e, 00, 30, 00, 31, 02, 04, 0c, 00, 19, 11, 00, 1a, 00, 31, 16, 00, 30, 00, 31, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02]
33
Number of files: 1
4-
- file 0 => global file 1
4+
- file 0 => $DIR/abort.rs
55
Number of expressions: 7
66
- expression 0 operands: lhs = Counter(1), rhs = Counter(0)
77
- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add)
@@ -36,7 +36,7 @@ Highest counter ID seen: c4
3636
Function name: abort::might_abort
3737
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 03, 01, 01, 14, 05, 02, 09, 01, 0f, 02, 02, 0c, 03, 02]
3838
Number of files: 1
39-
- file 0 => global file 1
39+
- file 0 => $DIR/abort.rs
4040
Number of expressions: 1
4141
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
4242
Number of file 0 mappings: 3

tests/coverage/assert-ne.cov-map

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Function name: assert_ne::main
22
Raw bytes (28): 0x[01, 01, 02, 01, 05, 01, 09, 04, 01, 08, 01, 03, 15, 05, 04, 0d, 00, 13, 02, 02, 0d, 00, 13, 06, 03, 05, 01, 02]
33
Number of files: 1
4-
- file 0 => global file 1
4+
- file 0 => $DIR/assert-ne.rs
55
Number of expressions: 2
66
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
77
- expression 1 operands: lhs = Counter(0), rhs = Counter(2)

tests/coverage/assert.cov-map

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Function name: assert::main
22
Raw bytes (61): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 09, 01, 09, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02]
33
Number of files: 1
4-
- file 0 => global file 1
4+
- file 0 => $DIR/assert.rs
55
Number of expressions: 6
66
- expression 0 operands: lhs = Counter(1), rhs = Counter(0)
77
- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add)
@@ -28,7 +28,7 @@ Highest counter ID seen: c3
2828
Function name: assert::might_fail_assert
2929
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 04, 01, 02, 0f, 02, 02, 25, 00, 3d, 05, 01, 01, 00, 02]
3030
Number of files: 1
31-
- file 0 => global file 1
31+
- file 0 => $DIR/assert.rs
3232
Number of expressions: 1
3333
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
3434
Number of file 0 mappings: 3

tests/coverage/assert_not.cov-map

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Function name: assert_not::main
22
Raw bytes (29): 0x[01, 01, 00, 05, 01, 06, 01, 01, 11, 01, 02, 05, 00, 13, 01, 01, 05, 00, 13, 01, 01, 05, 00, 15, 01, 01, 01, 00, 02]
33
Number of files: 1
4-
- file 0 => global file 1
4+
- file 0 => $DIR/assert_not.rs
55
Number of expressions: 0
66
Number of file 0 mappings: 5
77
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 17)

tests/coverage/async.cov-map

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Function name: async::c
22
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 01, 00, 19]
33
Number of files: 1
4-
- file 0 => global file 1
4+
- file 0 => $DIR/async.rs
55
Number of expressions: 0
66
Number of file 0 mappings: 1
77
- Code(Counter(0)) at (prev + 11, 1) to (start + 0, 25)
@@ -10,7 +10,7 @@ Highest counter ID seen: c0
1010
Function name: async::c::{closure#0}
1111
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 0b, 19, 01, 0e, 05, 02, 09, 00, 0a, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02]
1212
Number of files: 1
13-
- file 0 => global file 1
13+
- file 0 => $DIR/async.rs
1414
Number of expressions: 1
1515
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
1616
Number of file 0 mappings: 4
@@ -24,7 +24,7 @@ Highest counter ID seen: c1
2424
Function name: async::d
2525
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 01, 00, 14]
2626
Number of files: 1
27-
- file 0 => global file 1
27+
- file 0 => $DIR/async.rs
2828
Number of expressions: 0
2929
Number of file 0 mappings: 1
3030
- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 20)
@@ -33,7 +33,7 @@ Highest counter ID seen: c0
3333
Function name: async::d::{closure#0}
3434
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 14, 00, 19]
3535
Number of files: 1
36-
- file 0 => global file 1
36+
- file 0 => $DIR/async.rs
3737
Number of expressions: 0
3838
Number of file 0 mappings: 1
3939
- Code(Counter(0)) at (prev + 19, 20) to (start + 0, 25)
@@ -42,7 +42,7 @@ Highest counter ID seen: c0
4242
Function name: async::e (unused)
4343
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 01, 00, 14]
4444
Number of files: 1
45-
- file 0 => global file 1
45+
- file 0 => $DIR/async.rs
4646
Number of expressions: 0
4747
Number of file 0 mappings: 1
4848
- Code(Zero) at (prev + 21, 1) to (start + 0, 20)
@@ -51,7 +51,7 @@ Highest counter ID seen: (none)
5151
Function name: async::e::{closure#0} (unused)
5252
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 14, 00, 19]
5353
Number of files: 1
54-
- file 0 => global file 1
54+
- file 0 => $DIR/async.rs
5555
Number of expressions: 0
5656
Number of file 0 mappings: 1
5757
- Code(Zero) at (prev + 21, 20) to (start + 0, 25)
@@ -60,7 +60,7 @@ Highest counter ID seen: (none)
6060
Function name: async::f
6161
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 01, 00, 14]
6262
Number of files: 1
63-
- file 0 => global file 1
63+
- file 0 => $DIR/async.rs
6464
Number of expressions: 0
6565
Number of file 0 mappings: 1
6666
- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 20)
@@ -69,7 +69,7 @@ Highest counter ID seen: c0
6969
Function name: async::f::{closure#0}
7070
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 14, 00, 19]
7171
Number of files: 1
72-
- file 0 => global file 1
72+
- file 0 => $DIR/async.rs
7373
Number of expressions: 0
7474
Number of file 0 mappings: 1
7575
- Code(Counter(0)) at (prev + 23, 20) to (start + 0, 25)
@@ -78,7 +78,7 @@ Highest counter ID seen: c0
7878
Function name: async::foo (unused)
7979
Raw bytes (9): 0x[01, 01, 00, 01, 00, 19, 01, 00, 1e]
8080
Number of files: 1
81-
- file 0 => global file 1
81+
- file 0 => $DIR/async.rs
8282
Number of expressions: 0
8383
Number of file 0 mappings: 1
8484
- Code(Zero) at (prev + 25, 1) to (start + 0, 30)
@@ -87,7 +87,7 @@ Highest counter ID seen: (none)
8787
Function name: async::foo::{closure#0} (unused)
8888
Raw bytes (9): 0x[01, 01, 00, 01, 00, 19, 1e, 00, 2d]
8989
Number of files: 1
90-
- file 0 => global file 1
90+
- file 0 => $DIR/async.rs
9191
Number of expressions: 0
9292
Number of file 0 mappings: 1
9393
- Code(Zero) at (prev + 25, 30) to (start + 0, 45)
@@ -96,7 +96,7 @@ Highest counter ID seen: (none)
9696
Function name: async::g
9797
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1b, 01, 00, 17]
9898
Number of files: 1
99-
- file 0 => global file 1
99+
- file 0 => $DIR/async.rs
100100
Number of expressions: 0
101101
Number of file 0 mappings: 1
102102
- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 23)
@@ -105,7 +105,7 @@ Highest counter ID seen: c0
105105
Function name: async::g::{closure#0} (unused)
106106
Raw bytes (59): 0x[01, 01, 00, 0b, 00, 1b, 17, 01, 0c, 00, 02, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
107107
Number of files: 1
108-
- file 0 => global file 1
108+
- file 0 => $DIR/async.rs
109109
Number of expressions: 0
110110
Number of file 0 mappings: 11
111111
- Code(Zero) at (prev + 27, 23) to (start + 1, 12)
@@ -124,7 +124,7 @@ Highest counter ID seen: (none)
124124
Function name: async::h
125125
Raw bytes (9): 0x[01, 01, 00, 01, 01, 23, 01, 00, 16]
126126
Number of files: 1
127-
- file 0 => global file 1
127+
- file 0 => $DIR/async.rs
128128
Number of expressions: 0
129129
Number of file 0 mappings: 1
130130
- Code(Counter(0)) at (prev + 35, 1) to (start + 0, 22)
@@ -133,7 +133,7 @@ Highest counter ID seen: c0
133133
Function name: async::h::{closure#0} (unused)
134134
Raw bytes (39): 0x[01, 01, 00, 07, 00, 23, 16, 03, 0c, 00, 04, 09, 00, 0a, 00, 00, 0e, 00, 19, 00, 00, 1a, 00, 1b, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
135135
Number of files: 1
136-
- file 0 => global file 1
136+
- file 0 => $DIR/async.rs
137137
Number of expressions: 0
138138
Number of file 0 mappings: 7
139139
- Code(Zero) at (prev + 35, 22) to (start + 3, 12)
@@ -148,7 +148,7 @@ Highest counter ID seen: (none)
148148
Function name: async::i
149149
Raw bytes (9): 0x[01, 01, 00, 01, 01, 2c, 01, 00, 13]
150150
Number of files: 1
151-
- file 0 => global file 1
151+
- file 0 => $DIR/async.rs
152152
Number of expressions: 0
153153
Number of file 0 mappings: 1
154154
- Code(Counter(0)) at (prev + 44, 1) to (start + 0, 19)
@@ -157,7 +157,7 @@ Highest counter ID seen: c0
157157
Function name: async::i::{closure#0}
158158
Raw bytes (65): 0x[01, 01, 03, 05, 09, 11, 15, 0d, 11, 0b, 01, 2c, 13, 04, 0c, 09, 05, 09, 00, 0a, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 15, 01, 09, 00, 0a, 02, 00, 0e, 00, 17, 11, 00, 1b, 00, 20, 15, 00, 24, 00, 26, 06, 01, 0e, 00, 10, 0b, 02, 01, 00, 02]
159159
Number of files: 1
160-
- file 0 => global file 1
160+
- file 0 => $DIR/async.rs
161161
Number of expressions: 3
162162
- expression 0 operands: lhs = Counter(1), rhs = Counter(2)
163163
- expression 1 operands: lhs = Counter(4), rhs = Counter(5)
@@ -182,7 +182,7 @@ Highest counter ID seen: c5
182182
Function name: async::j
183183
Raw bytes (60): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0a, 01, 37, 01, 00, 0d, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 02, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 06, 01, 0e, 00, 10, 01, 02, 01, 00, 02]
184184
Number of files: 1
185-
- file 0 => global file 1
185+
- file 0 => $DIR/async.rs
186186
Number of expressions: 3
187187
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
188188
- expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add)
@@ -205,7 +205,7 @@ Highest counter ID seen: c2
205205
Function name: async::j::c
206206
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 39, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 02, 0d, 00, 0e, 01, 02, 05, 00, 06]
207207
Number of files: 1
208-
- file 0 => global file 1
208+
- file 0 => $DIR/async.rs
209209
Number of expressions: 1
210210
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
211211
Number of file 0 mappings: 4
@@ -219,7 +219,7 @@ Highest counter ID seen: c1
219219
Function name: async::j::d
220220
Raw bytes (9): 0x[01, 01, 00, 01, 01, 40, 05, 00, 17]
221221
Number of files: 1
222-
- file 0 => global file 1
222+
- file 0 => $DIR/async.rs
223223
Number of expressions: 0
224224
Number of file 0 mappings: 1
225225
- Code(Counter(0)) at (prev + 64, 5) to (start + 0, 23)
@@ -228,7 +228,7 @@ Highest counter ID seen: c0
228228
Function name: async::j::f
229229
Raw bytes (9): 0x[01, 01, 00, 01, 01, 41, 05, 00, 17]
230230
Number of files: 1
231-
- file 0 => global file 1
231+
- file 0 => $DIR/async.rs
232232
Number of expressions: 0
233233
Number of file 0 mappings: 1
234234
- Code(Counter(0)) at (prev + 65, 5) to (start + 0, 23)
@@ -237,7 +237,7 @@ Highest counter ID seen: c0
237237
Function name: async::k (unused)
238238
Raw bytes (29): 0x[01, 01, 00, 05, 00, 49, 01, 01, 0c, 00, 02, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
239239
Number of files: 1
240-
- file 0 => global file 1
240+
- file 0 => $DIR/async.rs
241241
Number of expressions: 0
242242
Number of file 0 mappings: 5
243243
- Code(Zero) at (prev + 73, 1) to (start + 1, 12)
@@ -250,7 +250,7 @@ Highest counter ID seen: (none)
250250
Function name: async::l
251251
Raw bytes (33): 0x[01, 01, 02, 01, 07, 05, 09, 05, 01, 51, 01, 01, 0c, 02, 02, 0e, 00, 10, 09, 01, 0e, 00, 10, 05, 01, 0e, 00, 10, 01, 02, 01, 00, 02]
252252
Number of files: 1
253-
- file 0 => global file 1
253+
- file 0 => $DIR/async.rs
254254
Number of expressions: 2
255255
- expression 0 operands: lhs = Counter(0), rhs = Expression(1, Add)
256256
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
@@ -266,7 +266,7 @@ Highest counter ID seen: c2
266266
Function name: async::m
267267
Raw bytes (9): 0x[01, 01, 00, 01, 01, 59, 01, 00, 19]
268268
Number of files: 1
269-
- file 0 => global file 1
269+
- file 0 => $DIR/async.rs
270270
Number of expressions: 0
271271
Number of file 0 mappings: 1
272272
- Code(Counter(0)) at (prev + 89, 1) to (start + 0, 25)
@@ -275,7 +275,7 @@ Highest counter ID seen: c0
275275
Function name: async::m::{closure#0} (unused)
276276
Raw bytes (9): 0x[01, 01, 00, 01, 00, 59, 19, 00, 22]
277277
Number of files: 1
278-
- file 0 => global file 1
278+
- file 0 => $DIR/async.rs
279279
Number of expressions: 0
280280
Number of file 0 mappings: 1
281281
- Code(Zero) at (prev + 89, 25) to (start + 0, 34)
@@ -284,7 +284,7 @@ Highest counter ID seen: (none)
284284
Function name: async::main
285285
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5b, 01, 08, 02]
286286
Number of files: 1
287-
- file 0 => global file 1
287+
- file 0 => $DIR/async.rs
288288
Number of expressions: 0
289289
Number of file 0 mappings: 1
290290
- Code(Counter(0)) at (prev + 91, 1) to (start + 8, 2)

tests/coverage/async2.cov-map

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Function name: async2::async_func
22
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0f, 01, 00, 17]
33
Number of files: 1
4-
- file 0 => global file 1
4+
- file 0 => $DIR/async2.rs
55
Number of expressions: 0
66
Number of file 0 mappings: 1
77
- Code(Counter(0)) at (prev + 15, 1) to (start + 0, 23)
@@ -10,7 +10,7 @@ Highest counter ID seen: c0
1010
Function name: async2::async_func::{closure#0}
1111
Raw bytes (24): 0x[01, 01, 00, 04, 01, 0f, 17, 03, 09, 01, 03, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
1212
Number of files: 1
13-
- file 0 => global file 1
13+
- file 0 => $DIR/async2.rs
1414
Number of expressions: 0
1515
Number of file 0 mappings: 4
1616
- Code(Counter(0)) at (prev + 15, 23) to (start + 3, 9)
@@ -22,7 +22,7 @@ Highest counter ID seen: c0
2222
Function name: async2::async_func_just_println
2323
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 01, 00, 24]
2424
Number of files: 1
25-
- file 0 => global file 1
25+
- file 0 => $DIR/async2.rs
2626
Number of expressions: 0
2727
Number of file 0 mappings: 1
2828
- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 36)
@@ -31,7 +31,7 @@ Highest counter ID seen: c0
3131
Function name: async2::async_func_just_println::{closure#0}
3232
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 24, 02, 02]
3333
Number of files: 1
34-
- file 0 => global file 1
34+
- file 0 => $DIR/async2.rs
3535
Number of expressions: 0
3636
Number of file 0 mappings: 1
3737
- Code(Counter(0)) at (prev + 23, 36) to (start + 2, 2)
@@ -40,7 +40,7 @@ Highest counter ID seen: c0
4040
Function name: async2::main
4141
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1b, 01, 07, 02]
4242
Number of files: 1
43-
- file 0 => global file 1
43+
- file 0 => $DIR/async2.rs
4444
Number of expressions: 0
4545
Number of file 0 mappings: 1
4646
- Code(Counter(0)) at (prev + 27, 1) to (start + 7, 2)
@@ -49,7 +49,7 @@ Highest counter ID seen: c0
4949
Function name: async2::non_async_func
5050
Raw bytes (24): 0x[01, 01, 00, 04, 01, 07, 01, 03, 09, 01, 03, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
5151
Number of files: 1
52-
- file 0 => global file 1
52+
- file 0 => $DIR/async2.rs
5353
Number of expressions: 0
5454
Number of file 0 mappings: 4
5555
- Code(Counter(0)) at (prev + 7, 1) to (start + 3, 9)

tests/coverage/async_block.cov-map

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Function name: async_block::main
22
Raw bytes (36): 0x[01, 01, 01, 05, 01, 06, 01, 07, 01, 00, 0b, 02, 01, 09, 00, 0a, 05, 00, 0e, 00, 13, 02, 01, 0d, 00, 13, 02, 07, 09, 00, 22, 01, 02, 01, 00, 02]
33
Number of files: 1
4-
- file 0 => global file 1
4+
- file 0 => $DIR/async_block.rs
55
Number of expressions: 1
66
- expression 0 operands: lhs = Counter(1), rhs = Counter(0)
77
Number of file 0 mappings: 6
@@ -19,7 +19,7 @@ Highest counter ID seen: c1
1919
Function name: async_block::main::{closure#0}
2020
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 09, 1c, 01, 17, 05, 01, 18, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a]
2121
Number of files: 1
22-
- file 0 => global file 1
22+
- file 0 => $DIR/async_block.rs
2323
Number of expressions: 1
2424
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
2525
Number of file 0 mappings: 4

0 commit comments

Comments
 (0)