]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
10 years agoSupport gdbarch_convert_register_p targets in address_from_register gdb-7.8-branch
Michael Eager [Mon, 2 Mar 2015 17:57:14 +0000 (09:57 -0800)] 
Support gdbarch_convert_register_p targets in address_from_register

Since the last change to address_from_register, it no longer supports
targets that require a special conversion (gdbarch_convert_register_p)
for plain pointer type; I had assumed no target does so.

This turned out to be incorrect: MIPS64 n32 big-endian needs such a
conversion in order to properly sign-extend pointer values.

This patch fixes this regression by handling targets that need a
special conversion in address_from_register as well.

gdb/ChangeLog:

* findvar.c (address_from_register): Handle targets requiring
a special conversion routine even for plain pointer types

10 years agoBump GDB version number to 7.8.2.DATE-cvs.
Joel Brobecker [Thu, 15 Jan 2015 11:17:01 +0000 (15:17 +0400)] 
Bump GDB version number to 7.8.2.DATE-cvs.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.8.2.DATE-cvs.

10 years agoDocument the GDB 7.8.2 release in gdb/ChangeLog
Joel Brobecker [Thu, 15 Jan 2015 11:10:26 +0000 (15:10 +0400)] 
Document the GDB 7.8.2 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.8.2 released.

10 years agoSet GDB version number to 7.8.2. gdb-7.8.2-release
Joel Brobecker [Thu, 15 Jan 2015 10:58:13 +0000 (14:58 +0400)] 
Set GDB version number to 7.8.2.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.8.2.

10 years agoPR17525 - breakpoint commands not executed when program run from -x script
Pedro Alves [Wed, 14 Jan 2015 12:38:47 +0000 (12:38 +0000)] 
PR17525 - breakpoint commands not executed when program run from -x script

Executing a gdb script that runs the inferior (from the command line
with -x), and has it hit breakpoints with breakpoint commands that
themselves run the target, is currently broken on async targets
(Linux, remote).

While we're executing a command list or a script, we force the
interpreter to be sync, which results in some functions nesting an
event loop and waiting for the target to stop, instead of returning
immediately and having the top level event loop handle the stop.

The issue with this bug is simply that bpstat_do_actions misses
checking whether the interpreter is sync.  When we get here, in the
case of executing a script (or, when the interpreter is sync), the
program has already advanced to the next breakpoint, through
maybe_wait_sync_command_done.  We need to process its breakpoints
immediately, just like with a sync target.

Tested on x86_64 Fedora 20.

gdb/
2015-01-14  Pedro Alves  <palves@redhat.com>

PR gdb/17525
* breakpoint.c: Include "interps.h".
(bpstat_do_actions_1): Also check whether the interpreter is
async.

gdb/testsuite/
2015-01-14  Pedro Alves  <palves@redhat.com>
    Joel Brobecker  <brobecker@adacore.com>

PR gdb/17525
* gdb.base/bp-cmds-execution-x-script.c: New file.
* gdb.base/bp-cmds-execution-x-script.exp: New file.
* gdb.base/bp-cmds-execution-x-script.gdb: New file.

10 years agoPR cli/17828: -batch -ex r breaks terminal
Pedro Alves [Wed, 14 Jan 2015 12:43:30 +0000 (12:43 +0000)] 
PR cli/17828: -batch -ex r breaks terminal

Commit d3d4baed (PR python/17372 - Python hangs when displaying
help()) had the side effect of causing 'gdb -batch' to leave the
terminal in the wrong state if the program was run.  E.g,.

 $ echo 'main(){*(int*)0=0;}' | gcc -x c -; ./gdb/gdb -batch -ex r ./a.out
 Program received signal SIGSEGV, Segmentation fault.
 0x00000000004004ff in main ()
 $

If you start typing the next command, seemingly nothing happens - GDB
left the terminal with echo disabled.

The issue is that that "r" ends up in fetch_inferior_event, which
calls reinstall_readline_callback_handler_cleanup, which causes
readline to prep the terminal (raw, echo disabled).  But "-batch"
causes GDB to exit before the top level event loop is first started,
and then nothing de-preps the terminal.

The reinstall_readline_callback_handler_cleanup function's intro
comment mentions:

 "Need to do this as we go back to the event loop, ready to process
 further input."

but the implementation forgets the case of when the interpreter is
sync, which indicates we won't return to the event loop yet, or as in
the case of -batch, we have not started it yet.

The fix is to not install the readline callback in that case.

For the test, in this case, checking that command echo still works is
sufficient.  Comparing stty output before/after running GDB is even
better.  Because stty may not be available, the test tries both ways.
In any case, since expect's spawn (what we use to start gdb) creates a
new pseudo tty, another expect spawn or tcl exec after GDB exits would
not see the wrong terminal settings.  So instead, the test spawns a
shell and runs stty and GDB in it.

Tested on x86_64 Fedora 20.

gdb/
2015-01-14  Pedro Alves  <palves@redhat.com>

PR cli/17828
* infrun.c (reinstall_readline_callback_handler_cleanup): Don't
reinstall if the interpreter is sync.

gdb/testsuite/
2015-01-14  Pedro Alves  <palves@redhat.com>

PR cli/17828
* gdb.base/batch-preserve-term-settings.c: New file.
* gdb.base/batch-preserve-term-settings.exp: New file.

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 13 Jan 2015 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 12 Jan 2015 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 11 Jan 2015 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 10 Jan 2015 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 9 Jan 2015 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 8 Jan 2015 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 7 Jan 2015 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 6 Jan 2015 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 5 Jan 2015 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 4 Jan 2015 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 3 Jan 2015 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 2 Jan 2015 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 1 Jan 2015 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoLift DWARF unwinder restriction in dwarf2-frame.c::dwarf2_frame_cfa
Joel Brobecker [Fri, 21 Nov 2014 03:59:35 +0000 (04:59 +0100)] 
Lift DWARF unwinder restriction in dwarf2-frame.c::dwarf2_frame_cfa

GDB is currently broken on all SPARC targets when using GCC 4.9.
When trying to print any local variable:

    (gdb) p x
    can't compute CFA for this frame

This is related to the fact that the compiler now generates DWARF 4
debugging info by default, and in particular that it now emits
DW_OP_call_frame_cfa, which triggers a limitation in dwarf2_frame_cfa:

   /* This restriction could be lifted if other unwinders are known to
      compute the frame base in a way compatible with the DWARF
      unwinder.  */
   if (!frame_unwinder_is (this_frame, &dwarf2_frame_unwind)
       && !frame_unwinder_is (this_frame, &dwarf2_tailcall_frame_unwind))
     error (_("can't compute CFA for this frame"));

We couldn't append the dwarf2 unwinder to all SPARC targets because
it does not work properly with StackGhost:
    https://www.sourceware.org/ml/gdb-patches/2014-07/msg00012.html

We also later discovered that using the DWARF2 unwinder means
using it for computing the function's return address, which
is buggy when it comes to functions returning a struct (where
the return address is saved-pc+12 instead of saved-pc+8).
This is because GCC is emitting the info about the return address
as %o7/%i7 instead of the actual return address.  For functions
that have debugging info, we compensate by looking at the function's
return type and add the extra +4, but for function without debug
info, we're stuck.

EricB and I twisted the issue in all the directions we could think of,
and unfortunately couldn't find a way to make it work without
introduction one regression or another.

But, stepping back a little, just removing the restriction seems to work
well for us on all both sparc-elf and {sparc,sparc64}-solaris.
After reviewing the previous discussions about this test, I could
not figure out whether some unwinders were already known to have
incompatible CFAs or if the concern was purely theoretical:
    https://www.sourceware.org/ml/gdb-patches/2009-06/msg00191.html
    https://www.sourceware.org/ml/gdb-patches/2009-07/msg00570.html
    https://www.sourceware.org/ml/gdb-patches/2009-09/msg00027.html

At the moment, we took the approach of trying it out, and see what
happens...

gdb/ChangeLog:

        PR backtrace/16215:
        * dwarf2-frame.c (dwarf2_frame_cfa): Remove the restriction
        the frame unwinder must either be the dwarf2_frame_unwind
        or the dwarf2_tailcall_frame_unwind.  Verify that this_frame's
        stack_addr is valid before calling get_frame_base.  Throw
        an error if not valid.

Tested on sparc-solaris and sparc-elf with AdaCore's testsuite
(the FSF testsuite crashes all of AdaCore's solaris machines).

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 31 Dec 2014 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoFix executable indicator in file name completion on Windows.
Eli Zaretskii [Tue, 30 Dec 2014 19:14:25 +0000 (21:14 +0200)] 
Fix executable indicator in file name completion on Windows.

* complete.c (stat_char) [_WIN32]: Don't use 'access' and X_OK on
Windows, they don't work.  Instead, look at the file-name
extension to determine whether the file is executable.

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 30 Dec 2014 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 29 Dec 2014 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 28 Dec 2014 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 27 Dec 2014 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 26 Dec 2014 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 25 Dec 2014 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 24 Dec 2014 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 23 Dec 2014 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 22 Dec 2014 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 21 Dec 2014 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 20 Dec 2014 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 19 Dec 2014 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 18 Dec 2014 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 17 Dec 2014 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 16 Dec 2014 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAdd _bfd_elf_ifunc_get_synthetic_symtab
H.J. Lu [Thu, 4 Dec 2014 22:19:41 +0000 (14:19 -0800)] 
Add _bfd_elf_ifunc_get_synthetic_symtab

In i386 and x86-64 binaries with ifunc, relocations against .got.plt
section may not be in the same order as entries in PLT section.  This
patch adds _bfd_elf_ifunc_get_synthetic_symtab.  It takes a function
pointer which returns an array of PLT entry symbol values.  It calls
the function pointer to get the PLT entry symbol value array indexed
by relocation index, instead of calling plt_sym_val on each relocation
index.

PR binutils/17677
* elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): New prototype.
* elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): New
function.
* elf32-i386.c (elf_i386_plt_sym_val): Removed.
(elf_backend_plt_sym_val): Likewise.
(elf_i386_get_plt_sym_val): New.
(elf_i386_get_synthetic_symtab): Likewise.
(bfd_elf32_get_synthetic_symtab): Likewise.
* elf64-x86-64.c (elf_x86_64_plt_sym_val): Removed.
(elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise.
(elf_backend_plt_sym_val): Likewise.
(elf_x86_64_get_plt_sym_val): New.
(bfd_elf32_get_synthetic_symtab): Likewise.
(elf_x86_64_get_synthetic_symtab): Use
_bfd_elf_ifunc_get_synthetic_symtab.
(bfd_elf64_get_synthetic_symtab): Don't undefine for NaCl.

10 years agoFix 7.8 regression: resolve_dynamic_struct: Assertion `TYPE_NFIELDS (type) > 0' ...
Jan Kratochvil [Sat, 13 Dec 2014 14:31:59 +0000 (15:31 +0100)] 
Fix 7.8 regression: resolve_dynamic_struct: Assertion `TYPE_NFIELDS (type) > 0' (PR 17642)

https://sourceware.org/bugzilla/show_bug.cgi?id=17642

Regression since:
commit 012370f6818657a816df1463ee71ca4e4ee40b33
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu May 8 11:26:44 2014 -0600
    handle VLA in a struct or union

Bugreport:
Regression with gdb scripts for Linux kernel
https://sourceware.org/ml/gdb/2014-08/msg00127.html

That big change after "else" is just reindentation.

gdb/ChangeLog
2014-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

PR symtab/17642
* gdbtypes.c (resolve_dynamic_type_internal): Apply check_typedef to
TYPE if not TYPE_CODE_TYPEDEF.

gdb/testsuite/ChangeLog
2014-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

PR symtab/17642
* gdb.base/vla-stub-define.c: New file.
* gdb.base/vla-stub.c: New file.
* gdb.base/vla-stub.exp: New file.

10 years agoReindent code (resolve_dynamic_type_internal).
Jan Kratochvil [Mon, 24 Nov 2014 17:05:04 +0000 (18:05 +0100)] 
Reindent code (resolve_dynamic_type_internal).

gdb/ChangeLog
2014-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdbtypes.c (resolve_dynamic_type_internal): Reindent the code.

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 15 Dec 2014 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 14 Dec 2014 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 13 Dec 2014 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 12 Dec 2014 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 11 Dec 2014 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 10 Dec 2014 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 9 Dec 2014 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 8 Dec 2014 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 7 Dec 2014 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 6 Dec 2014 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 5 Dec 2014 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 4 Dec 2014 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 3 Dec 2014 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 2 Dec 2014 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 1 Dec 2014 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 30 Nov 2014 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 29 Nov 2014 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 28 Nov 2014 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 27 Nov 2014 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 26 Nov 2014 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 25 Nov 2014 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 24 Nov 2014 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 23 Nov 2014 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 22 Nov 2014 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 21 Nov 2014 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Nov 2014 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Nov 2014 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 18 Nov 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 17 Nov 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 16 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 15 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 14 Nov 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 13 Nov 2014 00:00:09 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 12 Nov 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 11 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 10 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 9 Nov 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 8 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 7 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 6 Nov 2014 00:00:11 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 5 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 4 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 3 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 2 Nov 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 1 Nov 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 31 Oct 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 30 Oct 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoBump GDB version number to 7.8.1.DATE-cvs.
Joel Brobecker [Wed, 29 Oct 2014 20:01:12 +0000 (13:01 -0700)] 
Bump GDB version number to 7.8.1.DATE-cvs.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.8.1.DATE-cvs.

10 years agoDocument the GDB 7.8.1 release in gdb/ChangeLog
Joel Brobecker [Wed, 29 Oct 2014 19:56:54 +0000 (12:56 -0700)] 
Document the GDB 7.8.1 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.8.1 released.

10 years agoSet GDB version number to 7.8.1. gdb-7.8.1-release
Joel Brobecker [Wed, 29 Oct 2014 19:45:51 +0000 (12:45 -0700)] 
Set GDB version number to 7.8.1.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.8.1.

10 years agoPR 17408 - assertion failure in switch_back_to_stepped_thread
Pedro Alves [Wed, 29 Oct 2014 18:27:38 +0000 (18:27 +0000)] 
PR 17408 - assertion failure in switch_back_to_stepped_thread

This PR shows that GDB can easily trigger an assertion here, in
infrun.c:

 5392              /* Did we find the stepping thread?  */
 5393              if (tp->control.step_range_end)
 5394                {
 5395                  /* Yep.  There should only one though.  */
 5396                  gdb_assert (stepping_thread == NULL);
 5397
 5398                  /* The event thread is handled at the top, before we
 5399                     enter this loop.  */
 5400                  gdb_assert (tp != ecs->event_thread);
 5401
 5402                  /* If some thread other than the event thread is
 5403                     stepping, then scheduler locking can't be in effect,
 5404                     otherwise we wouldn't have resumed the current event
 5405                     thread in the first place.  */
 5406                  gdb_assert (!schedlock_applies (currently_stepping (tp)));
 5407
 5408                  stepping_thread = tp;
 5409                }

Like:

 gdb/infrun.c:5406: internal-error: switch_back_to_stepped_thread: Assertion `!schedlock_applies (1)' failed.

The way the assertion is written is assuming that with schedlock=step
we'll always leave threads other than the one with the stepping range
locked, while that's not true with the "next" command.  With schedlock
"step", other threads still run unlocked when "next" detects a
function call and steps over it.  Whether that makes sense or not,
still, it's documented that way in the manual.  If another thread hits
an event that doesn't cause a stop while the nexting thread steps over
a function call, we'll get here and fail the assertion.

The fix is just to adjust the assertion.  Even though we found the
stepping thread, we'll still step-over the breakpoint that just
triggered correctly.

Surprisingly, gdb.threads/schedlock.exp doesn't have any test that
steps over a function call.  This commits fixes that.  This ensures
that "next" doesn't switch focus to another thread, and checks whether
other threads run locked or not, depending on scheduler locking mode
and command.  There's a lot of duplication in that file that this ends
cleaning up.  There's more that could be cleaned up, but that would
end up an unrelated change, best done separately.

This new coverage in schedlock.exp happens to trigger the internal
error in question, like so:

 FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (1) (GDB internal error)
 FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (3) (GDB internal error)
 FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (5) (GDB internal error)
 FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (7) (GDB internal error)
 FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (9) (GDB internal error)
 FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next does not change thread (switched to thread 0)
 FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: current thread advanced - unlocked (wrong amount)

That's because we have more than one thread running the same loop, and
while one thread is stepping over a function call, the other thread
hits the step-resume breakpoint of the first, which needs to be
stepped over, and we end up in switch_back_to_stepped_thread exactly
in the problem case.

I think a simpler and more directed test is also useful, to not rely
on internal breakpoint magics.  So this commit also adds a test that
has a thread trip on a conditional breakpoint that doesn't cause a
user-visible stop while another thread is stepping over a call.  That
currently fails like this:

 FAIL: gdb.threads/next-bp-other-thread.exp: schedlock=step: next over function call (GDB internal error)

Tested on x86_64 Fedora 20.

gdb/
2014-10-29  Pedro Alves  <palves@redhat.com>

PR gdb/17408
* infrun.c (switch_back_to_stepped_thread): Use currently_stepping
instead of assuming a thread with a stepping range is always
stepping.

gdb/testsuite/
2014-10-29  Pedro Alves  <palves@redhat.com>

PR gdb/17408
* gdb.threads/schedlock.c (some_function): New function.
(call_function): New global.
(MAYBE_CALL_SOME_FUNCTION): New macro.
(thread_function): Call it.
* gdb.threads/schedlock.exp (get_args): Add description parameter,
and use it instead of a global counter.  Adjust all callers.
(get_current_thread): Use "find current thread" for test message
here rather than having all callers pass down the same string.
(goto_loop): New procedure, factored out from ...
(my_continue): ... this.
(step_ten_loops): Change parameter from test message to command to
use.  Adjust.
(list_count): Delete global.
(check_result): New procedure, factored out from duplicate top
level code.
(continue tests): Wrap in with_test_prefix.
(test_step): New procedure, factored out from duplicate top level
code.
(top level): Test "step" in combination with all scheduler-locking
modes.  Test "next" in combination with all scheduler-locking
modes, and in combination with stepping over a function call or
not.
* gdb.threads/next-bp-other-thread.c: New file.
* gdb.threads/next-bp-other-thread.exp: New file.

10 years agoPR python/17372 - Python hangs when displaying help()
Pedro Alves [Thu, 23 Oct 2014 16:13:35 +0000 (17:13 +0100)] 
PR python/17372 - Python hangs when displaying help()

This is more of a readline/terminal issue than a Python one.

PR17372 is a regression in 7.8 caused by the fix for PR17072:

 commit 0017922d0292d8c374584f6100874580659c9973
 Author: Pedro Alves <palves@redhat.com>
 Date:   Mon Jul 14 19:55:32 2014 +0100

    Background execution + pagination aborts readline/gdb

    gdb_readline_wrapper_line removes the handler after a line is
    processed.  Usually, we'll end up re-displaying the prompt, and that
    reinstalls the handler.  But if the output is coming out of handling
    a stop event, we don't re-display the prompt, and nothing restores the
    handler.  So the next input wakes up the event loop and calls into
    readline, which aborts.
...
    gdb/
    2014-07-14  Pedro Alves  <palves@redhat.com>

        PR gdb/17072
        * top.c (gdb_readline_wrapper_line): Tweak comment.
        (gdb_readline_wrapper_cleanup): If readline is enabled, reinstall
        the input handler callback.

The problem is that installing the input handler callback also preps
the terminal, putting it in raw mode and with echo disabled, which is
bad if we're going to call a command that assumes cooked/canonical
mode, and echo enabled, like in the case of the PR, Python's
interactive shell.  Another example I came up with that doesn't depend
on Python is starting a subshell with "(gdb) shell /bin/sh" from a
multi-line command.  Tests covering both these examples are added.

The fix is to revert the original fix for PR gdb/17072, and instead
restore the callback handler after processing an asynchronous target
event.

Furthermore, calling rl_callback_handler_install when we already have
some input in readline's line buffer discards that input, which is
obviously a bad thing to do while the user is typing.  No specific
test is added for that, because I first tried calling it even if the
callback handler was still installed and that resulted in hundreds of
failures in the testsuite.

gdb/
2014-10-29  Pedro Alves  <palves@redhat.com>

PR python/17372
* event-top.c (change_line_handler): Call
gdb_rl_callback_handler_remove instead of
rl_callback_handler_remove.
(callback_handler_installed): New global.
(gdb_rl_callback_handler_remove, gdb_rl_callback_handler_install)
(gdb_rl_callback_handler_reinstall): New functions.
(display_gdb_prompt): Call gdb_rl_callback_handler_remove and
gdb_rl_callback_handler_install instead of
rl_callback_handler_remove and rl_callback_handler_install.
(gdb_disable_readline): Call gdb_rl_callback_handler_remove
instead of rl_callback_handler_remove.
* event-top.h (gdb_rl_callback_handler_remove)
(gdb_rl_callback_handler_install)
(gdb_rl_callback_handler_reinstall): New declarations.
* infrun.c (reinstall_readline_callback_handler_cleanup): New
cleanup function.
(fetch_inferior_event): Install it.
* top.c (gdb_readline_wrapper_line) Call
gdb_rl_callback_handler_remove instead of
rl_callback_handler_remove.
(gdb_readline_wrapper_cleanup): Don't call
rl_callback_handler_install.

gdb/testsuite/
2014-10-29  Pedro Alves  <palves@redhat.com>

PR python/17372
* gdb.python/python.exp: Test a multi-line command that spawns
interactive Python.
* gdb.base/multi-line-starts-subshell.exp: New file.

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 29 Oct 2014 00:00:09 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 28 Oct 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 27 Oct 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 26 Oct 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Oct 2014 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Oct 2014 00:00:09 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Oct 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Oct 2014 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in