[Lldb-commits] [PATCH] D63914: Make the expression parser work for missing weak symbols

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 28 13:45:35 PDT 2019


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

A few nits, but nothing structural. Fix those and this will be good to go.



================
Comment at: include/lldb/Symbol/Symbol.h:257
                                          // doing name lookups
+      m_is_weak : 1,
       m_type : 7;
----------------
This will increase the size of Symbol since this extra bit makes it go over 16 bits in size. We can steal a bit away from m_type since it is used to hold lldb::SymbolType and we only have 28 lldb::SymbolType enums. You might need to check that the Swift branch didn't add any. 


================
Comment at: include/lldb/Symbol/Symbol.h:258
+      m_is_weak : 1,
       m_type : 7;
   Mangled m_mangled;         // uniqued symbol name/mangled name pair
----------------
change to:
```
m_type : 6;
```
See above comment.




================
Comment at: packages/Python/lldbsuite/test/expression_command/weak_symbols/TestWeakSymbols.py:24
+
+    @decorators.skipUnlessDarwin
+    def test_weak_symbol_in_expr(self):
----------------
We should get ELF support for this as well once this is in.


================
Comment at: source/Expression/IRInterpreter.cpp:236
         lldb_private::ConstString name(constant_func->getName());
-        lldb::addr_t addr = m_execution_unit.FindSymbol(name);
-        if (addr == LLDB_INVALID_ADDRESS)
+        bool missing_weak;
+        lldb::addr_t addr = m_execution_unit.FindSymbol(name, missing_weak);
----------------
Init this to something in case function below gets changed and doesn't init it.


================
Comment at: source/Plugins/ExpressionParser/Clang/IRForTarget.cpp:436
 
+    bool missing_weak;
     CFStringCreateWithBytes_addr =
----------------
init to something.


================
Comment at: source/Plugins/ExpressionParser/Clang/IRForTarget.cpp:862
 
+    bool missing_weak;
     static lldb_private::ConstString g_sel_registerName_str("sel_registerName");
----------------
init to something


================
Comment at: source/Plugins/ExpressionParser/Clang/IRForTarget.cpp:1034
 
+    bool missing_weak;
     static lldb_private::ConstString g_objc_getClass_str("objc_getClass");
----------------
init to something.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63914/new/

https://reviews.llvm.org/D63914





More information about the lldb-commits mailing list