Skip to content

Commit 1f9a38f

Browse files
author
Vladimir Kotal
committed
translate gdb slide
1 parent bbd5876 commit 1f9a38f

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

intro.tex

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,31 +1606,29 @@
16061606
\begin{slide}
16071607
\sltitle{GNU debugger \texttt{gdb}}
16081608
\begin{itemize}
1609-
\item Volání:\\
1609+
\item Usage:\\
16101610
\texttt{gdb [ \emph{options} ] [ \emph{program} [ \emph{core} ] ]}
1611-
\item Nejbì¾nìj¹í pøíkazy:\\
1611+
\item Most common commands:\\
16121612
\renewcommand{\arraystretch}{0.9}
16131613
\begin{tabular}{ll}
1614-
\texttt{run [\emph{arglist}]} & start programu\\
1615-
\texttt{bt} & vypi¹ zásobník\\
1616-
\texttt{print \emph{expr}} & vypi¹ výraz\\
1617-
\texttt{set \emph{var} = \emph{expr}} & zmìò hodnotu promìnné\\
1618-
\texttt{cont} & pokraèování bìhu programu\\
1619-
\texttt{next}, \texttt{step} & proveï øádku (bez/s vnoøením do funkce)\\
1620-
\texttt{break \emph{condition}} & nastavení breakpointu\\
1621-
\texttt{help [\emph{name}]} & nápovìda\\
1622-
\texttt{quit} & ukonèení debuggeru
1614+
\texttt{run [\emph{arglist}]} & programu start\\
1615+
\texttt{bt} & print stack\\
1616+
\texttt{print \emph{expr}} & print expression\\
1617+
\texttt{set \emph{var} = \emph{expr}} & change value of variable\\
1618+
\texttt{cont} & continue program run\\
1619+
\texttt{next}, \texttt{step} & execute a line (with/out going into func)\\
1620+
\texttt{break \emph{condition}} & set breakpoint\\
1621+
\texttt{help [\emph{name}]} & print help\\
1622+
\texttt{quit} & debugger exit
16231623
\end{tabular}
16241624
\end{itemize}
16251625
\end{slide}
16261626

16271627
\begin{itemize}
1628-
\item GNU obdoba \texttt{dbx}. Mód kompatibilní s \texttt{dbx} spustíte pøes
1629-
\texttt{-dbx}.
1630-
\item na rùzných platformách existují i debuggery s grafickým
1631-
rozhraním, napø. \texttt{workshop} (Solaris), \texttt{cvd} (IRIX),
1632-
\texttt{xxgdb} (GNU), \texttt{ddd} (GNU). Èasto fungují jako
1633-
nadstavby nad \texttt{dbx}, \texttt{gdb}.
1628+
\item GNU analogy of \texttt{dbx}. The \texttt{dbx} compatibility mode can be
1629+
enabled using the \texttt{-dbx} option.
1630+
\item Most platforms today offer debuggers with graphical front end. Often they
1631+
are implemented on top of \texttt{gdb}.
16341632

16351633
\item \begin{verbatim}
16361634
#include <stdio.h>
@@ -1655,12 +1653,11 @@
16551653
Program exited normally.
16561654
(gdb) q
16571655
\end{verbatim}
1658-
\item debuggery jsou výbornými pomocníky pokud vá¹ program konèí na chyby typu
1659-
``segmentation error'' -- tj. kdy¾ zkusíte nekorektnì pøistoupit do pamìti,
1660-
napøíklad tam kde nemáte co dìlat. Kdy¾ pøi pøekladu pou¾ijete option
1661-
\texttt{-g}, uká¾e vám pak debugger pøesnì èíslo øádku, kde nastal problém.
1662-
Konkrétní pøíklad (proè se vlastnì tento program chová jak se chová??? Hint:
1663-
zkuste pøelo¾it na Solarisu pøekladaèem \texttt{cc} a spustit):
1656+
\item Debuggers are great help when your program exits with
1657+
``segmentation error'' -- i.e. when accessing memory incorrectly.
1658+
When the \texttt{-g} option is used when compiling the debugger will be able to
1659+
show exact line of code where the problem happened.
1660+
Concrete example (can you tell why the program behaves in such a way ?):
16641661
\begin{verbatim}
16651662
$ cat -n main.c
16661663
1 int

0 commit comments

Comments
 (0)