[HN Gopher] How to read variables optimized out in GDB? ___________________________________________________________________ How to read variables optimized out in GDB? Author : kingluo Score : 39 points Date : 2022-10-11 17:30 UTC (5 hours ago) (HTM) web link (luajit.io) (TXT) w3m dump (luajit.io) | compiler-guy wrote: | Great article. Similar tricks are available in any interactive- | debugger worth its salt, not just gdb. | | So you can do similar tricks in LLDB, Visual Studio, and many | others. | steve_john wrote: | userbinator wrote: | This isn't something limited to GDB but I've always wondered why | no one seems to have bothered to come up with a solution after | all these years so that it can actually know that the variable is | in a register at that point. | stefan_ wrote: | Having spent some time looking at DWARF data closely, I get the | impression that there is an insane amount of information | generated and the format can handle way way more complex | scenarios than a simple "X is in register Y" - they got a full | state machine and all in there. But the tools available.. | simply do not consume it? I'm not entirely sure what the | disconnect is. | keepquestioning wrote: | optimized out is my number one pet peeve in my job. ___________________________________________________________________ (page generated 2022-10-11 23:00 UTC)