Commit Graph

4 Commits

Author SHA1 Message Date
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Pedro Alves dedad4e3d2 Unbuffer all tests that rely on stdio
This forces all tests that rely on stdio to be unbuffered, like
interrupt.exp was adjusted in 6f98576f.

To recap, in some scenarios, GDB or GDBserver can be spawned with
input _not_ connected to a tty, and then tests that rely on stdio fail
with timeouts, because the inferior's stdout and stderr streams end up
fully buffered.  Calling gdb_unbuffer_output forces output to be
unbuffered.

See https://sourceware.org/ml/gdb-patches/2015-02/msg00809.html and
https://sourceware.org/ml/gdb-patches/2015-02/msg00819.html.

Tested on x86_64 Fedora 20, native, and against a remote gdbserver
board file that connects to the target with ssh, with and without -t
(create pty).

gdb/testsuite/ChangeLog:
2015-07-29  Pedro Alves  <palves@redhat.com>

	* gdb.base/call-ar-st.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/call-rt-st.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/call-strs.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/call-strs.exp: Adjust to step over the
	gdb_unbuffer_output call.
	* gdb.base/catch-gdb-caused-signals.c: Include
	"../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/dprintf.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/ending-run.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/run.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/shlib-call.exp: Adjust to step over the
	gdb_unbuffer_output call.
	* gdb.base/shmain.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/sizeof.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
	* gdb.base/varargs.c: Include "../lib/unbuffer_output.c".
	(main): Rename to ...
	(test): ... this.
	(main): Reimplement.
	* gdb.base/varargs.exp: Run to test instead of to main.
	* gdb.mi/mi-dprintf.c: Include "../lib/unbuffer_output.c".
	(main): Call gdb_unbuffer_output.
2015-07-29 11:09:45 +01:00
Antoine Tremblay c9587f8823 Fix non executable stack handling when calling functions in the inferior.
When gdb creates a dummy frame to execute a function in the inferior,
the process may generate a SIGSEGV, SIGTRAP or SIGILL because the stack
is non executable. If the signal handler set in gdb has option print
or stop enabled for these signals gdb handles this correctly.

However, in the case of noprint and nostop the signal is short-circuited
and the inferior process is sent the signal directly. This causes the
inferior to crash because of gdb.

This patch adds a check for SIGSEGV, SIGTRAP or SIGILL so that these
signals are sent to gdb rather than short-circuited in the inferior.
gdb then handles them properly and the inferior process does not
crash.

This patch also fixes the same behavior in gdbserver.

Also added a small testcase to test the issue called catch-gdb-caused-signals.

This applies to Linux only, tested on Linux.

gdb/ChangeLog:
	PR breakpoints/16812
	* linux-nat.c (linux_nat_filter_event): Report SIGTRAP,SIGILL,SIGSEGV.
	* nat/linux-ptrace.c (linux_wstatus_maybe_breakpoint): Add.
	* nat/linux-ptrace.h: Add linux_wstatus_maybe_breakpoint.

gdb/gdbserver/ChangeLog:
	PR breakpoints/16812
	* linux-low.c (wstatus_maybe_breakpoint): Remove.
	(linux_low_filter_event): Update wstatus_maybe_breakpoint name.
	(linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.

gdb/testsuite/ChangeLog:
	PR breakpoints/16812
	* gdb.base/catch-gdb-caused-signals.c: New file.
	* gdb.base/catch-gdb-caused-signals.exp: New file.
2015-02-19 11:04:21 -05:00