--- a/doc/manual/troubleshoot.texi Mon Oct 19 17:35:02 2009 -0700
+++ b/doc/manual/troubleshoot.texi Mon Oct 19 07:54:31 2009 -0700
@@ -9,7 +9,9 @@
* Run-time errors::
@end menu
-Please note that the wiki (@uref{http://www.nsnam.org/wiki/index.php/Troubleshooting}) may have contributed items.
+Please note that the wiki @*
+(@uref{http://www.nsnam.org/wiki/index.php/Troubleshooting})
+may have contributed items.
@node Build errors
@section Build errors
@@ -23,18 +25,21 @@
Here is an example of what might occur:
-@verbatim
+@smallformat
+@example
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
Command ['/home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point'] exited with code -11
-@end verbatim
+@end example
+@end smallformat
The error message says that the program terminated unsuccessfully, but it is
not clear from this information what might be wrong. To examine more
closely, try running it under the @uref{http://sources.redhat.com/gdb/,,gdb debugger}:
-@verbatim
+@smallformat
+@example
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="gdb %s"
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
@@ -44,7 +49,8 @@
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
-This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
+This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
+library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point
@@ -61,7 +67,8 @@
$2 = {m_ptr = 0x0}
(gdb) quit
The program is running. Exit anyway? (y or n) y
-@end verbatim
+@end example
+@end smallformat
Note first the way the program was invoked-- pass the command to run as
an argument to the command template "gdb %s".
@@ -70,11 +77,13 @@
socketFactory.
Let's look around line 136 of tcp-point-to-point, as gdb suggests:
-@verbatim
+@smallformat
+@example
Ptr<SocketFactory> socketFactory = n2->GetObject<SocketFactory> (Tcp::iid);
Ptr<Socket> localSocket = socketFactory->CreateSocket ();
localSocket->Bind ();
-@end verbatim
+@end example
+@end smallformat
The culprit here is that the return value of GetObject is not being
checked and may be null.
@@ -82,6 +91,8 @@
Sometimes you may need to use the @uref{http://valgrind.org,,valgrind memory
checker} for more subtle errors. Again, you invoke the use of valgrind
similarly:
-@verbatim
+@smallformat
+@example
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="valgrind %s"
-@end verbatim
+@end example
+@end smallformat