Allow `parseString()` to return an empty `StringRef` when the delimiter appears at position 0. This enables parsing pre-aggregated profile addresses with an omitted buildid but preserved colon (`:addr` format), where the empty buildid corresponds to the main binary. Previously, `parseString()` rejected zero-length fields by treating `StringEnd == 0` the same as `StringRef::npos` (delimiter not found). These are distinct situations: `npos` means no delimiter exists, while `0` means the field before the delimiter is empty. The fix removes the `StringEnd == 0` sub-condition so only the missing-delimiter case errors. The existing test for buildid-prefixed addresses is extended to also verify that `:addr` input produces identical output to the plain-address and non-empty-buildid variants. Test Plan: Added empty-buildid input file and extended `pre-aggregated-perf-buildid.test` to run perf2bolt with `:addr` format and diff the fdata output against the existing buildid-prefixed result.
10 lines
243 B
Plaintext
10 lines
243 B
Plaintext
B deadbeefaabbccdd:7f36d18d60c0 :400bbc 2 0
|
|
B :400ad1 :400e00 2 0
|
|
B :400b10 :4005f0 1 0
|
|
B :400bb7 :400610 1 0
|
|
B :4005f0 cafebabe01234567:7f36d18f2ce0 1 0
|
|
B :4011a0 :4011a9 33 4
|
|
B :4011ad :401180 58 0
|
|
F :401170 :4011b2 22
|
|
B :400dae :400d90 1 0
|