3 # This script is supposed to help use the param_mapper output.
4 # Give it a function and parameter and it lists the functions
5 # and parameters which are basically equivalent.
11 print ("trace_params.pl <smatch output file> <function> <parameter>\n");
27 if ($link =~ /$target/) {
28 %{$param_map{$link}}->{found
} = $FOUND;
32 if (%{$param_map{$link}}->{found
} == $FOUND) {
35 if (%{$param_map{$link}}->{found
} == $NOTFOUND) {
39 %{$param_map{$link}}->{found
} = $NOTFOUND;
40 foreach my $l (@
{%{$param_map{$link}}->{links
}}){
41 $found = recurse
($l, $target);
43 %{$param_map{$link}}->{found
} = $FOUND;
57 foreach my $link (keys %param_map){
58 recurse
($link, $target);
67 if (!defined($param_map{$one})) {
68 $param_map{$one} = {found
=> $UNKNOWN, links
=> []};
70 push @
{$param_map{$one}->{links
}}, $two;
79 if (/.*?:\d+ (.*?)\(\) info: param_mapper (\d+) => (.*?) (\d+)/) {
80 add_link
("$1%$2", "$3%$4");
87 foreach my $func (keys %param_map){
88 my $tmp = $param_map{$func};
90 if (%{$tmp}->{found
} == $FOUND) {
91 my ($f, $p) = split(/%/, $func);
101 if (!$file or !$func or !defined($param)) {
106 printf("Error: $file does not exist.\n");
111 compress_all
($func, $param);