[llvm-dev] Debug symbols are missing in elf

Robinson, Paul via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 21 05:46:13 PDT 2020



> -----Original Message-----
> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Nagaraju
> Mekala via llvm-dev
> Sent: Tuesday, April 21, 2020 6:04 AM
> To: jh7370.2008 at my.bristol.ac.uk
> Cc: LLVM Developers Mailing List <llvm-dev at lists.llvm.org>
> Subject: Re: [llvm-dev] Debug symbols are missing in elf
> 
> Hi James,
> 
> Thanks for reply.
> When I looked in to the generated debug dump from the object file I
> found that DW_AT_name is always (indirect string, offset: 0x0): clang
> version 8.0.1, instead of variable names.

That symptom suggests that relocations from .debug_info to .debug_str 
are not being handled correctly.  Either your backend is not emitting 
them correctly, or the dumper does not know what to do with them.

If you are able to dump the .rela.debug_info section and it looks
reasonable, the fault is most likely with the dumper.  If you are
using llvm-dwarfdump then that should not be hard to solve.
--paulr

> 
> Below is a sample output of the debug dump.
> 
>  Compilation Unit @ offset 0x0:
>    Length:        0x6a (32-bit)
>    Version:       4
>    Abbrev Offset: 0x0
>    Pointer Size:  4
>  <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
>     <c>   DW_AT_producer    : (indirect string, offset: 0x0): clang
> version 8.0.1
>     <10>   DW_AT_language    : 12       (ANSI C99)
>     <12>   DW_AT_name        : (indirect string, offset: 0x0): clang
> version 8.0.1
>     <16>   DW_AT_stmt_list   : 0x0
>     <1a>   DW_AT_comp_dir    : (indirect string, offset: 0x0): clang
> version 8.0.1
>     <1e>   DW_AT_low_pc      : 0x0
>     <22>   DW_AT_high_pc     : 0x6c
>  <1><26>: Abbrev Number: 2 (DW_TAG_subprogram)
>     <27>   DW_AT_low_pc      : 0x0
>     <2b>   DW_AT_high_pc     : 0x6c
>     <2f>   DW_AT_frame_base  : 1 byte block: 51         (DW_OP_reg1 (r1))
>     <31>   DW_AT_name        : (indirect string, offset: 0x0): clang
> version 8.0.1
>     <35>   DW_AT_decl_file   : 1
>     <36>   DW_AT_decl_line   : 51
>     <37>   DW_AT_type        : <0x66>
>     <3b>   DW_AT_external    : 1
> 
> -Nagaraju



More information about the llvm-dev mailing list