From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15608 invoked by alias); 25 Feb 2003 19:40:11 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15596 invoked from network); 25 Feb 2003 19:40:10 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 25 Feb 2003 19:40:10 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 0A5908001BC; Tue, 25 Feb 2003 14:40:10 -0500 (EST) Message-ID: <3E5BC699.4090404@redhat.com> Date: Tue, 25 Feb 2003 19:40:00 -0000 From: "J. Johnston" Organization: Red Hat Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: infptrace fix References: <3E5AAB5F.1070408@redhat.com> <1030225001024.ZM8081@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00650.txt.bz2 Kevin Buettner wrote: > On Feb 24, 6:31pm, J. Johnston wrote: > > >>The following patch fixes a problem on linux regarding attached >>processes. When gdb quits, it goes to detach the process. If the >>process has already been killed, the ptrace detach call sets errno. >>This causes infptrace.c: detach() to issue a perror_with_name() >>call which eventually gets caught and the user is returned to the >>gdb prompt. If we try and quit again, we go through the same >>sequence and so on and so on. >> >>The patch recognizes if errno is set to ESRCH, indicating that the >>process cannot be found which is ok and should not result in an >>error being flagged. >> >>Ok to install? >> >> >>-- Jeff J. >> >>2003-02-24 Jeff Johnston >> >> * infptrace.c (detach): Do not flag error if ptrace detach fails and >> errno is set to ESRCH. > > > This is okay. > > (For other errors during detach, I wonder if it'd make sense to just > issue a warning which decodes the errno...) > Thanks Kevin. Patch applied. I also wondered if a warning should be issued but I do not know what other errors can occur with the detach operation. I also considered moving the attached_flag reset to before the error check so at least we didn't come back to detach it again and again. -- Jeff J.