2 ms·
> even mapping instructions back to line of codes is a difficult process Enough is retained to allow line-step debugging. Godbolt will even do a nice mapping f
by pjc50 2y ago
> even mapping instructions back to line of codes is a difficult process
Enough is retained to allow line-step debugging. Godbolt will even do a nice mapping for you between source and object lines. Yes, a lot of it gets thrown away. My point is "this line of code has no effect on the output" is a problem, and the developer should be warned rather than lulled into a false sense of security that their check is doing something.
(Code coverage has the same issue of doing line attribution, plus the difficulty of hitting error conditions in practice, but it would also show unexecuted lines of code)
- gpderetta 2y agoYou are vastly underestimating the amount of false positives under inlining and interprocedural optimizations.
- compiler-guy 2y ago> Enough is retained to allow line-step debugging. Only without optimization. Every compiler I have ever used (and I have used a lot of them!) starts having difficulty with step-debugging at the lowest-level of optimization, typically -O1. Some functions work, most don't.