I am using gdb to debug a c++ library I made for R using Rcpp. However, when I step through the code it seems to go all over the place, and some of the variables have been optimized out so I can't see their values. How can I compile without optimization? Also, is there any neat way to run R with gdb through emacs? Thanks.