[all-commits] [llvm/llvm-project] 83ba37: [lldb] Clear cached unwind plans when adding symbo...

Pavel Labath via All-commits all-commits at lists.llvm.org
Fri Feb 7 03:52:43 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83ba3740bf51347307494d013099e392c310e32b
      https://github.com/llvm/llvm-project/commit/83ba3740bf51347307494d013099e392c310e32b
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2025-02-07 (Fri, 07 Feb 2025)

  Changed paths:
    M lldb/include/lldb/Symbol/UnwindTable.h
    M lldb/source/Commands/CommandObjectTarget.cpp
    M lldb/source/Commands/Options.td
    M lldb/source/Symbol/UnwindTable.cpp
    R lldb/test/Shell/SymbolFile/Inputs/target-symbols-add-unwind.c
    M lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test

  Log Message:
  -----------
  [lldb] Clear cached unwind plans when adding symbols (#125839)

PR #86603 broke unwinding in for unwind info added via "target symbols
add". #86770 attempted to fix this, but the fix was only partial -- it
accepted new sources of unwind information, but didn't take into account
that the symbol file can alter what lldb percieves as function
boundaries.

A stripped file will not contain information about private
(non-exported) symbols, which will make the public symbols appear very
large. If lldb tries to unwind from such a function before symbols are
added, then the cached unwind plan will prevent new (correct) unwind
plans from being created.

target-symbols-add-unwind.test might have caught this, were it not for
the fact that the "image show-unwind" command does *not* use cached
unwind information (it recomputes it from scratch).

The changes in this patch come in three pieces:
- Clear cached unwind plans when adding symbols. Since the symbol
boundaries can change, we cannot trust anything we've computed
previously.
- Add a flag to "image show-unwind" to display the cached unwind
information (mainly for the use in the test, but I think it's also
generally useful).
- Rewrite the test to better and more reliably simulate the real-world
scenario: I've swapped the running process for a core (minidump) file so
it can run anywhere; used the caching version of the show-unwind
command; and swapped C for assembly to better control the placement of
symbols



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list