The tenth chapter-Embedded Linux debugging technology

Source: Internet
Author: User

Embedded Debugging methods:

1. Simulator. For example, Qtopia core can be used to provide qvfb,arm hardware simulations using the frame Buffer Simulation tool SkyEye open source projects.

2. Remote Debugging. The debugger is also on the PC, and the debugger communicates with the program being debugged over the network.

3. Post-mortem analysis using log and core dump files.

STDPRM Standard printer LPT1 port

Stdaux standard serial Device COM1 port

StdIn does not necessarily come from the keyboard, stdout and stderr are not always displayed on the screen and can be redirected to other devices or disk files.

With fprintf (), the first parameter is recommended to use stderr instead of stdout, because stderr runs at a higher level, and the program stderr output when the exception exits, and StdOut does not.

CMD >file redirect stdout to file

CMD >>file append stdout to File

CMD 2>>file 1>&2 append stderr to file and append stdout to stderr

redirect via Freopen () in C program

FILE *freopen (const char *filename,const char mode,file *stream)

For example, Freopen ("Err.log", "W", stderr) redirects stderr to the Err.log file.

Control the level of log

For example QT provides Qdebug (), qwarning (), GTK also has corresponding g_debug (), G_error (), kernel debugging PRINTK () also provides many levels.

The Qdebug ("var=%d\n", Var) can be removed by using the macro Qt_no_debug_output provided by QT at compile time, and can be re-compiled the next time you need it.

The tenth chapter-Embedded Linux debugging technology

Related Article

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.