Tips and Tricks using the GCC, CPP and Binutils
For the http://www.lug-salem.de/ I am preparing a short presentation for showing how to use the gcc and cpp and so for collecting information.
the general idea is to specialize the information more and more, adding in more constants.
By dealing with the output of the preprocessor we can get a concise overview of the source code in one file. By looking at the assembler, we can see all types of information that is otherwise hard to find.
Here is the outline:
1. unpacking the project
looking through the files available
2. configuration and debugging
m4, shell, sed, grep,test and friends
aclocale, automake, autoconf
3. modification of the makefiles,
turning on the verbose mode and save temps in CFLAGS
creating of new rules
4. CPP and various options
4. compilation with the gcc, what are the passes.
4. What dump options are available
5. binutils NM, OBJDUMP, ReadElf for getting at the results
Finding out the sizes of objects
finding names of functions out of the addresses
6. using and scripting GDB for debugging and data collection
7. Dealing with core dumps
stopping the command immediatly with a kill sig stop
debugging without debug information (map files and objdump)
mapping OBJ files to ASM
8. Doxygen and Co
10. Profiling, gprof, cache grid, memory profiles, strace, oprofile