[Dwarf-discuss] Does DWARF 5 specify which DW_LNCT content types are valid for directory entries?
Ron Brender
ron.brender@gmail.com
Tue Jan 14 13:18:17 GMT 2025
John and all,
Well, a directory is a file, right? Ergo...
OTOH, you have a point about applicability. How about making a concrete
proposal?
DWARF is permissive in any case...
Ron
On Tue, Jan 14, 2025 at 7:52 AM John DelSignore via Dwarf-discuss <
dwarf-discuss@lists.dwarfstd.org> wrote:
> In-line below...
> On 1/13/25 20:10, David Anderson via Dwarf-discuss wrote:
>
> On 1/13/25 11:35, David Blaikie via Dwarf-discuss wrote:
>
> I guess Jon is referring to the 16th field in the header, "directories
> (sequence of directory names)" which uses the same encoding system (but
> a separate format field, so the directories can have different active
> fields than the files) and there doesn't seem to be a list of what's
> suitable in one and not the other.
>
> Yes, the above is exactly what I was referring to...
>
> Clearly, all of the content type codes apply to files. In section 6.2.4.1,
> the meaning of each content type code is defined for *files*.
>
> However, other than DW_LNCT_path, the spec does not say whether or not the
> remaining content type codes do or do not apply to *directories*.
>
>
> I don't feel too strongly about it - if someone finds a use case for
> putting the more file-centric attributes on directories, I guess more
> power to them? But equally having advice/suggestions if it helps someone
> seems fine too...
>
>
> My bad. John was quite precise in the question... but I misread it.
>
> Seems to me that the types defined in 6.2.4.1 Standard Content
> Descriptions are not all required. Optional.
>
> DW_LNCT_directory_index is odd on a directory
> though an opportunity for a compiler
> to create nested references and an infinite loop of directory references
> (which would be caught immediately in testing).
>
> DW_LNCT_timestamp is meaningless on a directory? So don't use it.
> DW_LNCT_MD5 is meaningless on a directory too? Again, simply don't use it.
>
> Think of it from a third-party consumer point of view. Our debugger
> consumes DWARF from many different producers (GNU, LLVM, etc.). If a
> compiler produces something, like DW_LNCT_directory_index on a directory,
> I'd like the DWARF spec to tell me what it means. I don't want to have to
> guess what it means. Also, different producers might decide it means
> something different.
>
> IMHO, the point of a spec is to specify exactly what something means, and
> the permissive nature of the DWARF spec is as much a weakness as a strength.
>
>
> The whole point of the DW_LNCT was to make the fields
> optional, I seem to recall. Of course without
> DW_LNCT_path an entry would be useless.
>
> Yes, optional for files (other than DW_LNCT_path) makes sense.
>
> The thing that does not make sense is for the spec to not say what is
> valid vs. invalid. FWIW, I like the rigor that AMD used in their DWARF
> Extensions For Heterogeneous Debugging. For example, related to this
> discussion, it defines DW_LNCT_LLVM_source:
>
>
> https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html#id79
>
> It includes the sentence, "It can be used for file name entries." That's
> good, but even better would be for it to say, "It can be used for file name
> entries, but not directory entries."
>
> Cheers, John D.
>
>
>
> DavidA
>
> --
> If it weren't for Philo T. Farnsworth, inventor
> of television, we'd still be eating frozen radio
> dinners. -- Johnny Carson
> --
> Dwarf-discuss mailing list
> Dwarf-discuss@lists.dwarfstd.org
>
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.dwarfstd.org%2Fmailman%2Flistinfo%2Fdwarf-discuss&data=05%7C02%7Cjdelsignore%40perforce.com%7Ca826bab442ff4780428608dd3438475f%7C95b666d19a7549ab95a38969fbcdc08c%7C0%7C0%7C638724138517911752%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=jJzqeO%2FQQFHdwOwdzSwruwzrfl7T1ohhcrA3ZgIOzkw%3D&reserved=0
> <https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss>
>
>
> CAUTION: This email originated from outside of the organization. Do not
> click on links or open attachments unless you recognize the sender and know
> the content is safe.
>
>
> This e-mail may contain information that is privileged or confidential. If
> you are not the intended recipient, please delete the e-mail and any
> attachments and notify us immediately.
>
> --
> Dwarf-discuss mailing list
> Dwarf-discuss@lists.dwarfstd.org
> https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20250114/7b208bac/attachment-0001.htm>
More information about the Dwarf-discuss
mailing list