93 lines · plain
1## Show that llvm-dwarfdump prints a range of different structures in the2## .debug_abbrev section when requested. As well as basic cases, this test also3## shows how llvm-dwarfdump handles unknown tag, attribute and form values.4 5# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o6# RUN: llvm-dwarfdump --debug-abbrev %t.o | FileCheck %s --match-full-lines7 8# CHECK: .debug_abbrev contents:9# CHECK-NEXT: Abbrev table for offset: 0x0000000010# CHECK-NEXT: [66] DW_TAG_compile_unit DW_CHILDREN_yes11# CHECK-NEXT: DW_AT_name DW_FORM_string12# CHECK-NEXT: DW_AT_stmt_list DW_FORM_data213# CHECK-EMPTY:14# CHECK-NEXT: [128] DW_TAG_unknown_ffff DW_CHILDREN_no15# CHECK-NEXT: DW_AT_unknown_5 DW_FORM_unknown_216# CHECK-EMPTY:17# CHECK-NEXT: [66] DW_TAG_unknown_4080 DW_CHILDREN_no18# CHECK-EMPTY:19# CHECK-NEXT: [1] DW_TAG_unknown_4000 DW_CHILDREN_no20# CHECK-NEXT: DW_AT_unknown_2000 DW_FORM_unknown_ffff21# CHECK-NEXT: DW_AT_unknown_3fff DW_FORM_unknown_7f22# CHECK-NEXT: DW_AT_unknown_1fff DW_FORM_block223# CHECK-NEXT: DW_AT_unknown_4000 DW_FORM_block424# CHECK-EMPTY:25# CHECK-NEXT: [2] DW_TAG_unknown_407f DW_CHILDREN_no26# CHECK-EMPTY:27# CHECK-NEXT: Abbrev table for offset: 0x0000003828# CHECK-NEXT: [66] DW_TAG_entry_point DW_CHILDREN_no29# CHECK-NEXT: DW_AT_elemental DW_FORM_flag_present30 31## All values in this assembly are intended to be arbitrary, except where32## specified.33.section .debug_abbrev,"",@progbits34 .byte 0x42 ## Abbreviation Code35 ## Known tag with children and known attributes and forms.36 .byte 0x11 ## DW_TAG_compile_unit37 .byte 0x01 ## DW_CHILDREN_yes38 .byte 0x03 ## DW_AT_name39 .byte 0x08 ## DW_FORM_string (valid form for DW_AT_name).40 .byte 0x10 ## DW_AT_stmt_list41 .byte 0x05 ## DW_FORM_data2 (invalid form for DW_AT_stmt_list).42 .byte 0, 0 ## End of attributes43 44 ## Tag without children and reserved form/attribute values.45 .byte 0x80, 0x01 ## Multi-byte Abbreviation Code46 .byte 0xFF, 0xFF, 0x03 ## 0xFFFF == DW_TAG_hi_user47 .byte 0x00 ## DW_CHILDREN_no48 ## Reserved attribute and form.49 .byte 0x05 ## Reserved DW_AT_*50 .byte 0x02 ## Reserved DW_FORM_*51 .byte 0, 0 ## End of attributes.52 53 ## Tag with no attributes.54 .byte 0x42 ## Abbreviation Code (duplicate)55 .byte 0x80, 0x81, 0x01 ## 0x4080 == DW_TAG_lo_user56 .byte 0x00 ## DW_CHILDREN_no57 .byte 0, 0 ## End of attributes.58 59 ## Tag with attributes/forms with unknown values/values in user-defined ranges.60 .byte 0x01 ## Abbreviation Code61 ## FIXME: https://bugs.llvm.org/show_bug.cgi?id=44258 means that 0x80, 0x80, 0x0462 ## results in a failure to parse correctly, whilst the following tag value is63 ## interpreted incorrectly as 0x4000.64 .byte 0x80, 0x80, 0x05 ## 0x10001 == DW_TAG_hi_user + 265 .byte 0x00 ## DW_CHILDREN_no66 .byte 0x80, 0x40 ## 0x2000 == DW_AT_lo_user67 .byte 0xFF, 0xFF, 0x03 ## 0xFFFF == Unknown multi-byte form.68 .byte 0xFF, 0x7F ## DW_AT_hi_user69 .byte 0x7F ## Unknown single-byte form.70 .byte 0xFF, 0x3F ## DW_AT_lo_user - 171 .byte 0x03 ## DW_FORM_block272 .byte 0x80, 0x80, 0x01 ## DW_AT_hi_user + 173 .byte 0x04 ## DW_FORM_block474 .byte 0, 0 ## End of attributes.75 76 ## Tag with invalid children encoding.77 .byte 0x02 ## Abbreviation Code78 .byte 0xFF, 0x80, 0x01 ## 0x407F == DW_TAG_lo_user - 179 .byte 0x02 ## Invalid children encoding (interpreted as DW_CHILDREN_no).80 .byte 0, 0 ## End of attributes.81 82 .byte 0 ## End of first abbreviation set.83 84 ## Second .debug_abbrev set.85 .byte 0x42 ## Abbreviation Code (duplicate in different unit)86 .byte 0x03 ## DW_TAG_entry_point87 .byte 0x00 ## DW_CHILDREN_no88 .byte 0x66 ## DW_AT_elemental89 .byte 0x19 ## DW_FORM_flag_present90 .byte 0, 0 ## End of attributes.91 92 .byte 0 # End of second abbreviation set.93