[llvm-dev] yaml2obj support for COFF debug directories

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 4 12:48:11 PST 2020


I think it seems like an oversight, and improvements in this area would be
welcome.

I think most of the effort in COFF <-> YAML translation has been for
representing object files, and debug directories are a feature of fully
linked PE images. With that in mind, it's not too surprising that the
feature is missing.

On Tue, Mar 3, 2020 at 7:10 PM Penzin, Petr via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> *Spoiler:* the following only applies to Windows binary format handling.
>
> Potential for extending yaml2obj to support COFF debug directories
> <https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-directory-image-only>
> recently came up during a code review
> <https://reviews.llvm.org/D70606#1873185>. Currently, its COFF syntax
> <http://llvm.org/docs/yaml2obj.html#coff-syntax> allows for specifying
> section data, but not debug directories, that's why llvm-readobj tests
> which depend on debug directory contents use pre-built executable images
> instead of yaml2obj.
>
> It is possible to extend the tool, but first I would be interested in
> gathering feedback on usability of this, especially on potential uses of
> this change. It looks like porting llvm-readobj tests for codeview would
> depend on this and also D70606 <https://reviews.llvm.org/D70606> is
> introducing another possible use. But I am not sure how trivial would the
> codeview effort, would it be worth it or is it easier to leave things as
> they are for now?
>
> In case this is interesting, base Yaml syntax for COFF debug directory may
> look like this (enum values representing COFF Debug Types
> <https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-type>
> ):
>
> DebugDirectory:
>   - Type: [ {type: str, enum: [...]}, {type: int} ]
>   - DebugDirectoryData: {type: str}
>
> This may have to be further specialized for sub-categories, specifically
> codeview.
>
>
>
> Best,
>
> Petr
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200304/82c021ee/attachment.html>


More information about the llvm-dev mailing list