From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100893 invoked by alias); 23 May 2015 11:18:19 -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 100883 invoked by uid 89); 23 May 2015 11:18:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no 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; Sat, 23 May 2015 11:18:08 +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 (Postfix) with ESMTPS id BBCE38E3D2; Sat, 23 May 2015 11:18:07 +0000 (UTC) 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 t4NBI5Ki028993; Sat, 23 May 2015 07:18:06 -0400 Message-ID: <556061ED.3050708@redhat.com> Date: Sat, 23 May 2015 11:18:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Don Breazeal , gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] Make remote follow fork 'Detaching' message match native References: <1432320931-1550-1-git-send-email-donb@codesourcery.com> <1432320931-1550-2-git-send-email-donb@codesourcery.com> In-Reply-To: <1432320931-1550-2-git-send-email-donb@codesourcery.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-05/txt/msg00619.txt.bz2 On 05/22/2015 07:55 PM, Don Breazeal wrote: > This patch fixes a couple of failures in gdb.base/foll-vfork.exp for > extended-remote targets. The failures were the result of the > verbose/debug "Detaching..." messages in infrun.c:follow_fork_inferior > not matching what was expected in the extended-remote case. > > The path modifies the ptids used in the messages to ensure that they > print "process nnn" instead of (possibly) "Thread nnn.nnn". ... > The > ptids for the native case are already in this form, so there the > change has no effect. This isn't true. What happens is that linux_nat_pid_to_str gives (pid,pid,0) special treatment: (top-gdb) p ptid $2 = {pid = 14246, lwp = 14246, tid = 0} (top-gdb) bt #0 linux_nat_pid_to_str (ops=0xe357f0, ptid=...) at /home/pedro/gdb/mygit/src/gdb/linux-nat.c:4078 #1 0x0000000000675bb5 in delegate_pid_to_str (self=0xe357f0, arg1=...) at /home/pedro/gdb/mygit/src/gdb/target-delegates.c:1438 #2 0x0000000000682641 in target_pid_to_str (ptid=...) at /home/pedro/gdb/mygit/src/gdb/target.c:2212 #3 0x00000000006245b2 in follow_fork_inferior (follow_child=0, detach_fork=1) at /home/pedro/gdb/mygit/src/gdb/infrun.c:449 #4 0x0000000000624e7e in follow_fork () at /home/pedro/gdb/mygit/src/gdb/infrun.c:722 #5 0x000000000062a531 in handle_inferior_event_1 (ecs=0x7fffffffd180) at /home/pedro/gdb/mygit/src/gdb/infrun.c:4072 > The ptids in the extended-remote case must be > reported by gdbserver in the (pid,pid,0) form in order to later > identify and remove new fork children that are reported prematurely > by remote_update_thread_list. (so this bit is actually irrelevant) > So here we generate process-style ptids > to get identical messages in both native and extended-remote cases. > > OK? Still, detach is a process-wide operation, so this makes sense anyway. OK with commit log fixed. Thanks, Pedro Alves