From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7551 invoked by alias); 24 Feb 2003 23:31:44 -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 7543 invoked from network); 24 Feb 2003 23:31:43 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 24 Feb 2003 23:31:43 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 2AA5E800049 for ; Mon, 24 Feb 2003 18:31:43 -0500 (EST) Message-ID: <3E5AAB5F.1070408@redhat.com> Date: Mon, 24 Feb 2003 23:31: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: gdb-patches@sources.redhat.com Subject: RFA: infptrace fix Content-Type: multipart/mixed; boundary="------------090500090006030605060604" X-SW-Source: 2003-02/txt/msg00616.txt.bz2 This is a multi-part message in MIME format. --------------090500090006030605060604 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 749 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. --------------090500090006030605060604 Content-Type: text/plain; name="infptrace.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="infptrace.patch" Content-length: 495 Index: infptrace.c =================================================================== RCS file: /cvs/src/src/gdb/infptrace.c,v retrieving revision 1.22 diff -u -r1.22 infptrace.c --- infptrace.c 8 Nov 2002 23:48:38 -0000 1.22 +++ infptrace.c 24 Feb 2003 23:26:22 -0000 @@ -301,7 +301,7 @@ errno = 0; ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1, signal); - if (errno) + if (errno && errno != ESRCH) perror_with_name ("ptrace"); attach_flag = 0; } --------------090500090006030605060604--