Debug U-boot----Let GDB debug better

Source: Internet
Author: User
Tags root directory

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.