Updated trace-malloc tools. Updated type inferences in types.dat.

Enhanced type inference logic in TraceMalloc.pm to allow substack
matching so we can have fallback types.
b=62996,r=blizzard,sr=waterson.


git-svn-id: svn://10.0.0.236/trunk@99622 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogc%netscape.com
2001-07-20 00:59:24 +00:00
parent 3d92ed6a67
commit c3443641e4
2 changed files with 464 additions and 66 deletions

View File

@@ -60,12 +60,22 @@ sub infer_type($) {
my $link = \%::Fingerprints;
my $last;
my $type = 'void*';
FRAME: foreach my $frame (@$stack) {
last FRAME unless $link;
$frame =~ s/\[.*\]$//; # ignore exact addresses, as they'll drift
$last = $link;
#
# Remember this type, but keep going. We use the longest match
# we find, but substacks of longer matches will also match.
#
if ($last->{'#type#'}) {
$type = $last->{'#type#'};
}
$link = $link->{$frame};
if (! $link) {
@@ -82,12 +92,7 @@ sub infer_type($) {
}
}
if ($last && $last->{'#type#'}) {
return $last->{'#type#'};
}
else {
return 'void*';
}
return $type;
}