]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
input.cc: show line record indices in file_cache_slot::dump
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 28 Jan 2025 15:38:39 +0000 (10:38 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 28 Jan 2025 15:38:39 +0000 (10:38 -0500)
gcc/ChangeLog:
* input.cc (file_cache_slot::dump): Show indices within
m_line_record when dumping entries.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/input.cc

index a2953ed1b156c462fb3d3469bad53b67c4de93c3..9f3cc6651e8333f7d15cebeb5b758006c4a314ca 100644 (file)
@@ -665,10 +665,11 @@ file_cache_slot::dump (FILE *out, int indent) const
           indent, "", (int)m_missing_trailing_newline);
   fprintf (out, "%*sline records (%i):\n",
           indent, "", m_line_record.length ());
+  int idx = 0;
   for (auto &line : m_line_record)
-    fprintf (out, "%*sline %zi: byte offsets: %zi-%zi\n",
+    fprintf (out, "%*s[%i]: line %zi: byte offsets: %zi-%zi\n",
             indent + 2, "",
-            line.line_num, line.start_pos, line.end_pos);
+            idx++, line.line_num, line.start_pos, line.end_pos);
 }
 
 /* Returns TRUE iff the cache would need to be filled with data coming