This is the mail archive of the gdb-cvs@sourceware.org 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]

src/gdb ChangeLog darwin-nat.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2011-07-01 18:36:12

Modified files:
	gdb            : ChangeLog darwin-nat.c 

Log message:
	Darwin/detach: Do not resume inferior after ptrace detach
	
	When trying to detach from an inferior that we start from the debugger,
	GDB prints the following warning:
	
	(gdb) detach
	Detaching from program: /[...]/foo, process 74593
	warning: Mach error at "/[...]/darwin-nat.c:445" in function "darwin_resume_inferior": (os/kern) failure (0x5)
	
	The warning comes from the following code in darwin_detach:
	
	darwin_resume_inferior (inf);
	
	This is because the process has already been resumed by the
	PT_DETACH ptrace operation that has just been performed.
	
	On the other hand, when trying to detach from an inferior that
	was started outside of debugger control (thus after having attached
	the debugger to that inferior), things go smoothly.  That's because
	we don't use ptrace to control the process in that case, and so
	the resume is perfectly justified.
	
	This patch makes sure that we resume the inferior during the detach
	only when we're NOT using ptrace.
	
	gdb/ChangeLog:
	
	* darwin-nat.c (darwin_detach): Call darwin_resume_inferior
	only when inf->private->no_ptrace.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13144&r2=1.13145
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/darwin-nat.c.diff?cvsroot=src&r1=1.24&r2=1.25


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