DocBook police: open and close tags for <screen> should cuddle up to
the contents within.
This commit is contained in:
parent
f7eeb4d33c
commit
4a5e851cb2
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=9803
25 changed files with 257 additions and 520 deletions
|
|
@ -1,4 +1,4 @@
|
|||
<!-- $FreeBSD: doc/en_US.ISO_8859-1/articles/programming-tools/article.sgml,v 1.14 2001/04/09 00:33:41 dd Exp $ -->
|
||||
<!-- $FreeBSD: doc/en_US.ISO8859-1/articles/programming-tools/article.sgml,v 1.15 2001/04/17 15:53:39 nik Exp $ -->
|
||||
<!-- The FreeBSD Documentation Project -->
|
||||
|
||||
<!DOCTYPE ARTICLE PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN">
|
||||
|
|
@ -126,8 +126,7 @@
|
|||
<para>To get one of these packages, all you need to do is to
|
||||
click on the hotlink for the package, then run</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add <replaceable>package name</></userinput>
|
||||
</screen>
|
||||
<screen>&prompt.root; <userinput>pkg_add <replaceable>package name</></userinput></screen>
|
||||
|
||||
<para>as root. Obviously, you will need to have a fully
|
||||
functional FreeBSD 2.1.0 or later system for the package to
|
||||
|
|
@ -371,15 +370,13 @@
|
|||
<command>cc</command> is a front end that manages calling all these
|
||||
programs with the right arguments for you; simply typing</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>cc foobar.c</>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>cc foobar.c</></screen>
|
||||
|
||||
<para>will cause <filename>foobar.c</filename> to be compiled by all the
|
||||
steps above. If you have more than one file to compile, just do
|
||||
something like</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>cc foo.c bar.c</>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>cc foo.c bar.c</></screen>
|
||||
|
||||
<para>Note that the syntax checking is just that—checking
|
||||
the syntax. It will not check for any logical mistakes you may
|
||||
|
|
@ -557,8 +554,7 @@
|
|||
knows what you may be using in a few years time?</para>
|
||||
|
||||
<informalexample>
|
||||
<screen>&prompt.user; <userinput>cc -Wall -ansi -pedantic -o foobar foobar.c</userinput>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>cc -Wall -ansi -pedantic -o foobar foobar.c</userinput></screen>
|
||||
</informalexample>
|
||||
|
||||
<para>This will produce an executable <filename>foobar</filename>
|
||||
|
|
@ -1002,8 +998,7 @@ free(foo);
|
|||
<para>When you're working on a simple program with only one or
|
||||
two source files, typing in</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>cc file1.c file2.c</userinput>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>cc file1.c file2.c</userinput></screen>
|
||||
|
||||
<para>is not too bad, but it quickly becomes very tedious when
|
||||
there are several files—and it can take a while to
|
||||
|
|
@ -1013,8 +1008,7 @@ free(foo);
|
|||
recompile the source file if the source code has changed. So
|
||||
we could have something like:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>cc file1.o file2.o</userinput> … <userinput>file37.c</userinput> &hellip
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>cc file1.o file2.o</userinput> … <userinput>file37.c</userinput> &hellip</screen>
|
||||
|
||||
<para>if we'd changed <filename>file37.c</filename>, but not any
|
||||
of the others, since the last time we compiled. This may
|
||||
|
|
@ -1118,8 +1112,7 @@ install:
|
|||
<para>We can tell make which target we want to make by
|
||||
typing:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>make <replaceable>target</replaceable></userinput>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>make <replaceable>target</replaceable></userinput></screen>
|
||||
|
||||
<para><command>make</command> will then only look at that target
|
||||
and ignore any others. For example, if we type
|
||||
|
|
@ -1262,8 +1255,7 @@ DISTFILES= scheme-microcode+dist-7.3-freebsd.tgz
|
|||
for it in <filename>/usr/share/doc/psd/12.make</filename>. To
|
||||
view it, do</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>zmore paper.ascii.gz</userinput>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>zmore paper.ascii.gz</userinput></screen>
|
||||
|
||||
<para>in that directory.</para>
|
||||
|
||||
|
|
@ -1300,14 +1292,12 @@ DISTFILES= scheme-microcode+dist-7.3-freebsd.tgz
|
|||
<command>gdb</command> (<application>GNU
|
||||
debugger</application>). You start it up by typing</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>gdb <replaceable>progname</replaceable></userinput>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>gdb <replaceable>progname</replaceable></userinput></screen>
|
||||
|
||||
<para>although most people prefer to run it inside
|
||||
<application>Emacs</application>. You can do this by:</para>
|
||||
|
||||
<screen><userinput>M-x gdb RET <replaceable>progname</replaceable> RET</userinput>
|
||||
</screen>
|
||||
<screen><userinput>M-x gdb RET <replaceable>progname</replaceable> RET</userinput></screen>
|
||||
|
||||
<para>Using a debugger allows you to run the program under more
|
||||
controlled circumstances. Typically, you can step through the
|
||||
|
|
@ -1342,8 +1332,7 @@ DISTFILES= scheme-microcode+dist-7.3-freebsd.tgz
|
|||
see the name of the function you're in, instead of the source
|
||||
code. If you see a line like:</para>
|
||||
|
||||
<screen>… (no debugging symbols found) …
|
||||
</screen>
|
||||
<screen>… (no debugging symbols found) …</screen>
|
||||
|
||||
<para>when <command>gdb</command> starts up, you'll know that
|
||||
the program wasn't compiled with the <option>-g</option>
|
||||
|
|
@ -1398,8 +1387,7 @@ int bazz(int anint) {
|
|||
<screen>&prompt.user; <userinput>cc -g -o temp temp.c</userinput>
|
||||
&prompt.user; <userinput>./temp</userinput>
|
||||
This is my program
|
||||
anint = 4231
|
||||
</screen>
|
||||
anint = 4231</screen>
|
||||
|
||||
<para>That wasn't what we expected! Time to see what's going
|
||||
on!</para>
|
||||
|
|
@ -1419,8 +1407,7 @@ Breakpoint 1, main () at temp.c:9 <lineannotation><command>gdb</command> stops
|
|||
This is my program <lineannotation>Program prints out</>
|
||||
(gdb) <userinput>s</> <lineannotation>step into <function>bazz()</></>
|
||||
bazz (anint=4231) at temp.c:17 <lineannotation><command>gdb</command> displays stack frame</>
|
||||
(gdb)
|
||||
</screen>
|
||||
(gdb)</screen>
|
||||
|
||||
<para>Hang on a minute! How did <symbol>anint</symbol> get to be
|
||||
<literal>4231</literal>? Didn't we set it to be
|
||||
|
|
@ -1430,8 +1417,7 @@ bazz (anint=4231) at temp.c:17 <lineannotation><command>gdb</command> displays
|
|||
<screen>(gdb) <userinput>up</> <lineannotation>Move up call stack</>
|
||||
#1 0x1625 in main () at temp.c:11 <lineannotation><command>gdb</command> displays stack frame</>
|
||||
(gdb) <userinput>p i</> <lineannotation>Show us the value of <symbol>i</></>
|
||||
$1 = 4231 <lineannotation><command>gdb</command> displays <literal>4231</></>
|
||||
</screen>
|
||||
$1 = 4231 <lineannotation><command>gdb</command> displays <literal>4231</></></screen>
|
||||
|
||||
<para>Oh dear! Looking at the code, we forgot to initialise
|
||||
<symbol>i</symbol>. We meant to put</para>
|
||||
|
|
@ -1480,8 +1466,7 @@ main() {
|
|||
the usual way. Instead of typing <command>break</command> or
|
||||
<command>run</command>, type</para>
|
||||
|
||||
<screen>(gdb) <userinput>core <replaceable>progname</replaceable>.core</userinput>
|
||||
</screen>
|
||||
<screen>(gdb) <userinput>core <replaceable>progname</replaceable>.core</userinput></screen>
|
||||
|
||||
<para>If you're not in the same directory as the core file,
|
||||
you'll have to do <userinput>dir
|
||||
|
|
@ -1499,8 +1484,7 @@ Core was generated by `a.out'.
|
|||
Program terminated with signal 11, Segmentation fault.
|
||||
Cannot access memory at address 0x7020796d.
|
||||
#0 0x164a in bazz (anint=0x5) at temp.c:17
|
||||
(gdb)
|
||||
</screen>
|
||||
(gdb)</screen>
|
||||
|
||||
<para>In this case, the program was called
|
||||
<filename>a.out</filename>, so the core file is called
|
||||
|
|
@ -1519,8 +1503,7 @@ Cannot access memory at address 0x7020796d.
|
|||
#0 0x164a in bazz (anint=0x5) at temp.c:17
|
||||
#1 0xefbfd888 in end ()
|
||||
#2 0x162c in main () at temp.c:11
|
||||
(gdb)
|
||||
</screen>
|
||||
(gdb)</screen>
|
||||
|
||||
<para>The <function>end()</function> function is called when a
|
||||
program crashes; in this case, the <function>bazz()</function>
|
||||
|
|
@ -1541,8 +1524,7 @@ Cannot access memory at address 0x7020796d.
|
|||
use <command>ps</command> to find the process ID for the
|
||||
child, and do</para>
|
||||
|
||||
<screen>(gdb) <userinput>attach <replaceable>pid</replaceable></userinput>
|
||||
</screen>
|
||||
<screen>(gdb) <userinput>attach <replaceable>pid</replaceable></userinput></screen>
|
||||
|
||||
<para>in <command>gdb</command>, and then debug as usual.</para>
|
||||
|
||||
|
|
@ -1562,8 +1544,7 @@ else if (pid == 0) { /* child */
|
|||
sleep(10); /* Wait until someone attaches to us */
|
||||
<lineannotation>&hellip</lineannotation>
|
||||
} else { /* parent */
|
||||
<lineannotation>&hellip</lineannotation>
|
||||
</screen>
|
||||
<lineannotation>&hellip</lineannotation></screen>
|
||||
|
||||
<para>Now all you have to do is attach to the child, set
|
||||
<symbol>PauseMode</symbol> to <literal>0</literal>, and wait
|
||||
|
|
@ -2131,8 +2112,7 @@ in font-lock-auto-mode-list"
|
|||
Lisp</quote>. For example, if whizbang is a FreeBSD port, we
|
||||
can locate these files by doing</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>find /usr/ports/lang/whizbang -name "*.el" -print</userinput>
|
||||
</screen>
|
||||
<screen>&prompt.user; <userinput>find /usr/ports/lang/whizbang -name "*.el" -print</userinput></screen>
|
||||
|
||||
<para>and install them by copying them into the Emacs site Lisp
|
||||
directory. On FreeBSD 2.1.0-RELEASE, this is
|
||||
|
|
@ -2141,13 +2121,11 @@ in font-lock-auto-mode-list"
|
|||
<para>So for example, if the output from the find command
|
||||
was</para>
|
||||
|
||||
<screen>/usr/ports/lang/whizbang/work/misc/whizbang.el
|
||||
</screen>
|
||||
<screen>/usr/ports/lang/whizbang/work/misc/whizbang.el</screen>
|
||||
|
||||
<para>we would do</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cp /usr/ports/lang/whizbang/work/misc/whizbang.el /usr/local/share/emacs/site-lisp</userinput>
|
||||
</screen>
|
||||
<screen>&prompt.root; <userinput>cp /usr/ports/lang/whizbang/work/misc/whizbang.el /usr/local/share/emacs/site-lisp</userinput></screen>
|
||||
|
||||
<para>Next, we need to decide what extension whizbang source
|
||||
files have. Let's say for the sake of argument that they all
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue