bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/27484] New: clang++: objdump: DWARF error: could not find


From: mliska at suse dot cz
Subject: [Bug binutils/27484] New: clang++: objdump: DWARF error: could not find variable specification at offset
Date: Sun, 28 Feb 2021 09:45:44 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27484

            Bug ID: 27484
           Summary: clang++: objdump: DWARF error: could not find variable
                    specification at offset
           Product: binutils
           Version: 2.37 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: mliska at suse dot cz
  Target Milestone: ---

The following happens when using clang compiler:

$ clang++ --version
clang version 11.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ cat clang-dwarf.ii
class YearDatatypeValidator {
  static int classYearDatatypeValidator;
};
int YearDatatypeValidator::classYearDatatypeValidator;
void YearDatatypeValidatorserialize() {}

$ clang++ clang-dwarf.ii -g -c && objdump -S clang-dwarf.o

clang-dwarf.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <_Z30YearDatatypeValidatorserializev>:
objdump: DWARF error: could not find variable specification at offset 46
class YearDatatypeValidator {
  static int classYearDatatypeValidator;
};
int YearDatatypeValidator::classYearDatatypeValidator;
void YearDatatypeValidatorserialize() {}
   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   5d                      pop    %rbp
   5:   c3                      ret    

There's the content of debug info:

$ readelf --debug-dump clang-dwarf.o
Contents of the .debug_abbrev section:

  Number TAG (0x0)
   1      DW_TAG_compile_unit    [has children]
    DW_AT_producer     DW_FORM_strp
    DW_AT_language     DW_FORM_data2
    DW_AT_name         DW_FORM_strp
    DW_AT_stmt_list    DW_FORM_sec_offset
    DW_AT_comp_dir     DW_FORM_strp
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_data4
    DW_AT value: 0     DW_FORM value: 0
   2      DW_TAG_variable    [no children]
    DW_AT_specification DW_FORM_ref4
    DW_AT_location     DW_FORM_exprloc
    DW_AT_linkage_name DW_FORM_strp
    DW_AT value: 0     DW_FORM value: 0
   3      DW_TAG_class_type    [has children]
    DW_AT_calling_convention DW_FORM_data1
    DW_AT_name         DW_FORM_strp
    DW_AT_byte_size    DW_FORM_data1
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT value: 0     DW_FORM value: 0
   4      DW_TAG_member    [no children]
    DW_AT_name         DW_FORM_strp
    DW_AT_type         DW_FORM_ref4
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_external     DW_FORM_flag_present
    DW_AT_declaration  DW_FORM_flag_present
    DW_AT value: 0     DW_FORM value: 0
   5      DW_TAG_base_type    [no children]
    DW_AT_name         DW_FORM_strp
    DW_AT_encoding     DW_FORM_data1
    DW_AT_byte_size    DW_FORM_data1
    DW_AT value: 0     DW_FORM value: 0
   6      DW_TAG_subprogram    [no children]
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_data4
    DW_AT_frame_base   DW_FORM_exprloc
    DW_AT_linkage_name DW_FORM_strp
    DW_AT_name         DW_FORM_strp
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_external     DW_FORM_flag_present
    DW_AT value: 0     DW_FORM value: 0

Contents of the .debug_info section:

  Compilation Unit @ offset 0x0:
   Length:        0x6f (32-bit)
   Version:       4
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <c>   DW_AT_producer    : (indirect string, offset: 0x0): clang version
11.0.1
    <10>   DW_AT_language    : 33       (C++14)
    <12>   DW_AT_name        : (indirect string, offset: 0x15): clang-dwarf.ii
    <16>   DW_AT_stmt_list   : 0x0
    <1a>   DW_AT_comp_dir    : (indirect string, offset: 0x24):
/home/marxin/Programming/testcases
    <1e>   DW_AT_low_pc      : 0x0
    <26>   DW_AT_high_pc     : 0x6
 <1><2a>: Abbrev Number: 2 (DW_TAG_variable)
    <2b>   DW_AT_specification: <0x46>
    <2f>   DW_AT_location    : 9 byte block: 3 0 0 0 0 0 0 0 0  (DW_OP_addr: 0)
    <39>   DW_AT_linkage_name: (indirect string, offset: 0x7c):
_ZN21YearDatatypeValidator26classYearDatatypeValidatorE
 <1><3d>: Abbrev Number: 3 (DW_TAG_class_type)
    <3e>   DW_AT_calling_convention: 5  (pass by value)
    <3f>   DW_AT_name        : (indirect string, offset: 0x66):
YearDatatypeValidator
    <43>   DW_AT_byte_size   : 1
    <44>   DW_AT_decl_file   : 1
    <45>   DW_AT_decl_line   : 1
 <2><46>: Abbrev Number: 4 (DW_TAG_member)
    <47>   DW_AT_name        : (indirect string, offset: 0x47):
classYearDatatypeValidator
    <4b>   DW_AT_type        : <0x52>
    <4f>   DW_AT_decl_file   : 1
    <50>   DW_AT_decl_line   : 2
    <51>   DW_AT_external    : 1
    <51>   DW_AT_declaration : 1
 <2><51>: Abbrev Number: 0
 <1><52>: Abbrev Number: 5 (DW_TAG_base_type)
    <53>   DW_AT_name        : (indirect string, offset: 0x62): int
    <57>   DW_AT_encoding    : 5        (signed)
    <58>   DW_AT_byte_size   : 4
 <1><59>: Abbrev Number: 6 (DW_TAG_subprogram)
    <5a>   DW_AT_low_pc      : 0x0
    <62>   DW_AT_high_pc     : 0x6
    <66>   DW_AT_frame_base  : 1 byte block: 56         (DW_OP_reg6 (rbp))
    <68>   DW_AT_linkage_name: (indirect string, offset: 0xb4):
_Z30YearDatatypeValidatorserializev
    <6c>   DW_AT_name        : (indirect string, offset: 0xd8):
YearDatatypeValidatorserialize
    <70>   DW_AT_decl_file   : 1
    <71>   DW_AT_decl_line   : 5
    <72>   DW_AT_external    : 1
 <1><72>: Abbrev Number: 0

Contents of the .debug_str section:

  0x00000000 636c616e 67207665 7273696f 6e203131 clang version 11
  0x00000010 2e302e31 00636c61 6e672d64 77617266 .0.1.clang-dwarf
  0x00000020 2e696900 2f686f6d 652f6d61 7278696e .ii./home/marxin
  0x00000030 2f50726f 6772616d 6d696e67 2f746573 /Programming/tes
  0x00000040 74636173 65730063 6c617373 59656172 tcases.classYear
  0x00000050 44617461 74797065 56616c69 6461746f DatatypeValidato
  0x00000060 7200696e 74005965 61724461 74617479 r.int.YearDataty
  0x00000070 70655661 6c696461 746f7200 5f5a4e32 peValidator._ZN2
  0x00000080 31596561 72446174 61747970 6556616c 1YearDatatypeVal
  0x00000090 69646174 6f723236 636c6173 73596561 idator26classYea
  0x000000a0 72446174 61747970 6556616c 69646174 rDatatypeValidat
  0x000000b0 6f724500 5f5a3330 59656172 44617461 orE._Z30YearData
  0x000000c0 74797065 56616c69 6461746f 72736572 typeValidatorser
  0x000000d0 69616c69 7a657600 59656172 44617461 ializev.YearData
  0x000000e0 74797065 56616c69 6461746f 72736572 typeValidatorser
  0x000000f0 69616c69 7a6500                     ialize.

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      65
  DWARF Version:               4
  Prologue Length:             38
  Minimum Instruction Length:  1
  Maximum Ops per Instruction: 1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 13

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg
  Opcode 10 has 0 args
  Opcode 11 has 0 args
  Opcode 12 has 1 arg

 The Directory Table is empty.

 The File Name Table (offset 0x1d):
  Entry Dir     Time    Size    Name
  1     0       0       0       clang-dwarf.ii

 Line Number Statements:
  [0x00000030]  Extended opcode 2: set Address to 0x0
  [0x0000003b]  Special opcode 9: advance Address by 0 to 0x0 and Line by 4 to
5
  [0x0000003c]  Set column to 40
  [0x0000003e]  Set prologue_end to true
  [0x0000003f]  Special opcode 61: advance Address by 4 to 0x4 and Line by 0 to
5
  [0x00000040]  Advance PC by 2 to 0x6
  [0x00000042]  Extended opcode 1: End of Sequence

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]