From: Jørgen Kvalsvik Date: Tue, 14 Oct 2025 08:52:54 +0000 (+0200) Subject: gcov-dump: Print start-position for conditions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1681b203a0c9f37af82e0e0fcea7bfcc1dbfa00c;p=thirdparty%2Fgcc.git gcov-dump: Print start-position for conditions The printed position should be the start of the record, as is the case with lines. Before: ex.gcno: 795: 01470000: 16:CONDITIONS 2 conditions ex.gcno: 811: block 2: 1 ex.gcno: 819: block 5: 1 ex.gcno: 819: 01000000: 50:FUNCTION ... `main' ... After: ex.gcno: 795: 01470000: 16:CONDITIONS 2 conditions ex.gcno: 803: block 2: 1 ex.gcno: 811: block 5: 1 ex.gcno: 819: 01000000: 50:FUNCTION ... `main' ... gcc/ChangeLog: * gcov-dump.cc (tag_conditions): Read position before blocks, terms. --- diff --git a/gcc/gcov-dump.cc b/gcc/gcov-dump.cc index 8fe72713b2f..b3fc4279867 100644 --- a/gcc/gcov-dump.cc +++ b/gcc/gcov-dump.cc @@ -406,11 +406,12 @@ tag_conditions (const char *filename, unsigned /* tag */, int length, { for (unsigned ix = 0; ix != n_conditions; ix++) { + const gcov_position_t position = gcov_position (); const unsigned blockno = gcov_read_unsigned (); const unsigned nterms = gcov_read_unsigned (); printf ("\n"); - print_prefix (filename, depth, gcov_position ()); + print_prefix (filename, depth, position); printf (VALUE_PADDING_PREFIX "block %u:", blockno); printf (" %u", nterms); }