Hi, How is this patch going ? Best Regards Zhiyong From: Yan, Zhiyong Sent: Friday, May 5, 2023 10:14 AM To: gdb-patches@sourceware.org Subject: The patch for bugzilla 30387 Hi, There is a patch for https://sourceware.org/bugzilla/show_bug.cgi?id=30387, in the attachment. Bugzilla 30387 has given the steps of producing this issue on arm platform. Attached step5-assert.txt is a debug log which contains several "gdb step next" output. For example, at line 29, resume_one_thread() doesn't call process_one_lwp() because thread LWP 316.316 is pending, as a result the software breaking point is not installed. Later, if this pending thread makes "wait_1: Hit a non-gdbserver trap event." happen, stop_all_lwps() -> "prepare_resume_reply: Writing resume reply for" ->... In such case, "gdb N" can finish without assert error. But in step5-assert.txt, from line 14923 to 14943, we can see the pending thread make below happen, " wait_for_event_filtered: Got a pending child 316 362.994099 [threads] wait_for_event_filtered: Got an event from pending child 316 (117f) 362.994379 [threads] wait_1: Ignored signal 17 for LWP 316 " In this case "resume_stopped_resumed_lwps" will resume every 'stopped-resumed' thread, but a thread (previously pending) has no software break point installed, then resume_stopped_resumed_lwps() asserts failed in maybe_hw_step(). So, my points is: 1. Gdb should not assume pending threads always generate "a non-gdbserver trap event", a "Signal 17" event could happen. 2. Now that resume_stopped_resumed_lwps() -> may_hw_step() assumes that the break point must already exist, resume_one_thread() should ensure the software breaking point is installed although the thread is pending. Best Regards. Zhiyong