Commit Graph

96990 Commits

Author SHA1 Message Date
GDB Administrator
e9ddef0e66 Automatic date update in version.in 2019-09-06 00:01:07 +00:00
GDB Administrator
30f2a435e5 Automatic date update in version.in 2019-09-05 00:01:35 +00:00
GDB Administrator
af6b62c780 Automatic date update in version.in 2019-09-04 00:01:39 +00:00
GDB Administrator
ed14c4a538 Automatic date update in version.in 2019-09-03 00:01:05 +00:00
GDB Administrator
33ffb2c1b5 Automatic date update in version.in 2019-09-02 00:01:01 +00:00
GDB Administrator
0a4c3bdb1a Automatic date update in version.in 2019-09-01 00:01:33 +00:00
GDB Administrator
790ea6e3b3 Automatic date update in version.in 2019-08-31 00:01:45 +00:00
GDB Administrator
188e561c21 Automatic date update in version.in 2019-08-30 00:01:10 +00:00
GDB Administrator
061ca9bbc1 Automatic date update in version.in 2019-08-29 00:00:59 +00:00
GDB Administrator
607a69b8b0 Automatic date update in version.in 2019-08-28 00:01:25 +00:00
GDB Administrator
4ee05fb967 Automatic date update in version.in 2019-08-27 00:01:31 +00:00
GDB Administrator
69e0be31ee Automatic date update in version.in 2019-08-26 00:01:39 +00:00
GDB Administrator
3b5beecae9 Automatic date update in version.in 2019-08-25 00:02:21 +00:00
GDB Administrator
11e76e8d01 Automatic date update in version.in 2019-08-24 00:01:41 +00:00
GDB Administrator
727aef8153 Automatic date update in version.in 2019-08-23 00:01:48 +00:00
GDB Administrator
cf1bc0cd80 Automatic date update in version.in 2019-08-22 00:01:18 +00:00
GDB Administrator
e967953e28 Automatic date update in version.in 2019-08-21 00:00:52 +00:00
GDB Administrator
908db690e8 Automatic date update in version.in 2019-08-20 00:01:01 +00:00
GDB Administrator
e13a1a16d5 Automatic date update in version.in 2019-08-19 00:01:58 +00:00
GDB Administrator
f36c866169 Automatic date update in version.in 2019-08-18 00:02:23 +00:00
GDB Administrator
e853d5bce5 Automatic date update in version.in 2019-08-17 00:01:01 +00:00
GDB Administrator
55f04e741e Automatic date update in version.in 2019-08-16 00:00:56 +00:00
Tom de Vries
ee479c89ed [gdb] Handle vfork in thread with follow-fork-mode child
[ Backport of master commit b73715df01. ]

When debugging any of the testcases added by this commit, which do a
vfork in a thread with "set follow-fork-mode child" + "set
detach-on-fork on", we run into this assertion:

...
src/gdb/nat/x86-linux-dregs.c:146: internal-error: \
  void x86_linux_update_debug_registers(lwp_info*): \
  Assertion `lwp_is_stopped (lwp)' failed.
...

The assert is caused by the following: the vfork-child exit or exec
event is handled by handle_vfork_child_exec_or_exit, which calls
target_detach to detach from the vfork parent.  During target_detach
we call linux_nat_target::detach, which:

However, during the second step we run into this code in
stop_wait_callback:

...
  /* If this is a vfork parent, bail out, it is not going to report
     any SIGSTOP until the vfork is done with.  */
  if (inf->vfork_child != NULL)
    return 0;
...

and we don't wait for the threads to be stopped, which results in this
assert in x86_linux_update_debug_registers triggering during the third
step:

...
  gdb_assert (lwp_is_stopped (lwp));
...

The fix is to reset the vfork parent's vfork_child field before
calling target_detach in handle_vfork_child_exec_or_exit.  There's
already similar code for the other paths handled by
handle_vfork_child_exec_or_exit, so this commit refactors the code a
bit so that all paths share the same code.

The new tests cover both a vfork child exiting, and a vfork child
execing, since both cases would trigger the assertion.

The new testcases also exercise following the vfork children with "set
detach-on-fork off", since it doesn't seem to be tested anywhere.

Tested on x86_64-linux, using native and native-gdbserver.

gdb/ChangeLog:
2019-04-18  Tom de Vries  <tdevries@suse.de>
	    Pedro Alves  <palves@redhat.com>

	PR gdb/24454
	* infrun.c (handle_vfork_child_exec_or_exit): Reset vfork parent's
	vfork_child field before calling target_detach.

gdb/testsuite/ChangeLog:
2019-04-18  Tom de Vries  <tdevries@suse.de>
	    Pedro Alves  <palves@redhat.com>

	PR gdb/24454
	* gdb.threads/vfork-follow-child-exec.c: New file.
	* gdb.threads/vfork-follow-child-exec.exp: New file.
	* gdb.threads/vfork-follow-child-exit.c: New file.
	* gdb.threads/vfork-follow-child-exit.exp: New file.
2019-08-16 00:31:48 +02:00
GDB Administrator
cfa3fa0f41 Automatic date update in version.in 2019-08-15 00:01:13 +00:00
GDB Administrator
5302b8b344 Automatic date update in version.in 2019-08-14 00:01:04 +00:00
GDB Administrator
0a04b387e6 Automatic date update in version.in 2019-08-13 00:01:06 +00:00
GDB Administrator
8d597d0217 Automatic date update in version.in 2019-08-12 00:00:59 +00:00
GDB Administrator
15a7492a25 Automatic date update in version.in 2019-08-11 00:01:39 +00:00
GDB Administrator
5a627de47b Automatic date update in version.in 2019-08-10 00:00:58 +00:00
GDB Administrator
e80cd22e7e Automatic date update in version.in 2019-08-09 00:00:56 +00:00
GDB Administrator
d8a5975817 Automatic date update in version.in 2019-08-08 00:01:41 +00:00
Alan Hayward
8ac39635f6 Suppress SIGTTOU when handling errors
[ Backport of commit 766f883622. ]

Calls to error () can cause SIGTTOU to send gdb to the background.

For example, on an Arm build:
  (gdb) b main
  Breakpoint 1 at 0x10774: file /build/gdb/testsuite/../../../src/binutils-gdb/gdb/testsuite/gdb.base/watchpoint.c, line 174.
  (gdb) r
  Starting program: /build/gdb/testsuite/outputs/gdb.base/watchpoint/watchpoint

  [1]+  Stopped                 ../gdb ./outputs/gdb.base/watchpoint/watchpoint
  localhost$ fg
  ../gdb ./outputs/gdb.base/watchpoint/watchpoint
  Cannot parse expression `.L1199 4@r4'.
  warning: Probes-based dynamic linker interface failed.
  Reverting to original interface.

The SIGTTOU is raised whilst inside a syscall during the call to tcdrain.
Fix is to use scoped_ignore_sigttou to ensure SIGTTOU is blocked.

In addition fix include comments - job_control is not included via terminal.h

gdb/ChangeLog:

	* event-top.c: Remove include comment.
	* inflow.c (class scoped_ignore_sigttou): Move from here...
	* inflow.h (class scoped_ignore_sigttou): ...to here.
	* ser-unix.c (hardwire_drain_output): Block SIGTTOU during drain.
	* top.c:  Remove include comment.
2019-08-07 18:23:49 +02:00
Alan Hayward
7e38ddcb2e Fix breakpoints on file reloads for PIE binaries
[ Backport of master commit ea142fbfc9. ]

When a binary is built using PIE, reloading the file will cause GDB to error
on restart.  For example:
gdb ./a.out
(gdb) break main
(gdb) run
(gdb) file ./a.out
(gdb) continue

Will cause GDB to error with:
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x9e0
Command aborted.

This is due to the symbol offsets not being relocated after reloading the file.

Fix is to ensure solib_create_inferior_hook is called, in the same manner as
infrun.c:follow_exec().

Expand the idempotent test to cover PIE scenarios.

gdb/ChangeLog:

	* symfile.c (symbol_file_command): Call solib_create_inferior_hook.

gdb/testsuite/ChangeLog:

	* gdb.base/break-idempotent.exp: Test both PIE and non PIE.
2019-08-07 18:23:49 +02:00
Alan Hayward
3b752ac2e6 Testsuite: Ensure pie is disabled on some tests
[ Backport of master commit 968aa7ae38. ]

Recent versions of Ubuntu and Debian default GCC to enable pie.

In dump.exp, pie will causes addresses to be out of range for IHEX.

In break-interp.exp, pie is explicitly set for some tests and assumed
to be disabled for the remainder.

Ensure pie is disabled for these tests when required.

In addition, add a pie option to gdb_compile to match the nopie option
and simplify use.

gdb/testsuite/ChangeLog:

	* README: Add pie options.
	* gdb.base/break-interp.exp: Ensure pie is disabled.
	* gdb.base/dump.exp: Likewise.
	* lib/gdb.exp (gdb_compile): Add pie option.
2019-08-07 18:23:49 +02:00
GDB Administrator
dc5626e838 Automatic date update in version.in 2019-08-07 00:02:26 +00:00
GDB Administrator
40bfdfcd1a Automatic date update in version.in 2019-08-06 00:01:00 +00:00
GDB Administrator
b05a7d75b2 Automatic date update in version.in 2019-08-05 00:00:56 +00:00
GDB Administrator
4de38a3a76 Automatic date update in version.in 2019-08-04 00:01:40 +00:00
Tom Tromey
15522b80c9 Fix buglet in cp_print_value_fields patch
[ Backport of master commit 3d507ff23b. ]

Pedro pointed out an issue in the cp_print_value_fields
patch, aka the fix for PR c++/20020.

This patch addresses the issue.  Tested on x86-64 Fedora 29.

gdb/testsuite/ChangeLog
2019-06-27  Tom Tromey  <tromey@adacore.com>

	* gdb.cp/constexpr-field.exp: Use setup_xfail.
2019-08-03 09:42:28 +02:00
Tom Tromey
98c90f8028 Fix crash in cp_print_value_fields
[ Backport of master commit 4330d61dfb. ]

PR c++/20020 concerns a crash in cp_print_value_fields.  The immediate
cause is that cp_print_value_fields does not handle the case where
value_static_field fails.  This is fixed in this patch by calling
cp_print_static_field from the "try" block.

Digging a bit deeper, the error occurs because GCC does not emit a
DW_AT_const_value for a static constexpr member appearing in a
template class.  I've filed a GCC bug for this.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	PR c++/20020:
	* cp-valprint.c (cp_print_value_fields): Call
	cp_print_static_field inside "try".

gdb/testsuite/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	PR c++/20020:
	* gdb.cp/constexpr-field.exp: New file.
	* gdb.cp/constexpr-field.cc: New file.
2019-08-03 09:42:28 +02:00
GDB Administrator
0bcd30db25 Automatic date update in version.in 2019-08-03 00:00:52 +00:00
GDB Administrator
e758a22f82 Automatic date update in version.in 2019-08-02 00:01:43 +00:00
GDB Administrator
121fe927df Automatic date update in version.in 2019-08-01 00:00:56 +00:00
GDB Administrator
05e432469a Automatic date update in version.in 2019-07-31 00:01:59 +00:00
GDB Administrator
708c7c8ea3 Automatic date update in version.in 2019-07-30 00:01:00 +00:00
GDB Administrator
9c3b4a444a Automatic date update in version.in 2019-07-29 00:00:56 +00:00
GDB Administrator
b93a00ca4d Automatic date update in version.in 2019-07-28 00:02:26 +00:00
GDB Administrator
746dfd243d Automatic date update in version.in 2019-07-27 00:00:58 +00:00
GDB Administrator
8b6767f3b7 Automatic date update in version.in 2019-07-26 00:01:06 +00:00
GDB Administrator
a5eb8e13d5 Automatic date update in version.in 2019-07-25 00:01:06 +00:00