2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2013-2014, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
6 #ifndef DEBUG_INFO_ENTRIES_H
7 #define DEBUG_INFO_ENTRIES_H
10 #include "DebugInfoEntry.h"
12 #include "AttributeValue.h"
17 // // not supported by all types:
20 // DW_AT_data_location
28 // DW_AT_accessibility // !file, !pointer to member
29 // DW_AT_declaration // !file
30 // DW_AT_abstract_origin // !interface
31 // DW_AT_description // !interface
32 // DW_AT_visibility // !interface
37 // addressing: modified
38 // DW_AT_address_class
41 // DW_AT_byte_size // !interface
42 // DW_AT_specification // !interface
44 // class base: compound
46 // array index: derived
52 // unspecified: common
58 // class/structure: class base
60 // interface: class base
66 // DW_AT_string_length
68 // subroutine: declared
69 // DW_AT_address_class
74 // enumeration: array index
75 // DW_AT_specification
77 // pointer to member: derived
78 // DW_AT_address_class
79 // DW_AT_containing_type
85 // subrange: array index
88 // DW_AT_threads_scaled
95 // DW_AT_specification
111 // volatile: modified
114 // restrict: modified
116 // pointer: addressing
117 // DW_AT_specification
119 // reference: addressing
123 // DW_AT_binary_scale
127 // DW_AT_decimal_scale
128 // DW_AT_decimal_sign
133 // DW_AT_picture_string
137 class DIECompileUnitBase
: public DebugInfoEntry
{
139 DIECompileUnitBase();
140 ~DIECompileUnitBase();
142 virtual status_t
InitAfterAttributes(
143 DebugInfoEntryInitInfo
& info
);
145 virtual const char* Name() const;
147 const char* CompilationDir() const
148 { return fCompilationDir
; }
150 uint16
Language() const { return fLanguage
; }
152 const DebugInfoEntryList
& Types() const { return fTypes
; }
153 const DebugInfoEntryList
& OtherChildren() const
154 { return fOtherChildren
; }
155 off_t
AddressRangesOffset() const
156 { return fAddressRangesOffset
; }
158 target_addr_t
LowPC() const { return fLowPC
; }
159 target_addr_t
HighPC() const { return fHighPC
; }
161 off_t
StatementListOffset() const
162 { return fStatementListOffset
; }
164 bool ContainsMainSubprogram() const
165 { return fContainsMainSubprogram
; }
167 virtual status_t
AddChild(DebugInfoEntry
* child
);
169 virtual status_t
AddAttribute_name(uint16 attributeName
,
170 const AttributeValue
& value
);
171 virtual status_t
AddAttribute_comp_dir(uint16 attributeName
,
172 const AttributeValue
& value
);
173 virtual status_t
AddAttribute_low_pc(uint16 attributeName
,
174 const AttributeValue
& value
);
175 virtual status_t
AddAttribute_high_pc(uint16 attributeName
,
176 const AttributeValue
& value
);
177 virtual status_t
AddAttribute_producer(uint16 attributeName
,
178 const AttributeValue
& value
);
179 virtual status_t
AddAttribute_stmt_list(uint16 attributeName
,
180 const AttributeValue
& value
);
181 virtual status_t
AddAttribute_macro_info(uint16 attributeName
,
182 const AttributeValue
& value
);
183 virtual status_t
AddAttribute_base_types(uint16 attributeName
,
184 const AttributeValue
& value
);
185 virtual status_t
AddAttribute_language(uint16 attributeName
,
186 const AttributeValue
& value
);
187 virtual status_t
AddAttribute_identifier_case(
188 uint16 attributeName
,
189 const AttributeValue
& value
);
190 virtual status_t
AddAttribute_use_UTF8(uint16 attributeName
,
191 const AttributeValue
& value
);
192 virtual status_t
AddAttribute_ranges(uint16 attributeName
,
193 const AttributeValue
& value
);
194 virtual status_t
AddAttribute_main_subprogram(
195 uint16 attributeName
,
196 const AttributeValue
& value
);
199 // virtual status_t AddAttribute_segment(uint16 attributeName,
200 // const AttributeValue& value);
202 // TODO: DW_AT_import
206 const char* fCompilationDir
;
207 target_addr_t fLowPC
;
208 target_addr_t fHighPC
;
209 off_t fStatementListOffset
;
210 off_t fMacroInfoOffset
;
211 off_t fAddressRangesOffset
;
212 DIECompileUnitBase
* fBaseTypesUnit
;
213 DebugInfoEntryList fTypes
;
214 DebugInfoEntryList fOtherChildren
;
216 uint8 fIdentifierCase
;
218 bool fContainsMainSubprogram
;
222 class DIEType
: public DebugInfoEntry
{
226 virtual bool IsType() const;
228 virtual const char* Name() const;
230 virtual bool IsDeclaration() const;
231 virtual const DynamicAttributeValue
* ByteSize() const;
233 virtual status_t
AddAttribute_name(uint16 attributeName
,
234 const AttributeValue
& value
);
235 virtual status_t
AddAttribute_allocated(uint16 attributeName
,
236 const AttributeValue
& value
);
237 virtual status_t
AddAttribute_associated(uint16 attributeName
,
238 const AttributeValue
& value
);
241 // DW_AT_data_location
246 DynamicAttributeValue fAllocated
;
247 DynamicAttributeValue fAssociated
;
251 class DIEModifiedType
: public DIEType
{
255 DIEType
* GetType() const { return fType
; }
257 virtual status_t
AddAttribute_type(uint16 attributeName
,
258 const AttributeValue
& value
);
265 class DIEAddressingType
: public DIEModifiedType
{
269 virtual status_t
AddAttribute_address_class(uint16 attributeName
,
270 const AttributeValue
& value
);
277 class DIEDeclaredType
: public DIEType
{
281 virtual const char* Description() const;
282 virtual DebugInfoEntry
* AbstractOrigin() const;
284 virtual DebugInfoEntry
* SignatureType() const;
286 virtual bool IsDeclaration() const;
288 virtual status_t
AddAttribute_accessibility(uint16 attributeName
,
289 const AttributeValue
& value
);
290 // TODO: !file, !pointer to member
291 virtual status_t
AddAttribute_declaration(uint16 attributeName
,
292 const AttributeValue
& value
);
294 virtual status_t
AddAttribute_description(uint16 attributeName
,
295 const AttributeValue
& value
);
297 virtual status_t
AddAttribute_abstract_origin(
298 uint16 attributeName
,
299 const AttributeValue
& value
);
301 virtual status_t
AddAttribute_signature(uint16 attributeName
,
302 const AttributeValue
& value
);
305 // DW_AT_visibility // !interface
308 virtual DeclarationLocation
* GetDeclarationLocation();
311 const char* fDescription
;
312 DeclarationLocation fDeclarationLocation
;
313 DebugInfoEntry
* fAbstractOrigin
;
314 DebugInfoEntry
* fSignatureType
;
315 uint8 fAccessibility
;
320 class DIEDerivedType
: public DIEDeclaredType
{
324 DIEType
* GetType() const { return fType
; }
326 virtual status_t
AddAttribute_type(uint16 attributeName
,
327 const AttributeValue
& value
);
334 class DIECompoundType
: public DIEDeclaredType
{
338 virtual bool IsNamespace() const;
340 virtual DebugInfoEntry
* Specification() const;
342 virtual const DynamicAttributeValue
* ByteSize() const;
344 const DebugInfoEntryList
& DataMembers() const
345 { return fDataMembers
; }
347 virtual status_t
AddChild(DebugInfoEntry
* child
);
349 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
350 const AttributeValue
& value
);
352 virtual status_t
AddAttribute_specification(uint16 attributeName
,
353 const AttributeValue
& value
);
357 DynamicAttributeValue fByteSize
;
358 DIECompoundType
* fSpecification
;
359 DebugInfoEntryList fDataMembers
;
363 class DIEClassBaseType
: public DIECompoundType
{
367 const DebugInfoEntryList
& BaseTypes() const
368 { return fBaseTypes
; }
369 const DebugInfoEntryList
& TemplateParameters() const
370 { return fTemplateParameters
; }
372 virtual status_t
AddChild(DebugInfoEntry
* child
);
375 DebugInfoEntryList fBaseTypes
;
376 DebugInfoEntryList fFriends
;
377 DebugInfoEntryList fAccessDeclarations
;
378 DebugInfoEntryList fMemberFunctions
;
379 DebugInfoEntryList fInnerTypes
;
380 DebugInfoEntryList fTemplateParameters
;
384 class DIENamedBase
: public DebugInfoEntry
{
388 virtual const char* Name() const;
389 virtual const char* Description() const;
391 virtual status_t
AddAttribute_name(uint16 attributeName
,
392 const AttributeValue
& value
);
393 virtual status_t
AddAttribute_description(uint16 attributeName
,
394 const AttributeValue
& value
);
398 const char* fDescription
;
402 class DIEDeclaredBase
: public DebugInfoEntry
{
407 virtual DeclarationLocation
* GetDeclarationLocation();
410 DeclarationLocation fDeclarationLocation
;
414 class DIEDeclaredNamedBase
: public DIEDeclaredBase
{
416 DIEDeclaredNamedBase();
418 virtual const char* Name() const;
419 virtual const char* Description() const;
421 uint8
Accessibility() const { return fAccessibility
; }
422 uint8
Visibility() const { return fVisibility
; }
423 virtual bool IsDeclaration() const;
425 virtual status_t
AddAttribute_name(uint16 attributeName
,
426 const AttributeValue
& value
);
427 virtual status_t
AddAttribute_description(uint16 attributeName
,
428 const AttributeValue
& value
);
429 virtual status_t
AddAttribute_accessibility(uint16 attributeName
,
430 const AttributeValue
& value
);
431 virtual status_t
AddAttribute_declaration(uint16 attributeName
,
432 const AttributeValue
& value
);
436 const char* fDescription
;
437 uint8 fAccessibility
;
443 class DIEArrayIndexType
: public DIEDerivedType
{
447 virtual const DynamicAttributeValue
* ByteSize() const;
449 const DynamicAttributeValue
* BitStride() const
450 { return &fBitStride
; }
451 const DynamicAttributeValue
* ByteStride() const
452 { return &fByteStride
; }
454 virtual status_t
AddAttribute_bit_stride(uint16 attributeName
,
455 const AttributeValue
& value
);
456 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
457 const AttributeValue
& value
);
458 virtual status_t
AddAttribute_byte_stride(uint16 attributeName
,
459 const AttributeValue
& value
);
462 DynamicAttributeValue fBitStride
;
463 DynamicAttributeValue fByteSize
;
464 DynamicAttributeValue fByteStride
;
471 class DIEArrayType
: public DIEDerivedType
{
475 virtual uint16
Tag() const;
477 virtual status_t
InitAfterHierarchy(
478 DebugInfoEntryInitInfo
& info
);
480 virtual DebugInfoEntry
* Specification() const;
482 virtual const DynamicAttributeValue
* ByteSize() const;
484 const DynamicAttributeValue
* BitStride() const
485 { return &fBitStride
; }
487 const DebugInfoEntryList
& Dimensions() const
488 { return fDimensions
; }
490 virtual status_t
AddChild(DebugInfoEntry
* child
);
492 virtual status_t
AddAttribute_ordering(uint16 attributeName
,
493 const AttributeValue
& value
);
494 virtual status_t
AddAttribute_bit_stride(uint16 attributeName
,
495 const AttributeValue
& value
);
496 virtual status_t
AddAttribute_stride_size(uint16 attributeName
,
497 const AttributeValue
& value
);
498 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
499 const AttributeValue
& value
);
500 virtual status_t
AddAttribute_specification(uint16 attributeName
,
501 const AttributeValue
& value
);
504 DynamicAttributeValue fBitStride
;
505 DynamicAttributeValue fByteSize
;
506 DebugInfoEntryList fDimensions
;
507 DIEArrayType
* fSpecification
;
512 class DIEClassType
: public DIEClassBaseType
{
516 virtual uint16
Tag() const;
520 class DIEEntryPoint
: public DebugInfoEntry
{
522 // TODO: Maybe introduce a common base class for DIEEntryPoint and
526 virtual uint16
Tag() const;
529 // DW_AT_address_class
541 class DIEEnumerationType
: public DIEArrayIndexType
{
543 DIEEnumerationType();
545 virtual uint16
Tag() const;
547 virtual DebugInfoEntry
* Specification() const;
549 const DebugInfoEntryList
& Enumerators() const
550 { return fEnumerators
; }
552 virtual status_t
AddChild(DebugInfoEntry
* child
);
554 virtual status_t
AddAttribute_specification(uint16 attributeName
,
555 const AttributeValue
& value
);
558 DIEEnumerationType
* fSpecification
;
559 DebugInfoEntryList fEnumerators
;
563 class DIEFormalParameter
: public DIEDeclaredNamedBase
{
565 DIEFormalParameter();
567 virtual uint16
Tag() const;
569 virtual DebugInfoEntry
* AbstractOrigin() const;
570 virtual LocationDescription
* GetLocationDescription();
572 DIEType
* GetType() const { return fType
; }
574 const ConstantAttributeValue
* ConstValue() const
577 bool IsArtificial() const { return fArtificial
; }
579 virtual status_t
AddAttribute_abstract_origin(
580 uint16 attributeName
,
581 const AttributeValue
& value
);
582 virtual status_t
AddAttribute_artificial(uint16 attributeName
,
583 const AttributeValue
& value
);
584 virtual status_t
AddAttribute_const_value(uint16 attributeName
,
585 const AttributeValue
& value
);
586 virtual status_t
AddAttribute_type(uint16 attributeName
,
587 const AttributeValue
& value
);
590 // DW_AT_default_value
594 // DW_AT_variable_parameter
597 LocationDescription fLocationDescription
;
598 DebugInfoEntry
* fAbstractOrigin
;
600 ConstantAttributeValue fValue
;
605 class DIEImportedDeclaration
: public DIEDeclaredNamedBase
{
607 DIEImportedDeclaration();
609 virtual uint16
Tag() const;
617 class DIELabel
: public DIEDeclaredNamedBase
{
621 virtual uint16
Tag() const;
624 // DW_AT_abstract_origin
631 class DIELexicalBlock
: public DIENamedBase
{
635 virtual uint16
Tag() const;
637 virtual DebugInfoEntry
* AbstractOrigin() const;
639 off_t
AddressRangesOffset() const
640 { return fAddressRangesOffset
; }
642 target_addr_t
LowPC() const { return fLowPC
; }
643 target_addr_t
HighPC() const { return fHighPC
; }
645 const DebugInfoEntryList
& Variables() const { return fVariables
; }
646 const DebugInfoEntryList
& Blocks() const { return fBlocks
; }
648 virtual status_t
AddChild(DebugInfoEntry
* child
);
650 virtual status_t
AddAttribute_low_pc(uint16 attributeName
,
651 const AttributeValue
& value
);
652 virtual status_t
AddAttribute_high_pc(uint16 attributeName
,
653 const AttributeValue
& value
);
654 virtual status_t
AddAttribute_ranges(uint16 attributeName
,
655 const AttributeValue
& value
);
656 virtual status_t
AddAttribute_abstract_origin(
657 uint16 attributeName
,
658 const AttributeValue
& value
);
661 DebugInfoEntryList fVariables
;
662 DebugInfoEntryList fBlocks
;
663 target_addr_t fLowPC
;
664 target_addr_t fHighPC
;
665 off_t fAddressRangesOffset
;
666 DIELexicalBlock
* fAbstractOrigin
;
673 class DIEMember
: public DIEDeclaredNamedBase
{
677 virtual uint16
Tag() const;
679 DIEType
* GetType() const { return fType
; }
680 const DynamicAttributeValue
* ByteSize() const
681 { return &fByteSize
; }
682 const DynamicAttributeValue
* BitOffset() const
683 { return &fBitOffset
; }
684 const DynamicAttributeValue
* DataBitOffset() const
685 { return &fDataBitOffset
; }
686 const DynamicAttributeValue
* BitSize() const
687 { return &fBitSize
; }
688 const MemberLocation
* Location() const
689 { return &fLocation
; }
691 virtual status_t
AddAttribute_type(uint16 attributeName
,
692 const AttributeValue
& value
);
693 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
694 const AttributeValue
& value
);
695 virtual status_t
AddAttribute_bit_size(uint16 attributeName
,
696 const AttributeValue
& value
);
697 virtual status_t
AddAttribute_bit_offset(uint16 attributeName
,
698 const AttributeValue
& value
);
699 virtual status_t
AddAttribute_data_bit_offset(
700 uint16 attributeName
,
701 const AttributeValue
& value
);
702 virtual status_t
AddAttribute_data_member_location(
703 uint16 attributeName
,
704 const AttributeValue
& value
);
711 DynamicAttributeValue fByteSize
;
712 DynamicAttributeValue fBitOffset
;
713 DynamicAttributeValue fDataBitOffset
;
714 DynamicAttributeValue fBitSize
;
715 MemberLocation fLocation
;
719 class DIEPointerType
: public DIEAddressingType
{
723 virtual uint16
Tag() const;
725 virtual DebugInfoEntry
* Specification() const;
727 virtual status_t
AddAttribute_specification(uint16 attributeName
,
728 const AttributeValue
& value
);
731 DIEPointerType
* fSpecification
;
735 class DIEReferenceType
: public DIEAddressingType
{
739 virtual uint16
Tag() const;
743 class DIECompileUnit
: public DIECompileUnitBase
{
747 virtual uint16
Tag() const;
751 class DIEStringType
: public DIEDeclaredType
{
755 virtual uint16
Tag() const;
757 virtual const DynamicAttributeValue
* ByteSize() const;
759 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
760 const AttributeValue
& value
);
763 DynamicAttributeValue fByteSize
;
765 // DW_AT_string_length
769 class DIEStructureType
: public DIEClassBaseType
{
773 virtual uint16
Tag() const;
777 class DIESubroutineType
: public DIEDeclaredType
{
781 virtual uint16
Tag() const;
783 DIEType
* ReturnType() const { return fReturnType
; }
785 const DebugInfoEntryList
& Parameters() const { return fParameters
; }
787 virtual status_t
AddChild(DebugInfoEntry
* child
);
789 virtual status_t
AddAttribute_address_class(uint16 attributeName
,
790 const AttributeValue
& value
);
791 virtual status_t
AddAttribute_prototyped(uint16 attributeName
,
792 const AttributeValue
& value
);
793 virtual status_t
AddAttribute_type(uint16 attributeName
,
794 const AttributeValue
& value
);
797 DebugInfoEntryList fParameters
;
798 DIEType
* fReturnType
;
804 class DIETypedef
: public DIEDerivedType
{
808 virtual uint16
Tag() const;
812 class DIEUnionType
: public DIECompoundType
{
816 virtual uint16
Tag() const;
820 class DIEUnspecifiedParameters
: public DIEDeclaredBase
{
822 DIEUnspecifiedParameters();
824 virtual uint16
Tag() const;
827 // DW_AT_abstract_origin
832 class DIEVariant
: public DIEDeclaredBase
{
836 virtual uint16
Tag() const;
839 // DW_AT_accessibility
840 // DW_AT_abstract_origin
847 class DIECommonBlock
: public DIEDeclaredNamedBase
{
851 virtual uint16
Tag() const;
853 virtual LocationDescription
* GetLocationDescription();
859 LocationDescription fLocationDescription
;
863 class DIECommonInclusion
: public DIEDeclaredBase
{
865 DIECommonInclusion();
867 virtual uint16
Tag() const;
870 // DW_AT_common_reference
877 class DIEInheritance
: public DIEDeclaredBase
{
881 virtual uint16
Tag() const;
883 DIEType
* GetType() const { return fType
; }
884 const MemberLocation
* Location() const
885 { return &fLocation
; }
887 virtual status_t
AddAttribute_type(uint16 attributeName
,
888 const AttributeValue
& value
);
889 virtual status_t
AddAttribute_data_member_location(
890 uint16 attributeName
,
891 const AttributeValue
& value
);
894 // DW_AT_accessibility
899 MemberLocation fLocation
;
903 class DIEInlinedSubroutine
: public DebugInfoEntry
{
905 DIEInlinedSubroutine();
907 virtual uint16
Tag() const;
910 // DW_AT_abstract_origin
925 class DIEModule
: public DIEDeclaredNamedBase
{
929 virtual uint16
Tag() const;
938 // DW_AT_specification
942 class DIEPointerToMemberType
: public DIEDerivedType
{
944 DIEPointerToMemberType();
946 virtual uint16
Tag() const;
948 DIECompoundType
* ContainingType() const
949 { return fContainingType
; }
951 const LocationDescription
& UseLocation() const
952 { return fUseLocation
; }
954 virtual status_t
AddAttribute_address_class(uint16 attributeName
,
955 const AttributeValue
& value
);
956 virtual status_t
AddAttribute_containing_type(
957 uint16 attributeName
,
958 const AttributeValue
& value
);
959 virtual status_t
AddAttribute_use_location(uint16 attributeName
,
960 const AttributeValue
& value
);
963 DIECompoundType
* fContainingType
;
964 LocationDescription fUseLocation
;
969 class DIESetType
: public DIEDerivedType
{
973 virtual uint16
Tag() const;
975 virtual const DynamicAttributeValue
* ByteSize() const;
977 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
978 const AttributeValue
& value
);
981 DynamicAttributeValue fByteSize
;
985 class DIESubrangeType
: public DIEArrayIndexType
{
989 virtual uint16
Tag() const;
991 const DynamicAttributeValue
* LowerBound() const
992 { return &fLowerBound
; }
993 const DynamicAttributeValue
* UpperBound() const
994 { return &fUpperBound
; }
995 const DynamicAttributeValue
* Count() const
998 virtual status_t
AddAttribute_count(uint16 attributeName
,
999 const AttributeValue
& value
);
1000 virtual status_t
AddAttribute_lower_bound(uint16 attributeName
,
1001 const AttributeValue
& value
);
1002 virtual status_t
AddAttribute_upper_bound(uint16 attributeName
,
1003 const AttributeValue
& value
);
1004 virtual status_t
AddAttribute_threads_scaled(
1005 uint16 attributeName
,
1006 const AttributeValue
& value
);
1009 DynamicAttributeValue fCount
;
1010 DynamicAttributeValue fLowerBound
;
1011 DynamicAttributeValue fUpperBound
;
1012 bool fThreadsScaled
;
1016 class DIEWithStatement
: public DebugInfoEntry
{
1020 virtual uint16
Tag() const;
1022 DIEType
* GetType() const { return fType
; }
1024 virtual LocationDescription
* GetLocationDescription();
1026 virtual status_t
AddAttribute_type(uint16 attributeName
,
1027 const AttributeValue
& value
);
1030 // DW_AT_accessibility
1031 // DW_AT_address_class
1032 // DW_AT_declaration
1041 LocationDescription fLocationDescription
;
1045 class DIEAccessDeclaration
: public DIEDeclaredNamedBase
{
1047 DIEAccessDeclaration();
1049 virtual uint16
Tag() const;
1053 class DIEBaseType
: public DIEType
{
1057 virtual uint16
Tag() const;
1059 virtual const DynamicAttributeValue
* ByteSize() const;
1060 const DynamicAttributeValue
* BitOffset() const
1061 { return &fBitOffset
; }
1062 const DynamicAttributeValue
* DataBitOffset() const
1063 { return &fDataBitOffset
; }
1064 const DynamicAttributeValue
* BitSize() const
1065 { return &fBitSize
; }
1066 uint8
Encoding() const { return fEncoding
; }
1067 uint8
Endianity() const { return fEndianity
; }
1069 virtual status_t
AddAttribute_encoding(uint16 attributeName
,
1070 const AttributeValue
& value
);
1071 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
1072 const AttributeValue
& value
);
1073 virtual status_t
AddAttribute_bit_size(uint16 attributeName
,
1074 const AttributeValue
& value
);
1075 virtual status_t
AddAttribute_bit_offset(uint16 attributeName
,
1076 const AttributeValue
& value
);
1077 virtual status_t
AddAttribute_data_bit_offset(
1078 uint16 attributeName
,
1079 const AttributeValue
& value
);
1080 virtual status_t
AddAttribute_endianity(uint16 attributeName
,
1081 const AttributeValue
& value
);
1084 // DW_AT_binary_scale
1085 // DW_AT_decimal_scale
1086 // DW_AT_decimal_sign
1087 // DW_AT_description
1088 // DW_AT_digit_count
1089 // DW_AT_picture_string
1093 DynamicAttributeValue fByteSize
;
1094 DynamicAttributeValue fBitOffset
;
1095 DynamicAttributeValue fDataBitOffset
;
1096 DynamicAttributeValue fBitSize
;
1102 class DIECatchBlock
: public DebugInfoEntry
{
1106 virtual uint16
Tag() const;
1109 // DW_AT_abstract_origin
1117 class DIEConstType
: public DIEModifiedType
{
1121 virtual uint16
Tag() const;
1125 class DIEConstant
: public DIEDeclaredNamedBase
{
1129 virtual uint16
Tag() const;
1131 DIEType
* GetType() const { return fType
; }
1133 const ConstantAttributeValue
* ConstValue() const
1136 virtual status_t
AddAttribute_const_value(uint16 attributeName
,
1137 const AttributeValue
& value
);
1138 virtual status_t
AddAttribute_type(uint16 attributeName
,
1139 const AttributeValue
& value
);
1144 // DW_AT_start_scope
1148 ConstantAttributeValue fValue
;
1152 class DIEEnumerator
: public DIEDeclaredNamedBase
{
1156 virtual uint16
Tag() const;
1158 const ConstantAttributeValue
* ConstValue() const
1161 virtual status_t
AddAttribute_const_value(uint16 attributeName
,
1162 const AttributeValue
& value
);
1165 ConstantAttributeValue fValue
;
1169 class DIEFileType
: public DIEDerivedType
{
1173 virtual uint16
Tag() const;
1175 virtual const DynamicAttributeValue
* ByteSize() const;
1177 virtual status_t
AddAttribute_byte_size(uint16 attributeName
,
1178 const AttributeValue
& value
);
1181 DynamicAttributeValue fByteSize
;
1185 class DIEFriend
: public DIEDeclaredBase
{
1189 virtual uint16
Tag() const;
1192 // DW_AT_abstract_origin
1197 class DIENameList
: public DIEDeclaredNamedBase
{
1201 virtual uint16
Tag() const;
1204 // DW_AT_abstract_origin
1208 class DIENameListItem
: public DIEDeclaredBase
{
1212 virtual uint16
Tag() const;
1215 // DW_AT_namelist_item
1219 class DIEPackedType
: public DIEModifiedType
{
1223 virtual uint16
Tag() const;
1227 class DIESubprogram
: public DIEDeclaredNamedBase
{
1232 virtual uint16
Tag() const;
1234 virtual DebugInfoEntry
* Specification() const;
1235 virtual DebugInfoEntry
* AbstractOrigin() const;
1237 off_t
AddressRangesOffset() const
1238 { return fAddressRangesOffset
; }
1240 target_addr_t
LowPC() const { return fLowPC
; }
1241 target_addr_t
HighPC() const { return fHighPC
; }
1243 const LocationDescription
* FrameBase() const { return &fFrameBase
; }
1245 const DebugInfoEntryList
Parameters() const { return fParameters
; }
1246 const DebugInfoEntryList
Variables() const { return fVariables
; }
1247 const DebugInfoEntryList
Blocks() const { return fBlocks
; }
1248 const DebugInfoEntryList
TemplateTypeParameters() const
1249 { return fTemplateTypeParameters
; }
1250 const DebugInfoEntryList
TemplateValueParameters() const
1251 { return fTemplateValueParameters
; }
1252 const DebugInfoEntryList
CallSites() const
1253 { return fCallSites
; }
1255 bool IsPrototyped() const { return fPrototyped
; }
1256 uint8
Inline() const { return fInline
; }
1257 bool IsArtificial() const { return fArtificial
; }
1258 uint8
CallingConvention() const
1259 { return fCallingConvention
; }
1260 bool IsMain() const { return fMain
; }
1262 DIEType
* ReturnType() const { return fReturnType
; }
1264 virtual status_t
AddChild(DebugInfoEntry
* child
);
1266 virtual status_t
AddAttribute_low_pc(uint16 attributeName
,
1267 const AttributeValue
& value
);
1268 virtual status_t
AddAttribute_high_pc(uint16 attributeName
,
1269 const AttributeValue
& value
);
1270 virtual status_t
AddAttribute_ranges(uint16 attributeName
,
1271 const AttributeValue
& value
);
1272 virtual status_t
AddAttribute_specification(uint16 attributeName
,
1273 const AttributeValue
& value
);
1274 virtual status_t
AddAttribute_address_class(uint16 attributeName
,
1275 const AttributeValue
& value
);
1276 virtual status_t
AddAttribute_prototyped(uint16 attributeName
,
1277 const AttributeValue
& value
);
1278 virtual status_t
AddAttribute_type(uint16 attributeName
,
1279 const AttributeValue
& value
);
1280 virtual status_t
AddAttribute_inline(uint16 attributeName
,
1281 const AttributeValue
& value
);
1282 virtual status_t
AddAttribute_abstract_origin(
1283 uint16 attributeName
,
1284 const AttributeValue
& value
);
1285 virtual status_t
AddAttribute_frame_base(
1286 uint16 attributeName
,
1287 const AttributeValue
& value
);
1288 virtual status_t
AddAttribute_artificial(
1289 uint16 attributeName
,
1290 const AttributeValue
& value
);
1291 virtual status_t
AddAttribute_calling_convention(
1292 uint16 attributeName
,
1293 const AttributeValue
& value
);
1294 virtual status_t
AddAttribute_main_subprogram(
1295 uint16 attributeName
,
1296 const AttributeValue
& value
);
1300 DebugInfoEntryList fParameters
;
1301 DebugInfoEntryList fVariables
;
1302 DebugInfoEntryList fBlocks
;
1303 DebugInfoEntryList fTemplateTypeParameters
;
1304 DebugInfoEntryList fTemplateValueParameters
;
1305 DebugInfoEntryList fCallSites
;
1306 target_addr_t fLowPC
;
1307 target_addr_t fHighPC
;
1308 off_t fAddressRangesOffset
;
1309 DIESubprogram
* fSpecification
;
1310 DIESubprogram
* fAbstractOrigin
;
1311 DIEType
* fReturnType
;
1312 LocationDescription fFrameBase
;
1313 uint8 fAddressClass
;
1318 uint8 fCallingConvention
;
1325 // DW_AT_object_pointer
1328 // DW_AT_return_addr
1330 // DW_AT_start_scope
1331 // DW_AT_static_link
1334 // DW_AT_vtable_elem_location
1338 class DIETemplateTypeParameter
: public DIEDeclaredNamedBase
{
1340 DIETemplateTypeParameter();
1342 virtual uint16
Tag() const;
1344 DIEType
* GetType() const { return fType
; }
1346 virtual status_t
AddAttribute_type(uint16 attributeName
,
1347 const AttributeValue
& value
);
1354 class DIETemplateValueParameter
: public DIEDeclaredNamedBase
{
1356 DIETemplateValueParameter();
1358 virtual uint16
Tag() const;
1360 DIEType
* GetType() const { return fType
; }
1362 const ConstantAttributeValue
* ConstValue() const
1365 virtual status_t
AddAttribute_const_value(uint16 attributeName
,
1366 const AttributeValue
& value
);
1367 virtual status_t
AddAttribute_type(uint16 attributeName
,
1368 const AttributeValue
& value
);
1372 ConstantAttributeValue fValue
;
1376 class DIEThrownType
: public DIEDeclaredBase
{
1380 virtual uint16
Tag() const;
1382 DIEType
* GetType() const { return fType
; }
1384 virtual status_t
AddAttribute_type(uint16 attributeName
,
1385 const AttributeValue
& value
);
1390 // DW_AT_data_location
1397 class DIETryBlock
: public DebugInfoEntry
{
1401 virtual uint16
Tag() const;
1404 // DW_AT_abstract_origin
1412 class DIEVariantPart
: public DIEDeclaredBase
{
1416 virtual uint16
Tag() const;
1418 DIEType
* GetType() const { return fType
; }
1420 virtual status_t
AddAttribute_type(uint16 attributeName
,
1421 const AttributeValue
& value
);
1424 // DW_AT_abstract_origin
1425 // DW_AT_accessibility
1426 // DW_AT_declaration
1434 class DIEVariable
: public DIEDeclaredNamedBase
{
1438 virtual uint16
Tag() const;
1440 virtual DebugInfoEntry
* Specification() const;
1441 virtual DebugInfoEntry
* AbstractOrigin() const;
1443 virtual LocationDescription
* GetLocationDescription();
1445 DIEType
* GetType() const { return fType
; }
1447 const ConstantAttributeValue
* ConstValue() const
1450 uint64
StartScope() const { return fStartScope
; }
1452 bool IsExternal() const { return fIsExternal
; }
1454 virtual status_t
AddAttribute_const_value(uint16 attributeName
,
1455 const AttributeValue
& value
);
1456 virtual status_t
AddAttribute_type(uint16 attributeName
,
1457 const AttributeValue
& value
);
1458 virtual status_t
AddAttribute_specification(uint16 attributeName
,
1459 const AttributeValue
& value
);
1460 virtual status_t
AddAttribute_abstract_origin(
1461 uint16 attributeName
,
1462 const AttributeValue
& value
);
1463 virtual status_t
AddAttribute_start_scope(
1464 uint16 attributeName
,
1465 const AttributeValue
& value
);
1466 virtual status_t
AddAttribute_external(
1467 uint16 attributeName
,
1468 const AttributeValue
& value
);
1475 LocationDescription fLocationDescription
;
1476 ConstantAttributeValue fValue
;
1478 DebugInfoEntry
* fSpecification
;
1479 DIEVariable
* fAbstractOrigin
;
1485 class DIEVolatileType
: public DIEModifiedType
{
1489 virtual uint16
Tag() const;
1491 virtual status_t
AddAttribute_decl_file(uint16 attributeName
,
1492 const AttributeValue
& value
);
1493 virtual status_t
AddAttribute_decl_line(uint16 attributeName
,
1494 const AttributeValue
& value
);
1495 virtual status_t
AddAttribute_decl_column(uint16 attributeName
,
1496 const AttributeValue
& value
);
1499 DeclarationLocation fDeclarationLocation
;
1503 class DIEDwarfProcedure
: public DebugInfoEntry
{
1505 DIEDwarfProcedure();
1507 virtual uint16
Tag() const;
1509 virtual LocationDescription
* GetLocationDescription();
1512 LocationDescription fLocationDescription
;
1516 class DIERestrictType
: public DIEModifiedType
{
1520 virtual uint16
Tag() const;
1524 class DIEInterfaceType
: public DIEClassBaseType
{
1528 virtual uint16
Tag() const;
1532 class DIENamespace
: public DIEDeclaredNamedBase
{
1536 virtual uint16
Tag() const;
1538 virtual bool IsNamespace() const;
1540 const DebugInfoEntryList
& Children() const
1541 { return fChildren
; }
1543 virtual status_t
AddChild(DebugInfoEntry
* child
);
1546 DebugInfoEntryList fChildren
;
1550 // DW_AT_start_scope
1554 class DIEImportedModule
: public DIEDeclaredBase
{
1556 DIEImportedModule();
1558 virtual uint16
Tag() const;
1562 // DW_AT_start_scope
1566 class DIEUnspecifiedType
: public DIEType
{
1568 DIEUnspecifiedType();
1570 virtual uint16
Tag() const;
1572 virtual status_t
AddAttribute_decl_file(uint16 attributeName
,
1573 const AttributeValue
& value
);
1574 virtual status_t
AddAttribute_decl_line(uint16 attributeName
,
1575 const AttributeValue
& value
);
1576 virtual status_t
AddAttribute_decl_column(uint16 attributeName
,
1577 const AttributeValue
& value
);
1580 // DW_AT_description
1583 DeclarationLocation fDeclarationLocation
;
1587 class DIEPartialUnit
: public DIECompileUnitBase
{
1591 virtual uint16
Tag() const;
1594 // DW_AT_description
1598 class DIEImportedUnit
: public DebugInfoEntry
{
1602 virtual uint16
Tag() const;
1609 class DIECondition
: public DIEDeclaredNamedBase
{
1613 virtual uint16
Tag() const;
1617 class DIESharedType
: public DIEModifiedType
{
1621 virtual uint16
Tag() const;
1623 virtual status_t
AddAttribute_count(uint16 attributeName
,
1624 const AttributeValue
& value
);
1625 virtual status_t
AddAttribute_decl_file(uint16 attributeName
,
1626 const AttributeValue
& value
);
1627 virtual status_t
AddAttribute_decl_line(uint16 attributeName
,
1628 const AttributeValue
& value
);
1629 virtual status_t
AddAttribute_decl_column(uint16 attributeName
,
1630 const AttributeValue
& value
);
1633 DynamicAttributeValue fBlockSize
;
1634 DeclarationLocation fDeclarationLocation
;
1638 class DIETypeUnit
: public DIECompileUnitBase
{
1642 virtual uint16
Tag() const;
1646 class DIERValueReferenceType
: public DIEReferenceType
{
1648 DIERValueReferenceType();
1650 virtual uint16
Tag() const;
1654 class DIETemplateTemplateParameter
: public DIEDeclaredBase
{
1656 DIETemplateTemplateParameter();
1658 virtual uint16
Tag() const;
1660 virtual const char* Name() const;
1662 virtual status_t
AddAttribute_name(uint16 attributeName
,
1663 const AttributeValue
& value
);
1670 class DIETemplateTypeParameterPack
: public DIEDeclaredBase
{
1672 DIETemplateTypeParameterPack();
1674 virtual uint16
Tag() const;
1676 virtual const char* Name() const;
1678 virtual status_t
AddAttribute_name(uint16 attributeName
,
1679 const AttributeValue
& value
);
1681 const DebugInfoEntryList
& Children() const
1682 { return fChildren
; }
1684 virtual status_t
AddChild(DebugInfoEntry
* child
);
1688 DebugInfoEntryList fChildren
;
1692 class DIETemplateValueParameterPack
: public DIEDeclaredBase
{
1694 DIETemplateValueParameterPack();
1696 virtual uint16
Tag() const;
1698 virtual const char* Name() const;
1700 virtual status_t
AddAttribute_name(uint16 attributeName
,
1701 const AttributeValue
& value
);
1703 const DebugInfoEntryList
& Children() const
1704 { return fChildren
; }
1706 virtual status_t
AddChild(DebugInfoEntry
* child
);
1710 DebugInfoEntryList fChildren
;
1714 class DIECallSite
: public DIEDeclaredBase
{
1718 virtual uint16
Tag() const;
1720 virtual const char* Name() const;
1722 virtual status_t
AddAttribute_name(uint16 attributeName
,
1723 const AttributeValue
& value
);
1725 const DebugInfoEntryList
& Children() const
1726 { return fChildren
; }
1728 virtual status_t
AddChild(DebugInfoEntry
* child
);
1732 DebugInfoEntryList fChildren
;
1736 class DIECallSiteParameter
: public DIEDeclaredBase
{
1738 DIECallSiteParameter();
1740 virtual uint16
Tag() const;
1742 virtual const char* Name() const;
1744 virtual status_t
AddAttribute_name(uint16 attributeName
,
1745 const AttributeValue
& value
);
1747 const DebugInfoEntryList
& Children() const
1748 { return fChildren
; }
1750 virtual status_t
AddChild(DebugInfoEntry
* child
);
1754 DebugInfoEntryList fChildren
;
1758 // #pragma mark - DebugInfoEntryFactory
1761 class DebugInfoEntryFactory
{
1763 DebugInfoEntryFactory();
1765 status_t
CreateDebugInfoEntry(uint16 tag
,
1766 DebugInfoEntry
*& entry
);
1770 #endif // DEBUG_INFO_ENTRIES_H