Date: Sun, 09 Apr 95 20:51:25 GMT From: "gj%pcs.dec.com@inet-gw-1.pa.dec.com" <garyj@rks32.pcs.dec.com> To: current%freebsd.org@inet-gw-1.pa.dec.com Subject: bug in gdb Message-ID: <m0ry3x8-0005OqC@rks32.pcs.dec.com>
next in thread | raw e-mail | index | archive | help
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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0ry3x8-0005OqC>
