aboutsummaryrefslogtreecommitdiff
path: root/memanalyze.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-21 19:37:15 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-21 19:37:15 +0000
commit5aa5ecb29b54b9f4c726623b5ad5488d02342ed5 (patch)
treeb231c935128e81d651a6b970c45d9f6cac0a624c /memanalyze.pl
parent20dd0670ba0907f41f414e7c988e7aa62a43f9b0 (diff)
downloadgnurl-5aa5ecb29b54b9f4c726623b5ad5488d02342ed5.tar.gz
gnurl-5aa5ecb29b54b9f4c726623b5ad5488d02342ed5.tar.bz2
gnurl-5aa5ecb29b54b9f4c726623b5ad5488d02342ed5.zip
modified to work with printf()s that writes 0x-prefix on %p data
Diffstat (limited to 'memanalyze.pl')
-rwxr-xr-xmemanalyze.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/memanalyze.pl b/memanalyze.pl
index 03b7b62f8..3b706af72 100755
--- a/memanalyze.pl
+++ b/memanalyze.pl
@@ -24,7 +24,7 @@ while(<STDIN>) {
$linenum = $2;
$function = $3;
- if($function =~ /free\(([0-9a-f]*)/) {
+ if($function =~ /free\(0x([0-9a-f]*)/) {
$addr = $1;
if($sizeataddr{$addr} <= 0) {
print "FREE ERROR: No memory allocated: $line\n";
@@ -35,7 +35,7 @@ while(<STDIN>) {
$getmem{$addr}=""; # forget after a good free()
}
}
- elsif($function =~ /malloc\((\d*)\) = ([0-9a-f]*)/) {
+ elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) {
$size = $1;
$addr = $2;
$sizeataddr{$addr}=$size;
@@ -43,7 +43,7 @@ while(<STDIN>) {
$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;
$newsize = $2;
$newaddr = $3;
@@ -57,7 +57,7 @@ while(<STDIN>) {
$getmem{$oldaddr}="";
$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
$dup = $1;