Branch Coverage

blib/lib/Parse/Readelf/Debug/Info.pm
Criterion Covered Total %
branch 227 252 90.0


line true false branch
798 1 23 unless ($file_name)
800 1 22 if (ref $this)
802 1 22 unless (-f $file_name)
804 1 21 if (defined $line_info and ref $line_info ne 'Parse::Readelf::Debug::Line')
809 17 4 unless defined $line_info
813 1 20 unless open READELF, '-|', $command . ' ' . $file_name
819 18 142 if /$re_section_start/
836 114 89006 if (/$re_dwarf_version/) { }
114 88892 elsif (/$re_unit_offset/) { }
84 88808 elsif (/$re_unit_signature/) { }
84 88724 elsif (/$re_type_offset/) { }
839 1 113 unless defined $re_item_start[$version]
857 0 84 unless $signature
862 54 89065 unless $version >= 0
865 17 89048 if (/$re_section_stop/ and not /$re_section_start/ or eof READELF)
872 19905 69160 if ($end_of_section or /$re_item_start[$version]/i) { }
31361 37799 elsif (not defined $item) { }
163 37636 elsif (/$re_abstract_origin[$version]/i) { }
0 37636 elsif (/$re_alignment[$version]/i) { }
112 37524 elsif (/$re_bit_offset[$version]/i) { }
112 37412 elsif (/$re_bit_size[$version]/i) { }
1858 35554 elsif (/$re_byte_size[$version]/i) { }
29 35525 elsif (/$re_comp_dir[$version]/i) { }
0 35525 elsif (/$re_const_expr[$version]/i) { }
883 34642 elsif (/$re_const_value[$version]/i) { }
0 34642 elsif (/$re_containing_type[$version]/i) { }
3435 31207 elsif (/$re_decl_file[$version]/i) { }
3435 27772 elsif (/$re_decl_line[$version]/i) { }
1479 26293 elsif (/$re_declaration[$version]/i) { }
0 26293 elsif (/$re_default_value[$version]/i) { }
601 25692 elsif (/$re_encoding[$version]/i) { }
1128 24564 elsif (/$re_external[$version]/i) { }
29 24535 elsif (/$re_language[$version]/i) { }
33 24502 elsif (defined $re_linkage_name_tag[$version] and /$re_linkage_name_tag[$version]/i) { }
172 24330 elsif (/$re_location[$version]/i) { }
1264 23066 elsif (/$re_member_location[$version]/i) { }
4680 18386 elsif (/$re_name_tag[$version]/i) { }
29 18357 elsif (/$re_producer[$version]/i) { }
21 18336 elsif (defined $re_signature_tag[$version] and /$re_signature_tag[$version]/i) { }
174 18162 elsif (/$re_specification[$version]/i) { }
12795 5367 elsif (/$re_type[$version]/i) { }
75 5292 elsif (/$re_upper_bound[$version]/i) { }
4380 912 elsif (/$re_ignored_attributes[$version]/i) { }
1 911 elsif (/^\s*(?:<[0-9A-F ]+>)?\s*(DW_AT_\w+)\s*:/i) { }
875 14749 5156 if (defined $item)
878 2748 12001 if ($signature)
883 2235 6009 if defined $item->{$_} and not $item->{$_} =~ /^S/
888 0 16857 if /^[0-9a-f]{1,7}$/
893 84 2664 if ($item->{'id'} eq $compilation_unit . '_' . $type_offset)
900 6 157 if (defined $item->{'abstract_origin'} and defined $item->{'type_tag'} and $item->{'type_tag'} eq 'DW_TAG_variable')
910 18160 568 if defined $item->{$_}
912 44 0 if ($item->{'type_tag'} eq 'DW_TAG_member' and not defined $item->{'member_location'} and $_ eq 'member_location' and $item->{'level'} > 1 and $level_stack[$item->{'level'} - 1]{'type_tag'} eq 'DW_TAG_union_type' and $level_stack[$item->{'level'} - 1]{'sub_items'})
923 18 26 if (defined $sibling) { }
8 18 elsif ($item->{'level'} <= 2) { }
930 15 3 if (defined $sibling->{'member_location'})
946 7 3 if ($item->{'type_tag'} eq 'DW_TAG_member' and defined $item->{'member_location'} and defined $item->{'type'} and defined $self{'item_map'}{$item->{'type'}} and not defined $self{'item_map'}{$item->{'type'}}{'member_location'})
965 14198 5701 if (defined $item)
968 0 14198 unless $item->{'type_tag'}
972 14169 29 if ($item->{'level'} >= 1)
976 10973 3196 if $item->{'level'} > 1
980 36 0 if ($item->{'type_tag'} eq 'DW_TAG_inheritance' and not defined $item->{'decl_file'} and defined $level_stack[$item->{'level'} - 1]{'decl_file'})
993 117 42 if (not defined $name and $item->{'type_tag'} =~ /^DW_TAG_(?:class|structure|union)_type$/ and defined $item->{'specification'} and defined $self{'item_map'}{$item->{'specification'}})
1004 4581 9617 if (defined $name)
1006 3405 1176 if (not defined $self{'name_map'}{$name}) { }
554 622 elsif (ref $self{'name_map'}{$name} eq 'HASH') { }
622 0 elsif (ref $self{'name_map'}{$name} eq 'ARRAY') { }
1023 3333 10865 if (defined $item->{'decl_file'})
1029 22 536 if $item->{'type_tag'} eq 'DW_TAG_pointer_type' and not defined $item->{'name'} and not defined $item->{'type'}
1033 17 19882 if $end_of_section
1038 3510 16372 $signature ? :
1042 14749 5133 if (defined $tag_needs_attributes->{$4}) { }
5132 1 elsif ($is_ignored{$4}) { }
1077 0 0 defined $2 ? :
1098 1264 0 if defined $1
1105 0 21 defined $1 ? :
1109 144 12651 defined $2 ? :
1127 144 28252 if (defined $item->{$_} and $item->{$_} =~ /^S([0-9A-F]+)/i)
1133 1 18 unless close READELF
1136 1 17 unless @{$self{'items'};} > 0
1182 22 9 ref $id eq 'HASH' ? :
8 31 !defined($id) ? :
1225 7 37 if $re_name eq ''
1229 9093 1760 ref $_ eq 'HASH' ? :
1232 11389 2855 if defined $_->{'name'} and not $_->{'name'} =~ /$re_name/
1239 292 60 if not defined $_->{'name'} and $re_name ne '' and not $_->{'type_tag'} =~ /^DW_TAG_(?:class|structure|union)_type$/ && defined $_->{'specification'} && $this->{'item_map'}{$_->{'specification'}}{'name'} =~ /$re_name/
1240 1648 915 if defined $_->{'type_tag'} and not $_->{'type_tag'} =~ /$re_type_tag/
1241 0 915 if not defined $_->{'type_tag'} and $re_type_tag ne ''
1242 913 2 defined $_->{'name'} ? :
1304 51 644 unless defined $initial_offset
1309 285 410 unless defined $item and defined $item->{'decl_file'}
1312 361 49 if (defined $this->{'sl_level'}) { }
1327 49 7 if ($display_nested_items or $item->{'type_tag'} ne 'DW_TAG_structure_type' or $level < 1 or $item->{'type_tag'} ne $this->{'tag_stack'}[$level - 1])
1334 2 0 if (not defined $name and $level < 1 and $item->{'type_tag'} =~ /^DW_TAG_(?:class|structure|union)_type$/ and defined $item->{'specification'} and defined $this->{'item_map'}{$item->{'specification'}})
1342 12 391 unless defined $name
1346 286 117 defined $item->{'member_location'} ? :
1350 149 254 defined $item->{'byte_size'} ? :
1354 78 325 if (defined $item->{'bit_size'} or defined $item->{'bit_offset'})
1357 78 0 defined $item->{'bit_size'} ? :
1359 78 0 defined $item->{'bit_offset'} ? :
1365 332 71 if (defined $item->{'type'})
1374 22 364 if ($type->{'type_tag'} eq 'DW_TAG_const_type') { }
6 358 elsif ($type->{'type_tag'} eq 'DW_TAG_volatile_type') { }
8 350 elsif ($type->{'type_tag'} eq 'DW_TAG_reference_type') { }
16 334 elsif ($type->{'type_tag'} eq 'DW_TAG_pointer_type') { }
14 320 elsif ($type->{'type_tag'} eq 'DW_TAG_array_type') { }
1376 14 8 unless $prefix =~ /const/
1383 6 0 unless $prefix =~ /volatile/
1398 4 12 if (defined $type->{'type'} and defined $this->{'item_map'}{$type->{'type'}})
1412 14 0 if defined $type->{'sub_items'}[$_]{'upper_bound'}
1425 248 6 if $size == 0 and defined $type->{'byte_size'} and $type->{'byte_size'} > 0
1431 6 326 if ($type->{'type_tag'} =~ /^DW_TAG_(?:class|structure|union)_type$/ and defined $type->{'specification'})
1437 330 2 if defined $type->{'name'}
1439 0 2 if $type_name eq '' and $prefix || $postfix
1441 14 318 if $prefix
1442 24 308 if $postfix
1445 2 330 if defined $re_substructure_filter and $type_name =~ /$re_substructure_filter/
1456 6 0 if defined $type->{'byte_size'} and $type->{'byte_size'} > 0
1469 312 0 unless $_->{'type_tag'} eq 'DW_TAG_typedef'
1473 119 284 if (@sub_layout)
1477 73 20 defined $Parse::Readelf::Debug::Info::b->[$BITOFFSET] ? :
19 163 defined $Parse::Readelf::Debug::Info::b->[$BITOFFSET] ? :
93 182 defined $Parse::Readelf::Debug::Info::a->[$BITOFFSET] ? :
0 112 unless $Parse::Readelf::Debug::Info::a->[$OFFSET] <=> $Parse::Readelf::Debug::Info::b->[$OFFSET] or defined $Parse::Readelf::Debug::Info::a->[$BITOFFSET] ? defined $Parse::Readelf::Debug::Info::b->[$BITOFFSET] ? $Parse::Readelf::Debug::Info::a->[$BITOFFSET] <=> $Parse::Readelf::Debug::Info::b->[$BITOFFSET] : 1 : (defined $Parse::Readelf::Debug::Info::b->[$BITOFFSET] ? -1 : 0)
1493 403 0 if (defined $item->{'compilation_unit'} and defined $item->{'decl_file'} and defined $item->{'decl_line'})
1503 7 396 if ($item->{'type_tag'} =~ /^DW_TAG_(?:class|structure|union)_type$/ and not $name and not $type_name and 0 == @bit_data) { }
1519 361 49 if ($this->{'sl_level'} > 0) { }