]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: use the pid from inferior in setup_inferior master
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Sat, 13 Dec 2025 11:50:47 +0000 (12:50 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Sat, 13 Dec 2025 11:50:50 +0000 (12:50 +0100)
This is a step to reduce the dependency on the global inferior_ptid
variable.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/infcmd.c

index ed4fb819faf0152a15e6c4042f9f83e15b128b97..ed1fa74dc37d0b5f47c010bc2c184e645768a2fa 100644 (file)
@@ -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);
 }