https://gcc.gnu.org/g:50c37516958319e10a137d2b3dba7b070523248a

commit r15-7256-g50c37516958319e10a137d2b3dba7b070523248a
Author: David Malcolm <dmalc...@redhat.com>
Date:   Tue Jan 28 10:38:39 2025 -0500

    input.cc: show line record indices in file_cache_slot::dump
    
    gcc/ChangeLog:
            * input.cc (file_cache_slot::dump): Show indices within
            m_line_record when dumping entries.
    
    Signed-off-by: David Malcolm <dmalc...@redhat.com>

Diff:
---
 gcc/input.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/input.cc b/gcc/input.cc
index a2953ed1b156..9f3cc6651e83 100644
--- a/gcc/input.cc
+++ b/gcc/input.cc
@@ -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

Reply via email to