<div dir="ltr">Two things stand out to me as odd here.<div><br></div><div>1) -glldb. -g is supposed to specify the debug information format, either dwarf, codeview, or whichever is the default. I've never heard of anyone using -glldb (or for that matter -ggdb). Just -g, -gcodeview, or -gdwarf.</div><div><br></div><div>2) You're using clang instead of clang-cl. While it's possible to make things work, we designed clang-cl specifically to avoid these kinds of issues, so I would first try running `clang-cl /Z7 main.c` and see if things suddenly start working better.</div><div><br></div><div>To be honest, I'm surprised it's even generating a PDB at all with the given command line, but then again it's not a codepath anyone has really tested, so maybe it's generating "something".</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2019 at 5:01 PM Adrian McCarthy via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry for the delay. There's definitely something going wrong here.<div><br></div><div>If you specify the .pdb file (target symbols add a.pdb), it iterates through the objfile plugins to see if any match, and none of them do (because a PDB file is not a "module").</div><div><br></div><div>If you specify the .exe file (target symbols add a.exe), it matches an objfile plugin and creates the symbol vendor, but the symbol vendor says the symbol file is the .exe itself rather than the .pdb, so it appears to work but no symbols are actually loaded.</div><div><br></div><div>If you specify the .exe with -s (target symbols add -s a.exe), you again get silent failure as in the previous case.</div><div><br></div><div>I'll look at this some more tomorrow to see if I can figure out what this code path is supposed to be doing.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 4, 2019 at 11:00 AM Christoph Baumann via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="DE"><div class="m_-2008010505221110650gmail-m_-3096204979025357429WordSection1"><p class="MsoNormal">Hey,<u></u><u></u></p><p class="MsoNormal">in order to try lldb on windows, i built (with clang compiler and lld linker (v7.0.1)) llvm, clang, lld and of course lldb from latest source with the following command line:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">> cmake -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_LINKER=lld-link -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_PYTHON_HOME=“C:\program files\python37“ -DLLVM_BUILD_TESTS=0 -DLLVM_BUILD_BENCHMARKS=0 -DLLVM_BUILD_EXAMPLES=0 -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGET_ARCH=host -DCMAKE_INSTALL_PREFIX=“..\release“ ..\src\llvm<u></u><u></u></p><p class="MsoNormal">>ninja install<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Here my little program i used to test lldb:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">> //main.c<u></u><u></u></p><p class="MsoNormal">> #include <stdio.h><u></u><u></u></p><p class="MsoNormal">><u></u> <u></u></p><p class="MsoNormal">> int a=10;<u></u><u></u></p><p class="MsoNormal">><u></u> <u></u></p><p class="MsoNormal">> int main(int argc, char *argv[]){<u></u><u></u></p><p class="MsoNormal">> for(int i=0;i<argc;i++){<u></u><u></u></p><p class="MsoNormal">> printf("%s\n", argv[i]);<u></u><u></u></p><p class="MsoNormal">> }<u></u><u></u></p><p class="MsoNormal">> return(0);<u></u><u></u></p><p class="MsoNormal">> }<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I compiled the above with „clang main.c -glldb -o a.exe“, which generated the executable a.exe and corresponding debug information a.pdb.<u></u><u></u></p><p class="MsoNormal">I launched lldb with „lldb a.exe“ and tried to load the debug information with „target symbols add a.pdb“, however this resulted in „error: symbol file [….]\a.pdb does not match any existing module“.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am using Windows 10 pro 64bit, my both, my test program and lldb were compiled for x64 target.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I have also tried the prebuilt llvm/lldb binaries (v8.0.0, v7.0.1) found on <a href="http://llvm.org" target="_blank">llvm.org</a>, same result.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I feel like i am missing something (unless lldb just does not work on windows yet).<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">(On a sidenote, compiling with -gdwarf-5 makes clang crash. I can send the debug information clang spits out once my debug build finishes.)<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Greetings<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>