]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1876679 from trunk:
authorRuediger Pluem <rpluem@apache.org>
Tue, 2 Jun 2020 12:11:39 +0000 (12:11 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 2 Jun 2020 12:11:39 +0000 (12:11 +0000)
gdbinit: print bucket fd when available. [skip ci]
Submitted by: ylavic
Reviewed by: rpluem

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1878392 13f79535-47bb-0310-9956-ffa450edef68

.gdbinit

index 2a3dddad35c217bac6e8c1ad4d4c9f6879f2291d..76ddc548dd0bf70a3b25ab0fee9d670af60cd895 100644 (file)
--- a/.gdbinit
+++ b/.gdbinit
@@ -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))
+    if ($bucket->type == &apr_bucket_type_file)
 
-        # 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
+        # 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