Forum Discussion
Altera_Forum
Honored Contributor
15 years agoData watchpoints won't work on items that the compiler assigns to a register, only on writes to real memory.
Even without the optimiser it is possible that 'retval' doesn't exist as a memory item (or at least the allocated item isn't used. If you move 'retval' outside the function and define it as 'volatile int retval' then the writes are required to be generated and the watchpoint should trap.