From owner-freebsd-current Sun Apr 9 13:55:28 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id NAA02519 for current-outgoing; Sun, 9 Apr 1995 13:55:28 -0700 Received: from inet-gw-1.pa.dec.com (inet-gw-1.pa.dec.com [16.1.0.22]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id NAA02512 for ; Sun, 9 Apr 1995 13:55:22 -0700 Received: from rks32.pcs.dec.com by inet-gw-1.pa.dec.com (5.65/24Feb95) id AA03766; Sun, 9 Apr 95 13:53:53 -0700 Received: by rks32.pcs.dec.com (Smail3.1.27.1 #16) id m0ry3x8-0005OqC; Sun, 9 Apr 95 22:51 MSZ Message-Id: To: current%freebsd.org@inet-gw-1.pa.dec.com Subject: bug in gdb Reply-To: gj@FreeBSD.org Date: Sun, 09 Apr 95 20:51:25 GMT From: "gj%pcs.dec.com@inet-gw-1.pa.dec.com" Sender: current-owner@FreeBSD.org Precedence: bulk as Thomas Graichen recently wrote in private mail: > * the gdb-4.13 of current (compiled and used under 2.0R) can not attach to my > own processes (it works only then i'm root - else i get open failed - for my > own processes) how embarassing ! This turns out to be a bug in infptrace.c. Below is a patch. Could some kind soul apply it ? Gary J. ------------------------------ SNIP ------------------------------------- *** infptrace.c.orig Tue Mar 28 16:37:49 1995 --- infptrace.c Sun Apr 9 22:41:08 1995 *************** *** 175,181 **** int fd; sprintf(procfile, "/proc/%d/ctl", pid); ! fd = open(procfile, O_RDWR, 0); if (fd < 0) { perror_with_name ("open"); --- 175,181 ---- int fd; sprintf(procfile, "/proc/%d/ctl", pid); ! fd = open(procfile, O_WRONLY, 0); if (fd < 0) { perror_with_name ("open"); *************** *** 217,223 **** int fd; sprintf(procfile, "/proc/%d/ctl", inferior_pid); ! fd = open(procfile, O_RDWR, 0); if (fd < 0) { perror_with_name ("open"); --- 217,223 ---- int fd; sprintf(procfile, "/proc/%d/ctl", inferior_pid); ! fd = open(procfile, O_WRONLY, 0); if (fd < 0) { perror_with_name ("open");