[Bug libdw/31111] New: Handle Clang DWARF 5 DW_AT_decl_file 0

2023-12-04 Thread gprocida at google dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=3

Bug ID: 3
   Summary: Handle Clang DWARF 5 DW_AT_decl_file 0
   Product: elfutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: libdw
  Assignee: unassigned at sourceware dot org
  Reporter: gprocida at google dot com
CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

There is an ambiguity in DWARF 5 noted and resolved for DWARF 6 in
https://dwarfstd.org/issues/210713.1.html.

Clang's treatment of this in DWARF 5 is as if it were DWARF 6, rather than
following the letter of the standard (and having to create and use an extra
file entry). See: https://github.com/llvm/llvm-project/issues/74097

Incidentally, following that change, the only sensible way to represent "no
source file" (for builtins like __va_list) is perhaps by omitting the attribute
altogether. (Clang and GCC treat __va_list and its members rather
inconsistently.)

For the record here, clang -gdwarf-5 populates the file table index 0 as per
DWARF 5, section 6.2.4 *and uses it in declarations*. However, elfutils
dwarf_decl_file detects index 0 specially and does not examine the file table
entry, reporting, "no file".

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug libdw/31111] Handle Clang DWARF 5 DW_AT_decl_file 0

2023-12-04 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=3

Mark Wielaard  changed:

   What|Removed |Added

 CC||mark at klomp dot org

--- Comment #1 from Mark Wielaard  ---
So I assume this means dwarf_decl_file doesn't work for such DWARF because it
has:

  /* Zero means no source file information available.  */
  if (idx == 0)
{
  __libdw_seterrno (DWARF_E_NO_ENTRY);
  return NULL;
}

Are there other issues?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug libdw/31111] Handle Clang DWARF 5 DW_AT_decl_file 0

2023-12-04 Thread gprocida at google dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=3

--- Comment #2 from gprocida at google dot com ---
I investigated and opened these other DWARF 4/5 issues with DW_AT_decl_file.

* https://github.com/llvm/llvm-project/issues/73652
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112726

Please let me know if you think they are at related to this issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.