Skip to content

Commit 2249ae4

Browse files
Jlalondkusmour
authored andcommitted
[LLDB][ProcessGDBRemote] Put SetCanJIT behind a guard clause
Summary: In D73806555, I have `SetCanJIT` be modified if the process can be resumed. This caused some test failures because the process couldn't Jit! After some investigation, I originally tried putting this behind `CanJIT() && !non_resumable`, but that itself would modify the state of Process. So I've settled on 'if we're in a non resumable stop, now disable JIT'. This will unblock the release and I will CP back to rc-main. Test Plan: ``` ./bin/llvm-lit -sv /data/users/jalalonde/llvm-sand/external/llvm-project/lldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py Testing Time: 34.21s Total Discovered Tests: 1 Passed: 1 (100.00%) ``` Reviewers: gclayton, peix Reviewed By: gclayton, peix Subscribers: #lldb_team Differential Revision: https://phabricator.intern.facebook.com/D75004779
1 parent 83b6283 commit 2249ae4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,16 @@ void ProcessGDBRemote::DidLaunchOrAttach(ArchSpec &process_arch) {
967967
GetTarget().SetArchitecture(process_arch);
968968
}
969969

970-
// If the process is in a non resumable stop, we'll keep erroring out
971-
// trying to jit and continue the process. So we set can JIT to false
972-
// so any expression is evaluated in LLDB.
973-
SetCanJIT(m_gdb_comm.SafeToResume());
970+
// We don't want to cause side-effects unintentionally on the happy path
971+
// so we don't touch CanJIT unless we know we've hit a non-resumable
972+
// state. Additionally we don't check `CanJIT` because it itself
973+
// would modify the state of CanJIT.
974+
if (!m_gdb_comm.SafeToResume()) {
975+
// If the process is in a non resumable stop, we'll keep erroring out
976+
// trying to jit and continue the process. So we set can JIT to false
977+
// so any expression is evaluated in LLDB.
978+
SetCanJIT(false);
979+
}
974980
}
975981

976982
// Target and Process are reasonably initailized;

0 commit comments

Comments
 (0)