4 ms·
> the information you want can't even exist in theory. There are things that do exist, though, right? For example, the compiler knows which values are live at
by mananaysiempre 3y ago
> the information you want can't even exist in theory.
There are things that do exist, though, right? For example, the compiler knows which values are live at every point of the code, and in which registers and stack slots they are located. In most cases it even knows the SSA that produced them, and—again, in most cases—that SSA is expressible in the source language in terms of user-visible values. (How to display that ergonomically in the presence of inlining is a problem, though.)
None of this will fit in DWARF, but honestly DWARF is enough of a slog to work with that I’m not really sorry about that. (And PDB is not a contender until actual first-party documentation and library code exists.) The design work is thorny, don’t get me wrong, but I don’t think this is impossible.
- IshKebab 3y ago> For example, the compiler knows which values are live at every point of the code, No because "point of the code" is not well defined after optimisation. The compiler can reorder statements, split them, merge them, inline them, outline them, eliminate them entirely etc.
- mananaysiempre 3y agoI meant each point of the machine code, of course.
- rcxdude 3y agoThe compiler needs to know that information in order to do said optimisations, so it does have the information somewhere, it just fails to express it in the debug information.