From 50c37516958319e10a137d2b3dba7b070523248a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 28 Jan 2025 10:38:39 -0500 Subject: [PATCH] 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 --- gcc/input.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/input.cc b/gcc/input.cc index a2953ed1b15..9f3cc6651e8 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 -- 2.47.2