From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101927 invoked by alias); 29 Mar 2016 23:49:40 -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 101910 invoked by uid 89); 29 Mar 2016 23:49:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=objection, news X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 29 Mar 2016 23:49:29 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D565B627D8; Tue, 29 Mar 2016 23:49:27 +0000 (UTC) Received: from [10.3.113.65] (ovpn-113-65.phx2.redhat.com [10.3.113.65]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2TNnQG1024873; Tue, 29 Mar 2016 19:49:26 -0400 Subject: Re: [PATCH v4] Implement 'catch syscall' for gdbserver To: Yao Qi References: <1449196006-13759-2-git-send-email-jistone@redhat.com> <1452308954-13679-1-git-send-email-jistone@redhat.com> <5694EC0E.2080904@redhat.com> <56954F8C.6010100@redhat.com> <56955283.1060502@redhat.com> <56955B84.7050905@redhat.com> <86mvphs6kv.fsf@gmail.com> <56FAC588.6060200@redhat.com> Cc: Pedro Alves , gdb-patches@sourceware.org, philippe.waroquiers@skynet.be, sergiodj@redhat.com, eliz@gnu.org, xdje42@gmail.com, scox@redhat.com From: Josh Stone Message-ID: <56FB1486.60208@redhat.com> Date: Tue, 29 Mar 2016 23:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <56FAC588.6060200@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-03/txt/msg00546.txt.bz2 On 03/29/2016 11:12 AM, Josh Stone wrote: > On 03/29/2016 07:26 AM, Yao Qi wrote: >> Hi Josh, >> This commit causes some fails on s39x, and ppc, as shown in buildbot. I >> saw them in aarch64 test as well. Could you take a look? >> >> https://sourceware.org/ml/gdb-testers/2016-q1/msg01544.html >> https://sourceware.org/ml/gdb-testers/2016-q1/msg01601.html > > Hmm. That new test is meant to make sure that the syscall entry/return > state is not lost across an execve. In the failure I knew, the execve > return was interpreted as an additional syscall entry. But in the cases > you've shown, it didn't catch syscall return from execve at all! > > I will investigate more... So, it seems those architectures don't preserve their original syscall numbers across an execve. $ gdb -ex 'catch syscall execve' -ex 'run' -ex 'catch syscall' \ -ex 'continue' --args sh -c /bin/true PPC64 and Aarch64 both read their syscall numbers from registers, and here they both get 0 ("restart_syscall" and "io_setup" respectively). S390X tries to decode it from the SVC instruction at PC-2, which will definitely fail after an execve -- gdb reports syscall -1. So when the catchpoint is only for execve, they continue past this one since the number doesn't look like execve. The good news is that all three do call it a syscall *return*, which was the main point of this particular test. If there's no objection, I can try to update the test to work more like my command above, matching any syscall at all on the return side of execve.