[Lldb-commits] [PATCH] D14538: Fix DwarfSymbolFile when appending global functions from different modules

Aidan Dodds via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 10 04:26:28 PST 2015

ADodds created this revision.
ADodds added a reviewer: clayborg.
ADodds added a subscriber: lldb-commits.
ADodds set the repository for this revision to rL LLVM.

This patch fixes a bug in SymbolFileDWARF::FindFunctions(), where functions may not be correctly found when appending to a list already containing some symbols.
Upon entering this function, original_size is set to the size of sc_list, however the target code should be executed not when the list is empty but when this list has not grown during this function invocation.  This patch corrects this problem.

Running the lldb test suite shows no regressions caused by this change, and fixes Bug 25433.




Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2711,7 +2711,7 @@
             // TODO: The arch in the object file isn't correct for MSVC
             // binaries on windows, we should find a way to make it
             // correct and handle those symbols as well.
-            if (sc_list.GetSize() == 0)
+            if (sc_list.GetSize() == original_size)
                 ArchSpec arch;
                 if (!parent_decl_ctx &&

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14538.39802.patch
Type: text/x-patch
Size: 643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151110/e3217cde/attachment.bin>

More information about the lldb-commits mailing list