From: Alex Rousskov Date: Mon, 1 Apr 2024 19:43:21 +0000 (+0000) Subject: scripts/find-alive.pl: Auto-detect auto-added ctors/dtors names (#1769) X-Git-Tag: SQUID_7_0_1~155 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f4adbf753df8b8a56e07ee91938848a19a88d94;p=thirdparty%2Fsquid.git scripts/find-alive.pl: Auto-detect auto-added ctors/dtors names (#1769) debugs(24, 9, "constructed, this=" << static_cast(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. --- diff --git a/scripts/find-alive.pl b/scripts/find-alive.pl index 40422c15b1..f0331eef08 100755 --- a/scripts/find-alive.pl +++ b/scripts/find-alive.pl @@ -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+)", ]; }