This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 03/17] Displaced stepping debug: fetch the right regcache


Pedro Alves <palves@redhat.com> writes:

> gdb/ChangeLog:
> 2015-04-01  Pedro Alves  <pedro@codesourcery.com>
>
> 	* infrun.c (resume) <displaced stepping debug output>: Get the
> 	leader thread's regcache, not resume_ptid's.

Hi Pedro,
From your change, I don't see why TP is the leader thread.

> ---
>  gdb/infrun.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdb/infrun.c b/gdb/infrun.c
> index cf0ef32..f23e76e 100644
> --- a/gdb/infrun.c
> +++ b/gdb/infrun.c
> @@ -2374,7 +2374,7 @@ resume (enum gdb_signal sig)
>        && tp->control.trap_expected
>        && use_displaced_stepping_now_p (gdbarch, sig))
>      {
> -      struct regcache *resume_regcache = get_thread_regcache (resume_ptid);
> +      struct regcache *resume_regcache = get_thread_regcache (tp->ptid);
>        struct gdbarch *resume_gdbarch = get_regcache_arch (resume_regcache);
>        CORE_ADDR actual_pc = regcache_read_pc (resume_regcache);

If we get recache from TP, can we remove local variables
resume_regcache, resume_gdbarch, actual_pc, and use regcache, gdbarch
and pc we've got at the beginning of function resume instead?

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]