[U-Boot-Users] Using the abatron to debug an image in flash
Wolfgang Denk
wd at denx.de
Thu Aug 7 14:30:42 CEST 2003
Dear Mark,
in message <9901EE1E8F8BD3119109009027A1B5F596AE40 at 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
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
Man is the best computer we can put aboard a spacecraft ... and the
only one that can be mass produced with unskilled labor.
-- Wernher von Braun
More information about the U-Boot
mailing list