You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2021/11/21 18:09:24 UTC

svn commit: r1895245 - /httpd/site/trunk/content/dev/debugging.mdtext

Author: covener
Date: Sun Nov 21 18:09:24 2021
New Revision: 1895245

URL: http://svn.apache.org/viewvc?rev=1895245&view=rev
Log:
"thread apply all bt" for live process example

also provide one-liner

Modified:
    httpd/site/trunk/content/dev/debugging.mdtext

Modified: httpd/site/trunk/content/dev/debugging.mdtext
URL: http://svn.apache.org/viewvc/httpd/site/trunk/content/dev/debugging.mdtext?rev=1895245&r1=1895244&r2=1895245&view=diff
==============================================================================
--- httpd/site/trunk/content/dev/debugging.mdtext (original)
+++ httpd/site/trunk/content/dev/debugging.mdtext Sun Nov 21 18:09:24 2021
@@ -199,7 +199,12 @@ to display a a live backtrace. For examp
      000162fc _start   (0, 0, 0, 0, 0, 0) + 5c
 </pre>
 Another technique is to use gdb to attach to the running process and then
-using "where" to print the backtrace, as in
+using "thread apply all bt" to print the backtrace, as in this one-liner:
+
+> sudo gdb /path/to/bin/httpd 204826 --batch --eval-command "where" --eval-command "thread apply all bt" --eval-command "detach"  --eval-command "quit" | tee gdb-output.txt
+
+Or interactively:
+
 <pre>
     % gdb httpd 10623
     GDB is free software and you are welcome to distribute copies of it
@@ -212,14 +217,7 @@ using "where" to print the backtrace, as
     /usr/local/apache/src/10623: No such file or directory.
     Attaching to program `/usr/local/apache/src/httpd', process 10623
     Reading symbols from /usr/lib/libsocket.so.1...done.
-    Reading symbols from /usr/lib/libnsl.so.1...done.
-    Reading symbols from /usr/lib/libc.so.1...done.
-    Reading symbols from /usr/lib/libdl.so.1...done.
-    Reading symbols from /usr/lib/libintl.so.1...done.
-    Reading symbols from /usr/lib/libmp.so.1...done.
-    Reading symbols from /usr/lib/libw.so.1...done.
-    Reading symbols from
-    /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...done.
+    ...
     0xef5b68d8 in   ()
     (gdb) where
     #0	0xef5b68d8 in	()
@@ -227,7 +225,11 @@ using "where" to print the backtrace, as
     #2	0x4257c in wait_or_timeout (status=0x0) at http_main.c:2357
     #3	0x44318 in standalone_main (argc=392552, argv=0x75800) at...
     #4	0x449fc in main (argc=3, argv=0xefffeee4) at http_main.c:4534
-    (gdb) 
+    (gdb) thread apply all bt
+    ...
+    (gdb) detach
+    [Inferior 1 (process 10623) detached]
+    (gdb) quit 
 </pre>
 
 # Getting a live backtrace on Windows # {#backtrace-win}