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

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 03:16:29 PDT 2020


Higuoxing added inline comments.


================
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
----------------
jhenderson wrote:
> 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.
> 
Oh, I see. What do you think of having an optional field `AddressSize` for the line table. If it's specified, yaml2obj will emit addresses according to the value.


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