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/testsuite ChangeLog README boards/nati ...


CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2013-10-02 11:44:20

Modified files:
	gdb/testsuite  : ChangeLog README 
	gdb/testsuite/boards: native-gdbserver.exp 
	                      native-stdio-gdbserver.exp 
	gdb/testsuite/lib: gdb.exp 

Log message:
	Teach the testsuite that GDBserver reliably reports program exits.
	
	Running catch-syscall.exp against a gdbserver that actually supports
	it, we get:
	
	FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
	FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
	FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
	FAIL: gdb.base/catch-syscall.exp: continue until exit at catch syscall with unused syscall (mlock) (the program exited)
	FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited)
	
	The fail pattern is:
	
	Catchpoint 2 (call to syscall exit_group), 0x000000323d4baa29 in _exit () from /lib64/libc.so.6
	(gdb) PASS: gdb.base/catch-syscall.exp: program has called exit_group
	delete breakpoints
	Delete all breakpoints? (y or n) y
	(gdb) info breakpoints
	No breakpoints or watchpoints.
	(gdb) break exit
	Breakpoint 3 at 0x323d438bf0
	(gdb) continue
	Continuing.
	[Inferior 1 (process 21081) exited normally]
	
	That "break exit" + "continue" comes from:
	
	> # gdb_continue_to_end:
	> #	The case where the target uses stubs has to be handled specially. If a
	> #       stub is used, we set a breakpoint at exit because we cannot rely on
	> #       exit() behavior of a remote target.
	> #
	
	The native-gdbserver.exp board, used to test against gdbserver in
	"target remote" mode, triggers that case ($use_gdb_stub is true).  So
	gdb_continue_to_end doesn't work for catch-syscall.exp as here we
	catch the exit_group and continue from that, expecting to see a real
	program exit.  I was about to post a patch that changes
	catch-syscall.exp to call a new function that just always does what
	gdb_continue_to_end does in the !$use_gdb_stub case.  But, since
	GDBserver doesn't really need this, in the end I thought it better to
	teach the testsuite that there are stubs that know how to report
	program exits, by adding a new "exit_is_reliable" board variable that
	then gdb_continue_to_end checks.
	
	Tested on x86_64 Fedora 17, native and gdbserver.
	
	gdb/testsuite/
	2013-10-02  Pedro Alves  <palves@redhat.com>
	
	* README (Board Settings): Document "exit_is_reliable".
	* lib/gdb.exp (gdb_continue_to_end): Check whether the board says
	running to exit reliably reports program exits.
	* boards/native-gdbserver.exp: Set exit_is_reliable in the board
	info.
	* boards/native-stdio-gdbserver.exp: Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3820&r2=1.3821
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/README.diff?cvsroot=src&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/boards/native-gdbserver.exp.diff?cvsroot=src&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/boards/native-stdio-gdbserver.exp.diff?cvsroot=src&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/lib/gdb.exp.diff?cvsroot=src&r1=1.246&r2=1.247


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