You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2020/06/02 12:11:39 UTC

svn commit: r1878392 - in /httpd/httpd/branches/2.4.x: ./ .gdbinit

Author: rpluem
Date: Tue Jun  2 12:11:39 2020
New Revision: 1878392

URL: http://svn.apache.org/viewvc?rev=1878392&view=rev
Log:
Merge r1876679 from trunk:

gdbinit: print bucket fd when available. [skip ci]
Submitted by: ylavic
Reviewed by: rpluem

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/.gdbinit

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1876679

Modified: httpd/httpd/branches/2.4.x/.gdbinit
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/.gdbinit?rev=1878392&r1=1878391&r2=1878392&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/.gdbinit (original)
+++ httpd/httpd/branches/2.4.x/.gdbinit Tue Jun  2 12:11:39 2020
@@ -151,18 +151,13 @@ define dump_bucket_ex
         print_bkt_datacol "rc" "n/%c" 'a' $sh
 
     else
-    if (($bucket->type == &apr_bucket_type_file) || \
-        ($bucket->type == &apr_bucket_type_pipe) || \
-        ($bucket->type == &apr_bucket_type_socket))
-
-        # buckets that contain data not in memory (ie not printable)
-
-        print_bkt_datacol "contents" "[**unprintable**%c" ']' $sh
-        printf "     "
-        if $bucket->type == &apr_bucket_type_file
-            set $refcount = ((apr_bucket_refcount *)$bucket->data)->refcount
-            print_bkt_datacol "rc" "%d" $refcount $sh
-        end
+    if ($bucket->type == &apr_bucket_type_file)
+
+        # file bucket, can show fd and refcount
+        set $fd = ((apr_bucket_file*)$bucket->data)->fd->filedes
+        print_bkt_datacol "contents" "[***file***] fd=%-6ld" (long)$fd $sh
+        set $refcount = ((apr_bucket_refcount *)$bucket->data)->refcount
+        print_bkt_datacol "rc" "%d" $refcount $sh
 
     else
     if (($bucket->type == &apr_bucket_type_heap)      || \
@@ -230,8 +225,27 @@ define dump_bucket_ex
         end
 
     else
-        # 3rd-party bucket type
-        print_bkt_datacol "contents" "[**unknown**%c" ']' $sh
+        if ($bucket->type == &apr_bucket_type_pipe)
+
+            # pipe bucket, can show fd
+            set $fd = ((apr_file_t*)$bucket->data)->filedes;
+            print_bkt_datacol "contents" "[***pipe***] fd=%-6ld" (long)$fd $sh
+
+        else
+        if ($bucket->type == &apr_bucket_type_socket)
+
+            # file bucket, can show fd
+            set $fd = ((apr_socket_t*)$bucket->data)->socketdes;
+            print_bkt_datacol "contents" "[**socket**] fd=%-6ld" (long)$fd $sh
+
+        else
+
+            # 3rd-party bucket type
+            print_bkt_datacol "contents" "[**opaque**]%-10c" ' ' $sh
+        end
+        end
+
+        # no refcount
         printf "         "
         print_bkt_datacol "rc" "n/%c" 'a' $sh
     end