This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 15/17] PPC64: Fix gdb.arch/ppc64-atomic-inst.exp with displaced stepping
- 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, 21 Apr 2015 12:20:59 +0100
- Subject: Re: [PATCH v3 15/17] PPC64: Fix gdb.arch/ppc64-atomic-inst.exp with displaced stepping
- Authentication-results: sourceware.org; auth=none
- References: <1429267521-21047-1-git-send-email-palves at redhat dot com> <1429267521-21047-16-git-send-email-palves at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> The ppc64 displaced step code can't handle atomic sequences. Fallback
> to stepping over the breakpoint in-line if we detect one.
Probably arm atom sequences instructions can't be executed out-of-line
either, I'll write a test for this.
>
> gdb/ChangeLog:
> 2015-04-17 Pedro Alves <palves@redhat.com>
>
> * infrun.c (displaced_step_prepare): Return -1 if
> gdbarch_displaced_step_copy_insn returns NULL.
> (resume): When displaced stepping doesn't work, try software
> single-stepping.
This chunk isn't shown in the patch below, has been committed already?
> diff --git a/gdb/infrun.c b/gdb/infrun.c
> index be186a7..a89eefc 100644
> --- a/gdb/infrun.c
> +++ b/gdb/infrun.c
> @@ -1797,9 +1797,14 @@ displaced_step_prepare_throw (ptid_t ptid)
>
> closure = gdbarch_displaced_step_copy_insn (gdbarch,
> original, copy, regcache);
> -
> - /* We don't support the fully-simulated case at present. */
> - gdb_assert (closure);
> + if (closure == NULL)
> + {
> + /* The architecture doesn't know how or want to displaced step
> + this instruction or instruction sequence. Fallback to
> + stepping over the breakpoint in-line. */
> + do_cleanups (old_cleanups);
> + return -1;
> + }
>
> /* Save the information we need to fix things up if the step
> succeeds. */
We need to update the comments to displaced_step_prepare_throw about
return value -1.
--
Yao (éå)