Long time no Update blog. Come up and update today when you are free.
Recently picked up u-boot to tune, although said before the transplant, debugging success, but that bitter ah, GDB's cursor jump to jump, and the variable can not be traced, only by guessing, or using the serial port output. Consider that it should be compiled with the use of optimization options, so long as the GCC optimization options are removed, or choose not to optimize, you can debug smoothly. Don't talk too much, do it.
Open the Config.mk file in the Uboot root directory and find the following line optflags=-os #-fomit-frame-pointer
This line is the optimization option, change the-os to-o0 optflags=-o0 #-fomit-frame-pointer
Then recompile, generate the U-boot file, debug with Arm-linux-gdb, Arm-linux-gdb u-boot
or Arm-linux-gdbtui u-boot.
can go into debug mode, now the cursor is no longer jumping to jump, but also convenient to observe variables. haha ~ ~ ~
PS: Next, if you are using Eclipse to manage your project. Including editing, generation, debugging one-stop, truly integrated development.