<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
        {mso-style-link:"Body Text Char";
        margin-top:9.0pt;
        margin-right:0in;
        margin-bottom:9.0pt;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
span.BodyTextChar
        {mso-style-name:"Body Text Char";
        mso-style-link:"Body Text";}
p.FirstParagraph, li.FirstParagraph, div.FirstParagraph
        {mso-style-name:"First Paragraph";
        margin-top:9.0pt;
        margin-right:0in;
        margin-bottom:9.0pt;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
span.VerbatimChar
        {mso-style-name:"Verbatim Char";
        mso-style-link:"Source Code";
        font-family:Consolas;}
p.SourceCode, li.SourceCode, div.SourceCode
        {mso-style-name:"Source Code";
        mso-style-link:"Verbatim Char";
        margin-top:0in;
        margin-right:0in;
        margin-bottom:10.0pt;
        margin-left:0in;
        word-break:break-all;
        font-size:11.0pt;
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="FirstParagraph"><i>Spoiler:</i> the following only applies to Windows binary format handling.<o:p></o:p></p>
<p class="MsoBodyText">Potential for extending <span class="VerbatimChar">yaml2obj</span> to support COFF
<a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-directory-image-only">
debug directories</a> recently came up during <a href="https://reviews.llvm.org/D70606#1873185">
a code review</a>. Currently, its <a href="http://llvm.org/docs/yaml2obj.html#coff-syntax">
COFF syntax</a> allows for specifying section data, but not debug directories, that's why
<span class="VerbatimChar">llvm-readobj</span> tests which depend on debug directory contents use pre-built executable images instead of
<span class="VerbatimChar">yaml2obj</span>.<o:p></o:p></p>
<p class="MsoBodyText">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
<span class="VerbatimChar">llvm-readobj</span> tests for codeview would depend on this and also
<a href="https://reviews.llvm.org/D70606">D70606</a> 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?<o:p></o:p></p>
<p class="MsoBodyText">In case this is interesting, base Yaml syntax for COFF debug directory may look like this (enum values representing
<a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-type">
COFF Debug Types</a>):<o:p></o:p></p>
<p class="SourceCode"><span class="VerbatimChar">DebugDirectory:</span><br>
<span class="VerbatimChar">  - Type: [ {type: str, enum: [...]}, {type: int} ]</span><br>
<span class="VerbatimChar">  - DebugDirectoryData: {type: str}</span><o:p></o:p></p>
<p class="FirstParagraph">This may have to be further specialized for sub-categories, specifically codeview.<o:p></o:p></p>
<p class="MsoBodyText"><o:p> </o:p></p>
<p class="MsoBodyText">Best,<o:p></o:p></p>
<p class="MsoBodyText">Petr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>