--- Javier Almansa Sobrino <[EMAIL PROTECTED]> wrote: > Hi everyone. I'm trying to simulate and trace a > program developed with > avr-gcc, but I'm not able to see the value of any > local variable with > ddd or avr-gdb.
This is a common problem that is not simply solved. gcc is optimizing your code to the point where the variable you are interested is no longer being stored in memory, this keeps ddd from looking at it. Some options: * Reduce gcc's optimization while debugging (be sure to turn it back on once the bugs are removed). * Mark the variable(s) you are interested in as "volatile" (again, make sure you un-do this later). * Add code to store important values in a volatile location: #ifdef DEBUG volatile uint16_t DebugTrace; #endif x = f(y); #ifdef DEBUG DebugTrace = x; #endif z = g(x); #ifdef DEBUG DebugTrace = z; #endif HTH, Gre7g __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list