From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27358 invoked by alias); 16 Dec 2013 04:24:25 -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 27228 invoked by uid 89); 16 Dec 2013 04:24:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 ESMTP; Mon, 16 Dec 2013 04:24:23 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBG4OLQH001232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 15 Dec 2013 23:24:21 -0500 Received: from psique (ovpn-113-60.phx2.redhat.com [10.3.113.60]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBG4OJaL023784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 15 Dec 2013 23:24:20 -0500 From: Sergio Durigan Junior To: Doug Evans Cc: GDB Patches Subject: Re: [PATCH] Improve and fix catch-syscall.exp References: X-URL: http://www.redhat.com Date: Mon, 16 Dec 2013 04:24:00 -0000 In-Reply-To: (Doug Evans's message of "Sun, 15 Dec 2013 10:44:40 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00564.txt.bz2 On Sunday, December 15 2013, Doug Evans wrote: > Alternatively, gdb knows the numbers. IWBN to provide a way to print > them, and then the .exp file could get the numbers from that. > OTOH, one could just have the .exp do the catch and process the output > to get the number. > > (gdb) catch syscall 6 > Catchpoint 2 (syscall 'close' [6]) > (gdb) catch syscall close > Catchpoint 1 (syscall 'close' [6]) Yes, it can be done. But testing for the correctness of this number is also part of the test, IMO... > One might even check the .c __NR_ value with gdb's value computed from > the .exp for extra paranoid testing, but I'm guessing there's > insufficient benefit. ... and maybe it isn't an insufficient benefit. I mean, currently "catch syscall" works on the host only, but it's being implemented in gdbserver and eventually I guess it'll be a good idea to really check those numbers against the hard-coded ones. Currently, they are hard-coded in the .exp file, but as you said, one could check the __NR_* value too... Anyway, just my opinion of why we should keep those numbers hard-coded somewhere. -- Sergio