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

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 27 18:07:33 PDT 2019


jingham created this revision.
jingham added reviewers: JDevlieghere, clayborg.
Herald added subscribers: lldb-commits, teemperor, abidh.
Herald added a project: LLDB.

lldb wasn't handling weak symbols, so if you were debugging a binary that used a weak symbol, and the symbol was missing, any references to the symbol would result in a symbol not found error.  But it is actually legitimate to refer to missing weak symbols, you just have to test them against NULL first.

This patch does three things:

1. Adds a bit to indicate weakness to Symbol and IsWeak & SetIsWeak accessors
2. Teaches the ObjectFileMachO to detect weak symbols and mark them appropriately
3. Gets the symbol -> address lookup in IRExecutionUnit.cpp to mark missing weak symbols as such.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D63914

Files:
  include/lldb/Expression/IRExecutionUnit.h
  include/lldb/Symbol/Symbol.h
  packages/Python/lldbsuite/test/expression_command/weak_symbols/Makefile
  packages/Python/lldbsuite/test/expression_command/weak_symbols/TestWeakSymbols.py
  packages/Python/lldbsuite/test/expression_command/weak_symbols/dylib.c
  packages/Python/lldbsuite/test/expression_command/weak_symbols/dylib.h
  packages/Python/lldbsuite/test/expression_command/weak_symbols/main.c
  packages/Python/lldbsuite/test/expression_command/weak_symbols/module.modulemap
  source/Expression/IRExecutionUnit.cpp
  source/Expression/IRInterpreter.cpp
  source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Symbol/Symbol.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63914.206975.patch
Type: text/x-patch
Size: 20981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190628/fc5cf75e/attachment-0001.bin>


More information about the lldb-commits mailing list