[Lldb-commits] [PATCH] D39307: Fix global data symbol resolution
Alex Langford via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 25 15:24:58 PDT 2017
xiaobai created this revision.
With this patch I want to do the following:
When searching for global data symbols, only consider non-externally visible
symbols if we are in the module where they are visible.
I was investigating bug 35043
(https://bugs.llvm.org/show_bug.cgi?id=35043)
and found out I was able to reproduce this on a Linux x86-64 machine I have
access to. I was doing some digging, and found out that even when we're not in
the module with visibility, we would still consider internal symbols from other
modules when clang was asking us to find external declarations by name.
So in TestLambdas, we want to define a lambda with parameters (int a, int b).
Clang wants to ensure we don't redeclare our parameters. Through a long chain of
function calls, the call chain ends up
at SymbolContext::FindBestGlobalDataSymbol(), which (on my machine) will find
that there is are symbols named "a" and "b" in another module, but they are not
externally visible. lldb will complain that there are multiple defined internal
symbols, but these shouldn't matter for our lambda.
I don't have as much context as some of y'all about whether or not this kind of
change will present significant problems elsewhere, or if we should tackle this
problem another way. Feedback is very much appreciated.
https://reviews.llvm.org/D39307
Files:
packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
source/Symbol/SymbolContext.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39307.120327.patch
Type: text/x-patch
Size: 10301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171025/791f47f4/attachment.bin>
More information about the lldb-commits
mailing list