From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14912 invoked by alias); 2 Nov 2012 19:02:17 -0000 Received: (qmail 14904 invoked by uid 22791); 2 Nov 2012 19:02:16 -0000 X-SWARE-Spam-Status: No, hits=-7.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Nov 2012 19:02:06 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA2J26sL024180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Nov 2012 15:02:06 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qA2J25I5008841; Fri, 2 Nov 2012 15:02:05 -0400 Message-ID: <509418AC.2060404@redhat.com> Date: Fri, 02 Nov 2012 19:02:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: RFC: handle new NT_SIGINFO note in gdb References: <878vanyj3k.fsf__16012.8015945249$1351617533$gmane$org@fleche.redhat.com> <87d2zxrvuw.fsf@fleche.redhat.com> <87390rq319.fsf@fleche.redhat.com> In-Reply-To: <87390rq319.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-11/txt/msg00068.txt.bz2 Looks mostly good to me. Thanks. On 11/02/2012 06:21 PM, Tom Tromey wrote:> +gdb_test "thread 1" ".*" > +# siginfo is available here -- it shows SIGSTOP -- so we test to make > +# sure that we have a different signal from the SEGV thread. > +gdb_test "p \$_siginfo.si_signo == $ssi_errno" " = 0" \ > + "test signal in main thread" I think here should be $ssi_signo, not $ssi_errno. > + # The signalled thread always shows up as thread 1. > + gdb_test "thread 2" ".*" "switch threads with core file" > + gdb_test "p \$_siginfo.si_signo == $ssi_errno" " = 0" \ > + "test signal in main thread with core file" Ditto. > + # The signalled thread always shows up as thread 1. > + gdb_test "thread 2" ".*" "switch threads with core file" Note this is actually more of an accident than GDB making sure that always happens. GDB makes no effort to make sure the the signaled thread is the first dumped thread. GDB's internal thread list is ordered newer->older, and since thread 2 is the one that crashes, and is the newest, that thread ends up appearing first in the core, and hence when gdb loads the core, it ends up as selected thread. If it was thread 1 that crashed, thread 2 in the running program would still end up as thread 1 in the core. (It just tried that, with a pristine mainline). -- Pedro Alves