55 lines · plain
1RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-dwp.x86_64.o | FileCheck %s2 3; Testing the following simple dwp file:4; a.cpp:5; struct foo { };6; foo a;7; b.cpp:8; struct bar { };9; bar b() {10; }11 12; CHECK-NOT: .debug_info contents:13; CHECK-LABEL: .debug_info.dwo contents:14; CHECK: Compile Unit15 16; Verify that the second CU uses the index for its abbrev offset17; CHECK: Compile Unit18; CHECK-SAME: abbr_offset = 0x004319; CHECK: DW_TAG_compile_unit20; CHECK-NOT: DW_TAG21; CHECK: DW_AT_name {{.*}} "b.cpp"22 23; Verify that abbreviations are decoded using the abbrev offset in the index24; CHECK: DW_TAG_structure_type25; CHECK: DW_TAG_subprogram26 27; CHECK-LABEL: .debug_types.dwo contents:28; CHECK: Type Unit29; CHECK: DW_TAG_type_unit30; CHECK: DW_AT_stmt_list {{.*}}(0x00000000)31; CHECK: DW_TAG_structure_type32; CHECK: DW_AT_decl_file {{.*}} ("a.cpp")33; CHECK: Type Unit34; CHECK: DW_TAG_type_unit35; CHECK: DW_AT_stmt_list {{.*}}(0x00000000)36; CHECK: DW_TAG_structure_type37; CHECK: DW_AT_decl_file {{.*}} ("b.cpp")38 39; CHECK: .debug_cu_index contents:40; CHECK-NEXT: version = 2, units = 2, slots = 1641; CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS42; CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------43; CHECK-NEXT: 3 0xfef104c25502f092 [0x000000000000002d, 0x000000000000005f) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)44; CHECK-NEXT: 9 0x03c30756e2d45008 [0x0000000000000000, 0x000000000000002d) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)45 46; CHECK: .debug_tu_index contents:47; CHECK-NEXT: version = 2, units = 2, slots = 1648; CHECK: Index Signature TYPES ABBREV LINE STR_OFFSETS49; CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------50; CHECK-NEXT: 9 0x1d02f3be30cc5688 [0x0000000000000024, 0x0000000000000048) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)51; CHECK-NEXT: 13 0x3875c0e21cda63fc [0x0000000000000000, 0x0000000000000024) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)52 53; TODO: use the index section offset info to correctly dump strings in debug info54; TODO: use the index section offset info to correctly dump file names in debug info55