From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122012 invoked by alias); 8 May 2015 14:40:15 -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 121999 invoked by uid 89); 8 May 2015 14:40:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 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, 08 May 2015 14:40:14 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id CA226B8130; Fri, 8 May 2015 14:40:12 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t48Ee8iQ006530; Fri, 8 May 2015 10:40:10 -0400 Message-ID: <554CCAC8.7080209@redhat.com> Date: Fri, 08 May 2015 14:40: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: Luis Machado , Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code References: <1429889336-12277-1-git-send-email-qiyaoltc@gmail.com> <554A3D61.8090302@redhat.com> <554A44B9.3090503@codesourcery.com> <86sib8vjtv.fsf@gmail.com> <554B4223.1000003@codesourcery.com> <554B702F.5090006@codesourcery.com> In-Reply-To: <554B702F.5090006@codesourcery.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-05/txt/msg00197.txt.bz2 On 05/07/2015 03:01 PM, Luis Machado wrote: > On 05/07/2015 07:44 AM, Luis Machado wrote: >> On 05/07/2015 06:05 AM, Yao Qi wrote: >>> Luis Machado writes: >>> >>>>>> -# Get the inferior's PID. >>>>>> -set infpid "" >>>>>> gdb_test_multiple "info inferiors" "getting inferior pid" { >>>>>> - -re "process \($decimal\).*\r\n$gdb_prompt $" { >>>>>> - set infpid $expect_out(1,string) >>>>>> + -re "process $decimal.*\r\n$gdb_prompt $" { >>>>>> } >>>>>> -re "Remote target.*$gdb_prompt $" { >>>>>> # If the target does not provide PID information (like >>>>>> usermode QEMU), >>>>> >>>>> This "If the target does not provide PID information" check sounds >>>>> odd now. Do we still need it? >>>> >>>> If we're not dealing with PID's, i don't think so. >>> >>> At the very start, I removed this block, but I recall that this block is >>> used as a guard for usermode QEMU which doesn't provide PID >>> information. With this patch applied, we'll access >>> /proc/self/coredump_filter, but I am afraid it doesn't work as expected >>> on usermode QEMU, because usermode QEMU just intercepts few /proc >>> accesses and pass most of them through the host linux. Accessing >>> /proc/QEMU_PID/coredump_filter isn't what we want in this test, so I >>> think it's better to skip the test for usermode QEMU. >>> >>> Of course, I don't mind removing this block. Luis, could you try this >>> patch and remove this block, see whether it causes fails on usermode >>> QEMU? >>> >> >> Yeah, that sounds problematic. I'll give it a try and will let you know. > > Removing that conditional block i get 14 FAIL's, so it doesn't look like > this test is suited for usermode QEMU. But what does gdb.log show? With usermode QEMU, the program and qemu are the same process, thus have the same PID. I just tried loading up the test's probably (manually compiled) under F20's qemu-arm, generating a core with gcore, and then loading the core back into gdb, which worked. I didn't test beyond that as I don't have a usermode qemu board file handy (it'd be nice to have one in testsuite/boards/). I'm not immediately seeing the fundamental reason this shouldn't have worked, and we may be hiding a bug instead. Thanks, Pedro Alves