3 # Remove certain <frame>.....</frame> records that are suspected to point
4 # to some kind of system library. Those are
5 # - frames with <obj>/lib/....
6 # - frames with <obj>/usr/lib/....
7 # - frames without source informatino and without a function name
9 # There may be others...
17 # Info about the current frame
18 my $has_source_info = 0; # <dir>, <file>, <line>
19 my $has_function_name = 0; # <fn>
20 my $has_system_obj = 0; # <obj>/lib... or <obj>/usr/lib...
25 if ($line =~ /<frame>/) {
28 $has_source_info = $has_function_name = $has_system_obj = 0;
37 if ($line =~ /<\/frame
>/) {
38 # Is this a frame we want to keep?
39 my $ignore_frame = $has_system_obj ||
40 (! $has_source_info && ! $has_function_name);
41 if (! $ignore_frame) {
46 $has_source_info = 1 if ($line =~ /<(dir|file|line)>/);
47 $has_function_name = 1 if ($line =~ /<fn>/);
48 # This may require tweaking; currently /lib and /usr/lib are matched
49 $has_system_obj = 1 if ($line =~ /<obj>\/lib
/);
50 $has_system_obj = 1 if ($line =~ /<obj>\/usr\
/lib/);