5. Debugging is twice as hard as writing the code inDebugging is twice as hard as writing the code in
the first place.the first place.
Therefore, if you write the code AS CLEVERLY ASTherefore, if you write the code AS CLEVERLY AS
POSSIBLE, you are by DEFINITION, not smartPOSSIBLE, you are by DEFINITION, not smart
enough to debug it.enough to debug it.
-- Brian Kernighan-- Brian Kernighan
22. GDB configurationGDB configuration
Should we stop the trace after exec ?Should we stop the trace after exec ?
➢set follow-exec-mode newset follow-exec-mode new
➢ new - follow the new processnew - follow the new process
➢ same - keep the same processsame - keep the same process
23. GDB configurationGDB configuration
Should we trace the child processes?Should we trace the child processes?
➢set detach-on-fork onset detach-on-fork on
➢ on - detach the child processon - detach the child process
➢ off - do not detachoff - do not detach