From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14214 invoked by alias); 14 Nov 2014 15:54:51 -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 14204 invoked by uid 89); 14 Nov 2014 15:54:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 14 Nov 2014 15:54:49 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAEFskJ6016435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Nov 2014 10:54:46 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAEFsiQC026931; Fri, 14 Nov 2014 10:54:45 -0500 Message-ID: <546625C4.5050007@redhat.com> Date: Fri, 14 Nov 2014 15:54:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Sergio Durigan Junior , GDB Patches CC: Gabriel Krisman Bertazi Subject: Re: [PATCH 3/3] Testcase References: <1415837887-28888-1-git-send-email-sergiodj@redhat.com> <1415837887-28888-4-git-send-email-sergiodj@redhat.com> In-Reply-To: <1415837887-28888-4-git-send-email-sergiodj@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-11/txt/msg00315.txt.bz2 On 11/13/2014 12:18 AM, Sergio Durigan Junior wrote: > This patch implements the testcase for this fix. The test is very > simple: we just have to verify if the syscall number for each > architecture has different meanings. I chose to test i386 and x86_64 > here, but it could be any other architecture supported by the "catch > syscall" command. This only works if the built GDB has these architectures configured in. E.g., an --enable-targets=all build on x86: (gdb) set architecture aarch64 The target architecture is assumed to be aarch64 while on a default x86 build: (gdb) set architecture aarch64 Undefined item: "aarch64". >From that, you can see that: (gdb) set architecture i386 would fail on non-x86 builds that don't include x86 in --enable-targets=foo. > > +proc test_catch_syscall_multi_target {} { Please make this "multi_arch". Let's leave "multi-target" for https://sourceware.org/gdb/wiki/MultiTarget. > + global decimal binfile > + > + with_test_prefix "multiple targets" { > + clean_restart $binfile > + > + gdb_test "set architecture i386" \ > + "The target architecture is assumed to be i386" \ > + "set arch to i386" > + > + gdb_test "catch syscall 1" \ > + "Catchpoint $decimal \\(syscall .exit. \\\[1\\\]\\)" \ > + "insert catch syscall on syscall 1 -- exit on i386" > + > + gdb_test "set architecture i386:x86-64" \ > + "The target architecture is assumed to be i386:x86-64" \ > + "set arch to x86_64" > + > + gdb_test "catch syscall 1" \ > + "Catchpoint $decimal \\(syscall .write. \\\[1\\\]\\)" \ > + "insert catch syscall on syscall 1 -- exit on i386" The "exit on i386" part seems stale here. I think we should do something like this: if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } { set arch1 "i386" set syscall1 "exit" set arch2 "i386:x86-64" set syscall2 "write" } elseif { [istarget "powerpc-*-linux*"] || [istarget "powerpc64-*-linux*"] } { ... } elseif { [istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] } { ... } elseif { [istarget "mips*-linux*"] } { ... } elseif { [istarget "arm*-linux*"] } { ... } elseif { [istarget "s390*-linux*"] } { ... } else { error "please port me" } Thanks, Pedro Alves