
Wolfgang Denk wrote:
In message E19utSW-0000xx-00@hall.mail.mindspring.net you wrote:
I usually set TEXT_BASE=0 in board/lubbock/config.mk for debugging before start_armboot. No need to reflash. You should be able to reload symbols in gdb at offset 0, but for some reason I've never been able to get this to work correctly. So linking at 0 sets symbols for gdb correctly. Then you can use gdb in a normal manner.
No need to recompile / relink. GDB will do the same when you use "symbol-file" to delte the current ymbol table and "add-symbol-file" to load the symbol file to the wanted target address (0x0).
Thanks Wolfgang and Kyle for your advice. Now, I can debug the boot process from the first instruction. Finally I've created two binaries: u-boot to execute and u-boot.debug (with TEXTBASE=0x0), to debug the first part of boot process. When the boot process arrives to the start_armboot function, I discard the current symbol file(u-boot.debug) and load the new one(u-boot).
Now, I have a new (minor) problem. The execution order which shows the gdb seems to be wrong (I`ve stopeed at the start_armboot funcion and the lines which show the gdb are different of the real execution). I suppose that it is a compiler optimization problem. Anyone knows which are the suitable flags to use with the compiler to avoid this behaviour ?
Regards, Juan Antonio