[PATCH] D85717: [DWARFYAML] Teach yaml2obj emit the correct line table program.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 03:10:59 PDT 2020


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM, since it's an improvement on the current behaviour, but I think my inline comment should be addressed in a follow-up (assuming you agree, of course).



================
Comment at: llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml:526-531
+## j) Test that yaml2obj emits an error message if the line table's associated compilation unit's address
+## size is not 8 or 4.
+
+# RUN: not yaml2obj --docnum=10 %s 2>&1 | FileCheck %s --check-prefix=INVALID-ADDRSIZE
+
+# INVALID-ADDRSIZE: yaml2obj: error: unable to write address for operator DW_LNE_set_address: invalid integer write size: 3
----------------
It's good to have a test for this, but I actually think the behaviour is incorrect for yaml2obj. It's possible to have line tables without .debug_info, and there's no reference from a line table to .debug_info anyway. The address should be inferred from the target machine, in my opinion (in this case it would be 8).

>From the DWARF v4 spec:

> 2.   DW_LNE_set_address   The DW_LNE_set_address opcode takes a single relocatable address as an operand. The size of the operand is the size of an address on the target machine.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85717/new/

https://reviews.llvm.org/D85717



More information about the llvm-commits mailing list