-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Revive shell test after updating UnwindTable (#86770)
In commit 2f63718 Author: Jason Molenda <jmolenda@apple.com> Date: Tue Mar 26 09:07:15 2024 -0700 [lldb] Don't clear a Module's UnwindTable when adding a SymbolFile (#86603) I stopped clearing a Module's UnwindTable when we add a SymbolFile to avoid the memory management problems with adding a symbol file asynchronously while the UnwindTable is being accessed on another thread. This broke the target-symbols-add-unwind.test shell test on Linux which removes the DWARF debub_frame section from a binary, loads it, then loads the unstripped binary with the DWARF debug_frame section and checks that the UnwindPlans for a function include debug_frame. I originally decided that I was willing to sacrifice the possiblity of additional unwind sources from a symbol file because we rely on assembly emulation so heavily, they're rarely critical. But there are targets where we we don't have emluation and rely on things like DWARF debug_frame a lot more, so this probably wasn't a good choice. This patch adds a new UnwindTable::Update method which looks for any new sources of unwind information and adds it to the UnwindTable, and calls that after a new SymbolFile has been added to a Module.
- Loading branch information
1 parent
7711853
commit 6a0ec8e
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# TODO: When it's possible to run "image show-unwind" without a running | ||
# process, we can remove the unsupported line below, and hard-code an ELF | ||
# triple in the test. | ||
# UNSUPPORTED: system-windows, system-darwin | ||
|
||
# RUN: cd %T | ||
# RUN: %clang_host %S/Inputs/target-symbols-add-unwind.c -g \ | ||
# RUN: -fno-unwind-tables -fno-asynchronous-unwind-tables \ | ||
# RUN: -o target-symbols-add-unwind.debug | ||
# RUN: llvm-objcopy --strip-debug target-symbols-add-unwind.debug \ | ||
# RUN: target-symbols-add-unwind.stripped | ||
# RUN: %lldb target-symbols-add-unwind.stripped -s %s -o quit | FileCheck %s | ||
|
||
process launch --stop-at-entry | ||
image show-unwind -n main | ||
# CHECK-LABEL: image show-unwind -n main | ||
# CHECK-NOT: debug_frame UnwindPlan: | ||
|
||
target symbols add -s target-symbols-add-unwind.stripped target-symbols-add-unwind.debug | ||
# CHECK-LABEL: target symbols add | ||
# CHECK: symbol file {{.*}} has been added to {{.*}} | ||
|
||
image show-unwind -n main | ||
# CHECK-LABEL: image show-unwind -n main | ||
# CHECK: debug_frame UnwindPlan: | ||
# CHECK-NEXT: This UnwindPlan originally sourced from DWARF CFI | ||
# CHECK-NEXT: This UnwindPlan is sourced from the compiler: yes. |