This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 03/17] Displaced stepping debug: fetch the right regcache
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 07 Apr 2015 14:55:27 +0100
- Subject: Re: [PATCH 03/17] Displaced stepping debug: fetch the right regcache
- Authentication-results: sourceware.org; auth=none
- References: <1427926454-16431-1-git-send-email-palves at redhat dot com> <1427926454-16431-4-git-send-email-palves at redhat dot com>
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 (éå)