Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer runapp02.tex V2 - 09/04/2008 6:09pm Page 1172

Appendix B: Working with the Source Code


Figure B-8: Examining data structures of the local kernel.

If no type information is present for a pointer (this is, frequently the case in doubly linked standard lists),
C-style typecasts can be specified in theGDBinput field.

TheData->Detect Aliasesoption must be enabled to instructDDDto detect pointers to the same memory
area and to redirect the arrows to an existing representation of the structure rather than inserting a new
graphic representation. This is the case in the previous example, as indicated by theparentpointers
that all (correctly) point to the same element. Note however thatDDDis much slower than usual when it
operates in this mode.

Thecorefiles are not normally modified when they are processed by a debugger, soGDBdoes not notice
if any change is made to a value in kernel memory — changes are propagated via thekcorefile. If the
memory contents that are relevant to a user change, the user must explicitly reload the core file withcore
/proc/kcore.DDDautomatically displays values that have changed against a yellow background so that
they are easy to recognize.

B.5.3 KGDB


Two machines connected via a network or a serial cable provide a better debugging setup with practically
all the same options as are available when debugging normal applications. TheKGDBpatch installs a
Free download pdf