1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

modified to work with printf()s that writes 0x-prefix on %p data

This commit is contained in:
Daniel Stenberg 2000-11-21 19:37:15 +00:00
parent 20dd0670ba
commit 5aa5ecb29b

View File

@ -24,7 +24,7 @@ while(<STDIN>) {
$linenum = $2; $linenum = $2;
$function = $3; $function = $3;
if($function =~ /free\(([0-9a-f]*)/) { if($function =~ /free\(0x([0-9a-f]*)/) {
$addr = $1; $addr = $1;
if($sizeataddr{$addr} <= 0) { if($sizeataddr{$addr} <= 0) {
print "FREE ERROR: No memory allocated: $line\n"; print "FREE ERROR: No memory allocated: $line\n";
@ -35,7 +35,7 @@ while(<STDIN>) {
$getmem{$addr}=""; # forget after a good free() $getmem{$addr}=""; # forget after a good free()
} }
} }
elsif($function =~ /malloc\((\d*)\) = ([0-9a-f]*)/) { elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) {
$size = $1; $size = $1;
$addr = $2; $addr = $2;
$sizeataddr{$addr}=$size; $sizeataddr{$addr}=$size;
@ -43,7 +43,7 @@ while(<STDIN>) {
$getmem{$addr}="$source:$linenum"; $getmem{$addr}="$source:$linenum";
} }
elsif($function =~ /realloc\(([0-9a-f]*), (\d*)\) = ([0-9a-f]*)/) { elsif($function =~ /realloc\(0x([0-9a-f]*), (\d*)\) = 0x([0-9a-f]*)/) {
$oldaddr = $1; $oldaddr = $1;
$newsize = $2; $newsize = $2;
$newaddr = $3; $newaddr = $3;
@ -57,7 +57,7 @@ while(<STDIN>) {
$getmem{$oldaddr}=""; $getmem{$oldaddr}="";
$getmem{$newaddr}="$source:$linenum"; $getmem{$newaddr}="$source:$linenum";
} }
elsif($function =~ /strdup\(([0-9a-f]*)\) \((\d*)\) = ([0-9a-f]*)/) { elsif($function =~ /strdup\(0x([0-9a-f]*)\) \((\d*)\) = 0x([0-9a-f]*)/) {
# strdup(a5b50) (8) = df7c0 # strdup(a5b50) (8) = df7c0
$dup = $1; $dup = $1;