[Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.

Dawn Perchik via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 7 14:57:46 PST 2015


dawn created this revision.
dawn added reviewers: paulherman, clayborg, granata.enrico.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.

When multiple functions are found by name, lldb removes duplicate entries of functions with the same type, so the first function in the symbol context list is chosen, even if it isn't in scope.  This patch uses the declaration context of the execution context to select the function which is in scope.

This fixes cases like the following:

    int func();
    namespace ns {
        int func();
        void here() {
            // Run to BP here and eval 'p func()';
            // lldb used to find ::func(), now finds ns::func().
        }
    }


Repository:
  rL LLVM

http://reviews.llvm.org/D15312

Files:
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/GoASTContext.h
  include/lldb/Symbol/TypeSystem.h
  packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile
  packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
  packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
  packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  source/Symbol/ClangASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15312.42113.patch
Type: text/x-patch
Size: 35216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151207/575d6cf3/attachment-0001.bin>


More information about the lldb-commits mailing list