From ca33858d7afce032367f296ad1eedb84e6bd958b Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 25 Aug 2026 14:31:46 -0700 Subject: [PATCH] orbmortem: fix source line association The source loader accidentally ate the character after each newline, rather than the newline itself. This led to consecutive lines disappearing, and lines sometimes losing their first character. The former screwed up the association between lines in the debug info and the file displayed by orbmortem. Fix by zeroing the newline character itself. The character is already consumed according to the `l` and `r` variables; it just needs changing to `\0`. --- Src/loadelf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Src/loadelf.c b/Src/loadelf.c index e10652c0..f624a6a4 100644 --- a/Src/loadelf.c +++ b/Src/loadelf.c @@ -724,8 +724,9 @@ static bool _loadSource( struct symbol *p ) if ( l ) { - *r++ = 0; - l--; + /* Back up to newline and replace it with \0 */ + r--; + *r++ = '\0'; } } }