aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2025-01-28 10:38:39 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2025-01-28 10:38:39 -0500
commit50c37516958319e10a137d2b3dba7b070523248a (patch)
treeced1146a8f363bdc597d97748ec0150f16749544 /gcc
parentb4bd06774ced72d5f0059ec55022840ad3f37fa4 (diff)
downloadgcc-50c37516958319e10a137d2b3dba7b070523248a.zip
gcc-50c37516958319e10a137d2b3dba7b070523248a.tar.gz
gcc-50c37516958319e10a137d2b3dba7b070523248a.tar.bz2
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 <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/input.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/input.cc b/gcc/input.cc
index a2953ed..9f3cc66 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