[Lldb-commits] [lldb] d29a50f - Revert "[lldb] Allow fetching of RA register when above fault handler (#98566)"

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 19 16:09:03 PST 2024


Author: Jason Molenda
Date: 2024-11-19T16:01:27-08:00
New Revision: d29a50f358e71a695b23e456d66ed2924617deb9

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

LOG: Revert "[lldb] Allow fetching of RA register when above fault handler (#98566)"

This reverts commit fd424179dcb3417fc0675f77d2bf06c750dd1c33.

This patch has two problems.  First, it is unnecessary, Pavel landed
a fix a week or so before mine which solves this problem in
bbd54e08b08f5ccd38c4665178e65c58f7b14459 .  Second, the fix is
incorrect; for a function above a trap handler, where all registers
are available, this patch would have lldb fetch the return address
register from frame 0.  This might be 10 frames up in the stack;
the frame 0 return address register is incorrect.  The change would
have been correct a short bit later than this, but Pavel's fix is
executed earlier in the function and none of this is needed.

Added: 
    

Modified: 
    lldb/source/Target/RegisterContextUnwind.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Target/RegisterContextUnwind.cpp b/lldb/source/Target/RegisterContextUnwind.cpp
index 9a4a8db84a9fa5..dbe885e286ff74 100644
--- a/lldb/source/Target/RegisterContextUnwind.cpp
+++ b/lldb/source/Target/RegisterContextUnwind.cpp
@@ -1402,7 +1402,7 @@ RegisterContextUnwind::SavedLocationForRegister(
       // it's still live in the actual register. Handle this specially.
 
       if (!have_unwindplan_regloc && return_address_reg.IsValid() &&
-          BehavesLikeZerothFrame()) {
+          IsFrameZero()) {
         if (return_address_reg.GetAsKind(eRegisterKindLLDB) !=
             LLDB_INVALID_REGNUM) {
           lldb_private::UnwindLLDB::ConcreteRegisterLocation new_regloc;


        


More information about the lldb-commits mailing list