• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/simark/autotools-bump
RSS
修訂. 時間 作者
63a9e92 users/simark/autotools-bump 2018-06-19 01:00:58 Simon Marchi

Generated files

633f513 2018-06-19 01:00:58 Simon Marchi

Bump to autoconf 2.69 and automake 1.15.1

~~~
New in v2:

- Remove version checks from AUTOMAKE_OPTIONS and AC_PREREQ from
configure.ac's (see rationale below).
- Add AC_USE_SYSTEM_EXTENSIONS to intl/configure.ac (see problem #10).
- Add missing AC_LANG_SOURCE usage in root configure.ac.
- Update README-maintainer-mode
- Re-generated all (hopefully) that needs to be generated. I built
using --enable-maintainer-mode, and grepped around to find references
to prior versions of autoconf/automake.

I forced pushed to users/simark/autotools-bump on sourceware.
~~~

When trying to run the update-gnulib.sh script in gdb, I get this:

Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^ =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1.
Aborting.

Apparently, it's an issue with a regex in automake that triggers a
warning starting with Perl 5.22. It has been fixed in automake 1.15.1.
So I think it's a good excuse to bump the versions of autoconf and
automake used in the gnulib import. And to avoid requiring multiple
builds of autoconf/automake, it was suggested that we bump the required
version of those tools for all binutils-gdb.

For autoconf, the 2.69 version is universally available, so it's an easy
choice. For automake, different distros and distro versions have
different automake versions. But 1.15.1 seems to be the most readily
available as a package. In any case, it's easy to build it from source.

I removed the version checks from AUTOMAKE_OPTIONS and AC_PREREQ,
because I don't think they are useful in our case. They only specify a
lower bound for the acceptable version of automake/autoconf. That's
useful if you let the user choose the version of the tool they want to
use, but want to set a minimum version (because you use a feature that
was introduced in that version). In our case, we force people to use a
specific version anyway. For the autoconf version, we have the check in
config/override.m4 that enforces the version we want. It will be one
less thing to update next time we change autotools version.

This patch only includes the manually edited file. The changes to
generated files are included in the following patch. I have included
the generated changes in the ChangeLog entries below, and would amend
them just before pushing.

To help with testing, I pushed the changes to the
users/simark/autotools-bump on sourceware's git.

I hit a few categories of problems that required some changes. They are
described below along with the chosen solutions.

Problem 1:

configure.ac:17: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see:
configure.ac:17: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Solution 1:

Adjust the code based on the example at that URL.

Problem 2 (in zlib/):

Makefile.am: error: required file './INSTALL' not found
Makefile.am: 'automake --add-missing' can install 'INSTALL'
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './COPYING' not found
Makefile.am: 'automake --add-missing' can install 'COPYING'

Solution 2:

Add the foreign option to AUTOMAKE_OPTIONS.

Problem 3:

doc/Makefile.am:20: error: support for Cygnus-style trees has been removed

Solution 3:

Remove the cygnus options.

Problem 4:

Makefile.am:656: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Solution 4:

Rename "INCLUDES = " to "AM_CPPFLAGS += " (because AM_CPPFLAGS is
already defined earlier).

Problem 5:

doc/Makefile.am:71: warning: suffix '.texinfo' for Texinfo files is discouraged; use '.texi' instead
doc/Makefile.am: warning: Oops!
doc/Makefile.am: It appears this file (or files included by it) are triggering
doc/Makefile.am: an undocumented, soon-to-be-removed automake hack.
doc/Makefile.am: Future automake versions will no longer place in the builddir
doc/Makefile.am: (rather than in the srcdir) the generated '.info' files that
doc/Makefile.am: appear to be cleaned, by e.g. being listed in CLEANFILES or
doc/Makefile.am: DISTCLEANFILES.
doc/Makefile.am: If you want your '.info' files to be placed in the builddir
doc/Makefile.am: rather than in the srcdir, you have to use the shiny new
doc/Makefile.am: 'info-in-builddir' automake option.

Solution 5:

Rename .texinfo files to .texi.

Problem 6:

doc/Makefile.am: warning: Oops!
doc/Makefile.am: It appears this file (or files included by it) are triggering
doc/Makefile.am: an undocumented, soon-to-be-removed automake hack.
doc/Makefile.am: Future automake versions will no longer place in the builddir
doc/Makefile.am: (rather than in the srcdir) the generated '.info' files that
doc/Makefile.am: appear to be cleaned, by e.g. being listed in CLEANFILES or
doc/Makefile.am: DISTCLEANFILES.
doc/Makefile.am: If you want your '.info' files to be placed in the builddir
doc/Makefile.am: rather than in the srcdir, you have to use the shiny new
doc/Makefile.am: 'info-in-builddir' automake option.

Solution 6:

Remove the hack at the bottom of doc/Makefile.am and use
the info-in-builddir automake option.

Problem 7:

doc/Makefile.am:35: error: required file '../texinfo.tex' not found
doc/Makefile.am:35: 'automake --add-missing' can install 'texinfo.tex'

Solution 7:

Use the no-texinfo.tex automake option. We also have one in
texinfo/texinfo.tex, not sure if we should point to that, or move it
(or a newer version of it added with automake --add-missing) to
top-level.

Problem 8:

Makefile.am:131: warning: source file 'config/tc-aarch64.c' is in a subdirectory,
Makefile.am:131: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled. For now, the corresponding output
automake: object file(s) will be placed in the top-level directory. However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.

Solution 8:

Use subdir-objects, that means adjusting references to some .o that will now
be in config/.

Problem 9:

configure.ac:375: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2601: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2617: AC_COMPILE_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2063: AC_CACHE_CHECK is expanded from...
configure.ac:375: the top level

Solution 9:

Use AC_LANG_SOURCE, or use proper quoting.

Problem 10 (in intl/):

configure.ac:7: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
/usr/share/aclocal/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from...
/usr/share/aclocal/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from...
/usr/share/aclocal/threadlib.m4:318: gl_THREADLIB is expanded from...
/usr/share/aclocal/lock.m4:9: gl_LOCK is expanded from...
/usr/share/aclocal/intl.m4:211: gt_INTL_SUBDIR_CORE is expanded from...
/usr/share/aclocal/intl.m4:25: AM_INTL_SUBDIR is expanded from...
/usr/share/aclocal/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
configure.ac:7: the top level

Solution 10:

Add AC_USE_SYSTEM_EXTENSIONS in configure.ac.

ChangeLog:

* libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
* README-maintainer-mode: Update version requirements.
* ar-lib: New file.
* test-driver: New file.
* configure: Re-generate.

bfd/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
(INCLUDES): Rename to ...
(AM_CPPFLAGS): ... this.
* configure.ac: Remove AC_PREREQ.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
info-in-builddir no-texinfo.tex.
(info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
* doc/bfd.texinfo: Rename to ...
* doc/bfd.texi: ... this.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

binutils/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, add
info-in-builddir no-texinfo.tex.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

config/ChangeLog:

* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

etc/ChangeLog:

* configure.in: Remove AC_PREREQ.
* configure: Re-generate.

gas/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11, add subdir-objects.
(TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O): Add config/ prefix.
* configure.ac (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O, emfiles,
extra_objects): Add config/ prefix.
* doc/as.texinfo: Rename to...
* doc/as.texi: ... this.
* doc/Makefile.am: Rename as.texinfo to as.texi throughout.
Remove DISTCLEANFILES hack.
(AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add no-texinfo.tex and
info-in-builddir.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

gdb/ChangeLog:

* common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION,
PACKAGE_STRING, PACKAGE_TARNAME): Undefine.
* configure.ac: Remove AC_PREREQ, add missing quoting.
* gnulib/configure.ac: Modernize usage of
AC_INIT/AM_INIT_AUTOMAKE. Remove AC_PREREQ.
* gnulib/update-gnulib.sh (AUTOCONF_VERSION): Bump to 2.69.
(AUTOMAKE_VERSION): Bump to 1.15.1.
* configure: Re-generate.
* config.in: Re-generate.
* aclocal.m4: Re-generate.
* gnulib/aclocal.m4: Re-generate.
* gnulib/config.in: Re-generate.
* gnulib/configure: Re-generate.
* gnulib/import/Makefile.in: Re-generate.

gdb/gdbserver/ChangeLog:

* configure.ac: Remove AC_PREREQ, add missing quoting.
* configure: Re-generate.
* config.in: Re-generate.
* aclocal.m4: Re-generate.

gdb/testsuite/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.

gold/ChangeLog:

* configure.ac: Remove AC_PREREQ, add missing quoting and usage
of AC_LANG_SOURCE.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
* testsuite/Makefile.in: Re-generate.

gprof/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* Makefile.am: Remove DISTCLEANFILES hack.
(AUTOMAKE_OPTIONS): Remove 1.11, add info-in-builddir.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
* gconfig.in: Re-generate.

intl/ChangeLog:

* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
* configure: Re-generate.
* config.h.in: Re-generate.
* aclocal.m4: Re-generate.

ld/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* Makefile.am: Remove DISTCLEANFILES hack, rename ld.texinfo to
ld.texi, ldint.texinfo to ldint.texi throughout.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
* README: Rename ld.texinfo to ld.texi, ldint.texinfo to
ldint.texi throughout.
* gen-doc.texi: Likewise.
* h8-doc.texi: Likewise.
* ld.texinfo: Rename to ...
* ld.texi: ... this.
* ldint.texinfo: Rename to ...
* ldint.texi: ... this.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.

libdecnumber/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* aclocal.m4.

libiberty/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* config.in: Re-generate.

opcodes/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
* configure.ac: Remove AC_PREREQ.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.

readline/ChangeLog.gdb:

* configure: Re-generate.
* examples/rlfe/configure: Re-generate.

sim/ChangeLog:

* All configure.ac: Remove AC_PREREQ.
* All configure: Re-generate.

zlib/ChangeLog.bin-gdb:

* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add
foreign.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.

0388427 2018-06-19 00:27:20 Simon Marchi

include: Sync with GCC

Bring changes from GCC in shared headers.

include/ChangeLog:

Sync with GCC

2018-05-24 Tom Rix <trix@juniper.net>

* dwarf2.def (DW_FORM_strx*, DW_FORM_addrx*): New.

2017-11-20 Kito Cheng <kito.cheng@gmail.com>

* longlong.h [__riscv] (__umulsidi3): Define.
[__riscv] (umul_ppmm): Likewise.
[__riscv] (__muluw3): Likewise.

db67d45 2018-06-18 22:37:47 Simon Marchi

configure.ac: Sync with GCC

Here's an extra one... I'll need to make some changes to the root
configure.ac. This patch makes sure it is in sync with GCC first.

ChangeLog:

* configure.ac: Sync with GCC, remove MPX-related things.

f57a3bc 2018-06-18 22:37:46 Simon Marchi

libdecnumber: Sync with GCC

b0f49e3 2018-06-18 22:37:44 Simon Marchi

zlib: Sync with GCC

zlib/ChangeLog.bin-gdb:

Sync with FSF GCC sources.

978588d 2018-06-18 22:34:12 Simon Marchi

libiberty: Sync with GCC

Also sync include/simple-object.h, which goes together with the change
in libiberty.

37f980d 2018-06-18 22:33:48 Simon Marchi

config: Sync with GCC

... and re-generate all possible configure files, since they may depend
on things in config/.

config/ChangeLog:

Sync with GCC
2018-06-08 Martin Liska <mliska@suse.cz>

* bootstrap-mpx.mk: Remove.

2018-05-10 Martin Liska <mliska@suse.cz>

PR bootstrap/64914
* bootstrap-ubsan.mk: Define UBSAN_BOOTSTRAP.

2018-05-09 Joshua Watt <jpewhacker@gmail.com>

* ax_pthread.m4: Add file.

2018-05-08 Richard Biener <rguenther@suse.de>

PR bootstrap/85571
* bootstrap-lto-noplugin.mk: Disable compare.
* bootstrap-lto.mk: Supply contrib/compare-lto for do-compare.

2018-04-24 H.J. Lu <hongjiu.lu@intel.com>

PR bootstrap/85490
* bootstrap-cet.mk (STAGE4_CFLAGS): New.

2018-04-24 H.J. Lu <hongjiu.lu@intel.com>

PR target/85485
* bootstrap-cet.mk (STAGE2_CFLAGS): Remove -mcet.
(STAGE3_CFLAGS): Likewise.

2018-04-24 H.J. Lu <hongjiu.lu@intel.com>

PR target/85485
* cet.m4 (GCC_CET_FLAGS): Replace -mcet with -mshstk.

2018-04-19 Jakub Jelinek <jakub@redhat.com>

* cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace
--enable-cet=default with --enable-cet=auto.

2018-04-18 David Malcolm <dmalcolm@redhat.com>

PR jit/85384
* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.

77236b8 2018-06-18 21:30:32 Alan Modra

Build ifunc tests when non-native

Plus a number of fixes to the pr23169 tests.

* testsuite/lib/ld-lib.exp (check_ifunc_available): Pass without
running executable when non-native.
(check_ifunc_attribute_available): Likewise.
* testsuite/ld-ifunc/pr23169a.rd: Remove extraneous lines. Match
st_other strings. Pass when func is an ifunc.
* testsuite/ld-ifunc/pr23169b.rd: Remove extraneous lines. Correct
reloc regexp. Correct match-anything line.
* testsuite/ld-ifunc/pr23169c.rd: Remove extraneous lines. Match
st_other strings.

ed1299f 2018-06-18 20:56:44 Mephi

Add support for the TLV relocation generated by LLVM for x86_64 MACH-O targets.

PR 23297
* mach-o-x86-64.c (x86_64_howto_table): Add entry for
BFD_RELOC_MACH_O_X86_64_RELOC_TLV.
(bfd_mach_o_x86_64_canonicalize_one_reloc): Handle the new reloc.
(bfd_mach_o_x86_64_swap_reloc_out): Likewise.
* reloc.c (BFD_RELOC_MACH_O_X86_64_TV): New entry.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.

0289527 2018-06-18 18:10:00 Alan Hayward

Ptrace support for AArch64 SVE gdbserver

Add checks to detect SVE tdesc. Easiest way to do this is by checking the
size of the vector registers.

Use the common aarch64 ptrace copy functions for reading/writing registers.
A wrapper is required due to the common functions using reg_buffer_common.

gdbserver/
* linux-aarch64-low.c (is_sve_tdesc): New function.
(aarch64_sve_regs_copy_to_regcache): Likewise.
(aarch64_sve_regs_copy_from_regcache): Likewise.
(aarch64_regs_info): Add SVE checks.
(initialize_low_arch): Initialize SVE.

e9902bf 2018-06-18 18:06:53 Alan Hayward

Ptrace support for Aarch64 SVE

Add support for reading and writing registers for Aarch64 SVE.

We need to support the cases where the kernel only gives us a
fpsimd structure. This occurs when there is no active SVE state
in the kernel (for example, after starting a new process).

Added checks to make sure the vector length has not changed whilst
the process is running.

gdb/
* aarch64-linux-nat.c (fetch_sveregs_from_thread): New function.
(store_sveregs_to_thread): Likewise.
(aarch64_linux_fetch_inferior_registers): Check for SVE.
(aarch64_linux_store_inferior_registers): Likewise.
* nat/aarch64-sve-linux-ptrace.c (aarch64_sve_get_sveregs): New
function.
(aarch64_sve_regs_copy_to_regcache): Likewise.
(aarch64_sve_regs_copy_from_regcache): Likewise.
* nat/aarch64-sve-linux-ptrace.h (aarch64_sve_get_sveregs): New
declaration.
(aarch64_sve_regs_copy_to_regcache): Likewise.
(aarch64_sve_regs_copy_from_regcache): Likewise.
(sve_context): Structure from Linux headers.
(SVE_SIG_ZREGS_SIZE): Define from Linux headers.
(SVE_SIG_ZREG_SIZE): Likewise.
(SVE_SIG_PREG_SIZE): Likewise.
(SVE_SIG_FFR_SIZE): Likewise.
(SVE_SIG_REGS_OFFSET): Likewise.
(SVE_SIG_ZREGS_OFFSET): Likewise.
(SVE_SIG_ZREG_OFFSET): Likewise.
(SVE_SIG_ZREGS_SIZE): Likewise.
(SVE_SIG_PREGS_OFFSET): Likewise.
(SVE_SIG_PREG_OFFSET): Likewise.
(SVE_SIG_PREGS_SIZE): Likewise.
(SVE_SIG_FFR_OFFSET): Likewise.
(SVE_SIG_REGS_SIZE): Likewise.
(SVE_SIG_CONTEXT_SIZE): Likewise.
(SVE_PT_REGS_MASK): Likewise.
(SVE_PT_REGS_FPSIMD): Likewise.
(SVE_PT_REGS_SVE): Likewise.
(SVE_PT_VL_INHERIT): Likewise.
(SVE_PT_VL_ONEXEC): Likewise.
(SVE_PT_REGS_OFFSET): Likewise.
(SVE_PT_FPSIMD_OFFSET): Likewise.
(SVE_PT_FPSIMD_SIZE): Likewise.
(SVE_PT_SVE_ZREG_SIZE): Likewise.
(SVE_PT_SVE_PREG_SIZE): Likewise.
(SVE_PT_SVE_FFR_SIZE): Likewise.
(SVE_PT_SVE_FPSR_SIZE): Likewise.
(SVE_PT_SVE_FPCR_SIZE): Likewise.
(__SVE_SIG_TO_PT): Likewise.
(SVE_PT_SVE_OFFSET): Likewise.
(SVE_PT_SVE_ZREGS_OFFSET): Likewise.
(SVE_PT_SVE_ZREG_OFFSET): Likewise.
(SVE_PT_SVE_ZREGS_SIZE): Likewise.
(SVE_PT_SVE_PREGS_OFFSET): Likewise.
(SVE_PT_SVE_PREG_OFFSET): Likewise.
(SVE_PT_SVE_PREGS_SIZE): Likewise.
(SVE_PT_SVE_FFR_OFFSET): Likewise.
(SVE_PT_SVE_FPSR_OFFSET): Likewise.
(SVE_PT_SVE_FPCR_OFFSET): Likewise.
(SVE_PT_SVE_SIZE): Likewise.
(SVE_PT_SIZE): Likewise.
(HAS_SVE_STATE): New define.

gdbserver/
* Makefile.in: Add aarch64-sve-linux-ptrace.c.

17a1cc8 2018-06-18 18:02:56 Alan Hayward

Add Aarch64 SVE compatibility macros

This header provides compatibility support for SVE allow building
even when the underlying host system lacks support for SVE.
If the binary is then run on an SVE-enabled kernel then support
will automatically be available.

gdb/
* nat/aarch64-sve-linux-sigcontext.h: New file.
* nat/aarch64-sve-linux-ptrace.h (SVE_VQ_BYTES): Move to
new files.
(SVE_VQ_MIN): Likewise.
(SVE_VQ_MAX): Likewise.
(SVE_VL_MIN): Likewise.
(SVE_VL_MAX): Likewise.
(SVE_NUM_ZREGS): Likewise.
(SVE_NUM_PREGS): Likewise.
(sve_vl_valid): Likewise.
(struct user_sve_header): Likewise.

0fe3a55 2018-06-18 16:04:38 Tom de Vries

[gdb/testsuite/ada] Fix number-of-bp test in bp_inlined_func.exp

At the moment, bp_inlined_func.exp passes for a combined current gcc and
gdb-binutils repos build but fails for a build with system gcc (7.3.1) and
ld (2.29.1).

It checks for 4 breakpoints on read_small:
...
gdb_test "break read_small" \
"Breakpoint $decimal at $hex: read_small\\. \\(4 locations\\)" \
"set breakpoint at read_small"
...
and fails because it gets 5 breakpoint locations instead:
...
(gdb) break read_small
Breakpoint 2 at 0x401f9a: read_small. (5 locations)
(gdb) FAIL: gdb.ada/bp_inlined_func.exp: set breakpoint at read_small
...

The 4 expected breakpoint locations are inlined versions of read_small, and
the 5th breakpoint location has this address:
...
(gdb) info breakpoint
Num Type Disp Enb Address What
1 breakpoint keep y <MULTIPLE>
1.1 y 0x0000000000401f9a in b.read_small
at bp_inlined_func/b.adb:20
...
which is the read_small function itself:
...
(gdb) x 0x0000000000401f9a
0x401f9a <b__read_small+4>: 0x22f8058b
...

This patch updates the test to allow 5 breakpoint locations.

Tested on the configurations mentioned above, on x86_64.

2018-06-18 Tom de Vries <tdevries@suse.de>

* gdb.ada/bp_inlined_func.exp: Allow 5 breakpoint locations.

fd8079f 2018-06-18 09:01:09 GDB Administrator

Automatic date update in version.in

8887b88 2018-06-17 09:00:41 GDB Administrator

Automatic date update in version.in

7010835 2018-06-16 09:03:57 Andrew Burgess

gdb: Don't drop SIGSTOP during stop_all_threads

This patch fixes an issue where GDB would sometimes hang when
attaching to a multi-threaded process. This issue was especially
likely to trigger if the machine (running the inferior) was under
load.

In summary, the problem is an imbalance between two functions in
linux-nat.c, stop_callback and stop_wait_callback. In stop_callback
we send SIGSTOP to a thread, but _only_ if the thread is not already
stopped, and if it is not signalled, which means it should stop soon.
In stop_wait_callback we wait for the SIGSTOP to arrive, however, we
are aware that the thread might have been signalled for some other
reason, and so if a signal other than SIGSTOP causes the thread to
stop then we stash that signal away so it can be reported back later.
If we get a SIGSTOP then this is discarded, after all, this signal was
sent from stop_callback. Except that this might not be the case, it
could be that SIGSTOP was sent to a thread from elsewhere in GDB, in
which case we would not have sent another SIGSTOP from stop_callback
and the SIGSTOP received in stop_wait_callback should not be ignored.

Below I've laid out the exact sequence of events that I saw that lead
me to track down the above diagnosis.

After attaching to the inferior GDB sends a SIGSTOP to all of the
threads and then returns to the event loop waiting for interesting
things to happen.

Eventually the first target event is detected (this will be the first
SIGSTOP arriving) and GDB calls inferior_event_handler which calls
fetch_inferior_event. Inside fetch_inferior_event GDB calls
do_target_wait which calls target_wait to find a thread with an event.

The target_wait call ends up in linux_nat_wait_1, which first checks
to see if any threads already have stashed stop events to report, and
if there are none then we enter a loop fetching as many events as
possible out of the kernel. This event fetching is non-blocking, and
we give up once the kernel has no more events ready to give us.

All of the events from the kernel are passed through
linux_nat_filter_event which stashes the wait status for all of the
threads that reported a SIGSTOP, these will be returned by future
calls to linux_nat_wait_1.

Lets assume for a moment that we've attached to a multi-threaded
inferior, and that all but one thread has reported its stop during the
initial wait call in linux_nat_wait_1. The other thread will be
reporting a SIGSTOP, but the kernel has not yet managed to deliver
that signal to GDB before GDB gave up waiting and continued handling
the events it already had. GDB selects one of the threads that has
reported a SIGSTOP and passes this thread ID back to
fetch_inferior_event.

To handle the thread's SIGSTOP, GDB calls handle_signal_stop, which
calls stop_all_threads, this calls wait_one, which in turn calls
target_wait.

The first call to target_wait at this point will result in a stashed
wait status being returned, at which point we call setup_inferior.
The call to setup_inferior leads to a call into try_thread_db_load_1
which results in a call to linux_stop_and_wait_all_lwps. This in turn
calls stop_callback on each thread followed by stop_wait_callback on
each thread.

We're now ready to make the mistake. In stop_callback we see that our
problem thread is not stopped, but is signalled, so it should stop
soon. As a result we don't send another SIGSTOP.

We then enter stop_wait_callback, eventually the problem thread stops
with SIGSTOP which we _incorrectly_ assume came from stop_callback,
and we discard.

Once stop_wait_callback has done its damage we return from
linux_stop_and_wait_all_lwps, finish in try_thread_db_load_1, and
eventually unwind back to the call to setup_inferior in
stop_all_threads. GDB now loops around, and performs another
target_wait to get the next event from the inferior.

The target_wait calls causes us to once again reach linux_nat_wait_1,
and we pass through some code that calls resume_stopped_resumed_lwps.
This allows GDB to resume threads that are physically stopped, but
which GDB doesn't see any good reason for the thread to remain
stopped. In our case, the problem thread which had its SIGSTOP
discarded is stopped, but doesn't have a stashed wait status to
report, and so GDB sets the thread going again.

We are now stuck waiting for an event on the problem thread that might
never arrive.

When considering how to write a test for this bug I struggled. The
issue was only spotted _randomly_ when a machine was heavily loaded
with many multi-threaded applications, and GDB was being attached (by
script) to all of these applications in parallel. In one reproducer I
required around 5 applications each of 5 threads per machine core in
order to reproduce the bug 2 out of 3 times.

What we really want to do though is simulate the kernel being slow to
report events through waitpid during the initial attach. The solution
I came up with was to write an LD_PRELOAD library that intercepts
(some) waitpid calls and rate limits them to one per-second. Any more
than that simply return 0 indicating there's no event available.
Obviously this can only be applied to waitpid calls that have the
WNOHANG flag set.

Unfortunately, once you ignore a waitpid call GDB can get a bit stuck.
Usually, once the kernel has made a child status available to waitpid
GDB will be sent a SIGCHLD signal. However, if the kernel makes 5
child statuses available but, due to the preload library we only
collect one of them, then the kernel will not send any further SIGCHLD
signals, and so, when GDB, thinking that the remaining statuses have
not yet arrived sits waiting for a SIGCHLD it will be disappointed.

The solution, implemented within the preload library, is that, when we
hold back a waitpid result from GDB we spawn a new thread. This
thread delays for a short period, and then sends GDB a SIGCHLD. This
causes GDB to retry the waitpid, at which point sufficient time has
passed and our library allows the waitpid call to complete.

gdb/ChangeLog:

* linux-nat.c (stop_wait_callback): Don't discard SIGSTOP if it
was requested by GDB.

gdb/testsuite/ChangeLog:

* gdb.threads/attach-slow-waitpid.c: New file.
* gdb.threads/attach-slow-waitpid.exp: New file.
* gdb.threads/slow-waitpid.c: New file.

c8e1763 2018-06-16 09:00:56 GDB Administrator

Automatic date update in version.in

479b3ef 2018-06-16 03:43:25 Tom de Vries

[gdb] Add me to write-after-approval section in MAINTAINERS

I've committed one patch modifying gdb ([gdb/cli] Honour 'print pretty' when
printing result of finish command) and I'm covered by the Novell blanket
copyright assignment. So AFAIU, I qualify for write-after-approval.

This patch adds me to the MAINTAINERS file in the write-after-approval section.

2018-06-15 Tom de Vries <tdevries@suse.de>

* MAINTAINERS (Write After Approval): Add Tom de Vries.

5785bb8 2018-06-15 09:00:48 GDB Administrator

Automatic date update in version.in

8199b8f 2018-06-15 07:38:32 Simon Marchi

update-gnulib.sh: Report required versions of autoconf/aclocal

Update the messages printed when the wrong version of autoconf/aclocal
is found to include the expected version too, like we already do for
automake.

gdb/ChangeLog:

* gnulib/update-gnulib.sh: Print expected versions of
autoconf/aclocal.

55c748a 2018-06-15 07:24:55 Simon Marchi

type alignment: Use type_length_units

The type alignment value is returned in 8-bit-bytes instead of target
memory addressable units. For example, on a target with 16-bit-bytes
where sizeof(int) == 1 (one addressable unit), alignof(int) currently
returns 2. After, this patch, it returns 1.

gdb/ChangeLog:

* arch-utils.c (default_type_align): Use type_length_units.
* gdbtypes.c (type_align): Use type_length_units.

b9a3c02 2018-06-15 06:46:15 Sergio Durigan Junior

Fix "beneath" conversion on AIX

GDB build on AIX is broken according to BuildBot:

../../binutils-gdb/gdb/aix-thread.c: In member function 'virtual void aix_thread_target::mourn_inferior()':
../../binutils-gdb/gdb/aix-thread.c:1735:34: error: 'beneath' cannot be used as a function
target_ops *beneath = beneath ();
^
This obvious commit fixes it. There's apparently another issue
breaking the build there, but that's unrelated.

gdb/ChangeLog:
2018-06-14 Sergio Durigan Junior <sergiodj@redhat.com>

* aix-thread.c (aix_thread_target::xfer_partial): Use
"beneath" as a method.

6f20c94 2018-06-15 05:34:49 Faraz Shahbazker

MIPS: Add Global INValidate ASE support

Add support for the Global INValidate Application Specific Extension
for Release 6 of the MIPS Architecture.

[1] "MIPS Architecture for Programmers Volume II-A: The MIPS32
Instruction Set Manual", Imagination Technologies Ltd., Document
Number: MD00086, Revision 6.06, December 15, 2016, Section 3.2
"Alphabetical List of Instructions", pp. 187-191

bfd/
* elfxx-mips.c (print_mips_ases): Add GINV extension.

binutils/
* readelf.c (print_mips_ases): Add GINV extension.

gas/
* NEWS: Mention MIPS Global INValidate ASE support.
* config/tc-mips.c (options): Add OPTION_GINV and OPTION_NO_GINV.
(md_longopts): Likewise.
(mips_ases): Define availability for GINV.
(mips_convert_ase_flags): Map ASE_GINV to AFL_ASE_GINV.
(md_show_usage): Add help for -mginv and -mno-ginv.
* doc/as.texinfo: Document -mginv, -mno-ginv.
* doc/c-mips.texi: Document -mginv, -mno-ginv, .set ginv and
.set noginv.
* testsuite/gas/mips/ase-errors-1.s: Add error checks for GINV
ASE.
* testsuite/gas/mips/ase-errors-2.s: Likewise.
* testsuite/gas/mips/ase-errors-1.l: Likewise.
* testsuite/gas/mips/ase-errors-2.l: Likewise.
* testsuite/gas/mips/ginv.d: New test.
* testsuite/gas/mips/ginv-err.d: New test.
* testsuite/gas/mips/ginv-err.l: New test stderr output.
* testsuite/gas/mips/ginv.s: New test source.
* testsuite/gas/mips/ginv-err.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

include/
* elf/mips.h (AFL_ASE_GINV, AFL_ASE_RESERVED1): New macros.
(AFL_ASE_MASK): Update to include AFL_ASE_GINV.
* opcode/mips.h: Document "+\" operand format.
(ASE_GINV): New macro.

opcodes/
* mips-dis.c (mips_arch_choices): Add GINV to mips32r6 and
mips64r6 descriptors.
(parse_mips_ase_option): Handle -Mginv option.
(print_mips_disassembler_options): Document -Mginv.
* mips-opc.c (decode_mips_operand) <+\>: New operand format.
(GINV): New macro.
(mips_opcodes): Define ginvi and ginvt.

8993072 2018-06-15 05:34:48 Maciej W. Rozycki

MIPS: Add CRC ASE support (ChangeLog)

Add missing ChangeLog entry in gas/ for NEWS from commit 730c31740a69
("MIPS: Add CRC ASE support").

74fdb8f 2018-06-15 05:31:41 Tom de Vries

[gdb] Fixup incomplete patch 0dbfed25e9

87a8eca 2018-06-15 05:28:39 Philippe Waroquiers

Fix/improve on-line help of 'define' command.

There is an inconsistency between the doc and the online help.
=> the doc is correct, so fixing/improving the on-line help.

2018-06-14 Philippe Waroquiers <philippe.waroquiers@skynet.be>

* cli/cli-script.c (_initialize_cli_script): Fix online documentation
of 'define' command.

0dbfed2 2018-06-15 05:19:51 Tom de Vries

[gdb] Add 'Concept Index' entry '&' for background execution

GDB's execution commands have a foreground and background variant: f.i.,
there's 'continue' and 'continue&', and both are listed individually in the
'Command, Variable, and Function Index'. But the '&' is not listed in the
'Concept Index' as being connected with the concept background execution.

This patch adds an '&' in the 'Concept Index':
...
* $_, $__, and value history: Memory. (line 119)
+* &, background execution of commands: Background Execution.
+ (line 16)
* --annotate: Mode Options. (line 121)
...
pointing to this line in 'Background Execution':
...
To specify background execution, add a '&' to the command.
...

Build on x86_64.

2018-06-14 Tom de Vries <tdevries@suse.de>

* gdb.texinfo (Background Execution): Add @cindex for '&'.

14897d6 2018-06-15 01:47:03 Pedro Alves

Avoid gdb.base/fork-running-state.exp lingering processes

Currently, the gdb.base/fork-running-state.exp testcase leaves a few
processes lingering until a 3 minutes alarm kills them:

pedro 28308 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state
pedro 28340 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state
pedro 28372 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state
pedro 28400 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state
pedro 28431 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state
pedro 28463 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state

Those processes used to kill themselves, but that was changed by
commit f50d8a2eaea0 ("Fix gdb.base/fork-running-state.exp race").

This commit restores the self-killing, but only in the cases gdb won't
try killing the processes, thus avoiding the old race.

(The restored code in fork_parent isn't exactly the same as it was.
In this version, we're exiting immediately when 'wait' returns
success, while in the old version we'd loop again and end up in the
perror call. The output from that perror call is not expected by the
"kill inferior" tests, and would result in a test FAIL.)

gdb/testsuite/ChangeLog:
2018-06-14 Pedro Alves <palves@redhat.com>

* gdb.base/fork-running-state.c: Include <errno.h>.
(exit_if_relative_exits): New.
(fork_child): If 'exit_if_relative_exits' is true, exit if the parent
exits.
(fork_parent): If 'exit_if_relative_exits' is true, exit if the
child exits.

5d9a060 2018-06-14 22:30:47 Tom de Vries

[gdb/cli] Honour 'print pretty' when printing result of finish command

Consider this testcase:
...
struct s {
int a;
int b;
};

struct s foo ()
{
struct s r;
r.a = 1;
r.b = 2;
return r;
}

int
main (void)
{
struct s v;
v = foo ();
return v.a + v.b;
}
...

When we compile it with -g, load the exec with gdb, and run till the end of foo,
we can print r:
...
(gdb) p r
$1 = {a = 1, b = 2}
...

and by setting pretty printing to on, we can get the fields of r printed each
on its own line:
...
(gdb) set print pretty
(gdb) p r
$2 = {
a = 1,
b = 2
}
...

However, when we finish foo, the printed function result value is not using
the pretty printing setting:
...
(gdb) finish
Run till exit from #0 foo () at test.c:11
0x00000000004004c1 in main () at test.c:18
18 v = foo ();
Value returned is $3 = {a = 1, b = 2}
...

This patch fixes that by using get_user_print_options instead of
get_no_prettyformat_print_options in print_return_value_1, which gives us:
...
(gdb) finish
Run till exit from #0 foo () at test.c:11
0x00000000004004c1 in main () at test.c:18
18 v = foo ();
Value returned is $2 = {
a = 1,
b = 2
}
...

Build & reg-tested on x86_64.

2018-06-14 Tom de Vries <tdevries@suse.de>

PR cli/22573
* infcmd.c (print_return_value_1): Use get_user_print_options instead of
get_no_prettyformat_print_options.

* gdb.base/finish-pretty.c: New test.
* gdb.base/finish-pretty.exp: New file.