]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
scripts/find-alive.pl: Auto-detect auto-added ctors/dtors names (#1769)
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 1 Apr 2024 19:43:21 +0000 (19:43 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 2 Apr 2024 03:04:39 +0000 (03:04 +0000)
    debugs(24, 9, "constructed, this=" << static_cast<void*>(this) ...

    MemBlob.cc(54) MemBlob: constructed, this=0x557f06b3ef00 ...

Class constructor and destructor sources should not manually duplicate
class names in debugs() statements. Many existing classes do the right
thing, but find-alive.pl still insists on a manually added class name,
forcing its users to add a colon: `find-alive.pl MemBlob:`.

We now accommodate both legacy/manual and modern/auto use cases.

scripts/find-alive.pl

index 40422c15b14da2523081fb6f4e5b0d3cde0cc6de..f0331eef085f8f89767859facbcdfa3376fe8ca1 100755 (executable)
@@ -75,8 +75,8 @@ my %Pairs = (
 if (!$Pairs{$Thing}) {
     warn("guessing construction/destruction pattern for $Thing\n");
     $Pairs{$Thing} = [
-        "\\b$Thing construct.*, this=(\\S+)",
-        "\\b$Thing destruct.*, this=(\\S+)",
+        "\\b${Thing}:? construct.*, this=(\\S+)",
+        "\\b${Thing}:? destruct.*, this=(\\S+)",
         ];
 }