[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 10 19:56:20 PDT 2017


clayborg added a comment.

In https://reviews.llvm.org/D33083#751836, @jingham wrote:

> Actually, I take that back.  Why do you have to call FindGlobalDataSymbol twice?  Shouldn't FindGlobalDataSymbol do that work for you.  After all you passed in the module.  It should itself prefer symbols in the module...
>
> It also seems wrong that we're just picking the first one in the case where we find two symbols at the same level distant from the current module.  Shouldn't that be an error?


Yes, that is why I suggested always doing a full search and then with a SymbolContextList that results by sorting things from the currently module (maybe more than 1), and then from other modules (maybe more than 1). Then the picking would start:
1- prefer exported symbols from the current module, if more than 1 match this criteria, then error
2- prefer exported symbols from other modules, if more than 1 match this criteria, then error
3 - prefer private symbols from current module, if more than 1 match this criteria, then error
4 - prefer private symbols from other modules, if more than 1 match this criteria, then error

Maybe 2 and 3 should be switched? I don't think so, but others might.


https://reviews.llvm.org/D33083





More information about the lldb-commits mailing list