|
600 | 600 | \item One of the most important thing of a C style (well, any style) is |
601 | 601 | consistency. And often it is not that important what exact C style a group |
602 | 602 | of coders is going to pick as it is that one specific style is chosen and then |
603 | | -religiously followed by all in the group. A good and rigorously followed cstyle |
| 603 | +religiously followed by all in the group. A good and rigorously followed cstyle |
604 | 604 | leads to a smaller number of bugs in code. |
605 | | -\item A pre-push hook that runs a C style check script and refuses to accept any |
606 | | -changesets not following the chosen C style is a working solution to avoid C |
607 | | -style violations. |
| 605 | +\item A process that runs C style check script before integration into a source |
| 606 | +code repository automatically and refuses to accept any changesets not following |
| 607 | +the chosen C style is a working solution to avoid C style violations. |
608 | 608 | \item \url{http://mff.devnull.cz/cstyle.html} |
609 | 609 | \end{itemize} |
610 | 610 |
|
|
692 | 692 | \end{tabular} |
693 | 693 |
|
694 | 694 | \begin{tabular}{ll} |
| 695 | +ifdef([[[NOSPELLCHECK]]], [[[ |
695 | 696 | \texttt{/usr/inc{}lude} & system header file root\\ |
696 | 697 | \texttt{/usr/lib/lib*.a} & static libraries\\ |
697 | 698 | \texttt{/usr/lib/lib*.so} & dynamic libraries |
| 699 | +]]]) |
698 | 700 | \end{tabular} |
699 | 701 | \end{slide} |
700 | 702 |
|
|
1051 | 1053 | \renewcommand{\arraystretch}{0.1} |
1052 | 1054 | \setlength{\tabcolsep}{0.25ex} |
1053 | 1055 | \begin{tabular}{lclcl} |
| 1056 | +ifdef([[[NOSPELLCHECK]]], [[[ |
1054 | 1057 | \texttt{main.c} & & & & \\ |
1055 | 1058 | & $\searrow$ & & & \\ |
1056 | 1059 | & & \texttt{main.o} & & \\ |
|
1060 | 1063 | & & \texttt{util.o} & & \\ |
1061 | 1064 | & $\nearrow$ & & & \\ |
1062 | 1065 | \texttt{util.c} & & & & \\ |
| 1066 | +]]]) |
1063 | 1067 | \end{tabular} |
1064 | 1068 | \end{itemize} |
1065 | 1069 | \end{minipage}\hfill |
|
1091 | 1095 | some files have been changed. You could always do something like |
1092 | 1096 | ``\texttt{make clean; make all}'' but if the whole compilation process takes |
1093 | 1097 | minutes or even hours, you really want a well written \texttt{Makefile}. |
1094 | | -\item A line ``\verb#prog : main.o util.o#'' defines that before \texttt{prog} |
1095 | | -is checked, the existence of |
| 1098 | +\item A line ifdef([[[NOSPELLCHECK]]], [[[``\verb#prog : main.o util.o#'']]]) |
| 1099 | +defines that before \texttt{prog} is checked, the existence of |
1096 | 1100 | \texttt{main.o} and \texttt{util.o} needs to be checked, and also whether they |
1097 | 1101 | are up to date. That check is performed recursively. After that, the existence |
1098 | 1102 | of \texttt{prog} is checked and whether it is up-to-date, which means whether |
|
1535 | 1539 | \sltitle{Debugger \texttt{dbx}} |
1536 | 1540 | \begin{itemize} |
1537 | 1541 | \item Usage:\\ |
| 1542 | +ifdef([[[NOSPELLCHECK]]], [[[ |
1538 | 1543 | \texttt{dbx [ \emph{options} ] [ \emph{program} [ \emph{core} ] ]} |
| 1544 | +]]]) |
1539 | 1545 | \item Most common commands:\\ |
1540 | 1546 | \renewcommand{\arraystretch}{0.9} |
1541 | 1547 | \begin{tabular}{ll} |
|
1544 | 1550 | \texttt{print \emph{expr}} & print expression\\ |
1545 | 1551 | \texttt{set \emph{var} = \emph{expr}} & change value of variable\\ |
1546 | 1552 | \texttt{cont} & continue program run\\ |
1547 | | -\texttt{next}, \texttt{step} & execute a line (with/out going into func)\\ |
| 1553 | +\texttt{next}, \texttt{step} & execute a line (with/out going into function)\\ |
1548 | 1554 | \texttt{stop \emph{condition}} & set breakpoint\\ |
1549 | 1555 | \texttt{trace \emph{condition}} & remove tracepoint\\ |
1550 | 1556 | \texttt{command \emph{n}} & action on breakpoint (commands follow)\\ |
|
1566 | 1572 | option for translation, it is also necessary to have the object files and source |
1567 | 1573 | files available in the same location as they were used for compilation. |
1568 | 1574 | This is typically true when debugging on the system where the code is written. |
1569 | | -For other use cases it is necessary to provide the needed files, the dbx |
1570 | | -command \texttt{pathmap} can help with that. |
| 1575 | +For other use cases it is necessary to provide the needed files, the |
| 1576 | +\texttt{dbx} command \texttt{pathmap} can help with that. |
1571 | 1577 | \item \texttt{gdb}-compatible mode can be enabled using \texttt{gdb on}. |
1572 | 1578 | If you want to know the \texttt{dbx} equivalent command to concrete |
1573 | 1579 | \texttt{gdb} command, see the \texttt{help FAQ}; the very first question is |
1574 | | -``A.1 Gdb does $<$something$>$; how do I do it in dbx?'' |
1575 | | -\item If the option \texttt{-g} is not used, dbx will be still usable on |
1576 | | -Solaris, because it will print function arguments. On BSD systems and Linux |
| 1580 | +``A.1 Gdb does $<$something$>$; how do I do it in \texttt{dbx} ?'' |
| 1581 | +\item If the option \texttt{-g} is not used, \texttt{dbx} will be still usable |
| 1582 | +on Solaris, because it will print function arguments. On BSD systems and Linux |
1577 | 1583 | distributions, the \texttt{-g} has to be used, otherwise the debuggers will not |
1578 | 1584 | be of much use. This is demonstrated in the \example{debug/dbx.c} example. |
1579 | | -When compiling with gcc and using gdb the \texttt{where} command will not show |
1580 | | -the function parameters, while on Solaris with the Studio compiler and dbx |
1581 | | -debugger, the function parameters will be shown. |
| 1585 | +When compiling with \texttt{gcc} and using \texttt{gdb} the \texttt{where} |
| 1586 | +command will not show the function parameters, while on Solaris with the Studio |
| 1587 | +compiler and \texttt{dbx} debugger, the function parameters will be shown. |
1582 | 1588 | \item Example: \example{debug/coredump.c}. After compilation and running the |
1583 | 1589 | program will crash and a core dump will be generated (if permitted on the system; |
1584 | 1590 | also see \texttt{ulimit -c}) |
|
1633 | 1639 | \texttt{print \emph{expr}} & print expression\\ |
1634 | 1640 | \texttt{set \emph{var} = \emph{expr}} & change value of variable\\ |
1635 | 1641 | \texttt{cont} & continue program run\\ |
1636 | | -\texttt{next}, \texttt{step} & execute a line (with/out going into func)\\ |
| 1642 | +\texttt{next}, \texttt{step} & execute a line (with/out going into function)\\ |
1637 | 1643 | \texttt{break \emph{condition}} & set breakpoint\\ |
1638 | 1644 | \texttt{help [\emph{name}]} & print help\\ |
1639 | 1645 | \texttt{quit} & debugger exit |
|
0 commit comments