From: David Malcolm Date: Tue, 28 Jan 2025 15:38:39 +0000 (-0500) Subject: input.cc: show line record indices in file_cache_slot::dump X-Git-Tag: basepoints/gcc-16~2297 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50c37516958319e10a137d2b3dba7b070523248a;p=thirdparty%2Fgcc.git 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 --- 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