[Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 13 15:35:18 PDT 2016
clayborg added a comment.
In http://reviews.llvm.org/D22294#483311, @sas wrote:
> In http://reviews.llvm.org/D22294#483264, @clayborg wrote:
> > Note that during function lookup, we can find **both** "putchar" and "__my_putchar" in the debug info, so you will be able to call both.
> Correct, unless as you pointed out both symbols are in libraries, and not in the main executable.
> Our experience using this feature of clang has been that both symbols being in libraries is the rule rather than the exception.
> See r221548 in llvm which introduces the symbol rewriter pass. This functionality is used for things like interposing of libraries, etc, or experiments where two versions of the same library are running alongside each other. This means that in the general use case, you have both the non-rewritten as well as the rewritten library loaded in the process.
> FWIW, the current version of lldb is already able to call `_my_putchar`, given that this is the name present in the Mach-O symbol table.
And adding the rewriting stuff does nothing to help these duplicate symbols. If you are not stopped in a.out, and you try to call putchar, your expression will fail with duplicate symbols even with your rewriting stuff. So there is no need to add it. Just fix the DWARF.
More information about the lldb-commits