.debug_frame not produced by default?

Hello,

Building an object file with ToT Clang:

Debug+Asserts/bin/clang -o penalty2.o -c penalty.cpp -g

These are the debug-related sections produced:

$ readelf -S penalty2.o |grep debug
[ 5] .debug_info PROGBITS 0000000000000000 00000bd0
[ 6] .rela.debug_info RELA 0000000000000000 00002f80
[ 7] .debug_abbrev PROGBITS 0000000000000000 000010b8
[ 8] .debug_aranges PROGBITS 0000000000000000 000011c3
[ 9] .debug_macinfo PROGBITS 0000000000000000 000011c3
[10] .debug_line PROGBITS 0000000000000000 000011c3
[11] .rela.debug_line RELA 0000000000000000 00003850
[12] .debug_loc PROGBITS 0000000000000000 00001350
[13] .debug_pubtypes PROGBITS 0000000000000000 00001350
[14] .rela.debug_pubty RELA 0000000000000000 00003868
[15] .debug_str PROGBITS 0000000000000000 00001373
[16] .debug_ranges PROGBITS 0000000000000000 000015ff

There’s no “.debug_frame”, although “.eh_frame” was produced. Doesn’t Clang/LLVM create the .debug_frame section by default?

Thanks in advance,
Eli

Hello,

Building an object file with ToT Clang:

Debug+Asserts/bin/clang -o penalty2.o -c penalty.cpp -g

These are the debug-related sections produced:

$ readelf -S penalty2.o |grep debug
  [ 5] .debug_info PROGBITS 0000000000000000 00000bd0
  [ 6] .rela.debug_info RELA 0000000000000000 00002f80
  [ 7] .debug_abbrev PROGBITS 0000000000000000 000010b8
  [ 8] .debug_aranges PROGBITS 0000000000000000 000011c3
  [ 9] .debug_macinfo PROGBITS 0000000000000000 000011c3
  [10] .debug_line PROGBITS 0000000000000000 000011c3
  [11] .rela.debug_line RELA 0000000000000000 00003850
  [12] .debug_loc PROGBITS 0000000000000000 00001350
  [13] .debug_pubtypes PROGBITS 0000000000000000 00001350
  [14] .rela.debug_pubty RELA 0000000000000000 00003868
  [15] .debug_str PROGBITS 0000000000000000 00001373
  [16] .debug_ranges PROGBITS 0000000000000000 000015ff

There's no ".debug_frame", although ".eh_frame" was produced. Doesn't
Clang/LLVM create the .debug_frame section by default?

Only if a eh_frame is not needed and there is a -g I think.

Thanks in advance,
Eli

Cheers,
Rafael

There’s no “.debug_frame”, although “.eh_frame” was produced. Doesn’t
Clang/LLVM create the .debug_frame section by default?

Only if a eh_frame is not needed and there is a -g I think.

So if eh_frame is emitted, the debugger is expected to use it for CFI as well, instead of dwarf_frame?
Eli

So if eh_frame is emitted, the debugger is expected to use it for CFI as
well, instead of dwarf_frame?

Correct.

Eli

Cheers,
Rafael