Re:How to read variables optimized out in GDB?
by jmorse2 on Tuesday October 11, 2022 @08:49PM
(#33171285)
> 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.
Re:How to read variables optimized out in GDB?
by TillE on Tuesday October 11, 2022 @09:12PM
(#33171479)
But 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.
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.