From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98761 invoked by alias); 19 Sep 2015 00:28:33 -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 98751 invoked by uid 89); 19 Sep 2015 00:28:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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; Sat, 19 Sep 2015 00:28:31 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 8D97E5BA3D; Sat, 19 Sep 2015 00:28:30 +0000 (UTC) Received: from [10.3.113.21] (ovpn-113-21.phx2.redhat.com [10.3.113.21]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8J0STD4018947; Fri, 18 Sep 2015 20:28:29 -0400 Subject: Re: [RFC] reviving 'catch syscall' for gdbserver To: Sergio Durigan Junior References: <55F3838A.4010005@redhat.com> <87vbbgpe1u.fsf@redhat.com> Cc: gdb-patches@sourceware.org, philippe.waroquiers@skynet.be, palves@redhat.com From: Josh Stone Message-ID: <55FCAC2D.8070905@redhat.com> Date: Sat, 19 Sep 2015 00:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <87vbbgpe1u.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-09/txt/msg00486.txt.bz2 On 09/11/2015 07:27 PM, Sergio Durigan Junior wrote: > Hi Josh, > > First of all, thanks for the patch and for reviving. This e-mail is not > really an in-depth reply; just a few things I would like to mention from > the top of my head. Thanks! >>> * QCatchSyscalls contains target specific numbers (this is the >>> above comment) >>> => have gdbserver handling QCatchSyscalls packet per inferior >> >> Does this still need to be per-inferior? I do understand that syscall >> numbers may differ, e.g. from i686 to x86_64 on the same target. Are >> there any other examples of such things that are dealt with separately? > > I pushed: > > > > (discussion: ) > > meanwhile, which should help address this issue (though it doesn't fix > the whole problem). You might be interested in reading > https://sourceware.org/bugzilla/show_bug.cgi?id=10737 as well. AIUI, you made the syscall tables per-arch, which is certainly good. But what happens when there are multiple inferiors of different archs? Are the syscall catchpoints per-inferior? It occurred to me that exec switching archs would be a problem, which Pedro also mentioned in PR10737#c5. So either gdbserver needs to be told syscalls by name, and remap them on exec, or the client needs an exec event so it can update a new QCatchSyscalls set itself. I suppose the client could catch the exec syscall directly, but surely it would be better to have a event based on PTRACE_EVENT_EXEC. Something to add in the style of fork-event?