This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: patch to infptrace.c


The attached patch changes the ptrace detach call to not perform error handling
when an error occurs in detach.  Without this patch, an error in detach stops gdb
from exiting.  The error keeps returning to the command line over and over again.

I thought I had fixed this earlier by adding a check for errno != ESRCH, but it
appears there are other scenarios that may occur.

Ok to commit?

-- Jeff J.

2003-05-21 Jeff Johnston <jjohnstn@redhat.com>

	* infptrace.c (detach): Call print_sys_errmsg when an error occurs
	instead of perror_with_name.
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.25
diff -u -p -r1.25 infptrace.c
--- infptrace.c	8 May 2003 20:52:47 -0000	1.25
+++ infptrace.c	21 May 2003 21:39:56 -0000
@@ -302,7 +302,7 @@ detach (int signal)
   ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1,
           signal);
   if (errno && errno != ESRCH)
-    perror_with_name ("ptrace");
+    print_sys_errmsg ("ptrace", errno);
   attach_flag = 0;
 }
 #endif /* ATTACH_DETACH */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]