[llvm-dev] yaml2obj support for COFF debug directories

Penzin, Petr via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 3 19:10:34 PST 2020


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200304/9c94b47b/attachment.html>


More information about the llvm-dev mailing list