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