From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25820 invoked by alias); 6 Sep 2011 13:44:10 -0000 Received: (qmail 25811 invoked by uid 22791); 6 Sep 2011 13:44:09 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Sep 2011 13:43:52 +0000 Received: (qmail 23639 invoked from network); 6 Sep 2011 13:43:52 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Sep 2011 13:43:52 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] Use displaced stepping regardless of SW single step Date: Tue, 06 Sep 2011 13:49:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: Yao Qi References: <4E63830D.9060604@codesourcery.com> In-Reply-To: <4E63830D.9060604@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201109061443.49878.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-09/txt/msg00086.txt.bz2 On Sunday 04 September 2011 14:54:21, Yao Qi wrote: > Hi, > I noticed that I can only do displaced stepping in first `si`, and in=20 > the following `si', displaced stepping is not used at all, as shown below, >=20 > (gdb) set displaced-stepping on > (gdb) set debug displaced 1 > (gdb) si > During symbol reading, incomplete CFI data; unspecified registers (e.g.,= =20 > rax) at 0x400565. > displaced: stepping process 32472 now > displaced: saved 0x400482: 49 89 d1 5e 48 89 e2 48 83 e4 f0 50 54 49 c7 c0 > displaced: copy 0x400564->0x400482: 55 48 89 e5 48 83 ec 10 e8 ff fe ff=20 > ff 89 45 fc > displaced: displaced pc to 0x400482 > displaced: run 0x400482: 55 48 89 e5 > displaced: restored 0x400482 > displaced: fixup (0x400564, 0x400482), insn =3D 0x55 0x48 ... > displaced: relocated %rip from 0x400483 to 0x400565 > 0x0000000000400565 24 { > (gdb) si > 0x0000000000400568 24 { > (gdb) si > 27 pid =3D fork (); >=20 > I don't think that is the expected behavior of gdb, so there may be=20 > something wrong in gdb. The displaced stepping is controlled by this=20 > condition check, But it is. Displaced stepping is only necessary to step over breakpoints (trap_expected) without removing them. If there's no breakpoint at the current instruction, we can just do a normal step. > I don't figure out the reason we need to check software_single_step_p=20 > here. We could do displaced stepping for targets support software=20 > single step, and we could do displaced stepping for HW single step as wel= l. =46rom : > > We still can't use software single-stepping simultaneously in multiple > > threads. Pedro, should we fix that or always use displaced stepping > > for now? >=20 > It would be nice to have that fixed, for sure, so yes to the > we should fix that question. However, it seems to me that this > is something that can be worked on mostly independently of the ARM > bits as it's a general software single-step issue, not really ARM > specific. Unless someone wants to (and has time to) tackle it > right now, I'd say go with the always displace-step version. If > nothing else, helps in stressing the displaced stepping > implementation. :-) --=20 Pedro Alves