From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10294 invoked by alias); 15 Nov 2012 10:36:41 -0000 Received: (qmail 10286 invoked by uid 22791); 15 Nov 2012 10:36:41 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,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; Thu, 15 Nov 2012 10:36:32 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAFAaU8W027244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Nov 2012 05:36:30 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qAFAaQcV010433; Thu, 15 Nov 2012 05:36:27 -0500 Message-ID: <50A4C5AA.70304@redhat.com> Date: Thu, 15 Nov 2012 10:36:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 MIME-Version: 1.0 To: John Gilmore CC: Mark Kettenis , brobecker@adacore.com, gdb@sourceware.org Subject: Re: Time to expand "Program received signal" ? References: <50A13A4E.3020000@redhat.com> <20121113162530.GX4847@adacore.com> <201211131640.qADGeKhs021376@glazunov.sibelius.xs4all.nl> <50A281BC.9030802@redhat.com> <201211132240.qADMeB2N032392@new.toad.com> <50A371C6.3080307@redhat.com> <201211141954.qAEJsQ2N026469@new.toad.com> In-Reply-To: <201211141954.qAEJsQ2N026469@new.toad.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00031.txt.bz2 On 14-11-2012 19:54, John Gilmore wrote: >>> GDB shouldn't mention threads at all, unless the program being debugged >>> is multi-threaded. >> >> Since 7.0 GDB models non-threaded programs as single threaded. > > OK, then, you can call it what you want. I call it what it is. GDB shouldn't mention > threads at all, unless the program being debugged has more than a > single thread. See? If it has a single thread, GDB calls that thread "thread 1". > Printing a thread identifier is extraneous information that the user > will just have to skip over to get to the real information (that their > program got a signal). You're making things more complicated than they are. There's nothing to skip over. GDB's model calls the unit of scheduling in the inferior that got the signal "Thread N". You can "thread N" to switch to it. (gdb) maint print target-stack The current target stack is: - child (Unix child process) - exec (Local exec file) - None (None) (gdb) info threads Id Target Id Frame * 1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89 (gdb) clone-inferior Added inferior 2. (gdb) info inferiors Num Description Executable 2 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break * 1 process 9939 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break (gdb) info threads Id Target Id Frame * 1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89 (gdb) inferior 2 [Switching to inferior 2 [] (/home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break)] (gdb) start Temporary breakpoint 2 at 0x4006bf: main. (2 locations) Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break Temporary breakpoint 2, main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89 89 if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */ (gdb) info inferiors Num Description Executable * 2 process 9943 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break 1 process 9939 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break (gdb) info threads Id Target Id Frame * 2 process 9943 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89 1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89 (gdb) -- Pedro Alves