public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [ob/pushed] Remove unnecessary inferior lookup in infrun:handle_one
@ 2022-03-07 16:29 Pedro Alves
  0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2022-03-07 16:29 UTC (permalink / raw)
  To: gdb-patches

infrun.c:handle_one calls find_inferior_ptid unnecessarily, since we
already have a thread pointer handy, and the thread has a pointer to
the inferior.  This commit removes the unnecessary lookup.

Change-Id: I2ae18601dd75346c6c91068e9a4f9a6484fb3339
---
 gdb/infrun.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/infrun.c b/gdb/infrun.c
index 85d8404f5b3..e3c1db73749 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4845,8 +4845,7 @@ handle_one (const wait_one_event &event)
 
       /* This may be the first time we see the inferior report
 	 a stop.  */
-      inferior *inf = find_inferior_ptid (event.target, event.ptid);
-      if (inf->needs_setup)
+      if (t->inf->needs_setup)
 	{
 	  switch_to_thread_no_regs (t);
 	  setup_inferior (0);

base-commit: aacf24b4db3422632d6b62d473faf71f4e737072
-- 
2.26.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-07 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 16:29 [ob/pushed] Remove unnecessary inferior lookup in infrun:handle_one Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).