[Lldb-commits] [lldb] e5984a3 - [lldb/elf] Avoid side effects in function calls ParseUnwindSymbols

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 22 05:31:10 PDT 2021


Author: Pavel Labath
Date: 2021-04-22T14:31:00+02:00
New Revision: e5984a3680bef22d422beaafa73bf131d7197973

URL: https://github.com/llvm/llvm-project/commit/e5984a3680bef22d422beaafa73bf131d7197973
DIFF: https://github.com/llvm/llvm-project/commit/e5984a3680bef22d422beaafa73bf131d7197973.diff

LOG: [lldb/elf] Avoid side effects in function calls ParseUnwindSymbols

This addresses post-commit feedback to cd64273.

Added: 
    

Modified: 
    lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 6e94ab97992a1..be73d38961ea6 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -2918,20 +2918,21 @@ void ObjectFileELF::ParseUnwindSymbols(Symtab *symbol_table,
       if (section_sp) {
         addr_t offset = file_addr - section_sp->GetFileAddress();
         const char *symbol_name = GetNextSyntheticSymbolName().GetCString();
+        uint64_t symbol_id = ++last_symbol_id;
         Symbol eh_symbol(
-            ++last_symbol_id, // Symbol table index.
-            symbol_name,      // Symbol name.
-            eSymbolTypeCode,  // Type of this symbol.
-            true,             // Is this globally visible?
-            false,            // Is this symbol debug info?
-            false,            // Is this symbol a trampoline?
-            true,             // Is this symbol artificial?
-            section_sp, // Section in which this symbol is defined or null.
-            offset,     // Offset in section or symbol value.
-            0,          // Size:          Don't specify the size as an FDE can
-            false,      // Size is valid: cover multiple symbols.
-            false,      // Contains linker annotations?
-            0);         // Symbol flags.
+            symbol_id,       // Symbol table index.
+            symbol_name,     // Symbol name.
+            eSymbolTypeCode, // Type of this symbol.
+            true,            // Is this globally visible?
+            false,           // Is this symbol debug info?
+            false,           // Is this symbol a trampoline?
+            true,            // Is this symbol artificial?
+            section_sp,      // Section in which this symbol is defined or null.
+            offset,          // Offset in section or symbol value.
+            0,     // Size:          Don't specify the size as an FDE can
+            false, // Size is valid: cover multiple symbols.
+            false, // Contains linker annotations?
+            0);    // Symbol flags.
         new_symbols.push_back(eh_symbol);
       }
     }


        


More information about the lldb-commits mailing list