]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
4 years agoSet GDB version number to 9.1. gdb-9.1-release
Joel Brobecker [Sat, 8 Feb 2020 12:50:15 +0000 (16:50 +0400)] 
Set GDB version number to 9.1.

gdb/ChangeLog:

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

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 8 Feb 2020 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoMake fputs_unfiltered use fputs_maybe_filtered
Iain Buclaw [Wed, 5 Feb 2020 11:45:13 +0000 (12:45 +0100)] 
Make fputs_unfiltered use fputs_maybe_filtered

This patch redefines fputs_unfiltered in utils.c, with new behavior to
forward parameters to fputs_maybe_filtered.  This makes
fputs_unfiltered identical to fputs_filtered, except filtering is
disabled.

Some callers of fputs_unfiltered have been updated to use ui_file_puts
where they were using other ui_file_* functions anyway for IO.

This fixes the problem I saw with \032\032post-prompt annotation being
flushed to stdout in the wrong order.

gdb/ChangeLog
2020-02-05  Iain Buclaw  <ibuclaw@gdcproject.org>

PR gdb/25190:
        * gdb/remote-sim.c (gdb_os_write_stderr): Update.
        * gdb/remote.c (remote_console_output): Update.
        * gdb/ui-file.c (fputs_unfiltered): Rename to...
        (ui_file_puts): ...this.
        * gdb/ui-file.h (ui_file_puts): Add declaration.
        * gdb/utils.c (emit_style_escape): Update.
        (flush_wrap_buffer): Update.
        (fputs_maybe_filtered): Update.
        (fputs_unfiltered): Add function.

Change-Id: I17ed5078f71208344f2f8ab634a6518b1af6e213

4 years agoMake gdb_flush also flush the wrap buffer
Iain Buclaw [Wed, 5 Feb 2020 11:25:09 +0000 (12:25 +0100)] 
Make gdb_flush also flush the wrap buffer

This changes gdb_flush to also flush the internal wrap buffer.  A few
places needed to continue using the previous approach, so this also
introduces ui_file_flush for those.

gdb/ChangeLog
2020-02-05  Iain Buclaw  <ibuclaw@gdcproject.org>

        * gdb/event-loop.c (gdb_wait_for_event): Update.
        * gdb/printcmd.c (printf_command): Update.
        * gdb/remote-fileio.c (remote_fileio_func_write): Update.
        * gdb/remote-sim.c (gdb_os_flush_stdout): Update.
        (gdb_os_flush_stderr): Update.
        * gdb/remote.c (remote_console_output): Update.
        * gdb/ui-file.c (gdb_flush): Rename to...
        (ui_file_flush): ...this.
        (stderr_file::write): Update.
        (stderr_file::puts): Update.
        * gdb/ui-file.h (gdb_flush): Rename to...
        (ui_file_flush): ...this.
        * gdb/utils.c (gdb_flush): Add function.
        * gdb/utils.h (gdb_flush): Add declaration.

Change-Id: I7ca143d30f03dc39f218f6e880eb9bca9e15af39

4 years agoRevert basenames_may_differ patch
Tom Tromey [Wed, 5 Feb 2020 09:53:44 +0000 (10:53 +0100)] 
Revert basenames_may_differ patch

Commit a0c1ffedc regressed certain cases coming from Eclipse.
See PR breakpoints/24915.

This patch reverts the commit for the gdb 9 release.

gdb/ChangeLog
2020-02-07  Tom Tromey  <tromey@adacore.com>

PR breakpoints/24915:
* source.c (find_and_open_source): Do not check basenames_may_differ.

gdb/testsuite/ChangeLog
2020-02-07  Tom Tromey  <tromey@adacore.com>

PR breakpoints/24915:
* gdb.base/annotate-symlink.exp: Use setup_xfail.

Change-Id: Iadbf42f35eb40c95ad32b2108ae25d8f199998bd

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 7 Feb 2020 00:01:51 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 6 Feb 2020 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 5 Feb 2020 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 4 Feb 2020 00:01:43 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 3 Feb 2020 00:01:43 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 2 Feb 2020 00:01:30 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoImplement '--enable-src-release-build' option and make src-release.sh use it
Sergio Durigan Junior [Sat, 1 Feb 2020 20:33:31 +0000 (15:33 -0500)] 
Implement '--enable-src-release-build' option and make src-release.sh use it

The generation of snapshots has been broken since we've disable
in-tree builds for GDB.  Given that src-release.sh performs a build
before creating the release tarball, and that this build is performed
in-tree, the solution we found is to implement a new top-level
configure flag called '--enable-src-release-build' which disables the
in-tree build restriction, and then make src-release.sh use it.

ChangeLog:
2020-02-01  Sergio Durigan Junior  <sergiodj@redhat.com>
    Eli Zaretskii  <eliz@gnu.org>

* configure.ac: Don't abort the build if trying to build GDB in tree
_and_ invoking with '--enable-src-release-build'.
* configure: Regenerate.
* src-release.sh (do_proto_toplev): Invoke 'configure' using

Change-Id: Ic6dd55accd9a03e62fe498f7fd704fb67f44bfa9

4 years agolibctf: compilation failure on MinGW due to missing errno values
Eli Zaretskii [Sat, 1 Feb 2020 11:25:19 +0000 (15:25 +0400)] 
libctf: compilation failure on MinGW due to missing errno values

This commit fixes a compilation failure in a couple of libctf files
due to the use of EOVERFLOW and ENOTSUP, which are not defined
when compiling on MinGW.

libctf/ChangeLog:

PR binutils/25155:
* ctf-create.c (EOVERFLOW): If not defined by system header,
redirect to ERANGE as a poor man's substitute.
* ctf-subr.c (ENOTSUP): If not defined, use ENOSYS instead.

This one is how Eli implemented it. I think this implementation
has a weakness in the following sense: If other units in libctf
start using those constants, we'll get the same error again.
Also, I'm wondering whether their use is documented as part of
the official libtcf API or not -- users might be writing code
that tests for these, and if the system doesn't support them,
how would they know what errno code to use in its place. This
argues for a having that information in one of libctf's header
files. I think it would be nice to have those in ctf-decls.h,
but I think we'll need to include <errno.h> in ctf-decls.h if
we decide to define those macros there.

Rather than second-guess what the CTF developers would prefer,
I'm starting by sending Eli's patch, to see what you guys think.

Thanks,
--
Joel

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 1 Feb 2020 00:01:34 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 31 Jan 2020 00:01:41 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 30 Jan 2020 00:01:30 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 29 Jan 2020 00:01:22 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoFix library segment-address for 64bit values
Hannes Domani [Tue, 28 Jan 2020 17:24:31 +0000 (18:24 +0100)] 
Fix library segment-address for 64bit values

The address was written as a long value, but long is always a 32bit value
on Windows, which lead to truncated addresses.
The solution was to use paddress instead.

gdb/gdbserver/ChangeLog:

2020-01-28  Hannes Domani  <ssbssa@yahoo.de>

* server.c (handle_qxfer_libraries): Write segment-address with
paddress.

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 28 Jan 2020 00:02:48 +0000 (00:02 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 27 Jan 2020 00:01:57 +0000 (00:01 +0000)] 
Automatic date update in version.in

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

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Jan 2020 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Jan 2020 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Jan 2020 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Jan 2020 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 21 Jan 2020 00:01:48 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 20 Jan 2020 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 19 Jan 2020 00:01:28 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 18 Jan 2020 00:01:25 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAbort configure immediately if building GDB in tree
Joel Brobecker [Fri, 17 Jan 2020 18:30:39 +0000 (19:30 +0100)] 
Abort configure immediately if building GDB in tree

The move of gnulib to the top src directory is causing the GDB build
to break if configured in tree. We hope to lift that limitation at
some point but, in the meantime, this commit allows us to abort
the initial configure right away with a clear error message should
the user attempt to build in tree.

ChangeLog:

        * configure.ac: Abort the build with an error if trying to build
        GDB in tree.
        * configure: Regenerate.

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Jan 2020 00:01:31 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 16 Jan 2020 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 15 Jan 2020 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Jan 2020 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 13 Jan 2020 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Jan 2020 00:02:18 +0000 (00:02 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 11 Jan 2020 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoDon't define _FORTIFY_SOURCE on MinGW
Christian Biesinger [Wed, 18 Dec 2019 18:06:43 +0000 (12:06 -0600)] 
Don't define _FORTIFY_SOURCE on MinGW

Recent MinGW versions require -lssp when using _FORTIFY_SOURCE, which
gdb does (in common-defs.h)
https://github.com/msys2/MINGW-packages/issues/5868#issuecomment-544107564

To avoid all the complications with checking for -lssp and making sure it's
linked statically, just don't define it.

gdb/ChangeLog:

2020-01-10  Christian Biesinger  <cbiesinger@google.com>

* gdbsupport/common-defs.h: Don't define _FORTIFY_SOURCE on MinGW.

Change-Id: Ide6870ab57198219a2ef78bc675768a789ca2b1d

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Jan 2020 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 9 Jan 2020 00:02:08 +0000 (00:02 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Jan 2020 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAdd constructor to stap_static_probe_ops
Tom Tromey [Thu, 19 Dec 2019 18:35:22 +0000 (11:35 -0700)] 
Add constructor to stap_static_probe_ops

PR build/24937 concerns an error given by the clang provided by a
particular version of macOS.  In particular, it reports

    error: default initialization of an object of const type 'const
    stap_static_probe_ops' without a user-provided default constructor

Although (at least according to sources I found online) this was
resolved as a bug in the standard, it seemed simple enough to work
around this.

Given that this is a trivial build fix, I think it should go on the
gdb 9 branch as well.

2020-01-07  Tom Tromey  <tromey@adacore.com>

PR build/24937:
* stap-probe.c (class stap_static_probe_ops): Add constructor.

Change-Id: I18f180c17850f420e9b66afc67f9cb3d8dceb0b3

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 7 Jan 2020 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agogdb: Fix backtrace with disassemble-next-line on
Andrew Burgess [Thu, 26 Dec 2019 20:56:01 +0000 (20:56 +0000)] 
gdb: Fix backtrace with disassemble-next-line on

In this commit:

  commit ec8e2b6d3051f0b4b2a8eee9917898e95046c62f
  Date:   Fri Jun 14 23:43:00 2019 +0100

      gdb: Don't allow annotations to influence what else GDB prints

A change was accidentally made that moved a call to do_gdb_disassembly
out of an if block guarded by 'if (source_print && sal.symtab)'.  The
result was that if a user has 'set disassemble-next-line on' then the
backtrace would now include some disassembly of a few instructions in
each frame.

This change was not intentional, but was not spotted by any tests.

This commit restores the old behaviour and adds a test to ensure this
doesn't break again in the future.

gdb/ChangeLog:

* stack.c (print_frame_info): Move disassemble_next_line code
inside source_print block.

gdb/testsuite/ChangeLog:

* gdb.base/backtrace.c: New file.
* gdb.base/backtrace.exp: New file.

Change-Id: I47c52a202fa74be138382646b695827940178689

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 6 Jan 2020 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agolibctf: Add configure check for asprintf (for MinGW)
Eli Zaretskii [Sun, 5 Jan 2020 05:50:27 +0000 (09:50 +0400)] 
libctf: Add configure check for asprintf (for MinGW)

This commit fixes a compilation warning when compiling libctf
on MinGW:

    libctf/ctf-dump.c:118:8: warning: implicit declaration of function
    'asprintf'; did you mean 'vasprintf'? [-Wimplicit-function-declaration]

 if (asprintf (&bit, " %lx: [slice 0x%x:0x%x]",
     ^~~~~~~~
     vasprintf

MinGW doesn't provide that function, so we depend on the one provided
by libiberty. However, the declaration is guarded by HAVE_DECL_ASPRINTF,
which we do not have in libctf's config.h.

libctf/ChangeLog:

PR binutils/25155:
* configure.ac: Add AC_CHECK_DECLS([asprintf]).
* configure, config.h.in: Regenerate.

(cherry picked from commit 3a657c600bde2d3bd84870f75968622bbdb69ce8)

4 years agolibctf: Regenerate Makefile.in and acinclude.m4
Joel Brobecker [Sun, 5 Jan 2020 05:49:33 +0000 (09:49 +0400)] 
libctf: Regenerate Makefile.in and acinclude.m4

I noticed that if I run "autoreconf" with vanilla automake-1.15.1
and autoconf-2.69, I get some differences.

libctf/ChangeLog:

        * Makefile.in, aclocal.m4: Regenerate.

4 years agoUpdate copyright year in gdbarch.sh doc/gdb.texinfo and doc/refcard.tex
Joel Brobecker [Wed, 1 Jan 2020 06:47:50 +0000 (10:47 +0400)] 
Update copyright year in gdbarch.sh doc/gdb.texinfo and doc/refcard.tex

These are files that need to be updated by hand, because the copyright.py
script isn't able to handle them automatically.

gdb/ChangeLog:

* gdbarch.sh: Update copyright year range of generated files.

gdb/doc/ChangeLog:

        * gdb.texinfo, refcard.tex: Update copyright year range.

(cherry picked from commit e5d78223eaf178ebb23aa20f209f71497aaae722)

4 years agoCopyright year range updates after running gdb/copyright.py
Joel Brobecker [Wed, 1 Jan 2020 06:45:00 +0000 (10:45 +0400)] 
Copyright year range updates after running gdb/copyright.py

gdb/ChangeLog:

Update copyright year range in all the GDB files automatically
handled by our copyright.py script.

4 years agogdb/copyright.py: Convert to Python 3
Joel Brobecker [Wed, 1 Jan 2020 06:32:53 +0000 (10:32 +0400)] 
gdb/copyright.py: Convert to Python 3

gdb/ChangeLog:

        * copyright.py: Convert to Python 3.

(cherry picked from commit 5f4def5cbd12e77075f64a6854fb002f34be8a01)

4 years agogdb/copyright.py: Adapt after move of gnulib from gdb to toplevel
Joel Brobecker [Wed, 1 Jan 2020 06:32:30 +0000 (10:32 +0400)] 
gdb/copyright.py: Adapt after move of gnulib from gdb to toplevel

gdb/ChangeLog:

* copyright.py: Adapt after move of gnulib directory from gdb
directory to toplevel directory.

(cherry picked from commit 51fd40020e1e0b21642cdec9c749f2e3862939ea)

4 years agogdb/copyright.py: Exit if run from the wrong directory
Joel Brobecker [Wed, 1 Jan 2020 06:32:20 +0000 (10:32 +0400)] 
gdb/copyright.py: Exit if run from the wrong directory

We printed an error, but kept going anyway... ;-)

gdb/ChangeLog:

* copyright.py (main): Exit if run from the wrong directory.

(cherry picked from commit 5fb651f2ddd54a1d3da6fcd172d9fab81893bbf9)

4 years agoupdate copyright year in version output of gdb, gdbserver and gdbreplay
Joel Brobecker [Wed, 1 Jan 2020 06:32:04 +0000 (10:32 +0400)] 
update copyright year in version output of gdb, gdbserver and gdbreplay

gdb/ChangeLog:

        * top.c (print_gdb_version): Change copyright year to 2020.

gdb/gdbserver/ChangeLog:

        * server.c (gdbserver_version): Change copyright year to 2020.
        * gdbreplay.c (gdbreplay_version): Likewise.

(cherry picked from commit 5dd8bf886a3f7535e0ad8b5218275efcf2cfff31)

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Jan 2020 00:01:40 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 4 Jan 2020 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Jan 2020 00:01:53 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 2 Jan 2020 00:01:20 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Jan 2020 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 31 Dec 2019 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 30 Dec 2019 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 29 Dec 2019 00:01:53 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 28 Dec 2019 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 27 Dec 2019 00:01:22 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoConsistently quote variables used with "test"
Christian Biesinger [Wed, 18 Dec 2019 21:03:07 +0000 (15:03 -0600)] 
Consistently quote variables used with "test"

This ensures that empty variables and variables with spaces are handled
correctly.

Code was inconsistent on whether the constant string (e.g. yes/no)
should also be quoted; I tried to be consistent with surrounding code.

This fixes the error Eli reported during configure with mingw (though that
was not fatal).

gdb/ChangeLog:

2019-12-19  Christian Biesinger  <cbiesinger@google.com>

* configure: Regenerate.
* configure.ac: Quote variable arguments of test.
* gdbsupport/common.m4: Likewise.

gdb/gdbserver/ChangeLog:

2019-12-19  Christian Biesinger  <cbiesinger@google.com>

* configure: Regenerate.
* configure.ac: Quote variable arguments of test.

Change-Id: I220e78b52c7db88b9dd058eda604635b03464fac

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 Dec 2019 00:01:40 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Dec 2019 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 Dec 2019 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoFix compilation of Readline on mingw.org's MinGW
Eli Zaretskii [Mon, 23 Dec 2019 14:28:32 +0000 (16:28 +0200)] 
Fix compilation of Readline on mingw.org's MinGW

readline/ChangeLog
2019-12-23  Eli Zaretskii  <eliz@gnu.org>

* posixstat.h (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH)
(S_IXOTH, S_IRWXG, S_IRWXO): Define if undefined, even if S_IRWXU
is defined, because non-Posix systems may defined only the user
bits.

(cherry picked from commit e76ff636537c6140bb9d0b0a39260d840f37ca7e)

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 Dec 2019 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 Dec 2019 00:01:39 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoFix inadvertent indentation changes in last commit.
Eli Zaretskii [Sat, 21 Dec 2019 07:32:39 +0000 (09:32 +0200)] 
Fix inadvertent indentation changes in last commit.

4 years agoInclude xxHash support status in GDB configuration report
Eli Zaretskii [Sat, 21 Dec 2019 07:23:44 +0000 (09:23 +0200)] 
Include xxHash support status in GDB configuration report

gdb/ChangeLog
2019-12-21  Eli Zaretskii  <eliz@gnu.org>

* top.c (print_gdb_configuration): Print "--with-xxhash" or
"--without-xxhash" according to HAVE_LIBXXHASH.

(cherry picked from commit 15b07e4f5672cf02487a26305ac3b2ddd0aec68e)

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Dec 2019 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Dec 2019 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Dec 2019 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoFix pthread_setname_np build error
Tom Tromey [Wed, 18 Dec 2019 18:45:51 +0000 (11:45 -0700)] 
Fix pthread_setname_np build error

My earlier patch to fix the pthread_setname_np build error on macOS
was incorrect.  While the macOS man page claims that
pthread_setname_np returns void, in <pthread.h> it is actually
declared returning "int".  I knew this earlier, but must have made
some mistake when preparing the patch for submission (perhaps when
removing the templates?).

This patch re-fixes the bug.  I'm also applying it to the 9.1 branch.

Tested by building on macOS High Sierra.

gdb/ChangeLog
2019-12-18  Tom Tromey  <tromey@adacore.com>

PR build/25268:
* gdbsupport/thread-pool.c (set_thread_name): Expect "int" return
type on macOS.  Add comment.

Change-Id: Ib09da6ac33958a0d843f65df2a528112356e7de6

4 years agoFix build failure on macOS
Tom Tromey [Wed, 18 Dec 2019 15:03:01 +0000 (08:03 -0700)] 
Fix build failure on macOS

PR build/25250 notes that the gdb 9 pre-release fails to build on
macOS, due to a name clash between field_kind::STRING and the STRING
token in ada-exp.y.  I am not sure (I couldn't reproduce this myself),
but presumably this is due to differences caused by the version of
bison in use there.

This patch works around the problem by renaming the field_kind
enumerator.  I chose to rename this one because it is used in
relatively few places -- it's just an implementation detail of the
style code.

This version also renames field_kind::SIGNED for consistency.

Let me know what you think.  I intend to check this in on the gdb 9
branch as well.

2019-12-18  Tom Tromey  <tromey@adacore.com>

PR build/25250:
* ui-out.c (ui_out::vmessage): Update.
* ui-out.h (enum class field_kind) <FIELD_STRING, FIELD_SIGNED>:
Rename.
(string_field): Update.
(signed_field): Update.

Change-Id: Iae9f36f1b793e22c61fee0de2ab2d508668ee7e4

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 Dec 2019 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoFix double-free when creating more than one block in JIT debug info reader
Simon Marchi [Mon, 16 Dec 2019 21:30:49 +0000 (16:30 -0500)] 
Fix double-free when creating more than one block in JIT debug info reader

A double-free happens when using a JIT debug info reader that creates
more than one block.  In the loop that frees blocks in finalize_symtab,
at the very end, the gdb_block_iter_tmp variable is set initially, but
not changed as the loop advances.  If we have two blocks, the first
iteration frees the first block, the second iteration frees the second
block, but the third iteration tries to free the second block again, as
gdb_block_iter_tmp keeps pointing on the second block.

Fix it by assigning the gdb_block_iter_tmp variable in the loop.

I have improved the jit-reader.exp test to cover this case, by adding a
second "JIT-ed" function and creating a block for it.  I have renamed
the existing function to something I find a bit more descriptive.  There
are no significant changes to jit-reader.exp itself, only updates
following the renaming.  The important changes are in jithost.c
(generate a new function) and in jitreader.c (create a gdb_block for
that function).

This was found because of an ASan report:

$ ./gdb testsuite/outputs/gdb.base/jit-reader/jit-reader -ex "jit-reader-load /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/jit-reader/jitreader.so" -ex r
Reading symbols from testsuite/outputs/gdb.base/jit-reader/jit-reader...
Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/jit-reader/jit-reader
=================================================================
==1751048==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000042eb8 at pc 0x5650ef8eec88 bp 0x7ffe52767290 sp 0x7ffe52767280
READ of size 8 at 0x604000042eb8 thread T0
    #0 0x5650ef8eec87 in finalize_symtab /home/simark/src/binutils-gdb/gdb/jit.c:768
    #1 0x5650ef8eef88 in jit_object_close_impl /home/simark/src/binutils-gdb/gdb/jit.c:797
    #2 0x7fbbda986278 in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:71
    #3 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850
    #4 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948
    #5 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396
    #6 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470
    [snip]

0x604000042eb8 is located 40 bytes inside of 48-byte region [0x604000042e90,0x604000042ec0)
freed by thread T0 here:
    #0 0x7fbbe57376b0 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:122
    #1 0x5650ef8f350b in xfree<gdb_block> /home/simark/src/binutils-gdb/gdb/gdbsupport/common-utils.h:62
    #2 0x5650ef8eeca9 in finalize_symtab /home/simark/src/binutils-gdb/gdb/jit.c:769
    #3 0x5650ef8eef88 in jit_object_close_impl /home/simark/src/binutils-gdb/gdb/jit.c:797
    #4 0x7fbbda986278 in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:71
    #5 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850
    #6 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948
    #7 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396
    #8 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470
    [snip]

previously allocated by thread T0 here:
    #0 0x7fbbe5737cd8 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:153
    #1 0x5650eef662f3 in xcalloc /home/simark/src/binutils-gdb/gdb/alloc.c:100
    #2 0x5650ef8f34ea in xcnew<gdb_block> /home/simark/src/binutils-gdb/gdb/gdbsupport/poison.h:122
    #3 0x5650ef8ed467 in jit_block_open_impl /home/simark/src/binutils-gdb/gdb/jit.c:557
    #4 0x7fbbda98620a in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:60
    #5 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850
    #6 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948
    #7 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396
    #8 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470
    [snip]

gdb/ChangeLog:

* jit.c (finalize_symtab): Set gdb_block_iter_tmp in loop.

gdb/testsuite/ChangeLog:

* gdb.base/jit-reader.exp (jit_reader_test): Rename
jit_function_00 to jit_function_stack_mangle.
* gdb.base/jithost.c (jit_function_t): Rename to...
(jit_function_stack_mangle_t): ... this.
(jit_function_add_t): New typedef.
(jit_function_00_code): Rename to...
(jit_function_stack_mangle_code): ... this, make static.
(jit_function_add_code): New.
(main): Generate "add" function and call it.  Adjust to changes
in jithost_abi.
* gdb.base/jithost.h (struct jithost_abi_bounds): New.
(struct jithost_abi) <begin, end>: Remove fields.
<object, function_stack_mangle, function_add>: New fields.
* gdb.base/jitreader.c (struct reader_state) <code_begin,
code_end>: Remove fields.
<func_stack_mangle>: New field.
(read_debug_info): Adjust to renaming, create block for "add"
function.
(read_sp, unwind_frame, get_frame_id): Adjust to other changes.

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 Dec 2019 00:01:00 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 Dec 2019 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoUpdate documentation for the default value of main set worker-threads
Christian Biesinger [Sun, 15 Dec 2019 00:18:49 +0000 (19:18 -0500)] 
Update documentation for the default value of main set worker-threads

I forgot to update this documentation when I changed the default for
maint set worker-threads to be 0. This is a branch-only change, because
on trunk this has been changed back to unlimited.

gdb/doc/ChangeLog:

2019-12-15  Christian Biesinger  <cbiesinger@google.com>

* gdb.texinfo (Maintenance Commands): Update documentation for
maint set worker-threads to say the default is 0.

Change-Id: I75b74c5da599e657ee94daa8c88b5a097bc58d15

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 Dec 2019 00:01:31 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agogdb/doc: Remove duplicate description of lookup_global_symbol
Andrew Burgess [Sat, 14 Dec 2019 23:11:58 +0000 (23:11 +0000)] 
gdb/doc: Remove duplicate description of lookup_global_symbol

In this commit:

  commit 086baaf1346f07acfb6708e8c6cb79274241488b
  Date:   Tue Oct 15 16:18:26 2019 +0100

      gdb/python: Introduce gdb.lookup_static_symbols

A duplicate description of gdb.lookup_global_symbol was accidentally
added.  This commit corrects this mistake and removes the duplicate.

gdb/doc/ChangeLog:

* python.texi (Symbols In Python): Remove duplicate description of
gdb.lookup_global_symbol.

Change-Id: I4457b42cf05bde39e5c0ff39f168af919cad1255

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 Dec 2019 00:01:00 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 Dec 2019 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 Dec 2019 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoBump GDB version number to 9.0.90.DATE-git.
Joel Brobecker [Wed, 11 Dec 2019 21:42:19 +0000 (22:42 +0100)] 
Bump GDB version number to 9.0.90.DATE-git.

gdb/ChangeLog:

* version.in: Set GDB version number to 9.0.90.DATE-git.

4 years agoDocument the GDB 9.0.90 release in gdb/ChangeLog
Joel Brobecker [Wed, 11 Dec 2019 21:42:13 +0000 (22:42 +0100)] 
Document the GDB 9.0.90 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 9.0.90 released.

4 years agoSet GDB version number to 9.0.90.
Joel Brobecker [Wed, 11 Dec 2019 20:54:26 +0000 (21:54 +0100)] 
Set GDB version number to 9.0.90.

gdb/ChangeLog:

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

4 years agogdb/NEWS: Say "Changes in GDB 9" rather than "Changes since GDB 8.3"
Joel Brobecker [Wed, 11 Dec 2019 20:51:26 +0000 (21:51 +0100)] 
gdb/NEWS: Say "Changes in GDB 9" rather than "Changes since GDB 8.3"

gdb/ChangeLog:

  * NEWS: Change "Changes since GDB 8.3" into "Changes in GDB 9".

4 years agoSet development mode to "off" by default.
Joel Brobecker [Wed, 11 Dec 2019 20:37:55 +0000 (21:37 +0100)] 
Set development mode to "off" by default.

bfd/ChangeLog:

* development.sh (development): Set to false.

4 years agoBump version to 9.0.90.DATE-git.
Joel Brobecker [Wed, 11 Dec 2019 20:37:08 +0000 (21:37 +0100)] 
Bump version to 9.0.90.DATE-git.

Now that the GDB 9 branch has been created, we can
bump the version number.

gdb/ChangeLog:

GDB 9 branch created (27f7b2f64062ac9e52afc60509263c2702a9ebd0):
* version.in: Bump version to 9.0.90.DATE-git.

4 years agoFix typo, get_Frame_id -> get_frame_id gdb-9-branchpoint
Simon Marchi [Wed, 11 Dec 2019 16:30:15 +0000 (11:30 -0500)] 
Fix typo, get_Frame_id -> get_frame_id

gdb/doc/ChangeLog:

* gdb.texinfo (Writing JIT Debug Info Readers): Fix typo.

4 years ago[gas][arm] Add -mwarn-restrict-it
Andre Vieira [Wed, 11 Dec 2019 15:53:26 +0000 (15:53 +0000)] 
[gas][arm] Add -mwarn-restrict-it

Add a -m{no-}warn-restrict-it option to control IT related warnings in
ARMv8-A and ARMv8-R.  This is disabled by default.

Committed on behalf of Wilco Dijkstra.

gas/ChangeLog:
2019-12-11  Wilco Dijkstra  <wdijkstr@arm.com>

* config/tc-arm.c (warn_on_restrict_it): Add new variable.
(it_fsm_post_encode): Check warn_on_restrict_it.
(arm_option_table): Add -mwarn-restrict-it/-mno-warn-restrict-it.
* testsuite/gas/arm/armv8-2-fp16-scalar-bad.d: Add -mwarn-restrict-it.
* testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d: Likewise.
* testsuite/gas/arm/armv8-a-bad.d: Likewise.
* testsuite/gas/arm/armv8-a-it-bad.d: Likewise.
* testsuite/gas/arm/armv8-r-bad.d: Likewise.
* testsuite/gas/arm/armv8-r-it-bad.d: Likewise.
* testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d: Likewise.
* testsuite/gas/arm/udf.d: Likewise.

4 years agoFix build on macOS
Tom Tromey [Tue, 10 Dec 2019 21:16:19 +0000 (14:16 -0700)] 
Fix build on macOS

PR build/25268 points out that the build fails on macOS, because on
macOS the "pthread_setname_np" function takes a single argument.

This patch fixes the problem, by introducing a new adapter function
that handles both styles of pthread_setname_np.

This change also meant moving the pthread_setname_np call to the
thread function, because macOS only permits setting the name of the
current thread.  This means that there can be a brief window when gdb
will see the wrong name; but I think this is a minor concern.

Tested by rebuilding on x86-64 Fedora 30, and on macOS High Sierra.
On Linux I also debugged gdb to ensure that the thread names are still
set correctly.

gdb/ChangeLog
2019-12-11  Tom Tromey  <tromey@adacore.com>

PR build/25268:
* gdbsupport/thread-pool.c (set_thread_name): New function.
(thread_pool::set_thread_count): Don't call pthread_setname_np.
(thread_pool::thread_function): Call set_thread_name.

Change-Id: Id7bf28d99ca27a893a9fc87ebb90b15a9c2a9cb4

4 years agoFix the build after bfd_get_signed_8 change
Tom Tromey [Wed, 11 Dec 2019 14:58:46 +0000 (07:58 -0700)] 
Fix the build after bfd_get_signed_8 change

A recent commit changed bfd_get_signed_8 to extend the result to a
bfd_signed_vma.  This caused a compiler error in one spot in my
--enable-targets=all gdb build, where the result of bfd_get_signed_8
was passed to printf.

This patch fixes the build.  Tested by rebuilding.

gdb/ChangeLog
2019-12-11  Tom Tromey  <tromey@adacore.com>

* fbsd-tdep.c (fbsd_core_info_proc_status): Cast result of
bfd_get_signed_8.

Change-Id: Ic015f5fd3d88da6b5da8f7b4e1d11d5c981333db

4 years agoRemove more shifts for sign/zero extension
Alan Modra [Wed, 11 Dec 2019 06:15:14 +0000 (16:45 +1030)] 
Remove more shifts for sign/zero extension

cpu/
* epiphany.cpu (f-sdisp11): Don't sign extend with shifts.
* lm32.cpu (f-branch, f-vall): Likewise.
* m32.cpu (f-lab-8-16): Likewise.
opcodes/
* arc-dis.c (BITS): Don't truncate high bits with shifts.
* nios2-dis.c (nios2_print_insn_arg): Don't sign extend with shifts.
* tic54x-dis.c (print_instruction): Likewise.
* tilegx-opc.c (parse_insn_tilegx): Likewise.
* tilepro-opc.c (parse_insn_tilepro): Likewise.
* visium-dis.c (disassem_class0): Likewise.
* pdp11-dis.c (sign_extend): Likewise.
(SIGN_BITS): Delete.
* epiphany-ibld.c: Regenerate.
* lm32-ibld.c: Regenerate.
* m32c-ibld.c: Regenerate.

4 years agobfd signed overflow fixes
Alan Modra [Wed, 11 Dec 2019 03:02:25 +0000 (13:32 +1030)] 
bfd signed overflow fixes

Aimed at quietening ubsan.

include/
* opcode/mmix.h (PUSHGO_INSN_BYTE): Make unsigned.
(GO_INSN_BYTE, SETL_INSN_BYTE, INCML_INSN_BYTE, INCMH_INSN_BYTE),
(INCH_INSN_BYTE, SWYM_INSN_BYTE, JMP_INSN_BYTE): Likewise.
bfd/
* elf32-rx.c (elf32_rx_relax_section): Avoid signed overflow.
* libaout.h (N_SET_INFO, N_SET_FLAGS): Likewise.
* netbsd.h (write_object_contents): Likewise.
* elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Likewise.
* libhppa.h (HPPA_R_CONSTANT): Don't signed extend with shifts.
(stm32l4xx_create_replacing_stub_vldm): Don't truncate high bits
with shifts.
* elf32-nds32.h (R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG): Define
using 1u shifted left.  Ditto for other macros.
* mmo.c (LOP): Make unsigned.

4 years agoMake bfd_get_8 return a bfd_vma like other bfd_get_* functions
Alan Modra [Wed, 11 Dec 2019 10:36:17 +0000 (21:06 +1030)] 
Make bfd_get_8 return a bfd_vma like other bfd_get_* functions

And similarly for bfd_get_signed_8.

bfd/
* libbfd.c (bfd_get_8): Return a bfd_vma.
(bfd_get_signed_8): Return a bfd_signed_vma.
* bfd-in2.h: Regenerate.
binutils/
* od-xcoff.c (dump_dumpx_core): Adjust for bfd_h_get_8 change.