4 ms·
"Optimized out" doesn't just cover a variable simply being in a register. The code might have been adjusted such that the variable's value isn't stored anywhere
by rlpb 4y ago
"Optimized out" doesn't just cover a variable simply being in a register. The code might have been adjusted such that the variable's value isn't stored anywhere any more, or some derivative value is stored instead. So in the general case, it's quite a complex problem.
- userbinator 4y agoSo in the general case, it's quite a complex problem. I'm not talking about "the general case". I'm referring to all the cases where the compiler obviously should know where the value is, yet the debugger somehow doesn't.
- jmorse2 4y ago> I'm referring to all the cases where the compiler obviously should know where the value is, yet the debugger somehow doesn't. Soooommmee of this can be explained by the design decisions in the compiler not lending themselves to working well with debug-info, as explained here [0] (shamless plug), from about 3 minutes in there's an example of a scenario where a variable location has to be discarded out of conservative precaution (4:40 to 7:00), rather than because it's definitely been optimised out. [0] https://www.youtube.com/watch?v=yxuwfNnp064&t=45s https://www.youtube.com/watch?v=yxuwfNnp064&t=45s
- TillE 4y agoBut there are plenty of cases where a debugger can tell you the value of variables which are definitely in registers, such as with function arguments. So this complaint really is about cases related to the optimizer which, as mentioned, is a very complex issue.
- deleted 4y ago[deleted]