[PATCH 2/2] gdb: remove duplicate call to get_thread_regcache in resume_1

simark@simark.ca simark@simark.ca
Tue Jan 7 04:19:06 GMT 2025


From: Simon Marchi <simon.marchi@polymtl.ca>

This call to get_thread_regcache should return the same regcache we
already fetched at the beginning of the function.

Change-Id: Ic2142148e6372fff37f38bb84aad7cd7a1c14577
---
 gdb/infrun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/infrun.c b/gdb/infrun.c
index c7a10db125a7..16a264698eb0 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2852,7 +2852,7 @@ resume_1 (enum gdb_signal sig)
 	{
 	  /* Update pc to reflect the new address from which we will
 	     execute instructions due to displaced stepping.  */
-	  pc = regcache_read_pc (get_thread_regcache (tp));
+	  pc = regcache_read_pc (regcache);
 
 	  step = gdbarch_displaced_step_hw_singlestep (gdbarch);
 	}
-- 
2.47.1



More information about the Gdb-patches mailing list