From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1834 invoked by alias); 15 Dec 2013 18:31:04 -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 1823 invoked by uid 89); 15 Dec 2013 18:31:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pb0-f53.google.com Received: from mail-pb0-f53.google.com (HELO mail-pb0-f53.google.com) (209.85.160.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 15 Dec 2013 18:31:03 +0000 Received: by mail-pb0-f53.google.com with SMTP id ma3so4550132pbc.12 for ; Sun, 15 Dec 2013 10:31:01 -0800 (PST) X-Received: by 10.68.130.234 with SMTP id oh10mr15996810pbb.0.1387132261189; Sun, 15 Dec 2013 10:31:01 -0800 (PST) Received: from sspiff.sspiff.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id gg10sm20531788pbc.46.2013.12.15.10.30.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Dec 2013 10:31:00 -0800 (PST) From: Doug Evans To: Sergio Durigan Junior Cc: GDB Patches Subject: Re: [PATCH] Improve and fix catch-syscall.exp References: Date: Sun, 15 Dec 2013 18:31:00 -0000 In-Reply-To: (Sergio Durigan Junior's message of "Fri, 13 Dec 2013 21:05:51 -0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00560.txt.bz2 Sergio Durigan Junior writes: > Hi, > > While fixing another bug, I found that the current > gdb.base/catch-syscall.exp is kind of messy, could use some > improvements, and is not correctly testing some things. > > I've made the following patch to address all the issues I found. On the > organization side, it does a cleanup and removes unecessary imports of > gdb_prompt, uses prepare_for_testing and clean_restart where needed, and > fixes some comments. The testcase was also not correctly testing > catching syscalls using only numbers, or catching many syscalls at > once. I fixed that. This is good because I will soon submit another > patch to fix a bug on catch syscall which will make use of the new > things I've added. > > I tested this on x86_64 Fedora 18, and I'm waiting for machines to test > on PPC and ARM at least, but I checked the syscalls numbers on every > architecture supported by the patch to make sure everything was OK. > > OK to apply? Hi. I was wondering, what if the magic numbers that are the syscall numbers were recorded in the test .c file like: int close_syscall_number = foo; and then have the .exp fetch these values after running-to-main. That would save having to record syscall numbers in the .exp, and all the conditionals to test for the architecture. Not sure there isn't a flaw in this plan, and I guess it's debatable whether it's better to just record the numbers in the .exp or reference the __NR_* numbers from asm/unistd*.h in the .c, but it sounds promising.