<div dir="ltr">did you run vcvars64.bat (or 32 if on 32 bit) before running cmake? That bat file sets all environment variables necessary like vsinstalldir. I think with that you might get DIA to work as well.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 23, 2018 at 9:39 AM, Henry Wong via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
Hi all,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
I have two questions about reading PDB file.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
For `llvm::pdb::loadDataFromEXE(<wbr>PDB_ReaderType Type, ...)`, there are two places calling this method,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
`LLVMSymbolizer::<wbr>getOrCreateModuleInfo(PDB_<wbr>ReaderType::DIA, ...)`, see <a href="https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403" id="m_-5976187533652657316LPlnk298816" target="_blank">https://github.com/llvm-<wbr>mirror/llvm/blob/master/lib/<wbr>DebugInfo/Symbolize/Symbolize.<wbr>cpp#L403</a>, </div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
and `SymbolFilePDB::<wbr>CalculateAbilities(PDB_<wbr>ReaderType::DIA, ...)`, see <a href="https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110" id="m_-5976187533652657316LPlnk378162" target="_blank">https://github.com/llvm-<wbr>mirror/lldb/blob/master/<wbr>source/Plugins/SymbolFile/PDB/<wbr>SymbolFilePDB.cpp#L110</a>. </div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
1) We can see that the arguments of the two calls are both `<span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">PDB_ReaderType::DIA</span>`, 
 that means the first IfStmt</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
in <span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">
`llvm::pdb::loadDataFromEXE(<wbr>PDB_ReaderType Type, ...)` is  temporarily useless</span>. Is that right?</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
2) I have visual studio 2015 installed on my computer and there is no an <span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">environment
 variable called</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400"> </span><code style="margin:0px;padding:1px 5px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;background-color:rgb(239,240,241);white-space:pre-wrap;color:rgb(36,39,41)">VSINSTALLDIR</code><span style="background-color:rgba(0,0,0,0);color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">.
 And the `<span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">LLVM_ENABLE_DIA_SDK` is 0, so every
 time need to call </span></span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<span style="background-color:rgba(0,0,0,0);color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt"><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">`<span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">llvm::pdb::loadDataFromEXE(<wbr>PDB_ReaderType
 Type, ...)</span>`, </span></span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<span style="background-color:rgba(0,0,0,0);color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt"><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">it
 will trigger the "DIA is not installed on the system" error. I want to known is this kind of behavior correct?</span></span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<span style="background-color:rgba(0,0,0,0);color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt"><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-------</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<div>Error llvm::pdb::loadDataForEXE(PDB_<wbr>ReaderType Type, StringRef Path,</div>
<div>                                std::unique_ptr<IPDBSession> &Session) {</div>
<div>  // Create the correct concrete instance type based on the value of Type.</div>
<div>  if (Type == PDB_ReaderType::Native)</div>
<div>    return NativeSession::createFromExe(<wbr>Path, Session);</div>
<div><br>
</div>
<div>#if LLVM_ENABLE_DIA_SDK</div>
<div>  return DIASession::createFromExe(<wbr>Path, Session);</div>
<div>#else</div>
<div>  return make_error<GenericError>("DIA is not installed on the system");</div>
<div>#endif</div>
<div>}</div>
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-------</span></div>
<div id="m_-5976187533652657316LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2xsdm0tbWlycm9yL2xsZGIvYmxvYi9tYXN0ZXIvc291cmNlL1BsdWdpbnMvU3ltYm9sRmlsZS9QREIvU3ltYm9sRmlsZVBEQi5jcHAjTDExMA.." style="width:100%;margin-top:16px;margin-bottom:16px;max-width:800px;min-width:424px">
<table id="m_-5976187533652657316LPContainer171119" style="padding:12px 36px 12px 12px;width:100%;border-width:1px;border-style:solid;border-color:rgb(200,200,200);border-radius:2px">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td>
<div id="m_-5976187533652657316LPImageContainer571233" style="margin-right:12px;height:160px;overflow:hidden">
<a id="m_-5976187533652657316LPImageAnchor890585" href="https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110" target="_blank"><img id="m_-5976187533652657316LPThumbnailImageId806496" alt="" style="display:block" src="https://avatars2.githubusercontent.com/u/1386314?s=400&v=4" height="160" width="160"></a></div>
</td>
<td style="width:100%">
<div id="m_-5976187533652657316LPTitle215850" style="font-size:21px;font-weight:300;margin-right:8px;font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px">
<a id="m_-5976187533652657316LPUrlAnchor688961" href="https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110" style="text-decoration:none;color:rgb(0,75,139)" target="_blank">llvm-mirror/lldb</a></div>
<div id="m_-5976187533652657316LPDescription864260" style="font-size:14px;max-height:100px;color:rgb(102,102,102);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px;margin-right:8px;overflow:hidden">
Mirror of official lldb git repository located at <a href="http://llvm.org/git/lldb" target="_blank">http://llvm.org/git/lldb</a>. Updated every five minutes.</div>
<div id="m_-5976187533652657316LPMetadata425013" style="font-size:14px;font-weight:400;color:rgb(166,166,166);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif">
<a href="http://github.com" target="_blank">github.com</a></div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div id="m_-5976187533652657316LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2xsdm0tbWlycm9yL2xsdm0vYmxvYi9tYXN0ZXIvbGliL0RlYnVnSW5mby9TeW1ib2xpemUvU3ltYm9saXplLmNwcCNMNDAz" style="width:100%;margin-top:16px;margin-bottom:16px;max-width:800px;min-width:424px">
<table id="m_-5976187533652657316LPContainer500089" style="padding:12px 36px 12px 12px;width:100%;border-width:1px;border-style:solid;border-color:rgb(200,200,200);border-radius:2px">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td>
<div id="m_-5976187533652657316LPImageContainer351450" style="margin-right:12px;height:160px;overflow:hidden">
<a id="m_-5976187533652657316LPImageAnchor422626" href="https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403" target="_blank"><img id="m_-5976187533652657316LPThumbnailImageId328644" alt="" style="display:block" src="https://avatars2.githubusercontent.com/u/1386314?s=400&v=4" height="160" width="160"></a></div>
</td>
<td style="width:100%">
<div id="m_-5976187533652657316LPTitle295986" style="font-size:21px;font-weight:300;margin-right:8px;font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px">
<a id="m_-5976187533652657316LPUrlAnchor610227" href="https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403" style="text-decoration:none;color:rgb(0,75,139)" target="_blank">llvm-mirror/llvm</a></div>
<div id="m_-5976187533652657316LPDescription217835" style="font-size:14px;max-height:100px;color:rgb(102,102,102);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px;margin-right:8px;overflow:hidden">
Mirror of official llvm git repository located at <a href="http://llvm.org/git/llvm" target="_blank">http://llvm.org/git/llvm</a>. Updated every five minutes.</div>
<div id="m_-5976187533652657316LPMetadata878570" style="font-size:14px;font-weight:400;color:rgb(166,166,166);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif">
<a href="http://github.com" target="_blank">github.com</a></div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="m_-5976187533652657316signature">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Henry Wong</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Qihoo 360 Codesafe Team</div>
</div>
</div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Leonardo Santagada</div>
</div>