[PATCH] Emit DWARF info for all code section in an assembly file

Oliver Stannard oliver.stannard at arm.com
Thu Apr 10 08:24:13 PDT 2014


  > You still need a DW_AT_low_pc as the offset for the for the ranges section.

  I don't think we need DW_AT_low_pc when the input is assembly, as it is optional in the DWARF spec and we do not emit any debug info which could use it.

  The two reasons to include DW_AT_low_pc as well as DW_AT_ranges are:
  * Specifying the default base address for the .debug_ranges section. We do not need this as we have a base address entry for each section in .debug_ranges, so the default never gets used.
  * Specifying the default base address for the .debug_loc section. We do not need this as we never emit the .debug_loc section for an assembly file.

  > What does GCC do here?

  GCC seems to do the same as I am doing:
  * If no sections contain code, don't emit any debug info (not even .debug_abbrev)
  * If exactly one section contains code, use low_pc and high_pc
  * Otherwise, use .debug_ranges

Hi echristo, rengolin,

http://reviews.llvm.org/D2697

CHANGE SINCE LAST DIFF
  http://reviews.llvm.org/D2697?vs=8304&id=8467#toc

Files:
  include/llvm/ADT/MapVector.h
  include/llvm/MC/MCContext.h
  include/llvm/MC/MCObjectStreamer.h
  include/llvm/MC/MCStreamer.h
  lib/MC/MCContext.cpp
  lib/MC/MCDwarf.cpp
  lib/MC/MCParser/AsmParser.cpp
  lib/MC/MCParser/ELFAsmParser.cpp
  test/MC/ARM/dwarf-asm-multiple-sections.s
  test/MC/ARM/dwarf-asm-no-code.s
  test/MC/ARM/dwarf-asm-nonstandard-section.s
  test/MC/ARM/dwarf-asm-single-section.s
  test/MC/ELF/gen-dwarf.s
  tools/llvm-mc/llvm-mc.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2697.8.patch
Type: text/x-patch
Size: 33184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140410/2804ea74/attachment.bin>


More information about the llvm-commits mailing list