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/gdbserver ChangeLog server.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2010-07-07 16:14:04

Modified files:
	gdb/gdbserver  : ChangeLog server.c 

Log message:
	[PATCH] Unexpected EOF read from connection with GDB after inferior exits.
	
	This is on GNU/Linux.
	
	GDBserver does not exit properly when the inferior exits, as demonstrated
	with any program using the procedure below:
	
	% gdbserver-head :4444 simple_main
	Process simple_main created; pid = 25681
	Listening on port 4444
	
	Then, in another terminal, start GDB, connect to GDBserver, and run
	the program to completion:
	
	% gdb-head simple_main
	(gdb) tar rem :4444
	(gdb) cont
	Continuing.
	
	Program exited normally.
	
	Going back to the terminal where GDBserver is running, we see the following
	output:
	
	Child exited with status 0
	readchar: Got EOF
	Remote side has terminated connection.  GDBserver will reopen the connection.
	Listening on port 4444
	
	The problem is that we're missing a call to mourn_inferior.  As a result,
	after we've handled the vCont packet, we fail to notice that there are
	no process left to debug (target_running() returns true), and thus try
	to continue reading from the remote socket.  However, since GDB just
	disconnected after having received the "exit with status 0" reply to the
	vCont request, the read triggers the EOF exception.
	
	gdb/gdbserver/ChangeLog:
	
	* server.c (handle_v_cont): Call mourn_inferior if process
	just exited.
	(myresume): Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/ChangeLog.diff?cvsroot=src&r1=1.397&r2=1.398
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/server.c.diff?cvsroot=src&r1=1.124&r2=1.125


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