In post_create_inferior, we get the current thread using the
inferior_thread function and store it in `thr`. We then call
get_current_regcache immediately after, which does:
return get_thread_regcache (inferior_thread ());
This patch makes post_create_inferior use get_thread_regcache, passing
`thr`, saving an unnecessary inferior_thread call.
gdb/ChangeLog:
* infcmd.c (post_create_inferior): Use get_thread_regcache
instead of get_current_regcache.
+2020-01-15 Simon Marchi <simon.marchi@efficios.com>
+
+ * infcmd.c (post_create_inferior): Use get_thread_regcache
+ instead of get_current_regcache.
+
2020-01-14 Tom Tromey <tom@tromey.com>
PR symtab/12535:
thr->suspend.stop_pc = 0;
try
{
- thr->suspend.stop_pc = regcache_read_pc (get_current_regcache ());
+ regcache *rc = get_thread_regcache (thr);
+ thr->suspend.stop_pc = regcache_read_pc (rc);
}
catch (const gdb_exception_error &ex)
{