<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body 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(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::getOrCreateModuleInfo(PDB_ReaderType::DIA, ...)`, see <a href="https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403" id="LPlnk298816">https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.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::CalculateAbilities(PDB_ReaderType::DIA, ...)`, see <a href="https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110" id="LPlnk378162">https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/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(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(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);">
-------------------------------------------------------------------------------------------------</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_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(Path, Session);</div>
<div><br>
</div>
<div>#if LLVM_ENABLE_DIA_SDK</div>
<div>  return DIASession::createFromExe(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;">-------------------------------------------------------------------------------------------------</span></div>
<div id="LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2xsdm0tbWlycm9yL2xsZGIvYmxvYi9tYXN0ZXIvc291cmNlL1BsdWdpbnMvU3ltYm9sRmlsZS9QREIvU3ltYm9sRmlsZVBEQi5jcHAjTDExMA.." contenteditable="false" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer171119" role="presentation" 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 valign="top" style="border-spacing: 0px;">
<td>
<div id="LPImageContainer571233" style="position: relative; margin-right: 12px; height: 160px; overflow: hidden;">
<a target="_blank" id="LPImageAnchor890585" href="https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110"><img id="LPThumbnailImageId806496" alt="" width="160" height="160" style="display: block;" src="https://avatars2.githubusercontent.com/u/1386314?s=400&v=4"></a></div>
</td>
<td style="width: 100%;">
<div id="LPTitle215850" 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 target="_blank" id="LPUrlAnchor688961" 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);">llvm-mirror/lldb</a></div>
<div id="LPDescription864260" 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 http://llvm.org/git/lldb. Updated every five minutes.</div>
<div id="LPMetadata425013" 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;">
github.com</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div id="LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2xsdm0tbWlycm9yL2xsdm0vYmxvYi9tYXN0ZXIvbGliL0RlYnVnSW5mby9TeW1ib2xpemUvU3ltYm9saXplLmNwcCNMNDAz" contenteditable="false" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer500089" role="presentation" 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 valign="top" style="border-spacing: 0px;">
<td>
<div id="LPImageContainer351450" style="position: relative; margin-right: 12px; height: 160px; overflow: hidden;">
<a target="_blank" id="LPImageAnchor422626" href="https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403"><img id="LPThumbnailImageId328644" alt="" width="160" style="display: block;" height="160" src="https://avatars2.githubusercontent.com/u/1386314?s=400&v=4"></a></div>
</td>
<td style="width: 100%;">
<div id="LPTitle295986" 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 target="_blank" id="LPUrlAnchor610227" href="https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403" style="text-decoration: none; color: rgb(0, 75, 139);">llvm-mirror/llvm</a></div>
<div id="LPDescription217835" 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 http://llvm.org/git/llvm. Updated every five minutes.</div>
<div id="LPMetadata878570" 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;">
github.com</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="signature">
<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>
</body>
</html>