> it would tell you exactly what line number was producing which C code and which behaviors were being exhibited (state changes)
Would you consider generating sourcemaps? Although they’re mainly used for minified JavaScript they sound like a perfect fit for this use case. Plus they’re so ubiquitous there’s already a ton of tooling that understands them.