From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20948 invoked by alias); 9 Jun 2011 13:25:16 -0000 Received: (qmail 20938 invoked by uid 22791); 9 Jun 2011 13:25:15 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_XF,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Jun 2011 13:24:55 +0000 Received: (qmail 12427 invoked from network); 9 Jun 2011 13:24:53 -0000 Received: from unknown (HELO ?192.168.0.102?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Jun 2011 13:24:53 -0000 Message-ID: <4DF0C99C.30703@codesourcery.com> Date: Thu, 09 Jun 2011 13:25:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pedro Alves CC: gdb-patches@sourceware.org, Mark Kettenis Subject: Re: [patch, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGILL References: <4DF09229.4070704@codesourcery.com> <201106091117.p59BHRWi025356@glazunov.sibelius.xs4all.nl> <201106091241.19314.pedro@codesourcery.com> In-Reply-To: <201106091241.19314.pedro@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2011-06/txt/msg00130.txt.bz2 On 06/09/2011 07:41 PM, Pedro Alves wrote: > On Thursday 09 June 2011 12:17:27, Mark Kettenis wrote: >>> Date: Thu, 09 Jun 2011 17:28:09 +0800 >>> From: Yao Qi >>> >>> In current gdb.base/savedregs.exp, signal handler is installed for >>> signal SIGSEGV, and SIGSEGV is trigger by `*(char *)0 = 0;'. However, >>> on non-mmu uclinux system, writing to an address 0x0 doesn't trigger >>> SIGSEGV. >>> >>> In my patch, SIGILL is chosen to replace SIGSEGV. One assumption here >>> is that 0xffff is an invalid instruction on all ports. >> >> Please don't do this. You're changing the test significantly. And >> there is no guarantee that 0xffff is an invalid instruction. Heck >> most platforms don't even have 16-bit instructions. > > If backtracing through 0 is important to this test (haven't looked), > and replacing the write to 0 by raise(SIGSEGV) won't cut it, > then you can use the same trick sigbpt.exp, signest.exp, signull.exp > use to skip the test on targets without an MMU. > Pedro, Thanks for this trick, which I don't know before. SIGSEGV usage in savedregs.exp is a little bit different from them. In savedregs.exp, SIGSEGV is used to trigger invocation of signal handler, and check registers contents in signal trampoline frame. If my understand is correct, I can't see any reason that we can't replace SIGSEGV by SIGILL, or other signal. Of course, we can skip savedregs.exp with the same trick, but it is imperfect that we skip a test which can be run naturally. -- Yao (齐尧)