From: Tankut Baris Aktemur Date: Sat, 13 Dec 2025 11:50:47 +0000 (+0100) Subject: gdb: use the pid from inferior in setup_inferior X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4928b0c0c3db24f2170ed226071f72597f12d746;p=thirdparty%2Fbinutils-gdb.git 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 --- 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); }