From 4928b0c0c3db24f2170ed226071f72597f12d746 Mon Sep 17 00:00:00 2001 From: Tankut Baris Aktemur Date: Sat, 13 Dec 2025 12:50:47 +0100 Subject: [PATCH] gdb: use the pid from inferior in setup_inferior This is a step to reduce the dependency on the global inferior_ptid variable. Approved-By: Simon Marchi --- gdb/infcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index ed4fb819faf..ed1fa74dc37 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2578,7 +2578,7 @@ setup_inferior (int from_tty) /* If no exec file is yet known, try to determine it from the process itself. */ if (current_program_space->exec_filename () == nullptr) - exec_file_locate_attach (inferior_ptid.pid (), 1, from_tty); + exec_file_locate_attach (inferior->pid, 1, from_tty); else { reopen_exec_file (); @@ -2586,7 +2586,7 @@ setup_inferior (int from_tty) } /* Take any necessary post-attaching actions for this platform. */ - target_post_attach (inferior_ptid.pid ()); + target_post_attach (inferior->pid); post_create_inferior (from_tty, true); } -- 2.47.3