That would be my thought, yea<br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 31, 2018 at 1:21 AM Aleksandr Urakov <<a href="mailto:aleksandr.urakov@jetbrains.com">aleksandr.urakov@jetbrains.com</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"><div dir="ltr"><div>Thanks for the reply!</div><div><br></div><div>Yes, the function search is implemented in the way similar to what you have described (and even the search in a symbol file is done before the search in a symtab). But for Module::FindSymbolsWithNameAndType function I can't find any relevant function in the SymbolFile. Do you mean that we need to extend the SymbolFile interface with such a function (which will search all public symbols by the name and the type), and then implement it in derived classes?</div></div></div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 30, 2018 at 6:03 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It seems reasonable to me to say that if the symbol is not found in the executables symtab, it will fall back to searching in the symbol file.. this logic doesn’t even need to be specific to PDB<br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 30, 2018 at 7:00 AM Aleksandr Urakov 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello!<div><br></div><div>I'm working on an expressions evaluation on Windows, and currently I'm trying to make a JIT evaluation working.</div><div><br></div><div>When I'm trying to evaluate the next expression:</div><div><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div dir="ltr"><div><font face="monospace, monospace">print S::x</font></div></div></blockquote><font face="monospace, monospace"><br></font><div dir="ltr"><div>on the next code:<br></div><div><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace, monospace">struct S {</font></div></div><div><div><font face="monospace, monospace"> static int x;</font></div></div><div><div><font face="monospace, monospace"> void foo() { }</font></div></div><div><div><font face="monospace, monospace">};</font></div></div><div><div><font face="monospace, monospace">int S::x = 5;</font></div></div><div><div><font face="monospace, monospace"><br></font></div></div><div><div><font face="monospace, monospace">int main() {</font></div></div><div><div><font face="monospace, monospace"> S().foo(); // here</font></div></div><div><div><font face="monospace, monospace"> return 0;</font></div></div><div><div><font face="monospace, monospace">}</font></div></div></blockquote><div dir="ltr"><div><br></div><div>the evaluation requires JIT (but printing of global variables requires not, and I can't figure out what is the key difference between a class static variable and a global variable in the case?).</div><div><br></div><div>During symbols resolving <font face="monospace, monospace">IRExecutionUnit::FindInSymbols</font> is used, and it searches a symbol among functions (which is not our case), and then calls <font face="monospace, monospace">Module::FindSymbolsWithNameAndType</font><font face="arial, helvetica, sans-serif"> for each module in the list. This function looks symbols up in a </font><font face="monospace, monospace">Symtab</font><font face="arial, helvetica, sans-serif">, which is retrieved through a </font><font face="monospace, monospace">SymbolVendor</font><font face="arial, helvetica, sans-serif">, and it retrieves one from an </font><font face="monospace, monospace">ObjectFile</font><font face="arial, helvetica, sans-serif">. ELF files contain symbols for such a variables in their symbol tables, but the problem is that PE files usually contain info about exported (and imported) symbols only, so the lookup in </font><font face="monospace, monospace">Symtab</font><font face="arial, helvetica, sans-serif"> fails.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I think that we need somehow to retrieve a symbols info from a symbol file. I thought that we can emit a </font><font face="monospace, monospace">Symtab</font><font face="arial, helvetica, sans-serif"> from a </font><font face="monospace, monospace">SymbolFile</font><font face="arial, helvetica, sans-serif"> just like from an </font><font face="monospace, monospace">ObjectFile</font><font face="arial, helvetica, sans-serif"> (and for now implement it for </font><font face="monospace, monospace">SymbolFilePDB</font><font face="arial, helvetica, sans-serif"> only), but I'm not sure if this solution is good. How can we solve the problem else?</font></div></div></div></div></div></div></div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><br></div>-- <br><div dir="ltr" class="m_-8107117035353549548m_-2747205785461882713m_3709203873988535760m_-3599710137144196275gmail_signature"><div dir="ltr"><div>Aleksandr Urakov</div><div><span>Software Developer</span></div><div><span>JetBrains</span></div><div><span><a href="http://www.jetbrains.com" target="_blank">http://www.jetbrains.com</a></span></div><div><span>The Drive to Develop</span></div></div></div></div></div></div></div></div></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="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-8107117035353549548gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Aleksandr Urakov</div><div><span>Software Developer</span></div><div><span>JetBrains</span></div><div><span><a href="http://www.jetbrains.com" target="_blank">http://www.jetbrains.com</a></span></div><div><span>The Drive to Develop</span></div></div></div></div>
</blockquote></div>