1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Copyright 2011-2014, Rene Gollent, rene@gollent.com. 4 * Distributed under the terms of the MIT License. 5 */ 6 7 #include "DebugInfoEntries.h" 8 9 #include <new> 10 11 #include "AttributeValue.h" 12 #include "Dwarf.h" 13 #include "SourceLanguageInfo.h" 14 15 16 // #pragma mark - DIECompileUnitBase 17 18 19 DIECompileUnitBase::DIECompileUnitBase() 20 : 21 fName(NULL), 22 fCompilationDir(NULL), 23 fLowPC(0), 24 fHighPC(0), 25 fStatementListOffset(-1), 26 fMacroInfoOffset(-1), 27 fAddressRangesOffset(-1), 28 fBaseTypesUnit(NULL), 29 fLanguage(0), 30 fIdentifierCase(0), 31 fUseUTF8(true), 32 fContainsMainSubprogram(false) 33 { 34 } 35 36 37 DIECompileUnitBase::~DIECompileUnitBase() 38 { 39 } 40 41 42 status_t 43 DIECompileUnitBase::InitAfterAttributes(DebugInfoEntryInitInfo& info) 44 { 45 switch (fLanguage) { 46 case 0: 47 info.languageInfo = &kUnknownLanguageInfo; 48 return B_OK; 49 case DW_LANG_C89: 50 info.languageInfo = &kC89LanguageInfo; 51 return B_OK; 52 case DW_LANG_C: 53 info.languageInfo = &kCLanguageInfo; 54 return B_OK; 55 case DW_LANG_C_plus_plus: 56 info.languageInfo = &kCPlusPlusLanguageInfo; 57 return B_OK; 58 case DW_LANG_C99: 59 info.languageInfo = &kC99LanguageInfo; 60 return B_OK; 61 default: 62 info.languageInfo = &kUnsupportedLanguageInfo; 63 return B_OK; 64 } 65 } 66 67 68 const char* 69 DIECompileUnitBase::Name() const 70 { 71 return fName; 72 } 73 74 75 status_t 76 DIECompileUnitBase::AddChild(DebugInfoEntry* child) 77 { 78 if (child->IsType()) 79 fTypes.Add(child); 80 else 81 fOtherChildren.Add(child); 82 return B_OK; 83 } 84 85 86 status_t 87 DIECompileUnitBase::AddAttribute_name(uint16 attributeName, 88 const AttributeValue& value) 89 { 90 fName = value.string; 91 return B_OK; 92 } 93 94 95 status_t 96 DIECompileUnitBase::AddAttribute_comp_dir(uint16 attributeName, 97 const AttributeValue& value) 98 { 99 fCompilationDir = value.string; 100 return B_OK; 101 } 102 103 104 status_t 105 DIECompileUnitBase::AddAttribute_low_pc(uint16 attributeName, 106 const AttributeValue& value) 107 { 108 fLowPC = value.address; 109 return B_OK; 110 } 111 112 113 status_t 114 DIECompileUnitBase::AddAttribute_high_pc(uint16 attributeName, 115 const AttributeValue& value) 116 { 117 fHighPC = value.address; 118 if (fLowPC != 0 && fHighPC < fLowPC) 119 fHighPC += fLowPC; 120 121 return B_OK; 122 } 123 124 125 status_t 126 DIECompileUnitBase::AddAttribute_producer(uint16 attributeName, 127 const AttributeValue& value) 128 { 129 // not interesting 130 return B_OK; 131 } 132 133 134 status_t 135 DIECompileUnitBase::AddAttribute_stmt_list(uint16 attributeName, 136 const AttributeValue& value) 137 { 138 fStatementListOffset = value.pointer; 139 return B_OK; 140 } 141 142 143 status_t 144 DIECompileUnitBase::AddAttribute_macro_info(uint16 attributeName, 145 const AttributeValue& value) 146 { 147 fMacroInfoOffset = value.pointer; 148 return B_OK; 149 } 150 151 152 status_t 153 DIECompileUnitBase::AddAttribute_base_types(uint16 attributeName, 154 const AttributeValue& value) 155 { 156 fBaseTypesUnit = dynamic_cast<DIECompileUnitBase*>(value.reference); 157 return fBaseTypesUnit != NULL ? B_OK : B_BAD_DATA; 158 } 159 160 161 status_t 162 DIECompileUnitBase::AddAttribute_language(uint16 attributeName, 163 const AttributeValue& value) 164 { 165 fLanguage = value.constant; 166 return B_OK; 167 } 168 169 170 status_t 171 DIECompileUnitBase::AddAttribute_identifier_case(uint16 attributeName, 172 const AttributeValue& value) 173 { 174 fIdentifierCase = value.constant; 175 return B_OK; 176 } 177 178 179 status_t 180 DIECompileUnitBase::AddAttribute_use_UTF8(uint16 attributeName, 181 const AttributeValue& value) 182 { 183 fUseUTF8 = value.flag; 184 return B_OK; 185 } 186 187 188 status_t 189 DIECompileUnitBase::AddAttribute_ranges(uint16 attributeName, 190 const AttributeValue& value) 191 { 192 fAddressRangesOffset = value.pointer; 193 return B_OK; 194 } 195 196 197 status_t 198 DIECompileUnitBase::AddAttribute_main_subprogram(uint16 attributeName, 199 const AttributeValue& value) 200 { 201 fContainsMainSubprogram = true; 202 return B_OK; 203 } 204 205 206 // #pragma mark - DIEType 207 208 209 DIEType::DIEType() 210 : 211 fName(NULL) 212 { 213 fAllocated.SetTo((uint64)0); 214 fAssociated.SetTo((uint64)0); 215 } 216 217 218 bool 219 DIEType::IsType() const 220 { 221 return true; 222 } 223 224 225 const char* 226 DIEType::Name() const 227 { 228 return fName; 229 } 230 231 232 bool 233 DIEType::IsDeclaration() const 234 { 235 return false; 236 } 237 238 239 const DynamicAttributeValue* 240 DIEType::ByteSize() const 241 { 242 return NULL; 243 } 244 245 246 status_t 247 DIEType::AddAttribute_name(uint16 attributeName, 248 const AttributeValue& value) 249 { 250 fName = value.string; 251 return B_OK; 252 } 253 254 255 status_t 256 DIEType::AddAttribute_allocated(uint16 attributeName, 257 const AttributeValue& value) 258 { 259 return SetDynamicAttributeValue(fAllocated, value); 260 } 261 262 263 status_t 264 DIEType::AddAttribute_associated(uint16 attributeName, 265 const AttributeValue& value) 266 { 267 return SetDynamicAttributeValue(fAssociated, value); 268 } 269 270 271 // #pragma mark - DIEModifiedType 272 273 274 DIEModifiedType::DIEModifiedType() 275 : 276 fType(NULL) 277 { 278 } 279 280 281 status_t 282 DIEModifiedType::AddAttribute_type(uint16 attributeName, 283 const AttributeValue& value) 284 { 285 fType = dynamic_cast<DIEType*>(value.reference); 286 return fType != NULL ? B_OK : B_BAD_DATA; 287 } 288 289 290 // #pragma mark - DIEAddressingType 291 292 293 DIEAddressingType::DIEAddressingType() 294 : 295 fAddressClass(0) 296 { 297 } 298 299 300 status_t 301 DIEAddressingType::AddAttribute_address_class(uint16 attributeName, 302 const AttributeValue& value) 303 { 304 // TODO: How is the address class handled? 305 fAddressClass = value.constant; 306 return B_OK; 307 } 308 309 310 // #pragma mark - DIEDeclaredType 311 312 313 DIEDeclaredType::DIEDeclaredType() 314 : 315 fDescription(NULL), 316 fAbstractOrigin(NULL), 317 fSignatureType(NULL), 318 fAccessibility(0), 319 fDeclaration(false) 320 { 321 } 322 323 324 const char* 325 DIEDeclaredType::Description() const 326 { 327 return fDescription; 328 } 329 330 331 DebugInfoEntry* 332 DIEDeclaredType::AbstractOrigin() const 333 { 334 return fAbstractOrigin; 335 } 336 337 338 DebugInfoEntry* 339 DIEDeclaredType::SignatureType() const 340 { 341 return fSignatureType; 342 } 343 344 345 bool 346 DIEDeclaredType::IsDeclaration() const 347 { 348 return fDeclaration; 349 } 350 351 352 status_t 353 DIEDeclaredType::AddAttribute_accessibility(uint16 attributeName, 354 const AttributeValue& value) 355 { 356 fAccessibility = value.constant; 357 return B_OK; 358 } 359 360 361 status_t 362 DIEDeclaredType::AddAttribute_declaration(uint16 attributeName, 363 const AttributeValue& value) 364 { 365 fDeclaration = value.flag; 366 return B_OK; 367 } 368 369 370 status_t 371 DIEDeclaredType::AddAttribute_description(uint16 attributeName, 372 const AttributeValue& value) 373 { 374 fDescription = value.string; 375 return B_OK; 376 } 377 378 379 status_t 380 DIEDeclaredType::AddAttribute_abstract_origin(uint16 attributeName, 381 const AttributeValue& value) 382 { 383 fAbstractOrigin = value.reference; 384 return B_OK; 385 } 386 387 388 status_t 389 DIEDeclaredType::AddAttribute_signature(uint16 attributeName, 390 const AttributeValue& value) 391 { 392 fSignatureType = value.reference; 393 return B_OK; 394 } 395 396 397 DeclarationLocation* 398 DIEDeclaredType::GetDeclarationLocation() 399 { 400 return &fDeclarationLocation; 401 } 402 403 404 // #pragma mark - DIEDerivedType 405 406 407 DIEDerivedType::DIEDerivedType() 408 : 409 fType(NULL) 410 { 411 } 412 413 414 status_t 415 DIEDerivedType::AddAttribute_type(uint16 attributeName, 416 const AttributeValue& value) 417 { 418 fType = dynamic_cast<DIEType*>(value.reference); 419 return fType != NULL ? B_OK : B_BAD_DATA; 420 } 421 422 423 424 425 // #pragma mark - DIECompoundType 426 427 428 DIECompoundType::DIECompoundType() 429 : 430 fSpecification(NULL) 431 { 432 } 433 434 435 bool 436 DIECompoundType::IsNamespace() const 437 { 438 return true; 439 } 440 441 442 DebugInfoEntry* 443 DIECompoundType::Specification() const 444 { 445 return fSpecification; 446 } 447 448 449 const DynamicAttributeValue* 450 DIECompoundType::ByteSize() const 451 { 452 return &fByteSize; 453 } 454 455 456 status_t 457 DIECompoundType::AddChild(DebugInfoEntry* child) 458 { 459 if (child->Tag() == DW_TAG_member) { 460 // TODO: Not for interfaces! 461 fDataMembers.Add(child); 462 return B_OK; 463 } 464 465 return DIEDeclaredType::AddChild(child); 466 } 467 468 469 status_t 470 DIECompoundType::AddAttribute_byte_size(uint16 attributeName, 471 const AttributeValue& value) 472 { 473 return SetDynamicAttributeValue(fByteSize, value); 474 } 475 476 477 status_t 478 DIECompoundType::AddAttribute_specification(uint16 attributeName, 479 const AttributeValue& value) 480 { 481 fSpecification = dynamic_cast<DIECompoundType*>(value.reference); 482 return fSpecification != NULL ? B_OK : B_BAD_DATA; 483 } 484 485 486 // #pragma mark - DIEClassBaseType 487 488 489 DIEClassBaseType::DIEClassBaseType() 490 { 491 } 492 493 494 status_t 495 DIEClassBaseType::AddChild(DebugInfoEntry* child) 496 { 497 switch (child->Tag()) { 498 case DW_TAG_inheritance: 499 fBaseTypes.Add(child); 500 return B_OK; 501 case DW_TAG_friend: 502 fFriends.Add(child); 503 return B_OK; 504 case DW_TAG_access_declaration: 505 fAccessDeclarations.Add(child); 506 return B_OK; 507 case DW_TAG_subprogram: 508 fMemberFunctions.Add(child); 509 return B_OK; 510 case DW_TAG_template_type_parameter: 511 case DW_TAG_template_value_parameter: 512 fTemplateParameters.Add(child); 513 return B_OK; 514 // TODO: Variants! 515 default: 516 { 517 if (child->IsType()) { 518 fInnerTypes.Add(child); 519 return B_OK; 520 } 521 522 return DIECompoundType::AddChild(child); 523 } 524 } 525 } 526 527 528 // #pragma mark - DIENamedBase 529 530 531 DIENamedBase::DIENamedBase() 532 : 533 fName(NULL), 534 fDescription(NULL) 535 { 536 } 537 538 539 const char* 540 DIENamedBase::Name() const 541 { 542 return fName; 543 } 544 545 546 const char* 547 DIENamedBase::Description() const 548 { 549 return fDescription; 550 } 551 552 553 status_t 554 DIENamedBase::AddAttribute_name(uint16 attributeName, 555 const AttributeValue& value) 556 { 557 fName = value.string; 558 return B_OK; 559 } 560 561 562 status_t 563 DIENamedBase::AddAttribute_description(uint16 attributeName, 564 const AttributeValue& value) 565 { 566 fDescription = value.string; 567 return B_OK; 568 } 569 570 571 // #pragma mark - DIEDeclaredBase 572 573 574 DIEDeclaredBase::DIEDeclaredBase() 575 { 576 } 577 578 579 DeclarationLocation* 580 DIEDeclaredBase::GetDeclarationLocation() 581 { 582 return &fDeclarationLocation; 583 } 584 585 586 // #pragma mark - DIEDeclaredNamedBase 587 588 589 DIEDeclaredNamedBase::DIEDeclaredNamedBase() 590 : 591 fName(NULL), 592 fDescription(NULL), 593 fAccessibility(0), 594 fVisibility(0), 595 fDeclaration(false) 596 { 597 } 598 599 600 const char* 601 DIEDeclaredNamedBase::Name() const 602 { 603 return fName; 604 } 605 606 607 const char* 608 DIEDeclaredNamedBase::Description() const 609 { 610 return fDescription; 611 } 612 613 614 bool 615 DIEDeclaredNamedBase::IsDeclaration() const 616 { 617 return fDeclaration; 618 } 619 620 621 status_t 622 DIEDeclaredNamedBase::AddAttribute_name(uint16 attributeName, 623 const AttributeValue& value) 624 { 625 fName = value.string; 626 return B_OK; 627 } 628 629 630 status_t 631 DIEDeclaredNamedBase::AddAttribute_description(uint16 attributeName, 632 const AttributeValue& value) 633 { 634 fDescription = value.string; 635 return B_OK; 636 } 637 638 639 status_t 640 DIEDeclaredNamedBase::AddAttribute_accessibility(uint16 attributeName, 641 const AttributeValue& value) 642 { 643 fAccessibility = value.constant; 644 return B_OK; 645 } 646 647 648 status_t 649 DIEDeclaredNamedBase::AddAttribute_declaration(uint16 attributeName, 650 const AttributeValue& value) 651 { 652 fDeclaration = value.flag; 653 return B_OK; 654 } 655 656 657 // #pragma mark - DIEArrayIndexType 658 659 660 DIEArrayIndexType::DIEArrayIndexType() 661 { 662 } 663 664 665 const DynamicAttributeValue* 666 DIEArrayIndexType::ByteSize() const 667 { 668 return &fByteSize; 669 } 670 671 672 status_t 673 DIEArrayIndexType::AddAttribute_bit_stride(uint16 attributeName, 674 const AttributeValue& value) 675 { 676 return SetDynamicAttributeValue(fBitStride, value); 677 } 678 679 680 status_t 681 DIEArrayIndexType::AddAttribute_byte_size(uint16 attributeName, 682 const AttributeValue& value) 683 { 684 return SetDynamicAttributeValue(fByteSize, value); 685 } 686 687 688 status_t 689 DIEArrayIndexType::AddAttribute_byte_stride(uint16 attributeName, 690 const AttributeValue& value) 691 { 692 return SetDynamicAttributeValue(fByteStride, value); 693 } 694 695 696 // #pragma mark - DIEArrayType 697 698 699 DIEArrayType::DIEArrayType() 700 : 701 fSpecification(NULL), 702 fOrdering(DW_ORD_row_major) 703 { 704 } 705 706 707 uint16 708 DIEArrayType::Tag() const 709 { 710 return DW_TAG_array_type; 711 } 712 713 714 status_t 715 DIEArrayType::InitAfterHierarchy(DebugInfoEntryInitInfo& info) 716 { 717 fOrdering = info.languageInfo->arrayOrdering; 718 return B_OK; 719 } 720 721 722 DebugInfoEntry* 723 DIEArrayType::Specification() const 724 { 725 return fSpecification; 726 } 727 728 729 const DynamicAttributeValue* 730 DIEArrayType::ByteSize() const 731 { 732 return &fByteSize; 733 } 734 735 736 status_t 737 DIEArrayType::AddChild(DebugInfoEntry* child) 738 { 739 // a dimension child must be of subrange or enumeration type 740 uint16 tag = child->Tag(); 741 if (tag == DW_TAG_subrange_type || tag == DW_TAG_enumeration_type) { 742 fDimensions.Add(child); 743 return B_OK; 744 } 745 746 return DIEDerivedType::AddChild(child); 747 } 748 749 750 status_t 751 DIEArrayType::AddAttribute_ordering(uint16 attributeName, 752 const AttributeValue& value) 753 { 754 fOrdering = value.constant; 755 return B_OK; 756 } 757 758 759 status_t 760 DIEArrayType::AddAttribute_bit_stride(uint16 attributeName, 761 const AttributeValue& value) 762 { 763 return SetDynamicAttributeValue(fBitStride, value); 764 } 765 766 767 status_t 768 DIEArrayType::AddAttribute_stride_size(uint16 attributeName, 769 const AttributeValue& value) 770 { 771 return SetDynamicAttributeValue(fBitStride, value); 772 } 773 774 775 status_t 776 DIEArrayType::AddAttribute_byte_size(uint16 attributeName, 777 const AttributeValue& value) 778 { 779 return SetDynamicAttributeValue(fByteSize, value); 780 } 781 782 783 status_t 784 DIEArrayType::AddAttribute_specification(uint16 attributeName, 785 const AttributeValue& value) 786 { 787 fSpecification = dynamic_cast<DIEArrayType*>(value.reference); 788 return fSpecification != NULL ? B_OK : B_BAD_DATA; 789 } 790 791 792 // #pragma mark - DIEClassType 793 794 795 DIEClassType::DIEClassType() 796 { 797 } 798 799 800 uint16 801 DIEClassType::Tag() const 802 { 803 return DW_TAG_class_type; 804 } 805 806 807 // #pragma mark - DIEEntryPoint 808 809 810 DIEEntryPoint::DIEEntryPoint() 811 { 812 } 813 814 815 uint16 816 DIEEntryPoint::Tag() const 817 { 818 return DW_TAG_entry_point; 819 } 820 821 822 // #pragma mark - DIEEnumerationType 823 824 825 DIEEnumerationType::DIEEnumerationType() 826 : 827 fSpecification(NULL) 828 { 829 } 830 831 832 uint16 833 DIEEnumerationType::Tag() const 834 { 835 return DW_TAG_enumeration_type; 836 } 837 838 839 DebugInfoEntry* 840 DIEEnumerationType::Specification() const 841 { 842 return fSpecification; 843 } 844 845 846 status_t 847 DIEEnumerationType::AddChild(DebugInfoEntry* child) 848 { 849 if (child->Tag() == DW_TAG_enumerator) { 850 fEnumerators.Add(child); 851 return B_OK; 852 } 853 854 return DIEDerivedType::AddChild(child); 855 } 856 857 858 status_t 859 DIEEnumerationType::AddAttribute_specification(uint16 attributeName, 860 const AttributeValue& value) 861 { 862 fSpecification = dynamic_cast<DIEEnumerationType*>(value.reference); 863 return fSpecification != NULL ? B_OK : B_BAD_DATA; 864 } 865 866 867 // #pragma mark - DIEFormalParameter 868 869 870 DIEFormalParameter::DIEFormalParameter() 871 : 872 fAbstractOrigin(NULL), 873 fType(NULL), 874 fArtificial(false) 875 { 876 } 877 878 879 uint16 880 DIEFormalParameter::Tag() const 881 { 882 return DW_TAG_formal_parameter; 883 } 884 885 886 DebugInfoEntry* 887 DIEFormalParameter::AbstractOrigin() const 888 { 889 return fAbstractOrigin; 890 } 891 892 893 LocationDescription* 894 DIEFormalParameter::GetLocationDescription() 895 { 896 return &fLocationDescription; 897 } 898 899 900 status_t 901 DIEFormalParameter::AddAttribute_abstract_origin(uint16 attributeName, 902 const AttributeValue& value) 903 { 904 fAbstractOrigin = value.reference; 905 return B_OK; 906 } 907 908 909 status_t 910 DIEFormalParameter::AddAttribute_artificial(uint16 attributeName, 911 const AttributeValue& value) 912 { 913 fArtificial = value.flag; 914 return B_OK; 915 } 916 917 918 status_t 919 DIEFormalParameter::AddAttribute_const_value(uint16 attributeName, 920 const AttributeValue& value) 921 { 922 return SetConstantAttributeValue(fValue, value); 923 } 924 925 926 status_t 927 DIEFormalParameter::AddAttribute_type(uint16 attributeName, 928 const AttributeValue& value) 929 { 930 fType = dynamic_cast<DIEType*>(value.reference); 931 return fType != NULL ? B_OK : B_BAD_DATA; 932 } 933 934 935 // #pragma mark - DIEImportedDeclaration 936 937 938 DIEImportedDeclaration::DIEImportedDeclaration() 939 { 940 } 941 942 943 uint16 944 DIEImportedDeclaration::Tag() const 945 { 946 return DW_TAG_imported_declaration; 947 } 948 949 950 // #pragma mark - DIELabel 951 952 953 DIELabel::DIELabel() 954 { 955 } 956 957 958 uint16 959 DIELabel::Tag() const 960 { 961 return DW_TAG_label; 962 } 963 964 965 // #pragma mark - DIELexicalBlock 966 967 968 DIELexicalBlock::DIELexicalBlock() 969 : 970 fLowPC(0), 971 fHighPC(0), 972 fAddressRangesOffset(-1), 973 fAbstractOrigin(NULL) 974 { 975 } 976 977 978 uint16 979 DIELexicalBlock::Tag() const 980 { 981 return DW_TAG_lexical_block; 982 } 983 984 985 DebugInfoEntry* 986 DIELexicalBlock::AbstractOrigin() const 987 { 988 return fAbstractOrigin; 989 } 990 991 992 status_t 993 DIELexicalBlock::AddChild(DebugInfoEntry* child) 994 { 995 switch (child->Tag()) { 996 case DW_TAG_variable: 997 fVariables.Add(child); 998 return B_OK; 999 case DW_TAG_lexical_block: 1000 fBlocks.Add(child); 1001 return B_OK; 1002 default: 1003 return DIENamedBase::AddChild(child); 1004 } 1005 } 1006 1007 1008 status_t 1009 DIELexicalBlock::AddAttribute_low_pc(uint16 attributeName, 1010 const AttributeValue& value) 1011 { 1012 fLowPC = value.address; 1013 return B_OK; 1014 } 1015 1016 1017 status_t 1018 DIELexicalBlock::AddAttribute_high_pc(uint16 attributeName, 1019 const AttributeValue& value) 1020 { 1021 fHighPC = value.address; 1022 if (fLowPC != 0 && fHighPC < fLowPC) 1023 fHighPC += fLowPC; 1024 1025 return B_OK; 1026 } 1027 1028 1029 status_t 1030 DIELexicalBlock::AddAttribute_ranges(uint16 attributeName, 1031 const AttributeValue& value) 1032 { 1033 fAddressRangesOffset = value.pointer; 1034 return B_OK; 1035 } 1036 1037 1038 status_t 1039 DIELexicalBlock::AddAttribute_abstract_origin(uint16 attributeName, 1040 const AttributeValue& value) 1041 { 1042 fAbstractOrigin = dynamic_cast<DIELexicalBlock*>(value.reference); 1043 return fAbstractOrigin != NULL ? B_OK : B_BAD_DATA; 1044 } 1045 1046 1047 // #pragma mark - DIEMember 1048 1049 1050 DIEMember::DIEMember() 1051 : 1052 fType(NULL) 1053 { 1054 } 1055 1056 1057 uint16 1058 DIEMember::Tag() const 1059 { 1060 return DW_TAG_member; 1061 } 1062 1063 1064 status_t 1065 DIEMember::AddAttribute_type(uint16 attributeName, 1066 const AttributeValue& value) 1067 { 1068 fType = dynamic_cast<DIEType*>(value.reference); 1069 return fType != NULL ? B_OK : B_BAD_DATA; 1070 } 1071 1072 1073 status_t 1074 DIEMember::AddAttribute_byte_size(uint16 attributeName, 1075 const AttributeValue& value) 1076 { 1077 return SetDynamicAttributeValue(fByteSize, value); 1078 } 1079 1080 1081 status_t 1082 DIEMember::AddAttribute_bit_size(uint16 attributeName, 1083 const AttributeValue& value) 1084 { 1085 return SetDynamicAttributeValue(fBitSize, value); 1086 } 1087 1088 1089 status_t 1090 DIEMember::AddAttribute_data_member_location(uint16 attributeName, 1091 const AttributeValue& value) 1092 { 1093 return SetMemberLocation(fLocation, value); 1094 } 1095 1096 1097 status_t 1098 DIEMember::AddAttribute_bit_offset(uint16 attributeName, 1099 const AttributeValue& value) 1100 { 1101 return SetDynamicAttributeValue(fBitOffset, value); 1102 } 1103 1104 1105 status_t 1106 DIEMember::AddAttribute_data_bit_offset(uint16 attributeName, 1107 const AttributeValue& value) 1108 { 1109 return SetDynamicAttributeValue(fDataBitOffset, value); 1110 } 1111 1112 1113 // #pragma mark - DIEPointerType 1114 1115 1116 DIEPointerType::DIEPointerType() 1117 : 1118 fSpecification(NULL) 1119 { 1120 } 1121 1122 1123 uint16 1124 DIEPointerType::Tag() const 1125 { 1126 return DW_TAG_pointer_type; 1127 } 1128 1129 1130 DebugInfoEntry* 1131 DIEPointerType::Specification() const 1132 { 1133 return fSpecification; 1134 } 1135 1136 1137 status_t 1138 DIEPointerType::AddAttribute_specification(uint16 attributeName, 1139 const AttributeValue& value) 1140 { 1141 fSpecification = dynamic_cast<DIEPointerType*>(value.reference); 1142 return fSpecification != NULL ? B_OK : B_BAD_DATA; 1143 } 1144 1145 1146 // #pragma mark - DIEReferenceType 1147 1148 1149 DIEReferenceType::DIEReferenceType() 1150 { 1151 } 1152 1153 1154 uint16 1155 DIEReferenceType::Tag() const 1156 { 1157 return DW_TAG_reference_type; 1158 } 1159 1160 1161 // #pragma mark - DIECompileUnit 1162 1163 1164 DIECompileUnit::DIECompileUnit() 1165 { 1166 } 1167 1168 1169 uint16 1170 DIECompileUnit::Tag() const 1171 { 1172 return DW_TAG_compile_unit; 1173 } 1174 1175 1176 // #pragma mark - DIEStringType 1177 1178 1179 DIEStringType::DIEStringType() 1180 { 1181 } 1182 1183 1184 uint16 1185 DIEStringType::Tag() const 1186 { 1187 return DW_TAG_string_type; 1188 } 1189 1190 1191 const DynamicAttributeValue* 1192 DIEStringType::ByteSize() const 1193 { 1194 return &fByteSize; 1195 } 1196 1197 1198 status_t 1199 DIEStringType::AddAttribute_byte_size(uint16 attributeName, 1200 const AttributeValue& value) 1201 { 1202 return SetDynamicAttributeValue(fByteSize, value); 1203 } 1204 1205 1206 // #pragma mark - DIEStructureType 1207 1208 1209 DIEStructureType::DIEStructureType() 1210 { 1211 } 1212 1213 1214 uint16 1215 DIEStructureType::Tag() const 1216 { 1217 return DW_TAG_structure_type; 1218 } 1219 1220 1221 // #pragma mark - DIESubroutineType 1222 1223 1224 DIESubroutineType::DIESubroutineType() 1225 : 1226 fReturnType(NULL), 1227 fAddressClass(0), 1228 fPrototyped(false) 1229 { 1230 } 1231 1232 1233 uint16 1234 DIESubroutineType::Tag() const 1235 { 1236 return DW_TAG_subroutine_type; 1237 } 1238 1239 1240 status_t 1241 DIESubroutineType::AddChild(DebugInfoEntry* child) 1242 { 1243 switch (child->Tag()) { 1244 case DW_TAG_formal_parameter: 1245 case DW_TAG_unspecified_parameters: 1246 fParameters.Add(child); 1247 return B_OK; 1248 default: 1249 return DIEDeclaredType::AddChild(child); 1250 } 1251 } 1252 1253 1254 status_t 1255 DIESubroutineType::AddAttribute_address_class(uint16 attributeName, 1256 const AttributeValue& value) 1257 { 1258 // TODO: How is the address class handled? 1259 fAddressClass = value.constant; 1260 return B_OK; 1261 } 1262 1263 1264 status_t 1265 DIESubroutineType::AddAttribute_prototyped(uint16 attributeName, 1266 const AttributeValue& value) 1267 { 1268 fPrototyped = value.flag; 1269 return B_OK; 1270 } 1271 1272 1273 status_t 1274 DIESubroutineType::AddAttribute_type(uint16 attributeName, 1275 const AttributeValue& value) 1276 { 1277 fReturnType = dynamic_cast<DIEType*>(value.reference); 1278 return fReturnType != NULL ? B_OK : B_BAD_DATA; 1279 } 1280 1281 1282 // #pragma mark - DIETypedef 1283 1284 1285 DIETypedef::DIETypedef() 1286 { 1287 } 1288 1289 1290 uint16 1291 DIETypedef::Tag() const 1292 { 1293 return DW_TAG_typedef; 1294 } 1295 1296 1297 // #pragma mark - DIEUnionType 1298 1299 1300 DIEUnionType::DIEUnionType() 1301 { 1302 } 1303 1304 1305 uint16 1306 DIEUnionType::Tag() const 1307 { 1308 return DW_TAG_union_type; 1309 } 1310 1311 1312 // #pragma mark - DIEUnspecifiedParameters 1313 1314 1315 DIEUnspecifiedParameters::DIEUnspecifiedParameters() 1316 { 1317 } 1318 1319 1320 uint16 1321 DIEUnspecifiedParameters::Tag() const 1322 { 1323 return DW_TAG_unspecified_parameters; 1324 } 1325 1326 1327 // #pragma mark - DIEVariant 1328 1329 1330 DIEVariant::DIEVariant() 1331 { 1332 } 1333 1334 1335 uint16 1336 DIEVariant::Tag() const 1337 { 1338 return DW_TAG_variant; 1339 } 1340 1341 1342 // #pragma mark - DIECommonBlock 1343 1344 1345 DIECommonBlock::DIECommonBlock() 1346 { 1347 } 1348 1349 1350 uint16 1351 DIECommonBlock::Tag() const 1352 { 1353 return DW_TAG_common_block; 1354 } 1355 1356 1357 LocationDescription* 1358 DIECommonBlock::GetLocationDescription() 1359 { 1360 return &fLocationDescription; 1361 } 1362 1363 1364 // #pragma mark - DIECommonInclusion 1365 1366 1367 DIECommonInclusion::DIECommonInclusion() 1368 { 1369 } 1370 1371 1372 uint16 1373 DIECommonInclusion::Tag() const 1374 { 1375 return DW_TAG_common_inclusion; 1376 } 1377 1378 1379 // #pragma mark - DIEInheritance 1380 1381 1382 DIEInheritance::DIEInheritance() 1383 : 1384 fType(NULL) 1385 { 1386 } 1387 1388 1389 uint16 1390 DIEInheritance::Tag() const 1391 { 1392 return DW_TAG_inheritance; 1393 } 1394 1395 1396 status_t 1397 DIEInheritance::AddAttribute_type(uint16 attributeName, 1398 const AttributeValue& value) 1399 { 1400 fType = dynamic_cast<DIEType*>(value.reference); 1401 return fType != NULL ? B_OK : B_BAD_DATA; 1402 } 1403 1404 1405 status_t 1406 DIEInheritance::AddAttribute_data_member_location(uint16 attributeName, 1407 const AttributeValue& value) 1408 { 1409 return SetMemberLocation(fLocation, value); 1410 } 1411 1412 1413 // #pragma mark - DIEInlinedSubroutine 1414 1415 1416 DIEInlinedSubroutine::DIEInlinedSubroutine() 1417 { 1418 } 1419 1420 1421 uint16 1422 DIEInlinedSubroutine::Tag() const 1423 { 1424 return DW_TAG_inlined_subroutine; 1425 } 1426 1427 1428 // #pragma mark - DIEModule 1429 1430 1431 DIEModule::DIEModule() 1432 { 1433 } 1434 1435 1436 uint16 1437 DIEModule::Tag() const 1438 { 1439 return DW_TAG_module; 1440 } 1441 1442 1443 // #pragma mark - DIEPointerToMemberType 1444 1445 1446 DIEPointerToMemberType::DIEPointerToMemberType() 1447 : 1448 fContainingType(NULL), 1449 fAddressClass(0) 1450 { 1451 } 1452 1453 1454 uint16 1455 DIEPointerToMemberType::Tag() const 1456 { 1457 return DW_TAG_ptr_to_member_type; 1458 } 1459 1460 1461 status_t 1462 DIEPointerToMemberType::AddAttribute_address_class(uint16 attributeName, 1463 const AttributeValue& value) 1464 { 1465 // TODO: How is the address class handled? 1466 fAddressClass = value.constant; 1467 return B_OK; 1468 } 1469 1470 1471 status_t 1472 DIEPointerToMemberType::AddAttribute_containing_type(uint16 attributeName, 1473 const AttributeValue& value) 1474 { 1475 DebugInfoEntry* type = value.reference; 1476 DIEModifiedType* modifiedType; 1477 while ((modifiedType = dynamic_cast<DIEModifiedType*>(type)) != NULL) 1478 type = modifiedType->GetType(); 1479 1480 fContainingType = dynamic_cast<DIECompoundType*>(type); 1481 return fContainingType != NULL ? B_OK : B_BAD_DATA; 1482 } 1483 1484 1485 status_t 1486 DIEPointerToMemberType::AddAttribute_use_location(uint16 attributeName, 1487 const AttributeValue& value) 1488 { 1489 if (value.attributeClass == ATTRIBUTE_CLASS_LOCLISTPTR) { 1490 fUseLocation.SetToLocationList(value.pointer); 1491 return B_OK; 1492 } 1493 1494 if (value.attributeClass == ATTRIBUTE_CLASS_BLOCK) { 1495 fUseLocation.SetToExpression(value.block.data, value.block.length); 1496 return B_OK; 1497 } 1498 1499 return B_BAD_DATA; 1500 } 1501 1502 1503 // #pragma mark - DIESetType 1504 1505 1506 DIESetType::DIESetType() 1507 { 1508 } 1509 1510 1511 uint16 1512 DIESetType::Tag() const 1513 { 1514 return DW_TAG_set_type; 1515 } 1516 1517 1518 const DynamicAttributeValue* 1519 DIESetType::ByteSize() const 1520 { 1521 return &fByteSize; 1522 } 1523 1524 1525 status_t 1526 DIESetType::AddAttribute_byte_size(uint16 attributeName, 1527 const AttributeValue& value) 1528 { 1529 return SetDynamicAttributeValue(fByteSize, value); 1530 } 1531 1532 1533 // #pragma mark - DIESubrangeType 1534 1535 1536 DIESubrangeType::DIESubrangeType() 1537 : 1538 fThreadsScaled(false) 1539 { 1540 } 1541 1542 1543 uint16 1544 DIESubrangeType::Tag() const 1545 { 1546 return DW_TAG_subrange_type; 1547 } 1548 1549 1550 status_t 1551 DIESubrangeType::AddAttribute_count(uint16 attributeName, 1552 const AttributeValue& value) 1553 { 1554 return SetDynamicAttributeValue(fCount, value); 1555 } 1556 1557 1558 status_t 1559 DIESubrangeType::AddAttribute_lower_bound(uint16 attributeName, 1560 const AttributeValue& value) 1561 { 1562 return SetDynamicAttributeValue(fLowerBound, value); 1563 } 1564 1565 1566 status_t 1567 DIESubrangeType::AddAttribute_upper_bound(uint16 attributeName, 1568 const AttributeValue& value) 1569 { 1570 return SetDynamicAttributeValue(fUpperBound, value); 1571 } 1572 1573 1574 status_t 1575 DIESubrangeType::AddAttribute_threads_scaled(uint16 attributeName, 1576 const AttributeValue& value) 1577 { 1578 fThreadsScaled = value.flag; 1579 return B_OK; 1580 } 1581 1582 1583 // #pragma mark - DIEWithStatement 1584 1585 1586 DIEWithStatement::DIEWithStatement() 1587 : 1588 fType(NULL) 1589 { 1590 } 1591 1592 1593 uint16 1594 DIEWithStatement::Tag() const 1595 { 1596 return DW_TAG_with_stmt; 1597 } 1598 1599 1600 LocationDescription* 1601 DIEWithStatement::GetLocationDescription() 1602 { 1603 return &fLocationDescription; 1604 } 1605 1606 1607 status_t 1608 DIEWithStatement::AddAttribute_type(uint16 attributeName, 1609 const AttributeValue& value) 1610 { 1611 fType = dynamic_cast<DIEType*>(value.reference); 1612 return fType != NULL ? B_OK : B_BAD_DATA; 1613 } 1614 1615 1616 // #pragma mark - DIEAccessDeclaration 1617 1618 1619 DIEAccessDeclaration::DIEAccessDeclaration() 1620 { 1621 } 1622 1623 1624 uint16 1625 DIEAccessDeclaration::Tag() const 1626 { 1627 return DW_TAG_access_declaration; 1628 } 1629 1630 1631 // #pragma mark - DIEBaseType 1632 1633 1634 DIEBaseType::DIEBaseType() 1635 : 1636 fEncoding(0), 1637 fEndianity(0) 1638 { 1639 } 1640 1641 1642 uint16 1643 DIEBaseType::Tag() const 1644 { 1645 return DW_TAG_base_type; 1646 } 1647 1648 1649 const DynamicAttributeValue* 1650 DIEBaseType::ByteSize() const 1651 { 1652 return &fByteSize; 1653 } 1654 1655 1656 status_t 1657 DIEBaseType::AddAttribute_encoding(uint16 attributeName, 1658 const AttributeValue& value) 1659 { 1660 fEncoding = value.constant; 1661 return B_OK; 1662 } 1663 1664 1665 status_t 1666 DIEBaseType::AddAttribute_byte_size(uint16 attributeName, 1667 const AttributeValue& value) 1668 { 1669 return SetDynamicAttributeValue(fByteSize, value); 1670 } 1671 1672 1673 status_t 1674 DIEBaseType::AddAttribute_bit_size(uint16 attributeName, 1675 const AttributeValue& value) 1676 { 1677 return SetDynamicAttributeValue(fBitSize, value); 1678 } 1679 1680 1681 status_t 1682 DIEBaseType::AddAttribute_bit_offset(uint16 attributeName, 1683 const AttributeValue& value) 1684 { 1685 return SetDynamicAttributeValue(fBitOffset, value); 1686 } 1687 1688 1689 status_t 1690 DIEBaseType::AddAttribute_data_bit_offset(uint16 attributeName, 1691 const AttributeValue& value) 1692 { 1693 return SetDynamicAttributeValue(fDataBitOffset, value); 1694 } 1695 1696 1697 status_t 1698 DIEBaseType::AddAttribute_endianity(uint16 attributeName, 1699 const AttributeValue& value) 1700 { 1701 fEndianity = value.constant; 1702 return B_OK; 1703 } 1704 1705 1706 // #pragma mark - DIECatchBlock 1707 1708 1709 DIECatchBlock::DIECatchBlock() 1710 { 1711 } 1712 1713 1714 uint16 1715 DIECatchBlock::Tag() const 1716 { 1717 return DW_TAG_catch_block; 1718 } 1719 1720 1721 // #pragma mark - DIEConstType 1722 1723 1724 DIEConstType::DIEConstType() 1725 { 1726 } 1727 1728 1729 uint16 1730 DIEConstType::Tag() const 1731 { 1732 return DW_TAG_const_type; 1733 } 1734 1735 1736 // #pragma mark - DIEConstant 1737 1738 1739 DIEConstant::DIEConstant() 1740 : 1741 fType(NULL) 1742 { 1743 } 1744 1745 1746 uint16 1747 DIEConstant::Tag() const 1748 { 1749 return DW_TAG_constant; 1750 } 1751 1752 1753 status_t 1754 DIEConstant::AddAttribute_const_value(uint16 attributeName, 1755 const AttributeValue& value) 1756 { 1757 return SetConstantAttributeValue(fValue, value); 1758 } 1759 1760 1761 status_t 1762 DIEConstant::AddAttribute_type(uint16 attributeName, 1763 const AttributeValue& value) 1764 { 1765 fType = dynamic_cast<DIEType*>(value.reference); 1766 return fType != NULL ? B_OK : B_BAD_DATA; 1767 } 1768 1769 1770 // #pragma mark - DIEEnumerator 1771 1772 1773 DIEEnumerator::DIEEnumerator() 1774 { 1775 } 1776 1777 1778 uint16 1779 DIEEnumerator::Tag() const 1780 { 1781 return DW_TAG_enumerator; 1782 } 1783 1784 1785 status_t 1786 DIEEnumerator::AddAttribute_const_value(uint16 attributeName, 1787 const AttributeValue& value) 1788 { 1789 return SetConstantAttributeValue(fValue, value); 1790 } 1791 1792 1793 // #pragma mark - DIEFileType 1794 1795 1796 DIEFileType::DIEFileType() 1797 { 1798 } 1799 1800 1801 uint16 1802 DIEFileType::Tag() const 1803 { 1804 return DW_TAG_file_type; 1805 } 1806 1807 1808 const DynamicAttributeValue* 1809 DIEFileType::ByteSize() const 1810 { 1811 return &fByteSize; 1812 } 1813 1814 1815 status_t 1816 DIEFileType::AddAttribute_byte_size(uint16 attributeName, 1817 const AttributeValue& value) 1818 { 1819 return SetDynamicAttributeValue(fByteSize, value); 1820 } 1821 1822 1823 // #pragma mark - DIEFriend 1824 1825 1826 DIEFriend::DIEFriend() 1827 { 1828 } 1829 1830 1831 uint16 1832 DIEFriend::Tag() const 1833 { 1834 return DW_TAG_friend; 1835 } 1836 1837 1838 // #pragma mark - DIENameList 1839 1840 1841 DIENameList::DIENameList() 1842 { 1843 } 1844 1845 1846 uint16 1847 DIENameList::Tag() const 1848 { 1849 return DW_TAG_namelist; 1850 } 1851 1852 1853 // #pragma mark - DIENameListItem 1854 1855 1856 DIENameListItem::DIENameListItem() 1857 { 1858 } 1859 1860 1861 uint16 1862 DIENameListItem::Tag() const 1863 { 1864 return DW_TAG_namelist_item; 1865 } 1866 1867 1868 // #pragma mark - DIEPackedType 1869 1870 1871 DIEPackedType::DIEPackedType() 1872 { 1873 } 1874 1875 1876 uint16 1877 DIEPackedType::Tag() const 1878 { 1879 return DW_TAG_packed_type; 1880 } 1881 1882 1883 // #pragma mark - DIESubprogram 1884 1885 1886 DIESubprogram::DIESubprogram() 1887 : 1888 fLowPC(0), 1889 fHighPC(0), 1890 fAddressRangesOffset(-1), 1891 fSpecification(NULL), 1892 fAbstractOrigin(NULL), 1893 fReturnType(NULL), 1894 fAddressClass(0), 1895 fPrototyped(false), 1896 fInline(DW_INL_not_inlined), 1897 fMain(false), 1898 fArtificial(false), 1899 fCallingConvention(DW_CC_normal) 1900 { 1901 } 1902 1903 1904 DIESubprogram::~DIESubprogram() 1905 { 1906 } 1907 1908 1909 uint16 1910 DIESubprogram::Tag() const 1911 { 1912 return DW_TAG_subprogram; 1913 } 1914 1915 1916 DebugInfoEntry* 1917 DIESubprogram::Specification() const 1918 { 1919 return fSpecification; 1920 } 1921 1922 1923 1924 DebugInfoEntry* 1925 DIESubprogram::AbstractOrigin() const 1926 { 1927 return fAbstractOrigin; 1928 } 1929 1930 1931 status_t 1932 DIESubprogram::AddChild(DebugInfoEntry* child) 1933 { 1934 switch (child->Tag()) { 1935 case DW_TAG_formal_parameter: 1936 case DW_TAG_unspecified_parameters: 1937 fParameters.Add(child); 1938 return B_OK; 1939 case DW_TAG_variable: 1940 fVariables.Add(child); 1941 return B_OK; 1942 case DW_TAG_lexical_block: 1943 fBlocks.Add(child); 1944 return B_OK; 1945 case DW_TAG_template_type_parameter: 1946 fTemplateTypeParameters.Add(child); 1947 return B_OK; 1948 case DW_TAG_template_value_parameter: 1949 fTemplateValueParameters.Add(child); 1950 return B_OK; 1951 case DW_TAG_GNU_call_site: 1952 fCallSites.Add(child); 1953 return B_OK; 1954 default: 1955 return DIEDeclaredNamedBase::AddChild(child); 1956 } 1957 } 1958 1959 1960 status_t 1961 DIESubprogram::AddAttribute_low_pc(uint16 attributeName, 1962 const AttributeValue& value) 1963 { 1964 fLowPC = value.address; 1965 return B_OK; 1966 } 1967 1968 1969 status_t 1970 DIESubprogram::AddAttribute_high_pc(uint16 attributeName, 1971 const AttributeValue& value) 1972 { 1973 fHighPC = value.address; 1974 if (fLowPC != 0 && fHighPC < fLowPC) 1975 fHighPC += fLowPC; 1976 1977 return B_OK; 1978 } 1979 1980 1981 status_t 1982 DIESubprogram::AddAttribute_ranges(uint16 attributeName, 1983 const AttributeValue& value) 1984 { 1985 fAddressRangesOffset = value.pointer; 1986 return B_OK; 1987 } 1988 1989 1990 status_t 1991 DIESubprogram::AddAttribute_specification(uint16 attributeName, 1992 const AttributeValue& value) 1993 { 1994 fSpecification = dynamic_cast<DIESubprogram*>(value.reference); 1995 return fSpecification != NULL ? B_OK : B_BAD_DATA; 1996 } 1997 1998 1999 status_t 2000 DIESubprogram::AddAttribute_address_class(uint16 attributeName, 2001 const AttributeValue& value) 2002 { 2003 // TODO: How is the address class handled? 2004 fAddressClass = value.constant; 2005 return B_OK; 2006 } 2007 2008 2009 status_t 2010 DIESubprogram::AddAttribute_prototyped(uint16 attributeName, 2011 const AttributeValue& value) 2012 { 2013 fPrototyped = value.flag; 2014 return B_OK; 2015 } 2016 2017 2018 status_t 2019 DIESubprogram::AddAttribute_type(uint16 attributeName, 2020 const AttributeValue& value) 2021 { 2022 fReturnType = dynamic_cast<DIEType*>(value.reference); 2023 return fReturnType != NULL ? B_OK : B_BAD_DATA; 2024 } 2025 2026 2027 status_t 2028 DIESubprogram::AddAttribute_inline(uint16 attributeName, 2029 const AttributeValue& value) 2030 { 2031 // TODO: How is the address class handled? 2032 fInline = value.constant; 2033 return B_OK; 2034 } 2035 2036 2037 status_t 2038 DIESubprogram::AddAttribute_abstract_origin(uint16 attributeName, 2039 const AttributeValue& value) 2040 { 2041 fAbstractOrigin = dynamic_cast<DIESubprogram*>(value.reference); 2042 return fAbstractOrigin != NULL ? B_OK : B_BAD_DATA; 2043 } 2044 2045 2046 status_t 2047 DIESubprogram::AddAttribute_frame_base(uint16 attributeName, 2048 const AttributeValue& value) 2049 { 2050 if (value.attributeClass == ATTRIBUTE_CLASS_LOCLISTPTR) { 2051 fFrameBase.SetToLocationList(value.pointer); 2052 return B_OK; 2053 } 2054 2055 if (value.attributeClass == ATTRIBUTE_CLASS_BLOCK) { 2056 fFrameBase.SetToExpression(value.block.data, value.block.length); 2057 return B_OK; 2058 } 2059 2060 return B_BAD_DATA; 2061 } 2062 2063 2064 status_t 2065 DIESubprogram::AddAttribute_artificial(uint16 attributeName, 2066 const AttributeValue& value) 2067 { 2068 fArtificial = value.flag; 2069 return B_OK; 2070 } 2071 2072 2073 status_t 2074 DIESubprogram::AddAttribute_calling_convention(uint16 attributeName, 2075 const AttributeValue& value) 2076 { 2077 fCallingConvention = value.constant; 2078 return B_OK; 2079 } 2080 2081 2082 status_t 2083 DIESubprogram::AddAttribute_main_subprogram(uint16 attributeName, 2084 const AttributeValue& value) 2085 { 2086 fMain = true; 2087 return B_OK; 2088 } 2089 2090 2091 // #pragma mark - DIETemplateTypeParameter 2092 2093 2094 DIETemplateTypeParameter::DIETemplateTypeParameter() 2095 : 2096 fType(NULL) 2097 { 2098 } 2099 2100 2101 uint16 2102 DIETemplateTypeParameter::Tag() const 2103 { 2104 return DW_TAG_template_type_parameter; 2105 } 2106 2107 2108 status_t 2109 DIETemplateTypeParameter::AddAttribute_type(uint16 attributeName, 2110 const AttributeValue& value) 2111 { 2112 fType = dynamic_cast<DIEType*>(value.reference); 2113 return fType != NULL ? B_OK : B_BAD_DATA; 2114 } 2115 2116 2117 // #pragma mark - DIETemplateValueParameter 2118 2119 2120 DIETemplateValueParameter::DIETemplateValueParameter() 2121 : 2122 fType(NULL) 2123 { 2124 } 2125 2126 2127 uint16 2128 DIETemplateValueParameter::Tag() const 2129 { 2130 return DW_TAG_template_value_parameter; 2131 } 2132 2133 2134 status_t 2135 DIETemplateValueParameter::AddAttribute_const_value(uint16 attributeName, 2136 const AttributeValue& value) 2137 { 2138 return SetConstantAttributeValue(fValue, value); 2139 } 2140 2141 2142 status_t 2143 DIETemplateValueParameter::AddAttribute_type(uint16 attributeName, 2144 const AttributeValue& value) 2145 { 2146 fType = dynamic_cast<DIEType*>(value.reference); 2147 return fType != NULL ? B_OK : B_BAD_DATA; 2148 } 2149 2150 2151 // #pragma mark - DIEThrownType 2152 2153 2154 DIEThrownType::DIEThrownType() 2155 : 2156 fType(NULL) 2157 { 2158 } 2159 2160 2161 uint16 2162 DIEThrownType::Tag() const 2163 { 2164 return DW_TAG_thrown_type; 2165 } 2166 2167 2168 status_t 2169 DIEThrownType::AddAttribute_type(uint16 attributeName, 2170 const AttributeValue& value) 2171 { 2172 fType = dynamic_cast<DIEType*>(value.reference); 2173 return fType != NULL ? B_OK : B_BAD_DATA; 2174 } 2175 2176 2177 // #pragma mark - DIETryBlock 2178 2179 2180 DIETryBlock::DIETryBlock() 2181 { 2182 } 2183 2184 2185 uint16 2186 DIETryBlock::Tag() const 2187 { 2188 return DW_TAG_try_block; 2189 } 2190 2191 2192 // #pragma mark - DIEVariantPart 2193 2194 2195 DIEVariantPart::DIEVariantPart() 2196 : 2197 fType(NULL) 2198 { 2199 } 2200 2201 2202 uint16 2203 DIEVariantPart::Tag() const 2204 { 2205 return DW_TAG_variant_part; 2206 } 2207 2208 2209 status_t 2210 DIEVariantPart::AddAttribute_type(uint16 attributeName, 2211 const AttributeValue& value) 2212 { 2213 fType = dynamic_cast<DIEType*>(value.reference); 2214 return fType != NULL ? B_OK : B_BAD_DATA; 2215 } 2216 2217 2218 // #pragma mark - DIEVariable 2219 2220 2221 DIEVariable::DIEVariable() 2222 : 2223 fType(NULL), 2224 fSpecification(NULL), 2225 fAbstractOrigin(NULL), 2226 fStartScope(0) 2227 { 2228 } 2229 2230 2231 uint16 2232 DIEVariable::Tag() const 2233 { 2234 return DW_TAG_variable; 2235 } 2236 2237 2238 DebugInfoEntry* 2239 DIEVariable::Specification() const 2240 { 2241 return fSpecification; 2242 } 2243 2244 2245 2246 DebugInfoEntry* 2247 DIEVariable::AbstractOrigin() const 2248 { 2249 return fAbstractOrigin; 2250 } 2251 2252 2253 LocationDescription* 2254 DIEVariable::GetLocationDescription() 2255 { 2256 return &fLocationDescription; 2257 } 2258 2259 2260 status_t 2261 DIEVariable::AddAttribute_const_value(uint16 attributeName, 2262 const AttributeValue& value) 2263 { 2264 return SetConstantAttributeValue(fValue, value); 2265 } 2266 2267 2268 status_t 2269 DIEVariable::AddAttribute_type(uint16 attributeName, 2270 const AttributeValue& value) 2271 { 2272 fType = dynamic_cast<DIEType*>(value.reference); 2273 return fType != NULL ? B_OK : B_BAD_DATA; 2274 } 2275 2276 2277 status_t 2278 DIEVariable::AddAttribute_specification(uint16 attributeName, 2279 const AttributeValue& value) 2280 { 2281 fSpecification = dynamic_cast<DIEVariable*>(value.reference); 2282 // in the case of static variables declared within a compound type, 2283 // the specification may point to a member entry rather than 2284 // a variable entry 2285 if (fSpecification == NULL) 2286 fSpecification = dynamic_cast<DIEMember*>(value.reference); 2287 2288 return fSpecification != NULL ? B_OK : B_BAD_DATA; 2289 } 2290 2291 2292 status_t 2293 DIEVariable::AddAttribute_abstract_origin(uint16 attributeName, 2294 const AttributeValue& value) 2295 { 2296 fAbstractOrigin = dynamic_cast<DIEVariable*>(value.reference); 2297 return fAbstractOrigin != NULL ? B_OK : B_BAD_DATA; 2298 } 2299 2300 2301 status_t 2302 DIEVariable::AddAttribute_start_scope(uint16 attributeName, 2303 const AttributeValue& value) 2304 { 2305 fStartScope = value.constant; 2306 return B_OK; 2307 } 2308 2309 2310 status_t 2311 DIEVariable::AddAttribute_external(uint16 attributeName, 2312 const AttributeValue& value) 2313 { 2314 fIsExternal = value.flag; 2315 return B_OK; 2316 } 2317 2318 2319 // #pragma mark - DIEVolatileType 2320 2321 2322 DIEVolatileType::DIEVolatileType() 2323 { 2324 } 2325 2326 2327 uint16 2328 DIEVolatileType::Tag() const 2329 { 2330 return DW_TAG_volatile_type; 2331 } 2332 2333 2334 status_t 2335 DIEVolatileType::AddAttribute_decl_file(uint16 attributeName, 2336 const AttributeValue& value) 2337 { 2338 fDeclarationLocation.SetFile(value.constant); 2339 return B_OK; 2340 } 2341 2342 2343 status_t 2344 DIEVolatileType::AddAttribute_decl_line(uint16 attributeName, 2345 const AttributeValue& value) 2346 { 2347 fDeclarationLocation.SetLine(value.constant); 2348 return B_OK; 2349 } 2350 2351 2352 status_t 2353 DIEVolatileType::AddAttribute_decl_column(uint16 attributeName, 2354 const AttributeValue& value) 2355 { 2356 fDeclarationLocation.SetColumn(value.constant); 2357 return B_OK; 2358 } 2359 2360 2361 // #pragma mark - DIEDwarfProcedure 2362 2363 2364 DIEDwarfProcedure::DIEDwarfProcedure() 2365 { 2366 } 2367 2368 2369 uint16 2370 DIEDwarfProcedure::Tag() const 2371 { 2372 return DW_TAG_dwarf_procedure; 2373 } 2374 2375 2376 LocationDescription* 2377 DIEDwarfProcedure::GetLocationDescription() 2378 { 2379 return &fLocationDescription; 2380 } 2381 2382 2383 // #pragma mark - DIERestrictType 2384 2385 2386 DIERestrictType::DIERestrictType() 2387 { 2388 } 2389 2390 2391 uint16 2392 DIERestrictType::Tag() const 2393 { 2394 return DW_TAG_restrict_type; 2395 } 2396 2397 2398 // #pragma mark - DIEInterfaceType 2399 2400 2401 DIEInterfaceType::DIEInterfaceType() 2402 { 2403 } 2404 2405 2406 uint16 2407 DIEInterfaceType::Tag() const 2408 { 2409 return DW_TAG_interface_type; 2410 } 2411 2412 2413 // #pragma mark - DIENamespace 2414 2415 2416 DIENamespace::DIENamespace() 2417 { 2418 } 2419 2420 2421 uint16 2422 DIENamespace::Tag() const 2423 { 2424 return DW_TAG_namespace; 2425 } 2426 2427 2428 bool 2429 DIENamespace::IsNamespace() const 2430 { 2431 return true; 2432 } 2433 2434 2435 status_t 2436 DIENamespace::AddChild(DebugInfoEntry* child) 2437 { 2438 fChildren.Add(child); 2439 return B_OK; 2440 } 2441 2442 2443 // #pragma mark - DIEImportedModule 2444 2445 2446 DIEImportedModule::DIEImportedModule() 2447 { 2448 } 2449 2450 2451 uint16 2452 DIEImportedModule::Tag() const 2453 { 2454 return DW_TAG_imported_module; 2455 } 2456 2457 2458 // #pragma mark - DIEUnspecifiedType 2459 2460 2461 DIEUnspecifiedType::DIEUnspecifiedType() 2462 { 2463 } 2464 2465 2466 uint16 2467 DIEUnspecifiedType::Tag() const 2468 { 2469 return DW_TAG_unspecified_type; 2470 } 2471 2472 2473 status_t 2474 DIEUnspecifiedType::AddAttribute_decl_file(uint16 attributeName, 2475 const AttributeValue& value) 2476 { 2477 fDeclarationLocation.SetFile(value.constant); 2478 return B_OK; 2479 } 2480 2481 2482 status_t 2483 DIEUnspecifiedType::AddAttribute_decl_line(uint16 attributeName, 2484 const AttributeValue& value) 2485 { 2486 fDeclarationLocation.SetLine(value.constant); 2487 return B_OK; 2488 } 2489 2490 2491 status_t 2492 DIEUnspecifiedType::AddAttribute_decl_column(uint16 attributeName, 2493 const AttributeValue& value) 2494 { 2495 fDeclarationLocation.SetColumn(value.constant); 2496 return B_OK; 2497 } 2498 2499 2500 // #pragma mark - DIEPartialUnit 2501 2502 2503 DIEPartialUnit::DIEPartialUnit() 2504 { 2505 } 2506 2507 2508 uint16 2509 DIEPartialUnit::Tag() const 2510 { 2511 return DW_TAG_partial_unit; 2512 } 2513 2514 2515 // #pragma mark - DIEImportedUnit 2516 2517 2518 DIEImportedUnit::DIEImportedUnit() 2519 { 2520 } 2521 2522 2523 uint16 2524 DIEImportedUnit::Tag() const 2525 { 2526 return DW_TAG_imported_unit; 2527 } 2528 2529 2530 // #pragma mark - DIECondition 2531 2532 2533 DIECondition::DIECondition() 2534 { 2535 } 2536 2537 2538 uint16 2539 DIECondition::Tag() const 2540 { 2541 return DW_TAG_condition; 2542 } 2543 2544 2545 // #pragma mark - DIESharedType 2546 2547 2548 DIESharedType::DIESharedType() 2549 { 2550 fBlockSize.SetTo(~(uint64)0); 2551 } 2552 2553 2554 uint16 2555 DIESharedType::Tag() const 2556 { 2557 return DW_TAG_shared_type; 2558 } 2559 2560 2561 status_t 2562 DIESharedType::AddAttribute_count(uint16 attributeName, 2563 const AttributeValue& value) 2564 { 2565 return SetDynamicAttributeValue(fBlockSize, value); 2566 } 2567 2568 2569 status_t 2570 DIESharedType::AddAttribute_decl_file(uint16 attributeName, 2571 const AttributeValue& value) 2572 { 2573 fDeclarationLocation.SetFile(value.constant); 2574 return B_OK; 2575 } 2576 2577 2578 status_t 2579 DIESharedType::AddAttribute_decl_line(uint16 attributeName, 2580 const AttributeValue& value) 2581 { 2582 fDeclarationLocation.SetLine(value.constant); 2583 return B_OK; 2584 } 2585 2586 2587 status_t 2588 DIESharedType::AddAttribute_decl_column(uint16 attributeName, 2589 const AttributeValue& value) 2590 { 2591 fDeclarationLocation.SetColumn(value.constant); 2592 return B_OK; 2593 } 2594 2595 2596 // #pragma mark - DIETypeUnit 2597 2598 2599 DIETypeUnit::DIETypeUnit() 2600 { 2601 } 2602 2603 2604 uint16 2605 DIETypeUnit::Tag() const 2606 { 2607 return DW_TAG_type_unit; 2608 } 2609 2610 2611 // #pragma mark - DIERValueReferenceType 2612 2613 2614 DIERValueReferenceType::DIERValueReferenceType() 2615 { 2616 } 2617 2618 2619 uint16 2620 DIERValueReferenceType::Tag() const 2621 { 2622 return DW_TAG_rvalue_reference_type; 2623 } 2624 2625 2626 // #pragma mark - DIETemplateTemplateParameter 2627 2628 2629 DIETemplateTemplateParameter::DIETemplateTemplateParameter() 2630 : 2631 fName(NULL) 2632 { 2633 } 2634 2635 2636 uint16 2637 DIETemplateTemplateParameter::Tag() const 2638 { 2639 return DW_TAG_GNU_template_template_param; 2640 } 2641 2642 2643 const char* 2644 DIETemplateTemplateParameter::Name() const 2645 { 2646 return fName; 2647 } 2648 2649 2650 status_t 2651 DIETemplateTemplateParameter::AddAttribute_name(uint16 attributeName, 2652 const AttributeValue& value) 2653 { 2654 fName = value.string; 2655 return B_OK; 2656 } 2657 2658 2659 // #pragma mark - DIETemplateTypeParameterPack 2660 2661 2662 DIETemplateTypeParameterPack::DIETemplateTypeParameterPack() 2663 : 2664 fName(NULL) 2665 { 2666 } 2667 2668 2669 uint16 2670 DIETemplateTypeParameterPack::Tag() const 2671 { 2672 return DW_TAG_GNU_template_parameter_pack; 2673 } 2674 2675 2676 const char* 2677 DIETemplateTypeParameterPack::Name() const 2678 { 2679 return fName; 2680 } 2681 2682 2683 status_t 2684 DIETemplateTypeParameterPack::AddAttribute_name(uint16 attributeName, 2685 const AttributeValue& value) 2686 { 2687 fName = value.string; 2688 return B_OK; 2689 } 2690 2691 2692 status_t 2693 DIETemplateTypeParameterPack::AddChild(DebugInfoEntry* child) 2694 { 2695 if (child->Tag() == DW_TAG_template_type_parameter) { 2696 fChildren.Add(child); 2697 return B_OK; 2698 } 2699 2700 return DIEDeclaredBase::AddChild(child); 2701 } 2702 2703 2704 // #pragma mark - DIETemplateValueParameterPack 2705 2706 2707 DIETemplateValueParameterPack::DIETemplateValueParameterPack() 2708 : 2709 fName(NULL) 2710 { 2711 } 2712 2713 2714 uint16 2715 DIETemplateValueParameterPack::Tag() const 2716 { 2717 return DW_TAG_GNU_formal_parameter_pack; 2718 } 2719 2720 2721 const char* 2722 DIETemplateValueParameterPack::Name() const 2723 { 2724 return fName; 2725 } 2726 2727 2728 status_t 2729 DIETemplateValueParameterPack::AddAttribute_name(uint16 attributeName, 2730 const AttributeValue& value) 2731 { 2732 fName = value.string; 2733 return B_OK; 2734 } 2735 2736 2737 status_t 2738 DIETemplateValueParameterPack::AddChild(DebugInfoEntry* child) 2739 { 2740 if (child->Tag() == DW_TAG_formal_parameter) { 2741 fChildren.Add(child); 2742 return B_OK; 2743 } 2744 2745 return DIEDeclaredBase::AddChild(child); 2746 } 2747 2748 2749 // #pragma mark - DIECallSite 2750 2751 2752 DIECallSite::DIECallSite() 2753 : 2754 fName(NULL) 2755 { 2756 } 2757 2758 2759 uint16 2760 DIECallSite::Tag() const 2761 { 2762 return DW_TAG_GNU_call_site; 2763 } 2764 2765 2766 const char* 2767 DIECallSite::Name() const 2768 { 2769 return fName; 2770 } 2771 2772 2773 status_t 2774 DIECallSite::AddAttribute_name(uint16 attributeName, 2775 const AttributeValue& value) 2776 { 2777 fName = value.string; 2778 return B_OK; 2779 } 2780 2781 2782 status_t 2783 DIECallSite::AddChild(DebugInfoEntry* child) 2784 { 2785 if (child->Tag() == DW_TAG_GNU_call_site_parameter) { 2786 fChildren.Add(child); 2787 return B_OK; 2788 } 2789 2790 return DIEDeclaredBase::AddChild(child); 2791 } 2792 2793 2794 // #pragma mark - DIECallSiteParameter 2795 2796 2797 DIECallSiteParameter::DIECallSiteParameter() 2798 : 2799 fName(NULL) 2800 { 2801 } 2802 2803 2804 uint16 2805 DIECallSiteParameter::Tag() const 2806 { 2807 return DW_TAG_GNU_call_site_parameter; 2808 } 2809 2810 2811 const char* 2812 DIECallSiteParameter::Name() const 2813 { 2814 return fName; 2815 } 2816 2817 2818 status_t 2819 DIECallSiteParameter::AddAttribute_name(uint16 attributeName, 2820 const AttributeValue& value) 2821 { 2822 fName = value.string; 2823 return B_OK; 2824 } 2825 2826 2827 status_t 2828 DIECallSiteParameter::AddChild(DebugInfoEntry* child) 2829 { 2830 return DIEDeclaredBase::AddChild(child); 2831 } 2832 2833 2834 // #pragma mark - DebugInfoEntryFactory 2835 2836 2837 DebugInfoEntryFactory::DebugInfoEntryFactory() 2838 { 2839 } 2840 2841 2842 status_t 2843 DebugInfoEntryFactory::CreateDebugInfoEntry(uint16 tag, DebugInfoEntry*& _entry) 2844 { 2845 DebugInfoEntry* entry = NULL; 2846 2847 switch (tag) { 2848 case DW_TAG_array_type: 2849 entry = new(std::nothrow) DIEArrayType; 2850 break; 2851 case DW_TAG_class_type: 2852 entry = new(std::nothrow) DIEClassType; 2853 break; 2854 case DW_TAG_entry_point: 2855 entry = new(std::nothrow) DIEEntryPoint; 2856 break; 2857 case DW_TAG_enumeration_type: 2858 entry = new(std::nothrow) DIEEnumerationType; 2859 break; 2860 case DW_TAG_formal_parameter: 2861 entry = new(std::nothrow) DIEFormalParameter; 2862 break; 2863 case DW_TAG_imported_declaration: 2864 entry = new(std::nothrow) DIEImportedDeclaration; 2865 break; 2866 case DW_TAG_label: 2867 entry = new(std::nothrow) DIELabel; 2868 break; 2869 case DW_TAG_lexical_block: 2870 entry = new(std::nothrow) DIELexicalBlock; 2871 break; 2872 case DW_TAG_member: 2873 entry = new(std::nothrow) DIEMember; 2874 break; 2875 case DW_TAG_pointer_type: 2876 entry = new(std::nothrow) DIEPointerType; 2877 break; 2878 case DW_TAG_reference_type: 2879 entry = new(std::nothrow) DIEReferenceType; 2880 break; 2881 case DW_TAG_compile_unit: 2882 entry = new(std::nothrow) DIECompileUnit; 2883 break; 2884 case DW_TAG_string_type: 2885 entry = new(std::nothrow) DIEStringType; 2886 break; 2887 case DW_TAG_structure_type: 2888 entry = new(std::nothrow) DIEStructureType; 2889 break; 2890 case DW_TAG_subroutine_type: 2891 entry = new(std::nothrow) DIESubroutineType; 2892 break; 2893 case DW_TAG_typedef: 2894 entry = new(std::nothrow) DIETypedef; 2895 break; 2896 case DW_TAG_union_type: 2897 entry = new(std::nothrow) DIEUnionType; 2898 break; 2899 case DW_TAG_unspecified_parameters: 2900 entry = new(std::nothrow) DIEUnspecifiedParameters; 2901 break; 2902 case DW_TAG_variant: 2903 entry = new(std::nothrow) DIEVariant; 2904 break; 2905 case DW_TAG_common_block: 2906 entry = new(std::nothrow) DIECommonBlock; 2907 break; 2908 case DW_TAG_common_inclusion: 2909 entry = new(std::nothrow) DIECommonInclusion; 2910 break; 2911 case DW_TAG_inheritance: 2912 entry = new(std::nothrow) DIEInheritance; 2913 break; 2914 case DW_TAG_inlined_subroutine: 2915 entry = new(std::nothrow) DIEInlinedSubroutine; 2916 break; 2917 case DW_TAG_module: 2918 entry = new(std::nothrow) DIEModule; 2919 break; 2920 case DW_TAG_ptr_to_member_type: 2921 entry = new(std::nothrow) DIEPointerToMemberType; 2922 break; 2923 case DW_TAG_set_type: 2924 entry = new(std::nothrow) DIESetType; 2925 break; 2926 case DW_TAG_subrange_type: 2927 entry = new(std::nothrow) DIESubrangeType; 2928 break; 2929 case DW_TAG_with_stmt: 2930 entry = new(std::nothrow) DIEWithStatement; 2931 break; 2932 case DW_TAG_access_declaration: 2933 entry = new(std::nothrow) DIEAccessDeclaration; 2934 break; 2935 case DW_TAG_base_type: 2936 entry = new(std::nothrow) DIEBaseType; 2937 break; 2938 case DW_TAG_catch_block: 2939 entry = new(std::nothrow) DIECatchBlock; 2940 break; 2941 case DW_TAG_const_type: 2942 entry = new(std::nothrow) DIEConstType; 2943 break; 2944 case DW_TAG_constant: 2945 entry = new(std::nothrow) DIEConstant; 2946 break; 2947 case DW_TAG_enumerator: 2948 entry = new(std::nothrow) DIEEnumerator; 2949 break; 2950 case DW_TAG_file_type: 2951 entry = new(std::nothrow) DIEFileType; 2952 break; 2953 case DW_TAG_friend: 2954 entry = new(std::nothrow) DIEFriend; 2955 break; 2956 case DW_TAG_namelist: 2957 entry = new(std::nothrow) DIENameList; 2958 break; 2959 case DW_TAG_namelist_item: 2960 entry = new(std::nothrow) DIENameListItem; 2961 break; 2962 case DW_TAG_packed_type: 2963 entry = new(std::nothrow) DIEPackedType; 2964 break; 2965 case DW_TAG_subprogram: 2966 entry = new(std::nothrow) DIESubprogram; 2967 break; 2968 case DW_TAG_template_type_parameter: 2969 entry = new(std::nothrow) DIETemplateTypeParameter; 2970 break; 2971 case DW_TAG_template_value_parameter: 2972 entry = new(std::nothrow) DIETemplateValueParameter; 2973 break; 2974 case DW_TAG_thrown_type: 2975 entry = new(std::nothrow) DIEThrownType; 2976 break; 2977 case DW_TAG_try_block: 2978 entry = new(std::nothrow) DIETryBlock; 2979 break; 2980 case DW_TAG_variant_part: 2981 entry = new(std::nothrow) DIEVariantPart; 2982 break; 2983 case DW_TAG_variable: 2984 entry = new(std::nothrow) DIEVariable; 2985 break; 2986 case DW_TAG_volatile_type: 2987 entry = new(std::nothrow) DIEVolatileType; 2988 break; 2989 case DW_TAG_dwarf_procedure: 2990 entry = new(std::nothrow) DIEDwarfProcedure; 2991 break; 2992 case DW_TAG_restrict_type: 2993 entry = new(std::nothrow) DIERestrictType; 2994 break; 2995 case DW_TAG_interface_type: 2996 entry = new(std::nothrow) DIEInterfaceType; 2997 break; 2998 case DW_TAG_namespace: 2999 entry = new(std::nothrow) DIENamespace; 3000 break; 3001 case DW_TAG_imported_module: 3002 entry = new(std::nothrow) DIEImportedModule; 3003 break; 3004 case DW_TAG_unspecified_type: 3005 entry = new(std::nothrow) DIEUnspecifiedType; 3006 break; 3007 case DW_TAG_partial_unit: 3008 entry = new(std::nothrow) DIEPartialUnit; 3009 break; 3010 case DW_TAG_imported_unit: 3011 entry = new(std::nothrow) DIEImportedUnit; 3012 break; 3013 case DW_TAG_condition: 3014 entry = new(std::nothrow) DIECondition; 3015 break; 3016 case DW_TAG_shared_type: 3017 entry = new(std::nothrow) DIESharedType; 3018 break; 3019 case DW_TAG_type_unit: 3020 entry = new(std::nothrow) DIETypeUnit; 3021 break; 3022 case DW_TAG_rvalue_reference_type: 3023 entry = new(std::nothrow) DIERValueReferenceType; 3024 break; 3025 case DW_TAG_GNU_template_template_param: 3026 entry = new(std::nothrow) DIETemplateTemplateParameter; 3027 break; 3028 case DW_TAG_GNU_template_parameter_pack: 3029 entry = new(std::nothrow) DIETemplateTypeParameterPack; 3030 break; 3031 case DW_TAG_GNU_formal_parameter_pack: 3032 entry = new(std::nothrow) DIETemplateValueParameterPack; 3033 break; 3034 case DW_TAG_GNU_call_site: 3035 entry = new(std::nothrow) DIECallSite; 3036 break; 3037 case DW_TAG_GNU_call_site_parameter: 3038 entry = new(std::nothrow) DIECallSiteParameter; 3039 break; 3040 default: 3041 return B_ENTRY_NOT_FOUND; 3042 break; 3043 } 3044 3045 _entry = entry; 3046 return B_OK; 3047 } 3048