From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54629 invoked by alias); 21 Apr 2015 11:21:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 54613 invoked by uid 89); 21 Apr 2015 11:21:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f170.google.com Received: from mail-pd0-f170.google.com (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 21 Apr 2015 11:21:13 +0000 Received: by pdbqa5 with SMTP id qa5so238761954pdb.1 for ; Tue, 21 Apr 2015 04:21:12 -0700 (PDT) X-Received: by 10.68.175.66 with SMTP id by2mr36092811pbc.141.1429615272072; Tue, 21 Apr 2015 04:21:12 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id rt12sm1791280pab.34.2015.04.21.04.21.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 Apr 2015 04:21:11 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 15/17] PPC64: Fix gdb.arch/ppc64-atomic-inst.exp with displaced stepping References: <1429267521-21047-1-git-send-email-palves@redhat.com> <1429267521-21047-16-git-send-email-palves@redhat.com> Date: Tue, 21 Apr 2015 11:21:00 -0000 In-Reply-To: <1429267521-21047-16-git-send-email-palves@redhat.com> (Pedro Alves's message of "Fri, 17 Apr 2015 11:45:19 +0100") Message-ID: <86618pzq04.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00763.txt.bz2 Pedro Alves 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 > > * 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) >=20=20 > closure =3D gdbarch_displaced_step_copy_insn (gdbarch, > original, copy, regcache); > - > - /* We don't support the fully-simulated case at present. */ > - gdb_assert (closure); > + if (closure =3D=3D 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; > + } >=20=20 > /* 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. --=20 Yao (=E9=BD=90=E5=B0=A7)