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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user