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 - DIENamespace 1869 1870 1871 DIENamespace::DIENamespace() 1872 { 1873 } 1874 1875 1876 uint16 1877 DIENamespace::Tag() const 1878 { 1879 return DW_TAG_namespace; 1880 } 1881 1882 1883 bool 1884 DIENamespace::IsNamespace() const 1885 { 1886 return true; 1887 } 1888 1889 1890 status_t 1891 DIENamespace::AddChild(DebugInfoEntry* child) 1892 { 1893 fChildren.Add(child); 1894 return B_OK; 1895 } 1896 1897 1898 // #pragma mark - DIEPackedType 1899 1900 1901 DIEPackedType::DIEPackedType() 1902 { 1903 } 1904 1905 1906 uint16 1907 DIEPackedType::Tag() const 1908 { 1909 return DW_TAG_packed_type; 1910 } 1911 1912 1913 // #pragma mark - DIESubprogram 1914 1915 1916 DIESubprogram::DIESubprogram() 1917 : 1918 fLowPC(0), 1919 fHighPC(0), 1920 fAddressRangesOffset(-1), 1921 fSpecification(NULL), 1922 fAbstractOrigin(NULL), 1923 fReturnType(NULL), 1924 fAddressClass(0), 1925 fPrototyped(false), 1926 fInline(DW_INL_not_inlined), 1927 fMain(false), 1928 fArtificial(false), 1929 fCallingConvention(DW_CC_normal) 1930 { 1931 } 1932 1933 1934 DIESubprogram::~DIESubprogram() 1935 { 1936 } 1937 1938 1939 uint16 1940 DIESubprogram::Tag() const 1941 { 1942 return DW_TAG_subprogram; 1943 } 1944 1945 1946 DebugInfoEntry* 1947 DIESubprogram::Specification() const 1948 { 1949 return fSpecification; 1950 } 1951 1952 1953 1954 DebugInfoEntry* 1955 DIESubprogram::AbstractOrigin() const 1956 { 1957 return fAbstractOrigin; 1958 } 1959 1960 1961 status_t 1962 DIESubprogram::AddChild(DebugInfoEntry* child) 1963 { 1964 switch (child->Tag()) { 1965 case DW_TAG_formal_parameter: 1966 case DW_TAG_unspecified_parameters: 1967 fParameters.Add(child); 1968 return B_OK; 1969 case DW_TAG_variable: 1970 fVariables.Add(child); 1971 return B_OK; 1972 case DW_TAG_lexical_block: 1973 fBlocks.Add(child); 1974 return B_OK; 1975 case DW_TAG_template_type_parameter: 1976 fTemplateTypeParameters.Add(child); 1977 return B_OK; 1978 case DW_TAG_template_value_parameter: 1979 fTemplateValueParameters.Add(child); 1980 return B_OK; 1981 case DW_TAG_GNU_call_site: 1982 fCallSites.Add(child); 1983 return B_OK; 1984 default: 1985 return DIENamespace::AddChild(child); 1986 } 1987 } 1988 1989 1990 1991 status_t 1992 DIESubprogram::AddAttribute_low_pc(uint16 attributeName, 1993 const AttributeValue& value) 1994 { 1995 fLowPC = value.address; 1996 return B_OK; 1997 } 1998 1999 2000 status_t 2001 DIESubprogram::AddAttribute_high_pc(uint16 attributeName, 2002 const AttributeValue& value) 2003 { 2004 fHighPC = value.address; 2005 if (fLowPC != 0 && fHighPC < fLowPC) 2006 fHighPC += fLowPC; 2007 2008 return B_OK; 2009 } 2010 2011 2012 status_t 2013 DIESubprogram::AddAttribute_ranges(uint16 attributeName, 2014 const AttributeValue& value) 2015 { 2016 fAddressRangesOffset = value.pointer; 2017 return B_OK; 2018 } 2019 2020 2021 status_t 2022 DIESubprogram::AddAttribute_specification(uint16 attributeName, 2023 const AttributeValue& value) 2024 { 2025 fSpecification = dynamic_cast<DIESubprogram*>(value.reference); 2026 return fSpecification != NULL ? B_OK : B_BAD_DATA; 2027 } 2028 2029 2030 status_t 2031 DIESubprogram::AddAttribute_address_class(uint16 attributeName, 2032 const AttributeValue& value) 2033 { 2034 // TODO: How is the address class handled? 2035 fAddressClass = value.constant; 2036 return B_OK; 2037 } 2038 2039 2040 status_t 2041 DIESubprogram::AddAttribute_prototyped(uint16 attributeName, 2042 const AttributeValue& value) 2043 { 2044 fPrototyped = value.flag; 2045 return B_OK; 2046 } 2047 2048 2049 status_t 2050 DIESubprogram::AddAttribute_type(uint16 attributeName, 2051 const AttributeValue& value) 2052 { 2053 fReturnType = dynamic_cast<DIEType*>(value.reference); 2054 return fReturnType != NULL ? B_OK : B_BAD_DATA; 2055 } 2056 2057 2058 status_t 2059 DIESubprogram::AddAttribute_inline(uint16 attributeName, 2060 const AttributeValue& value) 2061 { 2062 // TODO: How is the address class handled? 2063 fInline = value.constant; 2064 return B_OK; 2065 } 2066 2067 2068 status_t 2069 DIESubprogram::AddAttribute_abstract_origin(uint16 attributeName, 2070 const AttributeValue& value) 2071 { 2072 fAbstractOrigin = dynamic_cast<DIESubprogram*>(value.reference); 2073 return fAbstractOrigin != NULL ? B_OK : B_BAD_DATA; 2074 } 2075 2076 2077 status_t 2078 DIESubprogram::AddAttribute_frame_base(uint16 attributeName, 2079 const AttributeValue& value) 2080 { 2081 if (value.attributeClass == ATTRIBUTE_CLASS_LOCLISTPTR) { 2082 fFrameBase.SetToLocationList(value.pointer); 2083 return B_OK; 2084 } 2085 2086 if (value.attributeClass == ATTRIBUTE_CLASS_BLOCK) { 2087 fFrameBase.SetToExpression(value.block.data, value.block.length); 2088 return B_OK; 2089 } 2090 2091 return B_BAD_DATA; 2092 } 2093 2094 2095 status_t 2096 DIESubprogram::AddAttribute_artificial(uint16 attributeName, 2097 const AttributeValue& value) 2098 { 2099 fArtificial = value.flag; 2100 return B_OK; 2101 } 2102 2103 2104 status_t 2105 DIESubprogram::AddAttribute_calling_convention(uint16 attributeName, 2106 const AttributeValue& value) 2107 { 2108 fCallingConvention = value.constant; 2109 return B_OK; 2110 } 2111 2112 2113 status_t 2114 DIESubprogram::AddAttribute_main_subprogram(uint16 attributeName, 2115 const AttributeValue& value) 2116 { 2117 fMain = true; 2118 return B_OK; 2119 } 2120 2121 2122 // #pragma mark - DIETemplateTypeParameter 2123 2124 2125 DIETemplateTypeParameter::DIETemplateTypeParameter() 2126 : 2127 fType(NULL) 2128 { 2129 } 2130 2131 2132 uint16 2133 DIETemplateTypeParameter::Tag() const 2134 { 2135 return DW_TAG_template_type_parameter; 2136 } 2137 2138 2139 status_t 2140 DIETemplateTypeParameter::AddAttribute_type(uint16 attributeName, 2141 const AttributeValue& value) 2142 { 2143 fType = dynamic_cast<DIEType*>(value.reference); 2144 return fType != NULL ? B_OK : B_BAD_DATA; 2145 } 2146 2147 2148 // #pragma mark - DIETemplateValueParameter 2149 2150 2151 DIETemplateValueParameter::DIETemplateValueParameter() 2152 : 2153 fType(NULL) 2154 { 2155 } 2156 2157 2158 uint16 2159 DIETemplateValueParameter::Tag() const 2160 { 2161 return DW_TAG_template_value_parameter; 2162 } 2163 2164 2165 status_t 2166 DIETemplateValueParameter::AddAttribute_const_value(uint16 attributeName, 2167 const AttributeValue& value) 2168 { 2169 return SetConstantAttributeValue(fValue, value); 2170 } 2171 2172 2173 status_t 2174 DIETemplateValueParameter::AddAttribute_type(uint16 attributeName, 2175 const AttributeValue& value) 2176 { 2177 fType = dynamic_cast<DIEType*>(value.reference); 2178 return fType != NULL ? B_OK : B_BAD_DATA; 2179 } 2180 2181 2182 // #pragma mark - DIEThrownType 2183 2184 2185 DIEThrownType::DIEThrownType() 2186 : 2187 fType(NULL) 2188 { 2189 } 2190 2191 2192 uint16 2193 DIEThrownType::Tag() const 2194 { 2195 return DW_TAG_thrown_type; 2196 } 2197 2198 2199 status_t 2200 DIEThrownType::AddAttribute_type(uint16 attributeName, 2201 const AttributeValue& value) 2202 { 2203 fType = dynamic_cast<DIEType*>(value.reference); 2204 return fType != NULL ? B_OK : B_BAD_DATA; 2205 } 2206 2207 2208 // #pragma mark - DIETryBlock 2209 2210 2211 DIETryBlock::DIETryBlock() 2212 { 2213 } 2214 2215 2216 uint16 2217 DIETryBlock::Tag() const 2218 { 2219 return DW_TAG_try_block; 2220 } 2221 2222 2223 // #pragma mark - DIEVariantPart 2224 2225 2226 DIEVariantPart::DIEVariantPart() 2227 : 2228 fType(NULL) 2229 { 2230 } 2231 2232 2233 uint16 2234 DIEVariantPart::Tag() const 2235 { 2236 return DW_TAG_variant_part; 2237 } 2238 2239 2240 status_t 2241 DIEVariantPart::AddAttribute_type(uint16 attributeName, 2242 const AttributeValue& value) 2243 { 2244 fType = dynamic_cast<DIEType*>(value.reference); 2245 return fType != NULL ? B_OK : B_BAD_DATA; 2246 } 2247 2248 2249 // #pragma mark - DIEVariable 2250 2251 2252 DIEVariable::DIEVariable() 2253 : 2254 fType(NULL), 2255 fSpecification(NULL), 2256 fAbstractOrigin(NULL), 2257 fStartScope(0) 2258 { 2259 } 2260 2261 2262 uint16 2263 DIEVariable::Tag() const 2264 { 2265 return DW_TAG_variable; 2266 } 2267 2268 2269 DebugInfoEntry* 2270 DIEVariable::Specification() const 2271 { 2272 return fSpecification; 2273 } 2274 2275 2276 2277 DebugInfoEntry* 2278 DIEVariable::AbstractOrigin() const 2279 { 2280 return fAbstractOrigin; 2281 } 2282 2283 2284 LocationDescription* 2285 DIEVariable::GetLocationDescription() 2286 { 2287 return &fLocationDescription; 2288 } 2289 2290 2291 status_t 2292 DIEVariable::AddAttribute_const_value(uint16 attributeName, 2293 const AttributeValue& value) 2294 { 2295 return SetConstantAttributeValue(fValue, value); 2296 } 2297 2298 2299 status_t 2300 DIEVariable::AddAttribute_type(uint16 attributeName, 2301 const AttributeValue& value) 2302 { 2303 fType = dynamic_cast<DIEType*>(value.reference); 2304 return fType != NULL ? B_OK : B_BAD_DATA; 2305 } 2306 2307 2308 status_t 2309 DIEVariable::AddAttribute_specification(uint16 attributeName, 2310 const AttributeValue& value) 2311 { 2312 fSpecification = dynamic_cast<DIEVariable*>(value.reference); 2313 // in the case of static variables declared within a compound type, 2314 // the specification may point to a member entry rather than 2315 // a variable entry 2316 if (fSpecification == NULL) 2317 fSpecification = dynamic_cast<DIEMember*>(value.reference); 2318 2319 return fSpecification != NULL ? B_OK : B_BAD_DATA; 2320 } 2321 2322 2323 status_t 2324 DIEVariable::AddAttribute_abstract_origin(uint16 attributeName, 2325 const AttributeValue& value) 2326 { 2327 fAbstractOrigin = dynamic_cast<DIEVariable*>(value.reference); 2328 return fAbstractOrigin != NULL ? B_OK : B_BAD_DATA; 2329 } 2330 2331 2332 status_t 2333 DIEVariable::AddAttribute_start_scope(uint16 attributeName, 2334 const AttributeValue& value) 2335 { 2336 fStartScope = value.constant; 2337 return B_OK; 2338 } 2339 2340 2341 status_t 2342 DIEVariable::AddAttribute_external(uint16 attributeName, 2343 const AttributeValue& value) 2344 { 2345 fIsExternal = value.flag; 2346 return B_OK; 2347 } 2348 2349 2350 // #pragma mark - DIEVolatileType 2351 2352 2353 DIEVolatileType::DIEVolatileType() 2354 { 2355 } 2356 2357 2358 uint16 2359 DIEVolatileType::Tag() const 2360 { 2361 return DW_TAG_volatile_type; 2362 } 2363 2364 2365 status_t 2366 DIEVolatileType::AddAttribute_decl_file(uint16 attributeName, 2367 const AttributeValue& value) 2368 { 2369 fDeclarationLocation.SetFile(value.constant); 2370 return B_OK; 2371 } 2372 2373 2374 status_t 2375 DIEVolatileType::AddAttribute_decl_line(uint16 attributeName, 2376 const AttributeValue& value) 2377 { 2378 fDeclarationLocation.SetLine(value.constant); 2379 return B_OK; 2380 } 2381 2382 2383 status_t 2384 DIEVolatileType::AddAttribute_decl_column(uint16 attributeName, 2385 const AttributeValue& value) 2386 { 2387 fDeclarationLocation.SetColumn(value.constant); 2388 return B_OK; 2389 } 2390 2391 2392 // #pragma mark - DIEDwarfProcedure 2393 2394 2395 DIEDwarfProcedure::DIEDwarfProcedure() 2396 { 2397 } 2398 2399 2400 uint16 2401 DIEDwarfProcedure::Tag() const 2402 { 2403 return DW_TAG_dwarf_procedure; 2404 } 2405 2406 2407 LocationDescription* 2408 DIEDwarfProcedure::GetLocationDescription() 2409 { 2410 return &fLocationDescription; 2411 } 2412 2413 2414 // #pragma mark - DIERestrictType 2415 2416 2417 DIERestrictType::DIERestrictType() 2418 { 2419 } 2420 2421 2422 uint16 2423 DIERestrictType::Tag() const 2424 { 2425 return DW_TAG_restrict_type; 2426 } 2427 2428 2429 // #pragma mark - DIEInterfaceType 2430 2431 2432 DIEInterfaceType::DIEInterfaceType() 2433 { 2434 } 2435 2436 2437 uint16 2438 DIEInterfaceType::Tag() const 2439 { 2440 return DW_TAG_interface_type; 2441 } 2442 2443 2444 // #pragma mark - DIEImportedModule 2445 2446 2447 DIEImportedModule::DIEImportedModule() 2448 { 2449 } 2450 2451 2452 uint16 2453 DIEImportedModule::Tag() const 2454 { 2455 return DW_TAG_imported_module; 2456 } 2457 2458 2459 // #pragma mark - DIEUnspecifiedType 2460 2461 2462 DIEUnspecifiedType::DIEUnspecifiedType() 2463 { 2464 } 2465 2466 2467 uint16 2468 DIEUnspecifiedType::Tag() const 2469 { 2470 return DW_TAG_unspecified_type; 2471 } 2472 2473 2474 status_t 2475 DIEUnspecifiedType::AddAttribute_decl_file(uint16 attributeName, 2476 const AttributeValue& value) 2477 { 2478 fDeclarationLocation.SetFile(value.constant); 2479 return B_OK; 2480 } 2481 2482 2483 status_t 2484 DIEUnspecifiedType::AddAttribute_decl_line(uint16 attributeName, 2485 const AttributeValue& value) 2486 { 2487 fDeclarationLocation.SetLine(value.constant); 2488 return B_OK; 2489 } 2490 2491 2492 status_t 2493 DIEUnspecifiedType::AddAttribute_decl_column(uint16 attributeName, 2494 const AttributeValue& value) 2495 { 2496 fDeclarationLocation.SetColumn(value.constant); 2497 return B_OK; 2498 } 2499 2500 2501 // #pragma mark - DIEPartialUnit 2502 2503 2504 DIEPartialUnit::DIEPartialUnit() 2505 { 2506 } 2507 2508 2509 uint16 2510 DIEPartialUnit::Tag() const 2511 { 2512 return DW_TAG_partial_unit; 2513 } 2514 2515 2516 // #pragma mark - DIEImportedUnit 2517 2518 2519 DIEImportedUnit::DIEImportedUnit() 2520 { 2521 } 2522 2523 2524 uint16 2525 DIEImportedUnit::Tag() const 2526 { 2527 return DW_TAG_imported_unit; 2528 } 2529 2530 2531 // #pragma mark - DIECondition 2532 2533 2534 DIECondition::DIECondition() 2535 { 2536 } 2537 2538 2539 uint16 2540 DIECondition::Tag() const 2541 { 2542 return DW_TAG_condition; 2543 } 2544 2545 2546 // #pragma mark - DIESharedType 2547 2548 2549 DIESharedType::DIESharedType() 2550 { 2551 fBlockSize.SetTo(~(uint64)0); 2552 } 2553 2554 2555 uint16 2556 DIESharedType::Tag() const 2557 { 2558 return DW_TAG_shared_type; 2559 } 2560 2561 2562 status_t 2563 DIESharedType::AddAttribute_count(uint16 attributeName, 2564 const AttributeValue& value) 2565 { 2566 return SetDynamicAttributeValue(fBlockSize, value); 2567 } 2568 2569 2570 status_t 2571 DIESharedType::AddAttribute_decl_file(uint16 attributeName, 2572 const AttributeValue& value) 2573 { 2574 fDeclarationLocation.SetFile(value.constant); 2575 return B_OK; 2576 } 2577 2578 2579 status_t 2580 DIESharedType::AddAttribute_decl_line(uint16 attributeName, 2581 const AttributeValue& value) 2582 { 2583 fDeclarationLocation.SetLine(value.constant); 2584 return B_OK; 2585 } 2586 2587 2588 status_t 2589 DIESharedType::AddAttribute_decl_column(uint16 attributeName, 2590 const AttributeValue& value) 2591 { 2592 fDeclarationLocation.SetColumn(value.constant); 2593 return B_OK; 2594 } 2595 2596 2597 // #pragma mark - DIETypeUnit 2598 2599 2600 DIETypeUnit::DIETypeUnit() 2601 { 2602 } 2603 2604 2605 uint16 2606 DIETypeUnit::Tag() const 2607 { 2608 return DW_TAG_type_unit; 2609 } 2610 2611 2612 // #pragma mark - DIERValueReferenceType 2613 2614 2615 DIERValueReferenceType::DIERValueReferenceType() 2616 { 2617 } 2618 2619 2620 uint16 2621 DIERValueReferenceType::Tag() const 2622 { 2623 return DW_TAG_rvalue_reference_type; 2624 } 2625 2626 2627 // #pragma mark - DIETemplateTemplateParameter 2628 2629 2630 DIETemplateTemplateParameter::DIETemplateTemplateParameter() 2631 : 2632 fName(NULL) 2633 { 2634 } 2635 2636 2637 uint16 2638 DIETemplateTemplateParameter::Tag() const 2639 { 2640 return DW_TAG_GNU_template_template_param; 2641 } 2642 2643 2644 const char* 2645 DIETemplateTemplateParameter::Name() const 2646 { 2647 return fName; 2648 } 2649 2650 2651 status_t 2652 DIETemplateTemplateParameter::AddAttribute_name(uint16 attributeName, 2653 const AttributeValue& value) 2654 { 2655 fName = value.string; 2656 return B_OK; 2657 } 2658 2659 2660 // #pragma mark - DIETemplateTypeParameterPack 2661 2662 2663 DIETemplateTypeParameterPack::DIETemplateTypeParameterPack() 2664 : 2665 fName(NULL) 2666 { 2667 } 2668 2669 2670 uint16 2671 DIETemplateTypeParameterPack::Tag() const 2672 { 2673 return DW_TAG_GNU_template_parameter_pack; 2674 } 2675 2676 2677 const char* 2678 DIETemplateTypeParameterPack::Name() const 2679 { 2680 return fName; 2681 } 2682 2683 2684 status_t 2685 DIETemplateTypeParameterPack::AddAttribute_name(uint16 attributeName, 2686 const AttributeValue& value) 2687 { 2688 fName = value.string; 2689 return B_OK; 2690 } 2691 2692 2693 status_t 2694 DIETemplateTypeParameterPack::AddChild(DebugInfoEntry* child) 2695 { 2696 if (child->Tag() == DW_TAG_template_type_parameter) { 2697 fChildren.Add(child); 2698 return B_OK; 2699 } 2700 2701 return DIEDeclaredBase::AddChild(child); 2702 } 2703 2704 2705 // #pragma mark - DIETemplateValueParameterPack 2706 2707 2708 DIETemplateValueParameterPack::DIETemplateValueParameterPack() 2709 : 2710 fName(NULL) 2711 { 2712 } 2713 2714 2715 uint16 2716 DIETemplateValueParameterPack::Tag() const 2717 { 2718 return DW_TAG_GNU_formal_parameter_pack; 2719 } 2720 2721 2722 const char* 2723 DIETemplateValueParameterPack::Name() const 2724 { 2725 return fName; 2726 } 2727 2728 2729 status_t 2730 DIETemplateValueParameterPack::AddAttribute_name(uint16 attributeName, 2731 const AttributeValue& value) 2732 { 2733 fName = value.string; 2734 return B_OK; 2735 } 2736 2737 2738 status_t 2739 DIETemplateValueParameterPack::AddChild(DebugInfoEntry* child) 2740 { 2741 if (child->Tag() == DW_TAG_formal_parameter) { 2742 fChildren.Add(child); 2743 return B_OK; 2744 } 2745 2746 return DIEDeclaredBase::AddChild(child); 2747 } 2748 2749 2750 // #pragma mark - DIECallSite 2751 2752 2753 DIECallSite::DIECallSite() 2754 : 2755 fName(NULL) 2756 { 2757 } 2758 2759 2760 uint16 2761 DIECallSite::Tag() const 2762 { 2763 return DW_TAG_GNU_call_site; 2764 } 2765 2766 2767 const char* 2768 DIECallSite::Name() const 2769 { 2770 return fName; 2771 } 2772 2773 2774 status_t 2775 DIECallSite::AddAttribute_name(uint16 attributeName, 2776 const AttributeValue& value) 2777 { 2778 fName = value.string; 2779 return B_OK; 2780 } 2781 2782 2783 status_t 2784 DIECallSite::AddChild(DebugInfoEntry* child) 2785 { 2786 if (child->Tag() == DW_TAG_GNU_call_site_parameter) { 2787 fChildren.Add(child); 2788 return B_OK; 2789 } 2790 2791 return DIEDeclaredBase::AddChild(child); 2792 } 2793 2794 2795 // #pragma mark - DIECallSiteParameter 2796 2797 2798 DIECallSiteParameter::DIECallSiteParameter() 2799 : 2800 fName(NULL) 2801 { 2802 } 2803 2804 2805 uint16 2806 DIECallSiteParameter::Tag() const 2807 { 2808 return DW_TAG_GNU_call_site_parameter; 2809 } 2810 2811 2812 const char* 2813 DIECallSiteParameter::Name() const 2814 { 2815 return fName; 2816 } 2817 2818 2819 status_t 2820 DIECallSiteParameter::AddAttribute_name(uint16 attributeName, 2821 const AttributeValue& value) 2822 { 2823 fName = value.string; 2824 return B_OK; 2825 } 2826 2827 2828 status_t 2829 DIECallSiteParameter::AddChild(DebugInfoEntry* child) 2830 { 2831 return DIEDeclaredBase::AddChild(child); 2832 } 2833 2834 2835 // #pragma mark - DebugInfoEntryFactory 2836 2837 2838 DebugInfoEntryFactory::DebugInfoEntryFactory() 2839 { 2840 } 2841 2842 2843 status_t 2844 DebugInfoEntryFactory::CreateDebugInfoEntry(uint16 tag, DebugInfoEntry*& _entry) 2845 { 2846 DebugInfoEntry* entry = NULL; 2847 2848 switch (tag) { 2849 case DW_TAG_array_type: 2850 entry = new(std::nothrow) DIEArrayType; 2851 break; 2852 case DW_TAG_class_type: 2853 entry = new(std::nothrow) DIEClassType; 2854 break; 2855 case DW_TAG_entry_point: 2856 entry = new(std::nothrow) DIEEntryPoint; 2857 break; 2858 case DW_TAG_enumeration_type: 2859 entry = new(std::nothrow) DIEEnumerationType; 2860 break; 2861 case DW_TAG_formal_parameter: 2862 entry = new(std::nothrow) DIEFormalParameter; 2863 break; 2864 case DW_TAG_imported_declaration: 2865 entry = new(std::nothrow) DIEImportedDeclaration; 2866 break; 2867 case DW_TAG_label: 2868 entry = new(std::nothrow) DIELabel; 2869 break; 2870 case DW_TAG_lexical_block: 2871 entry = new(std::nothrow) DIELexicalBlock; 2872 break; 2873 case DW_TAG_member: 2874 entry = new(std::nothrow) DIEMember; 2875 break; 2876 case DW_TAG_pointer_type: 2877 entry = new(std::nothrow) DIEPointerType; 2878 break; 2879 case DW_TAG_reference_type: 2880 entry = new(std::nothrow) DIEReferenceType; 2881 break; 2882 case DW_TAG_compile_unit: 2883 entry = new(std::nothrow) DIECompileUnit; 2884 break; 2885 case DW_TAG_string_type: 2886 entry = new(std::nothrow) DIEStringType; 2887 break; 2888 case DW_TAG_structure_type: 2889 entry = new(std::nothrow) DIEStructureType; 2890 break; 2891 case DW_TAG_subroutine_type: 2892 entry = new(std::nothrow) DIESubroutineType; 2893 break; 2894 case DW_TAG_typedef: 2895 entry = new(std::nothrow) DIETypedef; 2896 break; 2897 case DW_TAG_union_type: 2898 entry = new(std::nothrow) DIEUnionType; 2899 break; 2900 case DW_TAG_unspecified_parameters: 2901 entry = new(std::nothrow) DIEUnspecifiedParameters; 2902 break; 2903 case DW_TAG_variant: 2904 entry = new(std::nothrow) DIEVariant; 2905 break; 2906 case DW_TAG_common_block: 2907 entry = new(std::nothrow) DIECommonBlock; 2908 break; 2909 case DW_TAG_common_inclusion: 2910 entry = new(std::nothrow) DIECommonInclusion; 2911 break; 2912 case DW_TAG_inheritance: 2913 entry = new(std::nothrow) DIEInheritance; 2914 break; 2915 case DW_TAG_inlined_subroutine: 2916 entry = new(std::nothrow) DIEInlinedSubroutine; 2917 break; 2918 case DW_TAG_module: 2919 entry = new(std::nothrow) DIEModule; 2920 break; 2921 case DW_TAG_ptr_to_member_type: 2922 entry = new(std::nothrow) DIEPointerToMemberType; 2923 break; 2924 case DW_TAG_set_type: 2925 entry = new(std::nothrow) DIESetType; 2926 break; 2927 case DW_TAG_subrange_type: 2928 entry = new(std::nothrow) DIESubrangeType; 2929 break; 2930 case DW_TAG_with_stmt: 2931 entry = new(std::nothrow) DIEWithStatement; 2932 break; 2933 case DW_TAG_access_declaration: 2934 entry = new(std::nothrow) DIEAccessDeclaration; 2935 break; 2936 case DW_TAG_base_type: 2937 entry = new(std::nothrow) DIEBaseType; 2938 break; 2939 case DW_TAG_catch_block: 2940 entry = new(std::nothrow) DIECatchBlock; 2941 break; 2942 case DW_TAG_const_type: 2943 entry = new(std::nothrow) DIEConstType; 2944 break; 2945 case DW_TAG_constant: 2946 entry = new(std::nothrow) DIEConstant; 2947 break; 2948 case DW_TAG_enumerator: 2949 entry = new(std::nothrow) DIEEnumerator; 2950 break; 2951 case DW_TAG_file_type: 2952 entry = new(std::nothrow) DIEFileType; 2953 break; 2954 case DW_TAG_friend: 2955 entry = new(std::nothrow) DIEFriend; 2956 break; 2957 case DW_TAG_namelist: 2958 entry = new(std::nothrow) DIENameList; 2959 break; 2960 case DW_TAG_namelist_item: 2961 entry = new(std::nothrow) DIENameListItem; 2962 break; 2963 case DW_TAG_packed_type: 2964 entry = new(std::nothrow) DIEPackedType; 2965 break; 2966 case DW_TAG_subprogram: 2967 entry = new(std::nothrow) DIESubprogram; 2968 break; 2969 case DW_TAG_template_type_parameter: 2970 entry = new(std::nothrow) DIETemplateTypeParameter; 2971 break; 2972 case DW_TAG_template_value_parameter: 2973 entry = new(std::nothrow) DIETemplateValueParameter; 2974 break; 2975 case DW_TAG_thrown_type: 2976 entry = new(std::nothrow) DIEThrownType; 2977 break; 2978 case DW_TAG_try_block: 2979 entry = new(std::nothrow) DIETryBlock; 2980 break; 2981 case DW_TAG_variant_part: 2982 entry = new(std::nothrow) DIEVariantPart; 2983 break; 2984 case DW_TAG_variable: 2985 entry = new(std::nothrow) DIEVariable; 2986 break; 2987 case DW_TAG_volatile_type: 2988 entry = new(std::nothrow) DIEVolatileType; 2989 break; 2990 case DW_TAG_dwarf_procedure: 2991 entry = new(std::nothrow) DIEDwarfProcedure; 2992 break; 2993 case DW_TAG_restrict_type: 2994 entry = new(std::nothrow) DIERestrictType; 2995 break; 2996 case DW_TAG_interface_type: 2997 entry = new(std::nothrow) DIEInterfaceType; 2998 break; 2999 case DW_TAG_namespace: 3000 entry = new(std::nothrow) DIENamespace; 3001 break; 3002 case DW_TAG_imported_module: 3003 entry = new(std::nothrow) DIEImportedModule; 3004 break; 3005 case DW_TAG_unspecified_type: 3006 entry = new(std::nothrow) DIEUnspecifiedType; 3007 break; 3008 case DW_TAG_partial_unit: 3009 entry = new(std::nothrow) DIEPartialUnit; 3010 break; 3011 case DW_TAG_imported_unit: 3012 entry = new(std::nothrow) DIEImportedUnit; 3013 break; 3014 case DW_TAG_condition: 3015 entry = new(std::nothrow) DIECondition; 3016 break; 3017 case DW_TAG_shared_type: 3018 entry = new(std::nothrow) DIESharedType; 3019 break; 3020 case DW_TAG_type_unit: 3021 entry = new(std::nothrow) DIETypeUnit; 3022 break; 3023 case DW_TAG_rvalue_reference_type: 3024 entry = new(std::nothrow) DIERValueReferenceType; 3025 break; 3026 case DW_TAG_GNU_template_template_param: 3027 entry = new(std::nothrow) DIETemplateTemplateParameter; 3028 break; 3029 case DW_TAG_GNU_template_parameter_pack: 3030 entry = new(std::nothrow) DIETemplateTypeParameterPack; 3031 break; 3032 case DW_TAG_GNU_formal_parameter_pack: 3033 entry = new(std::nothrow) DIETemplateValueParameterPack; 3034 break; 3035 case DW_TAG_GNU_call_site: 3036 entry = new(std::nothrow) DIECallSite; 3037 break; 3038 case DW_TAG_GNU_call_site_parameter: 3039 entry = new(std::nothrow) DIECallSiteParameter; 3040 break; 3041 default: 3042 return B_ENTRY_NOT_FOUND; 3043 break; 3044 } 3045 3046 _entry = entry; 3047 return B_OK; 3048 } 3049