diff options
| author | Chuck Lever <cel@kernel.org> | 2026-07-12 16:34:47 -0400 |
|---|---|---|
| committer | Chuck Lever <cel@kernel.org> | 2026-08-10 09:54:35 -0400 |
| commit | 883fe9a7ac13340efc8bac9135415e322821c711 (patch) | |
| tree | e5ae012c5e5faf1b938763bd23cfd344380b02cc /tools/perf/scripts/python/stackcollapse.py | |
| parent | daa52e37851a5a1b5890e7a250a27e94a8b9f273 (diff) | |
xdrgen: Align the error caret under tab-indented source
When xdrgen reports a parse or transform error, it prints the
offending source line followed by a caret marking the column. The
source line is emitted with its tab characters intact, but the caret
offset is computed from a tab-expanded copy of the text ahead of the
column. A terminal expands the line's leading tabs relative to the
four-space output indent, while the caret math expands the same tabs
from column zero, so the two disagree whenever the line is indented
with tabs and the caret lands past the token it should mark.
Render the displayed line with its tabs already expanded so the line
and the caret share one tab origin and the four-space indent cancels.
Fold the now-identical line-and-caret formatting out of both error
handlers into a single helper, so every caller reports the same
aligned output.
Link: https://patch.msgid.link/20260712203451.124902-2-cel@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
