[PATCH v2 24/47] gdb, remote: handle a generic process PID in remote_notice_new_inferior

Tankut Baris Aktemur
2024-12-13T16:23:02Z

If the ptid received by 'remote_notice_new_inferior' is a generic pid,
return after checking for a new inferior. Do not attempt checking for
and adding new threads.
---
gdb/remote.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/gdb/remote.c b/gdb/remote.c
index 4dc79daf0a8618c5920dd9461d91273244326336..86f9a976a31841a0e53a7fbf0a7eff85f3368d5d 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -3002,6 +3002,11 @@ remote_target::remote_notice_new_inferior (ptid_t currthread, bool executing)
inf = remote_add_inferior (fake_pid_p, pid, -1, 1);
}

+ /* We may have received the event for a process in general.
+ There is nothing to check further in this case. */
+ if (currthread.is_pid ())
+ return;
+
if (inferior_ptid.is_pid ()
&& pid == inferior_ptid.pid ())
{