]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcov-dump: Print start-position for conditions
authorJørgen Kvalsvik <j@lambda.is>
Tue, 14 Oct 2025 08:52:54 +0000 (10:52 +0200)
committerJørgen Kvalsvik <j@lambda.is>
Fri, 30 Jan 2026 10:20:57 +0000 (11:20 +0100)
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.

gcc/gcov-dump.cc

index 8fe72713b2f6753f5677dbb6fb26fc2e951aa46e..b3fc4279867c7a331c830067f54736029a32cef4 100644 (file)
@@ -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);
        }