Sometimes we build a program as release and when debugging, some variables cannot is printed out, and Displayed as optimized out . That's is because the debugger (GDB) always prints a variable which locates on the stack, or resides in Memory. But in release programs, variables might is optimized to only reside on register (or sometimes not exist and is pre-calculated into other variables when compiling). So print a variable which does not exist (in memory) always get to nothing. So this time we need to learn some ASM and print the related register. Also , specify a variable as ' volatile ' should prevent the Compiler from Optimizing the specified variable out From the memory.
When talking on release & Debug version of programs, both symbols and debug-info can reside in every Object-file/ex Ecutable, there is no difference between Debug & release when talking about symbols or debuginfos. Play around with Stacks, ABI & ASM is very important debugging release programs. But keep in mind symbols and Debug-infos is different. Symbols in Object Files/executables tells us which memory have the name of "a"; Debuginfos give sources. So in CentOS, installing a debuginfo of a certain package means we can then debug into the package functions (obtained the sourced version of the package libraries).
C:release & Debug Differences (might apply to all programming languages)