1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

supports the new ADDR prefix for getaddrinfo() and freeaddrinfo() tracing

This commit is contained in:
Daniel Stenberg 2001-10-04 13:25:40 +00:00
parent 5d9ae88f58
commit cfb32ec0cd

View File

@ -167,6 +167,37 @@ while(<STDIN>) {
$fopens--; $fopens--;
} }
} }
}
# ADDR url.c:1282 getaddrinfo() = 0x5ddd
elsif($_ =~ /^ADDR ([^:]*):(\d*) (.*)/) {
# generic match for the filename+linenumber
$source = $1;
$linenum = $2;
$function = $3;
if($function =~ /getaddrinfo\(\) = (\(nil\)|0x([0-9a-f]*))/) {
my $add = $2;
if($add eq "(nil)") {
;
}
else {
$addrinfo{$add}=1;
$addrinfofile{$add}="$source:$linenum";
$addrinfos++;
}
}
# fclose(0x1026c8)
elsif($function =~ /freeaddrinfo\(0x([0-9a-f]*)\)/) {
if(!$addrinfo{$1}) {
print "freeaddrinfo() without getaddrinfo(): $line\n";
}
else {
$addrinfo{$1}=0;
$addrinfos--;
}
}
} }
else { else {
print "Not recognized prefix line: $line\n"; print "Not recognized prefix line: $line\n";
@ -203,6 +234,15 @@ if($fopens) {
} }
} }
if($addrinfos) {
print "IPv6-style name resolve data left at:\n";
for(keys %addrinfofile) {
if($addrinfo{$_} == 1) {
print "getaddrinfo() called at ".$addrinfofile{$_}."\n";
}
}
}
if($verbose) { if($verbose) {
print "Mallocs: $mallocs\n", print "Mallocs: $mallocs\n",
"Reallocs: $reallocs\n", "Reallocs: $reallocs\n",