
Dear Mark,
in message 9901EE1E8F8BD3119109009027A1B5F596AE40@DIGINET2 you wrote:
(gdb) step 221 immr->im_fcc[CONFIG_ETHER_INDEX-1].fcc_fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC; (gdb) step 213 immr->im_cpmux.cmx_fcr = (immr->im_cpmux.cmx_fcr & ~CFG_CMXFCR_MASK) | (gdb) step 221 immr->im_fcc[CONFIG_ETHER_INDEX-1].fcc_fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC; (gdb) step 227 rxIdx = 0; (gdb) step 201 volatile cpm8260_t *cp = &(immr->im_cpm); (gdb) step 213 immr->im_cpmux.cmx_fcr = (immr->im_cpmux.cmx_fcr & ~CFG_CMXFCR_MASK) | (gdb) step 228 txIdx = 0; (gdb) step 213 immr->im_cpmux.cmx_fcr = (immr->im_cpmux.cmx_fcr & ~CFG_CMXFCR_MASK) | (gdb)
As you can see the code appears to jump around aimlessly, though the program still appears to run ok. Just to finish off I am able to configure the ram
Seems to be working perfectly.
Please remember that you are debugging on a C level, and a single line of C code may result in several / many assembler instructions, and the optimizer may reorder your statements as it seems "optimal" to him. This is what you are seeing here: GDB cannot undo the effects of the optimizer, so it does the best it can.
If you don't like this, then have a look at section "Debugging - Tips and Tricks" in our documentation at http://www.denx.de/twiki/bin/view/DULG/DebuggingTricks
Note that code size and performance will suffer from such mods.
Best regards,
Wolfgang Denk