[llvm-dev] [PDB] Error "DIA is not installed on the system" occured in `llvm::pdb::loadDataForExe()`.

Leonardo Santagada via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 23 09:08:39 PST 2018


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.

On Tue, Jan 23, 2018 at 9:39 AM, Henry Wong via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi all,
> I have two questions about reading PDB file.
>
> For `llvm::pdb::loadDataFromEXE(PDB_ReaderType Type, ...)`, there are two
> places calling this method,
> `LLVMSymbolizer::getOrCreateModuleInfo(PDB_ReaderType::DIA, ...)`, see
> https://github.com/llvm-mirror/llvm/blob/master/lib/
> DebugInfo/Symbolize/Symbolize.cpp#L403,
> and `SymbolFilePDB::CalculateAbilities(PDB_ReaderType::DIA, ...)`, see
> https://github.com/llvm-mirror/lldb/blob/master/
> source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110.
>
> 1) We can see that the arguments of the two calls are both `
> PDB_ReaderType::DIA`,  that means the first IfStmt
> in `llvm::pdb::loadDataFromEXE(PDB_ReaderType Type, ...)` is  temporarily
> useless. Is that right?
>
> 2) I have visual studio 2015 installed on my computer and there is no an environment
> variable called
>  VSINSTALLDIR. And the `LLVM_ENABLE_DIA_SDK` is 0, so every time need to
> call
> `llvm::pdb::loadDataFromEXE(PDB_ReaderType Type, ...)`,
> it will trigger the "DIA is not installed on the system" error. I want to
> known is this kind of behavior correct?
>
> ------------------------------------------------------------
> -------------------------------------
> Error llvm::pdb::loadDataForEXE(PDB_ReaderType Type, StringRef Path,
>                                 std::unique_ptr<IPDBSession> &Session) {
>   // Create the correct concrete instance type based on the value of Type.
>   if (Type == PDB_ReaderType::Native)
>     return NativeSession::createFromExe(Path, Session);
>
> #if LLVM_ENABLE_DIA_SDK
>   return DIASession::createFromExe(Path, Session);
> #else
>   return make_error<GenericError>("DIA is not installed on the system");
> #endif
> }
>
> ------------------------------------------------------------
> -------------------------------------
>
> <https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110>
> llvm-mirror/lldb
> <https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L110>
> Mirror of official lldb git repository located at http://llvm.org/git/lldb.
> Updated every five minutes.
> github.com
>
>
> <https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403>
> llvm-mirror/llvm
> <https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/Symbolize/Symbolize.cpp#L403>
> Mirror of official llvm git repository located at http://llvm.org/git/llvm.
> Updated every five minutes.
> github.com
>
>
> Henry Wong
> Qihoo 360 Codesafe Team
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>


-- 

Leonardo Santagada
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180123/eefeb585/attachment.html>


More information about the llvm-dev mailing list