Updated with more complete instructions on how to use gdb
authoraland <aland>
Tue, 28 Mar 2006 16:48:39 +0000 (16:48 +0000)
committeraland <aland>
Tue, 28 Mar 2006 16:48:39 +0000 (16:48 +0000)
doc/bugs

index 68d8882..52e74bf 100644 (file)
--- a/doc/bugs
+++ b/doc/bugs
@@ -46,12 +46,67 @@ BUGS
 
   $ gdb /path/to/executable /path/to/core/file
 
-  And then in 'gdb', do:
+  Enable logging in gdb via the following commands:
 
-  $ bt
+  (gdb) set logging file gdb-radiusd.log
+  (gdb) set logging on
 
-  Copy the output, and mail it to the list, along with the name of the
-  program you were running, and the name of the operating system.
+  and follow the instructions in section 4, below.
+
+3. DEBUGGING A LIVE SERVER
+
+  If you can't get a core dump, or the problem doesn't result in a
+  core dump, you may have to run the server under gdb.  To do this,
+  ensure that you have symbols in the binaries (i.e. a non-stripped
+  binary) by re-building the server as described in the previous
+  section.  Then, run the server under gdb as follows:
+
+  $ gdb radiusd
+
+  Enable logging in gdb via the following commands:
+
+  (gdb) set logging file gdb-radiusd.log
+  (gdb) set logging on
+
+  Tell gdb to pass any necessary command-line arguments to the
+  server:
+
+  (gdb) set args ...
+
+  Where the "..." are the command-line arguments you normally pass to
+  radiusd.  If you don't normally pass command-line arguments, this
+  line is not necessary.
+
+  Then, do:
+
+  (gdb) run
+
+  When something interesting happens, you can hit CTRL-C in the
+  window, and you should be back at the gdb prompt:
+
+  (gdb)
+
+  And follow the instructions in section 4, below.
+
+4. OBTAINING USEFUL INFORMATION
+
+  If the server was built with threads, you can do:
+
+  (gdb) info threads
+
+  Which will give you information about the threads.  If the server
+  isn't threaded, that command-line will print a message saying so.
+
+  Then, do:
+
+  (gdb) thread apply all bt full
+
+  If the server isn't threaded, the "thread apply" section isn't necessary
+
+  The output should be printed to the screen, and also sent to the
+  gdb-radiusd.log file.  Copy the log gile and mail it to the list, or
+  put it on a web page if it's too large.  Include the name of the
+  operating system.
   Without this information, it's impossible for anyone to know why the
   program core dumped.