cvs commit: doc/en_US.ISO8859-1/books/faq book.sgml

Giorgos Keramidas keramida at freebsd.org
Sat Jul 5 03:48:04 UTC 2008


On Sat, 5 Jul 2008 02:24:32 +0000 (UTC), Gabor Pali <pgj at FreeBSD.org> wrote:
> pgj         2008-07-05 02:24:32 UTC
>
>   FreeBSD doc repository
>
>   Modified files:
>     en_US.ISO8859-1/books/faq book.sgml
>   Log:
>   Update Question 14.10:
>   - Rephrase the make(1) command for ppp(8)

Hi Gabor,

The old command was:

    make clean && make install

which ensures that *all* the sources of ppp(8) are compiled with the new
CFLAGS, so that -g can take effect.

The new command is:

    make install clean

If there is an already built version of the ppp(8) binary, this will
simply install the already existing binary, and then proceed to delete
it.

The suggestion about STRIP= and CFLAGS+='-g' is a bit old now too.  We
have support for debug builds in our build (see DEBUG_FLAGS in the
make(1) include files `bsd.own.mk', `bsd.prog.mk' and `bsd.lib.mk' at
`/usr/share/mk').  So the recommended way of rebuilding ppp(8) with
debugging flags should be:

    cd /usr/src/usr.sbin/ppp
    env DEBUG_FLAGS='-g' make clean
    env DEBUG_FLAGS='-g' make install

Does the following patch for this question look ok to you?

%%%
diff -r b0a718fb481d en_US.ISO8859-1/books/faq/book.sgml
--- a/en_US.ISO8859-1/books/faq/book.sgml	Sat Jul 05 06:32:27 2008 +0300
+++ b/en_US.ISO8859-1/books/faq/book.sgml	Sat Jul 05 06:46:04 2008 +0300
@@ -8566,18 +8566,34 @@
         </question>
 
         <answer>
-          <para>Your best bet here is to rebuild &man.ppp.8; by adding
-            <literal>CFLAGS+=-g</literal> and
-            <literal>STRIP=</literal> to the end of the <filename>/etc/make.conf</filename>, then
-            doing a <command>make <maketarget>install</maketarget>
-            <maketarget>clean</maketarget></command> in <filename>/usr/src/usr.sbin/ppp</filename>.  When &man.ppp.8; hangs, find the
-            &man.ppp.8; process ID with <command>pgrep
-            ppp</command> and run <command>gdb ppp
-            <replaceable>PID</replaceable></command> (as <command>gdb ppp `pgrep ppp`</command>).  From the <command>gdb</command>
-            prompt, you can then use <command>bt</command> to get a
-            stack trace.</para>
-
-          <para>Send the results to &a.brian;.</para>
+          <para>Your best bet here is to rebuild &man.ppp.8; with debugging
+	    information, and then use &man.gdb.1; to grab a stack trace from
+	    the <application>ppp</application> process that is stuck.  To
+	    rebuild the <application>ppp</application> utility with debugging
+	    information, you can type:</para>
+
+	  <screen>&prompt.root; <userinput>cd /usr/src/usr.sbin/ppp</userinput>
+&prompt.root; <userinput>env DEBUG_FLAGS='-g' make clean</userinput>
+&prompt.root; <userinput>env DEBUG_FLAGS='-g' make install</userinput></screen>
+
+	  <p>Then you should restart <application>ppp</application> and wait
+	    until it hangs again.  When the debug build
+	    of <application>ppp</application> hangs,
+	    start <application>gdb</application> on the stuck process by
+	    typing:</p>
+
+	  <screen>&prompt.root; <userinput>gdb ppp `pgrep ppp`</userinput></screen>
+
+	  <p>At the <application>gdb</application> prompt, you can use
+	    the <command>bt</command> or <command>where</command> commands to
+	    get a stack trace.  Save the output of
+	    your <application>gdb</application> session,
+	    and <quote>detach</quote> from the running process by
+	    the <command>quit</command> command
+	    of <application>gdb</application>.</p>
+
+	  <p>Finally, send the log of your <application>gdb</application>
+	    session to &a.brian;.</para>
         </answer>
       </qandaentry>
 
%%%


More information about the cvs-all mailing list