[lldb-dev] Symtab for PECOFF

Zachary Turner via lldb-dev lldb-dev at lists.llvm.org
Thu Aug 30 08:03:13 PDT 2018


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
On Thu, Aug 30, 2018 at 7:00 AM Aleksandr Urakov via lldb-dev <
lldb-dev at lists.llvm.org> wrote:

> Hello!
>
> I'm working on an expressions evaluation on Windows, and currently I'm
> trying to make a JIT evaluation working.
>
> When I'm trying to evaluate the next expression:
>
> print S::x
>
>
> on the next code:
>
> struct S {
>   static int x;
>   void foo() { }
> };
> int S::x = 5;
>
> int main() {
>   S().foo(); // here
>   return 0;
> }
>
>
> 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?).
>
> During symbols resolving IRExecutionUnit::FindInSymbols is used, and it
> searches a symbol among functions (which is not our case), and then calls
> Module::FindSymbolsWithNameAndType for each module in the list. This
> function looks symbols up in a Symtab, which is retrieved through a
> SymbolVendor, and it retrieves one from an ObjectFile. 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 Symtab fails.
>
> I think that we need somehow to retrieve a symbols info from a symbol
> file. I thought that we can emit a Symtab from a SymbolFile just like
> from an ObjectFile (and for now implement it for SymbolFilePDB only), but
> I'm not sure if this solution is good. How can we solve the problem else?
>
> --
> Aleksandr Urakov
> Software Developer
> JetBrains
> http://www.jetbrains.com
> The Drive to Develop
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20180830/d57bbe69/attachment-0001.html>


More information about the lldb-dev mailing list