August 21st, 2006

zap

Note to self

gdb can run on optimized code... but it may not show you what you think should be the case. For example: if a parameter on the stack ends up in a register, gcc is smart enough not to load it before it's really used, freeing the register over the interval from function entry to that first use. OTOH, if you ask gdb to print it out before then, you'll get the contents of the register it ends up in...even before that register gets the parameter value moved into it!
  • Current Mood
    surprised surprised