Skip to content

Commit 06817bb

Browse files
committed
Add workaround for issue #160216
1 parent afdf9a7 commit 06817bb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lldb/source/Core/Debugger.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,11 @@ bool Debugger::StatuslineSupported() {
20812081
return false;
20822082
}
20832083

2084+
static bool RequiresFollowChildWorkaround(const Process &process) {
2085+
// FIXME: https://github.com/llvm/llvm-project/issues/160216
2086+
return process.GetFollowForkMode() == eFollowChild;
2087+
}
2088+
20842089
lldb::thread_result_t Debugger::DefaultEventHandler() {
20852090
ListenerSP listener_sp(GetListener());
20862091
ConstString broadcaster_class_target(Target::GetStaticBroadcasterClass());
@@ -2140,17 +2145,19 @@ lldb::thread_result_t Debugger::DefaultEventHandler() {
21402145
ConstString broadcaster_class(broadcaster->GetBroadcasterClass());
21412146
if (broadcaster_class == broadcaster_class_process) {
21422147
if (ProcessSP process_sp = HandleProcessEvent(event_sp))
2143-
exe_ctx_ref = ExecutionContextRef(process_sp.get(),
2144-
/*adopt_selected=*/true);
2148+
if (!RequiresFollowChildWorkaround(*process_sp))
2149+
exe_ctx_ref = ExecutionContextRef(process_sp.get(),
2150+
/*adopt_selected=*/true);
21452151
} else if (broadcaster_class == broadcaster_class_target) {
21462152
if (Breakpoint::BreakpointEventData::GetEventDataFromEvent(
21472153
event_sp.get())) {
21482154
HandleBreakpointEvent(event_sp);
21492155
}
21502156
} else if (broadcaster_class == broadcaster_class_thread) {
21512157
if (ThreadSP thread_sp = HandleThreadEvent(event_sp))
2152-
exe_ctx_ref =
2153-
ExecutionContextRef(thread_sp.get(), /*adopt_selected=*/true);
2158+
if (!RequiresFollowChildWorkaround(*thread_sp->GetProcess()))
2159+
exe_ctx_ref = ExecutionContextRef(thread_sp.get(),
2160+
/*adopt_selected=*/true);
21542161
} else if (broadcaster == m_command_interpreter_up.get()) {
21552162
if (event_type &
21562163
CommandInterpreter::eBroadcastBitQuitCommandReceived) {

0 commit comments

Comments
 (0)