2

While analysing a core dump file, how do I see the values are optimized out? Is there a way to get the register they are stored in?

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
  • the best bet is to turn off optimization if you can. Otherwise, perhaps this answer would help? http://stackoverflow.com/a/1350436/1212725 – bruceg May 01 '17 at 23:31

1 Answers1

0

If you're at the point where you're looking at a core where certain values are optimized out if may be too late already. Easiest is if you can regularly reproduce the core in a build with debugging enabled.

However if you can't, one trick I've had moderate luck with is to move further up the call stack and try to get to the interesting data through more levels of indirection (for example, if you move up in the call stack, perhaps the pointer you need is in a memory location instead of in a register that has been lost).

Mark B
  • 95,107
  • 10
  • 109
  • 188