Forum Discussion
Altera_Forum
Honored Contributor
15 years agohello world - strange variables behavior
Hello, I'm new to nios2 developpement and i'm having problems running the simple hello_world exemple : When I lauch this code : int main()
{
unsigned char i,j,k;
printf("Hello from N...
Altera_Forum
Honored Contributor
15 years agoLook at the generated code...
gdb can't really guarantee to give you the values of variables that are in registers. Although if you aren't compiling with -O2 (you really should use -O2 or -O3) then it is likely that all the expected code (including all the load/stores from stack for the local variables) is actually generated. Marking global data 'volatile' will force all references in the C source to generate load/store instructions.