From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41719 invoked by alias); 30 Mar 2016 12:23:27 -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 41703 invoked by uid 89); 30 Mar 2016 12:23:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=jistone@redhat.com, jistoneredhatcom X-HELO: mail-pf0-f182.google.com Received: from mail-pf0-f182.google.com (HELO mail-pf0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 30 Mar 2016 12:23:20 +0000 Received: by mail-pf0-f182.google.com with SMTP id e128so20504550pfe.3 for ; Wed, 30 Mar 2016 05:23:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Es9Q7kOj0neuwp0EmG6hVtRbsHEQuI/TvQotoeoeKKg=; b=LT/CvopOBCEmUd7N6WpJ/NdotYPqFzODFwn+Dlnhhg/06BU6rPxKsw0lVaWK6TyCfN RjBPu75hCRi1lljPWk5I7rm0qQdblB1kOCrqjmPJidboKKDiscUxGxezl+UndHDYAWFA 0tPOhm0ou9b1vwL2R2wNDcJgNWobm7xMP/10hnBJ6557NAfiZ4N2gsV1pTzDzmSVyh0w h0wHeK+4BjKo0Nb7UjtSfRwgaYRxgB8M5tpe7gVS4Y/WGtPUpqMyH0CPFPear32NMTnX WOjX9jTSSpdtq58LH/SOXEKcnU9fNBe37E+XdH1tNNICmQt5ZtuxkJUlZ4+UCcn1Hgsr DjRw== X-Gm-Message-State: AD7BkJIQFp5qVfRXNQUJxNfnQajwHm4tFGDrr26y3Jl1k6dKtc6C0cqHw7i5quA9DEcyyA== X-Received: by 10.98.71.91 with SMTP id u88mr12645021pfa.161.1459340598374; Wed, 30 Mar 2016 05:23:18 -0700 (PDT) Received: from E107787-LIN (power-aix.osuosl.org. [140.211.15.154]) by smtp.gmail.com with ESMTPSA id u21sm5687737pfa.60.2016.03.30.05.23.14 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 30 Mar 2016 05:23:17 -0700 (PDT) From: Yao Qi To: Josh Stone Cc: Yao Qi , Pedro Alves , gdb-patches@sourceware.org, philippe.waroquiers@skynet.be, sergiodj@redhat.com, eliz@gnu.org, xdje42@gmail.com, scox@redhat.com Subject: Re: [PATCH v4] Implement 'catch syscall' for gdbserver 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> <56FB1486.60208@redhat.com> Date: Wed, 30 Mar 2016 12:23:00 -0000 In-Reply-To: <56FB1486.60208@redhat.com> (Josh Stone's message of "Tue, 29 Mar 2016 16:49:26 -0700") Message-ID: <86io04rw7k.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: 2016-03/txt/msg00559.txt.bz2 Josh Stone writes: Hi Josh, Thanks for the looking into this... > 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. I think it reveals a bug on getting syscall number. If the register having syscall number isn't preserved across the syscall, GDB should read syscall number somewhere else. > > 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. --=20 Yao (=E9=BD=90=E5=B0=A7)