Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Slide 1: Development Tools: Editor, Compiler, Linker, Debugger, Make | ||||||||
Line: 7 to 7 | ||||||||
The development cycle | ||||||||
Changed: | ||||||||
< < | The first and most important part in the development cycle is that you think! | |||||||
> > | The first and most important part in the development cycle is that you think! | |||||||
Of course a hello world program you can start implementing immediately. | ||||||||
Line: 40 to 40 | ||||||||
| ||||||||
Changed: | ||||||||
< < | +++-- | |||||||
> > | ||||||||
Linking several object filesWe have seen that functions can be implemented in dedicated files. | ||||||||
Line: 93 to 94 | ||||||||
You want to know how to really use emacs to its full potential? | ||||||||
Changed: | ||||||||
< < | Get the manual (some 400 pages!) | |||||||
> > | Get the manual (some 635 pages!) | |||||||
gcc | ||||||||
Line: 195 to 196 | ||||||||
A simpler Makefile | ||||||||
Changed: | ||||||||
< < | Make has predefined rules and it knows that a .c file | |||||||
> > | Make has predefined rules and it knows hot to produce | |||||||
Changed: | ||||||||
< < | must be compiled into a .o file | |||||||
> > | a .o file from a .c file | |||||||
We can therefore restrict out Makefile to this: | ||||||||
Line: 215 to 216 | ||||||||
| ||||||||
Changed: | ||||||||
< < | --++ | |||||||
> > | ||||||||
more Makefile examples%.o: %.c: | ||||||||
Line: 268 to 269 | ||||||||
How do we spot these errors? | ||||||||
Added: | ||||||||
> > | Printing debug informationVery often programmers put print statements purely for the sake of debugging. This is annoying when running the final program where this information should not be needed any more. One easy way out of the dilemma is given by the C preprocessor: #define DEBUG 1 #ifdef DEBUG p rintf(“printing some variable contents %d\n”,variable); #endif Commenting out the #define statement will get rid of all debugging prints.The debugger gdbSometimes printing debug information is not enough and we have to use a debugger. gdb the GNU debugger is still the standard tool Compile your program with the -g option to retain the symbol table Then run the program within the debugger gdb yourProgramUsing gdb
| |||||||
%SLIDESHOWEND% -- Uli Raich - 2017-09-08 |