I'm working on porting U-Boot to a custom board we're developing, based on the Texas Instruments AM5728, and I'm having some issues debugging U-Boot. I can load and debug U-Boot SPL via JTAG, but I cannot step/reach hardware breakpoints once U-Boot proper is loaded via JTAG after the SPL finishes. This is largely due to not knowing where the debugging symbol table exists in the U-Boot binary. I've enabled the DEBUG macro in U-Boot and have had no success, so I'm figuring that if I can get the debug symbols, I can actually step to whatever errors I'm having.
Is there a way to get the debugging symbols from the build process/Makefile?
There's a few things to bear in mind here. First, spl/u-boot-spl and u-boot are the ELF files for U-Boot and in the case of AM5728 you're going to be loading MLO and u-boot.img into memory to boot them. The second thing to keep in mind is that fairly early on U-Boot relocate itself in memory from where it was loaded and into an address that it calculates and resumes running from. The easiest way to obtain this value is, assuming your system boots to a prompt:
=> bdinfo
...
relocaddr = 0xFFF6D000
reloc off = 0x7F76D000
These values are system dependent but tell you both the absolute address in system memory and the offset to add to the linked in address to know where a given function resides now. The u-boot.map file will list among other things where all functions are linked at. How to tell your debugger where things are depends on the debugger in question. For example, with gdb you would re-load the symbol-file and give it the new relocaddr value.