|
|
|
@ -5,8 +5,30 @@ Quand plus rien ne marche, reste-il encore un espoir ? |
|
|
|
|
Il existe bien entendu des outils \textsl{mainstream} |
|
|
|
|
tels que le classique \texttt{gdb}\index{gdb}, mais il en existe |
|
|
|
|
une foultitude d'autres, injustement méconnus. |
|
|
|
|
En voici quelques-uns. |
|
|
|
|
Nous allons en voir quelques-uns. |
|
|
|
|
|
|
|
|
|
% ============================================================== |
|
|
|
|
|
|
|
|
|
\section{Gdb}\index{gdb} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GDB is a source-level debugger, capable of breaking programs at |
|
|
|
|
any specific line, displaying variable values, and determining |
|
|
|
|
where errors occurred. Currently, gdb supports C, C++, D, |
|
|
|
|
Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, |
|
|
|
|
Go, and Ada. \textsc{A must-have for any serious programmer}. |
|
|
|
|
|
|
|
|
|
\subsection{ddd} |
|
|
|
|
|
|
|
|
|
DDD is a graphical front-end for GDB and other command-line debuggers. |
|
|
|
|
Using DDD, you can see what is going on “inside” another program while |
|
|
|
|
it executes—or what another program was doing at the moment it crashed. |
|
|
|
|
|
|
|
|
|
\subsection{xxgdb} |
|
|
|
|
|
|
|
|
|
xxgdb is a simple but powerful graphical interface to the GNU |
|
|
|
|
debugger gdb. A more powerful (but slower and much bigger) interface |
|
|
|
|
is available in the ddd package. |
|
|
|
|
|
|
|
|
|
% ============================================================== |
|
|
|
|
|
|
|
|
@ -18,18 +40,12 @@ Comme vous le savez tous, un appel système |
|
|
|
|
est \textbf{le} moyen de communication qu'utilise un process |
|
|
|
|
utilisateur pôur demander un service au noyau. |
|
|
|
|
|
|
|
|
|
\begin{lstlisting}[language=C] |
|
|
|
|
#include <stdio.h> |
|
|
|
|
int main(int argc, char *argv[]) |
|
|
|
|
{ |
|
|
|
|
printf("Hello world.\n"); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
\end{lstlisting} |
|
|
|
|
\lstinputlisting[language=C]{code/hello.c} |
|
|
|
|
|
|
|
|
|
Un exemple canonique, n'est-il pas ? Ce bout de code affichant |
|
|
|
|
quelque chose à l'écran, il doit bien y avoir un appel au noyau |
|
|
|
|
qui traine par là. Nous allons donc le chercher% |
|
|
|
|
qui traine par là pour écrire vers la sortie standard. |
|
|
|
|
Nous allons donc le chercher% |
|
|
|
|
\footnote{En trichant un peu, je l'avoue, je connais son nom.} |
|
|
|
|
|
|
|
|
|
\begin{verbatim} |
|
|
|
|