]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 6 Mar 2019 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoRemove some Python 3 #ifs
Tom Tromey [Tue, 5 Mar 2019 21:58:24 +0000 (14:58 -0700)] 
Remove some Python 3 #ifs

A recent patch from Kevin Buettner taught me that the PyBytes API is
available on Python 2.  This patch removes a couple of related #ifs in
the Python code.

Tested on x86-64 Fedora 29, using both Python 3.7 and Python 2.7.

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

* python/py-prettyprint.c (print_string_repr): Remove #if.
* python/py-utils.c (unicode_to_encoded_string): Remove #if.

5 years agoChange the_dummy_target to be a global
Tom Tromey [Mon, 4 Mar 2019 20:37:59 +0000 (13:37 -0700)] 
Change the_dummy_target to be a global

While debugging gdb, I printed the target stack and got:

    (top-gdb) p g_target_stack
    $10 = {
      m_top = thread_stratum,
      m_stack = {0x142b0b0, 0x13da600 <exec_ops>, 0x1c70690, 0x13d63b0 <ravenscar_ops>, 0x0, 0x0, 0x0}
    }

(This is clearly from before the change to make ravenscar
multi-target-capable.)

Here, 0x142b0b0 is the singleton dummy target.  It seems to me that
since this is always a singleton, it would be a bit nicer if it were a
global, so that it would be noted in the above.

This patch implements this idea, and now I get:

    (top-gdb) p g_target_stack
    $2 = {
      m_top = dummy_stratum,
      m_stack = {0x1f1b040 <the_dummy_target>, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
    }

I did not do the same for the debug target.  It didn't seem as useful
to me.

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

* target.c (the_dummy_target): Move later.  Change type to
"dummy_target".
(initialize_targets): Don't initialize the_dummy_target.

5 years agoSmall fix to gdb.Value constructor doc
Simon Marchi [Tue, 5 Mar 2019 19:00:42 +0000 (14:00 -0500)] 
Small fix to gdb.Value constructor doc

The synopsis of the two-parameters form of the gdb.Value constructor is
currently shown as

    Value.__init__ (val, [, type ])

in the documentation.

First, there is an extra comma, which I think we can remove in any
case.

Then, since the type parameter is not optional, I would not put in
between square brackets.  Those usually indicate that something is
optional.

With this patch, it appears as:

    Value.__init__ (val, type)

gdb/doc/ChangeLog:

* python.texi (Values From Inferior): Change synopsys of the
second form of Value.__init__.

5 years agoFix a spelling mistake: "complaint" instead of "compliant".
Nick Clifton [Tue, 5 Mar 2019 17:32:35 +0000 (17:32 +0000)] 
Fix a spelling mistake: "complaint" instead of "compliant".

PR 24295
* doc/binutils.texi (ar cmdline): Fix spelling mistake.

5 years agoRemove gdb_bfd_fdopenr
Tom Tromey [Tue, 5 Mar 2019 16:03:55 +0000 (09:03 -0700)] 
Remove gdb_bfd_fdopenr

I noticed that gdb_bfd_fdopenr is no longer used, so this patch
removes it.  Tested by rebuilding and by grep.

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

* gdb_bfd.c (gdb_bfd_fdopenr): Remove.
* gdb_bfd.h (gdb_bfd_fdopenr): Don't declare.

5 years agoUpdated Swedish translation for the binutils sub-directory.
Nick Clifton [Tue, 5 Mar 2019 16:04:18 +0000 (16:04 +0000)] 
Updated Swedish translation for the binutils sub-directory.

5 years agoRemove excess calls to gdb_flush
Tom Tromey [Tue, 19 Feb 2019 20:36:17 +0000 (13:36 -0700)] 
Remove excess calls to gdb_flush

A customer noticed some mildly odd MI output, where CLI output was
split into multiple MI strings at unusual boundaries, like this:

    ~"$1 = (b => true"
    ~", p => 0x407260"

This is technically correct according to the MI spec, but still
unusual, in that there's no particular reason for the string to be
split where it is.

I tracked this down to a call to gdb_flush in generic_val_print.
Then, I went through all calls to gdb_flush and removed the ones I
thought were superfluous.  In particular:

* Any call in the value-printing code;
* Likewise the type-printing code (just a single call); and
* Any call that immediately followed a printf that obviously
  ended with a newline, my belief being that gdb's standard output
  streams are line buffered (by inheriting the behavior from stdio)

Regression tested on x86-64 Fedora 29.

I didn't add a new test case.  I tend to think we don't necessarily
want to specify this behavior in the tests.  Let me know what you
think of this.

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

* windows-nat.c (windows_nat_target::attach)
(windows_nat_target::detach): Don't call gdb_flush.
* valprint.c (generic_val_print, val_print, val_print_string):
Don't call gdb_flush.
* utils.c (defaulted_query): Don't call gdb_flush.
* typeprint.c (print_type_scalar): Don't call gdb_flush.
* target.c (target_announce_detach): Don't call gdb_flush.
* sparc64-tdep.c (adi_print_versions): Don't call gdb_flush.
* remote.c (extended_remote_target::attach): Don't call
gdb_flush.
* procfs.c (procfs_target::detach): Don't call gdb_flush.
* printcmd.c (do_examine): Don't call gdb_flush.
(info_display_command): Don't call gdb_flush.
* p-valprint.c (pascal_val_print): Don't call gdb_flush.
* nto-procfs.c (nto_procfs_target::attach): Don't call gdb_flush.
* memattr.c (info_mem_command): Don't call gdb_flush.
* mdebugread.c (mdebug_build_psymtabs): Don't call gdb_flush.
* m2-valprint.c (m2_val_print): Don't call gdb_flush.
* infrun.c (follow_exec, handle_command): Don't call gdb_flush.
* inf-ptrace.c (inf_ptrace_target::attach): Don't call gdb_flush.
* hppa-tdep.c (unwind_command): Don't call gdb_flush.
* gnu-nat.c (gnu_nat_target::attach): Don't call gdb_flush.
(gnu_nat_target::detach): Don't call gdb_flush.
* f-valprint.c (f_val_print): Don't call gdb_flush.
* darwin-nat.c (darwin_nat_target::attach): Don't call gdb_flush.
* cli/cli-script.c (read_command_lines): Don't call gdb_flush.
* cli/cli-cmds.c (shell_escape, print_disassembly): Don't call
gdb_flush.
* c-valprint.c (c_val_print): Don't call gdb_flush.
* ada-valprint.c (ada_print_scalar): Don't call gdb_flush.

5 years agoAdd ATTRIBUTE_UNUSED_RESULT to ref_ptr::release
Tom Tromey [Tue, 26 Feb 2019 21:59:47 +0000 (14:59 -0700)] 
Add ATTRIBUTE_UNUSED_RESULT to ref_ptr::release

This applies ATTRIBUTE_UNUSED_RESULT to ref_ptr::release and updates a
few spots to comply.  I believe one use in install_default_visualizer
was in error, fixed by this patch.

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

* varobj.c (update_dynamic_varobj_children): Update.
(install_default_visualizer): Use reset, not release.
* value.c (set_internalvar): Update.
* dwarf2loc.c (value_of_dwarf_reg_entry): Update.
* common/gdb_ref_ptr.h (class ref_ptr) <release>: Add
ATTRIBUTE_UNUSED_RESULT.

5 years agoAdd ATTRIBUTE_UNUSED_RESULT to scoped_remote_fd::release
Tom Tromey [Tue, 26 Feb 2019 21:52:47 +0000 (14:52 -0700)] 
Add ATTRIBUTE_UNUSED_RESULT to scoped_remote_fd::release

This applies ATTRIBUTE_UNUSED_RESULT to scoped_remote_fd::release.

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

* remote.c (class scoped_remote_fd) <release>: Add
ATTRIBUTE_UNUSED_RESULT.

5 years agoAdd ATTRIBUTE_UNUSED_RESULT to macro_buffer
Tom Tromey [Tue, 26 Feb 2019 21:52:05 +0000 (14:52 -0700)] 
Add ATTRIBUTE_UNUSED_RESULT to macro_buffer

This applies ATTRIBUTE_UNUSED_RESULT to macro_buffer::release.

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

* macroexp.c (struct macro_buffer) <release>: Add
ATTRIBUTE_UNUSED_RESULT.

5 years agoAdd ATTRIBUTE_UNUSED_RESULT to scoped_mmap
Tom Tromey [Tue, 26 Feb 2019 21:46:40 +0000 (14:46 -0700)] 
Add ATTRIBUTE_UNUSED_RESULT to scoped_mmap

This applies ATTRIBUTE_UNUSED_RESULT to scoped_mmap::release and fixes
a couple of spots to comply.

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

* nat/linux-btrace.c (linux_enable_bts, linux_enable_pt): Update.
* common/scoped_mmap.h (class scoped_mmap) <release>: Add
ATTRIBUTE_UNUSED_RESULT.

5 years agoAdd ATTRIBUTE_UNUSED_RESULT to scoped_fd
Tom Tromey [Tue, 26 Feb 2019 21:44:29 +0000 (14:44 -0700)] 
Add ATTRIBUTE_UNUSED_RESULT to scoped_fd

This applies ATTRIBUTE_UNUSED_RESULT to scoped_fd::release.

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

* common/scoped_fd.h (class scoped_fd) <release>: Add
ATTRIBUTE_UNUSED_RESULT.

5 years agoAdd ATTRIBUTE_UNUSED_RESULT to parser_state
Tom Tromey [Tue, 26 Feb 2019 21:39:55 +0000 (14:39 -0700)] 
Add ATTRIBUTE_UNUSED_RESULT to parser_state

This applies ATTRIBUTE_UNUSED_RESULT to parser_state::release.

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

* parser-defs.h (struct parser_state) <release>: Add
ATTRIBUTE_UNUSED_RESULT.

5 years agoIntroduce ATTRIBUTE_UNUSED_RESULT and use it
Tom Tromey [Tue, 26 Feb 2019 21:39:01 +0000 (14:39 -0700)] 
Introduce ATTRIBUTE_UNUSED_RESULT and use it

This introduces the new ATTRIBUTE_UNUSED_RESULT define, and applies it
to gdb_argv::release.

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

* utils.h (class gdb_argv) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
* common/common-defs.h (ATTRIBUTE_UNUSED_RESULT): Define.

5 years agoAllow multiple tests to be run on systems with older versions of TCL installed.
Matthew Malcomson [Tue, 5 Mar 2019 10:09:50 +0000 (10:09 +0000)] 
Allow multiple tests to be run on systems with older versions of TCL installed.

PR 24287
* testsuite/lib/binutils-common.exp (run_dump_test): Replace a use
of "lmap" with a "foreach" loop.

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 5 Mar 2019 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoUse '$enable_unittest' instead of '$development' on gdbserver/configure.srv (for...
Sergio Durigan Junior [Mon, 4 Mar 2019 17:44:20 +0000 (12:44 -0500)] 
Use '$enable_unittest' instead of '$development' on gdbserver/configure.srv (for 'aarch64*-*-linux*' case)

On commit 8ecfd7bd4acd69213c06fac6de9af38299123547 ("Add parameter to
allow enabling/disabling selftests via configure") it seems that I
forgot to use the proper '$enable_unittest' variable when checking to
see whether to add selftest-related objects to 'srv_regobj'.  This
causes a build failure on Aarch64 when 'development=false' (which is
the case for the 8.3 branch) and 'enable_unittest=true'.

This patch fixes the problem by using '$enable_unittest' instead of
'$development' when performing the check.  As a reminder, it's
important to notice that '$enable_unittest's default value (i.e., when
the option '--enable-unit-tests' is not passed to configure) is the
same as '$development', so this patch doesn't affect the current
build.

I'd like to install this patch both on master and on the 8.3 branch.

OK?

gdb/gdbserver/ChangeLog:
2019-03-04  Sergio Durigan Junior  <sergiodj@redhat.com>

* configure.srv: Use '$enable_unittest' instead of '$development'
when checking whether to fill 'srv_regobj' on 'aarch64*-*-linux*'
case.

5 years agogdbserver short-circuit-argument-list failures
Richard Bunt [Mon, 4 Mar 2019 15:08:51 +0000 (15:08 +0000)] 
gdbserver short-circuit-argument-list failures

This patch fixes test case failures observed when running
short-circuit-argument-list.exp with gdb server boards. Thanks to Sergio
Durigan Junior for pointing this out.

Assertions failed with the native{,-extended}-gdbserver boards as the
standard output from the test program appears in a different location
than observed on non-gdbserver boards. This standard output was used to
determine whether a function, which had been logically short-circuited,
was called or not. Since the location of the standard out cannot be
relied upon to verify this, a new mechanism was needed.

The test program now records function calls in variables named the same
as the function with a "_called" suffix. These variables can then be
queried from the test case to verify the occurrence of a call.

A method to reset the call counts has been included in the test case, so
that any future assertions added to this test can ensure a fresh set of
initial values before proceeding. Not resetting values between groups of
assertions creates a dependency between them, which increases the
likelihood that a single failure causes subsequent assertions to fail.

Regression tested on x86_64, aarch64 and ppc64le.
Regression tested with Ada on x86_64.
Regression tested with the native{,-extended}-gdbserver boards on x86_64.

5 years agoStop objcopy from attempting to copy thin archives.
Nick Clifton [Mon, 4 Mar 2019 13:11:08 +0000 (13:11 +0000)] 
Stop objcopy from attempting to copy thin archives.

PR 24281
* objcopy.c (copy_archive): Do not copy thin  archives.

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

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 3 Mar 2019 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoFix documentation of styles.
Eli Zaretskii [Sat, 2 Mar 2019 19:42:54 +0000 (21:42 +0200)] 
Fix documentation of styles.

gdb/doc/ChangeLog:
2019-03-02  Eli Zaretskii  <eliz@gnu.org>

* gdb.texinfo (Output Styling): Fix typos.  Document the default
foreground colors of the available styles.

5 years agoAvoid compilation warnings on MinGW.
Eli Zaretskii [Sat, 2 Mar 2019 13:22:11 +0000 (15:22 +0200)] 
Avoid compilation warnings on MinGW.

gdb/ChangeLog:
2019-03-02  Eli Zaretskii  <eliz@gnu.org>

* xml-syscall.c (xml_list_syscalls_by_group): Drop 'struct' from
for-loop range, to avoid compiler warnings.

* tui/tui.c (tui_enable) [__MINGW32__]: Don't declare 'cap', to
avoid compiler warnings about unused variables.

5 years agoGDB no longer supports Windows before XP.
Eli Zaretskii [Sat, 2 Mar 2019 13:18:32 +0000 (15:18 +0200)] 
GDB no longer supports Windows before XP.

gdb/ChangeLog:
2019-03-02  Eli Zaretskii  <eliz@gnu.org>

* NEWS: Mention end of support for native debugging on MS-Windows
before XP.

5 years agoFix GDB compilation on MinGW (PR gdb/24292)
Eli Zaretskii [Sat, 2 Mar 2019 13:13:54 +0000 (15:13 +0200)] 
Fix GDB compilation on MinGW (PR gdb/24292)

gdb/ChangeLog:

2019-03-02  Eli Zaretskii  <eliz@gnu.org>

PR gdb/24292
* common/netstuff.c:
* gdbserver/gdbreplay.c
* gdbserver/remote-utils.c:
* ser-tcp.c:
* unittests/parse-connection-spec-selftests.c [USE_WIN32API]:
Include ws2tcpip.h instead of wsiapi.h and winsock2.h.  Redefine
_WIN32_WINNT to 0x0501 if defined to a smaller value, as
'getaddrinfo' and 'freeaddrinfo' were not available before
Windows XP, and mingw.org's MinGW headers by default define
_WIN32_WINNT to 0x500.

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 2 Mar 2019 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoRevert "Add support to GNU ld to separate got related plt entries"
Andreas Krebbel [Fri, 1 Mar 2019 14:23:42 +0000 (15:23 +0100)] 
Revert "Add support to GNU ld to separate got related plt entries"

bfd/ChangeLog:

2019-03-01  Andreas Krebbel  <krebbel@linux.ibm.com>

This reverts commit 5a12586d44fa8d5dfc74cbca4f2f36a273a16335.
2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>

PR 20113
* elf32-s390.c (allocate_dynrelocs): Update comment.

ld/ChangeLog:

2019-03-01  Andreas Krebbel  <krebbel@linux.ibm.com>

This reverts commit 5a12586d44fa8d5dfc74cbca4f2f36a273a16335.
2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>

PR 20113
* emulparams/elf64_s390.sh (SEPARATE_GOTPLT): Define.
* emulparams/elf_s390.sh (SEPARATE_GOTPLT): Define.
* testsuite/ld-s390/gotreloc_31-1.dd: Update expected output.
* testsuite/ld-s390/tlsbin.dd: Likewise.
* testsuite/ld-s390/tlsbin.rd: Likewise.
* testsuite/ld-s390/tlsbin.sd: Likewise.
* testsuite/ld-s390/tlsbin_64.dd: Likewise.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.
* testsuite/ld-s390/tlsbin_64.sd: Likewise.
* testsuite/ld-s390/tlspic.dd: Likewise.
* testsuite/ld-s390/tlspic.rd: Likewise.
* testsuite/ld-s390/tlspic.sd: Likewise.
* testsuite/ld-s390/tlspic_64.dd: Likewise.
* testsuite/ld-s390/tlspic_64.rd: Likewise.
* testsuite/ld-s390/tlspic_64.sd: Likewise.
* testsuite/ld-s390/s390.exp: Skip s390 tests for tpf targets.

5 years agoFix coff_start_symtab resource leak found by Coverity
Gary Benson [Fri, 1 Mar 2019 13:50:27 +0000 (13:50 +0000)] 
Fix coff_start_symtab resource leak found by Coverity

This commit fixes a resource leak found by Coverity, where
coff_start_symtab performs an xstrdup that is now performed
within start_symtab by buildsym_compunit::buildsym_compunit.

gdb/ChangeLog:

* coffread.c (coff_start_symtab): Remove unnecessary xstrdup.

5 years agoBinutils: Always skip only 1 byte for CIE version 1's return address register.
Tamar Christina [Fri, 1 Mar 2019 11:37:51 +0000 (11:37 +0000)] 
Binutils: Always skip only 1 byte for CIE version 1's return address register.

According to the specification for the CIE entries, when the CIE version is 1 then
the return address register field is always 1 byte.  Readelf does this correctly in
read_cie in dwarf.c but ld does this incorrectly and always tries to read a
skip_leb128.  If the value here has the top bit set then ld will incorrectly read
at least another byte, causing either an assert failure or an incorrect address to
be used in eh_frame.

I'm not sure how to generate a generic test for this as I'd need to write assembly,
and it's a bit hard to trigger. Essentially the relocated value needs to start with
something that & 0x70 != 0x10 while trying to write a personality.

bfd/ChangeLog:

* elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct CIE parse.

5 years agoPR24272, out-of-bounds read in pex64_xdata_print_uwd_codes
Alan Modra [Thu, 28 Feb 2019 22:58:47 +0000 (09:28 +1030)] 
PR24272, out-of-bounds read in pex64_xdata_print_uwd_codes

The fix here is to use an unsigned comparison for
    if (a->NumberOfRvaAndSizes > IMAGE_NUMBEROF_DIRECTORY_ENTRIES)

include/
PR 24272
* coff/internal.h (struct internal_extra_pe_aouthdr): Change type
of SizeOfCode, SizeOfInitializedData, and SizeOfUninitializedData
to bfd_vma.  Change type of SectionAlignment, FileAlignment,
Reserved1, SizeOfImage, SizeOfHeaders, CheckSum, LoaderFlags,
and NumberOfRvaAndSizes to uint32_t.
bfd/
PR 24272
* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Use unsigned index.
(_bfd_XX_print_private_bfd_data_common): Adjust for type changes.

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 1 Mar 2019 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoTestsuite: Catch gdbserver socket listen errors
Alan Hayward [Thu, 28 Feb 2019 17:19:46 +0000 (17:19 +0000)] 
Testsuite: Catch gdbserver socket listen errors

When launching gdbserver, the testsuite checks for binding failure but
does not check for failure to listen to socket error (which can happen
due to another gdbserver binding to the socket at the same time).

When this error occurs, the test will ignore the error and connect GDB
to the failed port.  This may succeed and GDB will now be connected to
the gdbserver from another test.  This eventually causes both tests to
fail.

When running the tests suite with native-gdbserver across many cores,
this issue may happen once or twice, each causing random failures for
two .exp testscripts.

Example gdb.log output for the failure:

The testsuite sucessfully notices a failure to connect to port 2348.
It launches again with port 2349, which also fails.  The testsuite
ignores this error and uses gdb to connect to the port - which succeeds.

spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2348 /work/build/gdb/testsuite/outputs/gdb.ada/arrayidx/p^M
Can't bind address: Address already in use.^M
Exiting^M
Port 2348 is already in use.
spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2349 /work/build/gdb/testsuite/outputs/gdb.ada/arrayidx/p^M
Can't listen on socket: Address already in use.^M
Exiting^M
target remote localhost:2349^M
Remote debugging using localhost:2349^M
Reading /lib/ld-linux-aarch64.so.1 from remote target...^M
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.^M
Reading /lib/ld-linux-aarch64.so.1 from remote target...^M
Reading symbols from target:/lib/ld-linux-aarch64.so.1...^M
Reading /lib/ld-2.23.so from remote target...^M
Reading /lib/.debug/ld-2.23.so from remote target...^M
Reading /work/build/install/lib/debug//lib/ld-2.23.so from remote target...^M
Reading /work/build/install/lib/debug/lib//ld-2.23.so from remote target...^M
Reading target:/work/build/install/lib/debug/lib//ld-2.23.so from remote target...^M
(No debugging symbols found in target:/lib/ld-linux-aarch64.so.1)^M
0x0000ffffbf6d2cc0 in ?? () from target:/lib/ld-linux-aarch64.so.1^M
(gdb) continue^M
Continuing.^M
Reading /lib/aarch64-linux-gnu/libc.so.6 from remote target...^M
Reading /lib/aarch64-linux-gnu/libc-2.23.so from remote target...^M
Reading /lib/aarch64-linux-gnu/.debug/libc-2.23.so from remote target...^M
Reading /work/build/install/lib/debug//lib/aarch64-linux-gnu/libc-2.23.so from remote target...^M
Reading /work/build/install/lib/debug/lib/aarch64-linux-gnu//libc-2.23.so from remote target...^M
Reading target:/work/build/install/lib/debug/lib/aarch64-linux-gnu//libc-2.23.so from remote target...^M
[Inferior 1 (process 35351) exited normally]^M
(gdb) FAIL: gdb.ada/arrayidx.exp: can't run to main

Meanwhile, at the same time, in another test, gdbserver successfully
connects to port 2349.  GDB then tries to connect to the port, but it
times out because the GDB in the test above has already connected to it.

spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2348 /work/build/gdb/testsuite/outputs/gdb.ada/rdv_wait/foo^M
Can't bind address: Address already in use.^M
Exiting^M
Port 2348 is already in use.
spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2349 /work/build/gdb/testsuite/outputs/gdb.ada/rdv_wait/foo^M
Process /work/build/gdb/testsuite/outputs/gdb.ada/rdv_wait/foo created; pid = 65162^M
Listening on port 2349^M
Remote debugging from host 127.0.0.1, port 45154^M
target remote localhost:2349^M
localhost:2349: Connection timed out.^M
(gdb) ^CQuit^M
(gdb) task 2^M
Cannot inspect Ada tasks when program is not running^M

gdb/testsuite/ChangeLog:

* lib/gdbserver-support.exp (gdbserver_start): Check for listen
failure.

5 years agoCan't interrupt process without controlling terminal on Solaris (PR gdb/8527)
Rainer Orth [Thu, 28 Feb 2019 15:09:05 +0000 (16:09 +0100)] 
Can't interrupt process without controlling terminal on Solaris (PR gdb/8527)

If gdb attaches to a process that either has no controlling terminal,
or the controlling terminal differs from the one gdb is running under,
break/^C doesn't interrupt the debugged process on Solaris.

Fixed as follows, analogous to what all all other targets do.  Patch from
the PR, recently re-submitted by Brian Vandenberg.

Tested on amd64-pc-solaris2.11, sparcv9-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2019-02-28  Brian Vandenberg  <phantall@gmail.com>
    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gdb:
PR gdb/8527
* procfs.c (proc_wait_for_stop): Wrap write of PCWSTOP in
set_sigint_trap, clear_sigint_trap.

gdb/testsuite:
PR gdb/8527
* gdb.base/interrupt-daemon-attach.c,
gdb.base/interrupt-daemon-attach.exp: New test.

5 years agoPrevent a buffer overrun error when attempting to parse a corrupt ELF file.
Nick Clifton [Thu, 28 Feb 2019 14:30:20 +0000 (14:30 +0000)] 
Prevent a buffer overrun error when attempting to parse a corrupt ELF file.

PR 24273
* elf.c (bfd_elf_string_from_elf_section): Check for a string
section that is not NUL terminated.

5 years ago(gdb/sim) Move Mike Frysinger to past maintainers section
Joel Brobecker [Thu, 28 Feb 2019 07:20:29 +0000 (11:20 +0400)] 
(gdb/sim) Move Mike Frysinger to past maintainers section

sim/ChangeLog:

* MAINTAINERS: Move Mike Frysinger to past maintainers' section.

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 Feb 2019 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoFix regcache leak, and avoid possible regcache access after detach.
Philippe Waroquiers [Sat, 16 Feb 2019 13:11:38 +0000 (14:11 +0100)] 
Fix regcache leak, and avoid possible regcache access after detach.

Valgrind reports leaks like the below in various tests,
e.g. gdb.threads/attach-slow-waitpid.exp, gdb.ada/task_switch_in_core.exp, ...

Fix the leak by clearing the regcache when detaching from an inferior.
Note that these leaks are 'created' when GDB exits,
when the regcache::current_regcache is destroyed : the elements
of the forward_list are pointers, and the 'pointed to' memory is not
deleted by the forward_list destructor.

Nevertheless, fixing this leak is good as it makes a bunch of
tests 'leak clean'.

Also, it seems strange to keep a register cache for a process from
which GDB detached : it is not clear if this cache is still valid
after detach.  And effectively, when clearing only the regcache,
(and not the frame cache), then the frame cache was still 'pointing'
at this regcache and was used when switching to the child process
in the test gdb.threads/watchpoint-fork.exp, which seems strange.

So, we solve the leak and avoid possible accesses to the regcache
and frame cache of the detached inferior, by clearing both the
regcache and the frame cache.

Tested on debian/amd64, natively, under Valgrind,
and with make check RUNTESTFLAGS="--target_board=native-gdbserver".

==27679== VALGRIND_GDB_ERROR_BEGIN
==27679== 1,123 (72 direct, 1,051 indirect) bytes in 1 blocks are definitely lost in loss record 2,942 of 3,400
==27679==    at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344)
==27679==    by 0x5CDF71: get_thread_arch_aspace_regcache(ptid_t, gdbarch*, address_space*) (regcache.c:330)
==27679==    by 0x5CE12A: get_thread_regcache (regcache.c:366)
==27679==    by 0x5CE12A: get_current_regcache() (regcache.c:372)
==27679==    by 0x4FF63D: post_create_inferior(target_ops*, int) (infcmd.c:452)
==27679==    by 0x43AF62: core_target_open(char const*, int) (corelow.c:458)
==27679==    by 0x408B68: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1892)
...

gdb/ChangeLog
2019-02-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* target.c (target_detach): Clear the regcache and the
frame cache.

5 years agox86-64: Skip protected check on symbol defined by linker
H.J. Lu [Wed, 27 Feb 2019 19:53:16 +0000 (11:53 -0800)] 
x86-64: Skip protected check on symbol defined by linker

Skip symbol defined by linker when checking copy reloc on protected
symbol.

bfd/

PR ld/24276
* elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined
by linker when checking copy reloc on protected symbol.

ld/

PR ld/24276
* testsuite/ld-i386/i386.exp: Run PR ld/24276 test.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr24276.dso: New file.
* testsuite/ld-i386/pr24276.warn: Likewise.
* testsuite/ld-x86-64/pr24276.dso: Likewise.
* testsuite/ld-x86-64/pr24276.warn: Likewise.

5 years agoHandle \r\n in gdbreplay
Tom Tromey [Wed, 20 Feb 2019 21:29:23 +0000 (14:29 -0700)] 
Handle \r\n in gdbreplay

I tried gdbreplay yesterday, but the remotelogfile I received was made
on Windows, so the lines were terminated with \r\n rather than plain
\n.

This patch changes gdbreplay to allow \r\n line termination when
reading the log file.

gdb/gdbserver/ChangeLog
2019-02-27  Tom Tromey  <tromey@adacore.com>

* gdbreplay.c (logchar): Handle \r\n.

5 years agoTest "set width/height -1"
Pedro Alves [Wed, 27 Feb 2019 18:48:37 +0000 (18:48 +0000)] 
Test "set width/height -1"

As a follow up to the previous commit, add a test for "set
width/height -1", to make sure we don't overflow in readline with
negative values either.

gdb/testsuite/ChangeLog:
2019-02-27  Pedro Alves  <palves@redhat.com>

* gdb.base/page.exp: Add tests for "set width/height -1".

5 years agoMake 'show width/height' display "unlimited" when capped for readline
Pedro Alves [Wed, 27 Feb 2019 18:48:36 +0000 (18:48 +0000)] 
Make 'show width/height' display "unlimited" when capped for readline

When we cap the height/width sizes before passing to readline, tweak
the corresponding command variable to show "unlimited":

  (gdb) set height 0x8000
  (gdb) show height
  Number of lines gdb thinks are in a page is unlimited.

Instead of the current output:
  (gdb) set height 0x8000
  (gdb) show height
  Number of lines gdb thinks are in a page is 32768.

gdb/ChangeLog:
2019-02-27  Pedro Alves  <palves@redhat.com>

* utils.c (set_screen_size): When we cap the height/width sizes,
tweak the corresponding command variable to show "unlimited":

gdb/testsuite/ChangeLog:
2019-02-27  Pedro Alves  <palves@redhat.com>

* gdb.base/page.exp: Add tests for "set/show width/height" with
"infinite" values.

5 years agoPrevent overflow in rl_set_screen_size
Saagar Jha [Wed, 27 Feb 2019 18:48:35 +0000 (18:48 +0000)] 
Prevent overflow in rl_set_screen_size

GDB calls rl_set_screen_size in readline with the current screen size,
measured in rows and columns.  To represent "infinite" sizes, GDB
passes in INT_MAX; however, since rl_set_screen_size internally
multiplies the number of rows and columns, this causes a signed
integer overflow.  To prevent this we can instead pass in the
approximate square root of INT_MAX (which is still reasonably large),
so that even when the number of rows and columns is "infinite" we
don't overflow.

gdb/ChangeLog:
2019-02-27  Saagar Jha  <saagar@saagarjha.com>
    Pedro Alves  <palves@redhat.com>

* utils.c (set_screen_size): Reduce "infinite" rows and columns
before calling rl_set_screen_size.

5 years agoRemove Python 2.4 and 2.5 support
Tom Tromey [Tue, 26 Feb 2019 18:58:47 +0000 (11:58 -0700)] 
Remove Python 2.4 and 2.5 support

This removes all the remainings spots I could find that work around
issues in Python 2.4 and 2.5.

I don't have a good way to test that Python 2.6 still works.

Tested by the buildbot.

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

* config.in, configure: Rebuild.
* configure.ac (HAVE_LIBPYTHON2_4, HAVE_LIBPYTHON2_5): Never
define.
* python/py-value.c: Remove Python 2.4 workaround.
* python/py-utils.c (gdb_pymodule_addobject): Remove Python 2.4
workaround.
* python/py-type.c (convert_field, gdbpy_initialize_types): Remove
Python 2.4 workaround.
* python/python-internal.h: Remove Python 2.4 comment.
(Py_ssize_t): Don't define.
(PyVarObject_HEAD_INIT, Py_TYPE): Don't define.
(gdb_Py_DECREF): Remove Python 2.4 workaround.
(gdb_PyObject_GetAttrString, PyObject_GetAttrString): Remove.
(gdb_PyObject_HasAttrString, PyObject_HasAttrString): Remove.
* python/python.c (do_start_initialization): Remove Python 2.4
workaround.
* python/py-prettyprint.c (class dummy_python_frame): Remove.
(print_children): Remove Python 2.4 workaround.
* python/py-inferior.c (buffer_procs): Remove Python 2.4
workaround.
(CHARBUFFERPROC_NAME): Remove.
* python/py-breakpoint.c (gdbpy_initialize_breakpoints): Remove
Python 2.4 workaround.

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

* lib/gdb.exp (skip_python_tests_prompt): Don't check for Python
2.4.
* gdb.python/py-finish-breakpoint.exp: Remove Python 2.4
workaround.

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

* config.in, configure: Rebuild.
* configure.ac (HAVE_LIBPYTHON2_4, HAVE_LIBPYTHON2_5): Never
define.
* python/py-value.c: Remove Python 2.4 workaround.
* python/py-utils.c (gdb_pymodule_addobject): Remove Python 2.4
workaround.
* python/py-type.c (convert_field, gdbpy_initialize_types): Remove
Python 2.4 workaround.
* python/python-internal.h: Remove Python 2.4 comment.
(Py_ssize_t): Don't define.
(PyVarObject_HEAD_INIT, Py_TYPE): Don't define.
(gdb_Py_DECREF): Remove Python 2.4 workaround.
(gdb_PyObject_GetAttrString, PyObject_GetAttrString): Remove.
(gdb_PyObject_HasAttrString, PyObject_HasAttrString): Remove.
* python/python.c (do_start_initialization): Remove Python 2.4
workaround.
* python/py-prettyprint.c (class dummy_python_frame): Remove.
(print_children): Remove Python 2.4 workaround.
* python/py-inferior.c (buffer_procs): Remove Python 2.4
workaround.
(CHARBUFFERPROC_NAME): Remove.
* python/py-breakpoint.c (gdbpy_initialize_breakpoints): Remove
Python 2.4 workaround.

5 years agoDocument fact that mininum Python version is now 2.6
Kevin Buettner [Fri, 22 Feb 2019 00:22:13 +0000 (17:22 -0700)] 
Document fact that mininum Python version is now 2.6

gdb/ChangeLog:

* NEWS: Note minimum Python version.

gdb/doc/ChangeLog:

* gdb.texinfo (Configure Options): Document minimum python
version.

5 years agoUse Python 2.[67] / 3.X / PEP 3118 buffer protocol
Kevin Buettner [Tue, 19 Feb 2019 20:18:17 +0000 (13:18 -0700)] 
Use Python 2.[67] / 3.X / PEP 3118 buffer protocol

This patch removes the non-IS_PY3K code in infpy_write_memory()
and infpy_search_memory().  In both cases, the remaining code
from these ifdefs is related to use of the PEP 3118 buffer protocol.
(Deleted code is either due to simplification or related to use of the
old buffer protocol.)  PEP 3118 is sometimes referred to as the "new"
buffer protocol, though it's not that new anymore.

The link below describes new features in Python 2.6.  In particular,
it says that the buffer protocol described by PEP 3118 is in Python
2.6.  It also says (at the top of the page) that Python 2.6 was
released on Oct 1, 2008.

https://docs.python.org/3/whatsnew/2.6.html#pep-3118-revised-buffer-protocol

The last security release for the Python 2.6 series was 2.6.9.  It was
released on Oct 29, 2013.  According to this document...

https://www.python.org/download/releases/2.6.9/

...support for the 2.6 series has ended:

    With the 2.6.9 release, and five years after its first release,
    the Python 2.6 series is now officially retired.  All official
    maintenance for Python 2.6, including security patches, has ended.
    For ongoing maintenance releases, please see the Python 2.7
    series.

As noted earlier, Python 2.6, Python 2.7, and Python 3.X all have
support for the PEP 3118 buffer protocol.  Python releases prior
to 2.6 use an older buffer protocol.  Since Python 2.6 has been
retired for a good while now, it seems reasonable to me to remove
code using the older buffer protocol from GDB.

I have also simplified some of the code via use of the Py_buffer
unique_ptr specialization which I introduced in the two argument
gdb.Value constructor patch series.  Therefore, there is a dependency
on patch #1 from that series.

I have tested against both Python 2.7.15 and 3.7.2.  I see no
regressions among the non-racy tests.  I've also verified that
PyBuffer_Release is being called when the affected functions exit
while running the tests in gdb.python/py-inferior.exp by hand.  I've
also tried running valgrind on GDB while running this test, but I'm
puzzled by the results that I'm seeing - I'm seeing no additional
leaks when I comment out the Py_buffer_up lines that I introduced.
That said, I'm not seeing any leaks that obviously originate from
either infpy_write_memory() or infpy_search_memory().

gdb/ChangeLog:

* python/py-inferior.c (infpy_write_memory): Remove non-IS_PY3K
code from these functions.  Remove corresponding ifdefs.  Use
Py_buffer_up instead of explicit calls to PyBuffer_Release.
Remove gotos and target of gotos.
(infpy_search_memory): Likewise.

5 years agogdb/hppa: Use default gdbarch method default_dummy_id.
Andrew Burgess [Thu, 27 Dec 2018 11:56:03 +0000 (11:56 +0000)] 
gdb/hppa: Use default gdbarch method default_dummy_id.

Make use of the default gdbarch method for gdbarch_dummy_id.

I have not tested this change but, by inspecting the code, I believe
the default method is equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/hppa-tdep.c (hppa_dummy_id): Delete.
(hppa_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/h8300: Use default gdbarch methods where possible
Andrew Burgess [Thu, 27 Dec 2018 11:52:53 +0000 (11:52 +0000)] 
gdb/h8300: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/h8300-tdep.c (h8300_unwind_pc): Delete.
(h8300_unwind_sp): Delete.
(h8300_dummy_id): Delete.
(h8300_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/ft32: Use default gdbarch methods where possible
Andrew Burgess [Wed, 19 Dec 2018 22:34:19 +0000 (22:34 +0000)] 
gdb/ft32: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/ft32-tdep.c (ft32_dummy_id): Delete.
(ft32_unwind_pc): Delete.
(ft32_unwind_sp): Delete.
(ft32_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/frv: Use default gdbarch methods where possible
Andrew Burgess [Wed, 19 Dec 2018 22:31:50 +0000 (22:31 +0000)] 
gdb/frv: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/frv-tdep.c (frv_dummy_id): Delete.
(frv_unwind_pc): Delete.
(frv_unwind_sp): Delete.
(frv_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/riscv: Use default gdbarch methods where possible
Andrew Burgess [Wed, 19 Dec 2018 22:24:22 +0000 (22:24 +0000)] 
gdb/riscv: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

This change has been tested with no regressions.

gdb/ChangeLog:

* gdb/riscv-tdep.c (riscv_dummy_id): Delete.
(riscv_unwind_pc): Delete.
(riscv_unwind_sp): Delete.
(riscv_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/csky: Use default gdbarch methods where possible
Andrew Burgess [Wed, 19 Dec 2018 22:18:28 +0000 (22:18 +0000)] 
gdb/csky: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/csky-tdep.c (csky_dummy_id): Delete.
(csky_unwind_pc): Delete.
(csky_unwind_sp): Delete.
(csky_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/cris: Use default gdbarch methods where possible
Andrew Burgess [Sun, 9 Sep 2018 16:17:05 +0000 (17:17 +0100)] 
gdb/cris: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/cris-tdep.c (cris_dummy_id): Delete.
(cris_unwind_pc): Delete.
(cris_unwind_sp): Delete.
(cris_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/bfin: Use default gdbarch methods where possible
Andrew Burgess [Sun, 9 Sep 2018 16:14:20 +0000 (17:14 +0100)] 
gdb/bfin: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
and gdbarch_unwind_pc.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/bfin-tdep.c (bfin_dummy_id): Delete.
(bfin_unwind_pc): Delete.
(bfin_gdbarch_init): Don't register deleted functions with gdbarch.

5 years agogdb/arm: Use default gdbarch methods where possible
Andrew Burgess [Sun, 9 Sep 2018 16:10:21 +0000 (17:10 +0100)] 
gdb/arm: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/arm-tdep.c (arm_dummy_id): Delete.
(arm_unwind_pc): Delete.
(arm_unwind_sp): Delete.
(arm_gdbarch_init): Don't register deleted functions with gdbarch.

5 years agogdb/arc: Use default gdbarch methods where possible
Andrew Burgess [Sun, 9 Sep 2018 16:07:16 +0000 (17:07 +0100)] 
gdb/arc: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.  The
only difference is that the old ARC specific methods had additional
debugging, however, this was discussed on the mailing list[1] and it
was agreed these methods could be removed.

[1] https://sourceware.org/ml/gdb-patches/2018-12/msg00386.html

gdb/ChangeLog:

* gdb/arc-tdep.c (arc_dummy_id): Delete.
(arc_unwind_pc): Delete.
(arc_unwind_sp): Delete.
(arc_gdbarch_init): Don't register deleted functions with gdbarch.

5 years agogdb/alpha: Use default gdbarch methods where possible
Andrew Burgess [Sun, 9 Sep 2018 15:48:59 +0000 (16:48 +0100)] 
gdb/alpha: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id, and
gdbarch_unwind_pc.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/alpha-tdep.c (alpha_dummy_id): Delete.
(alpha_unwind_pc): Delete.
(alpha_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agogdb/aarch64: Use default gdbarch methods where possible
Andrew Burgess [Sun, 9 Sep 2018 14:52:28 +0000 (15:52 +0100)] 
gdb/aarch64: Use default gdbarch methods where possible

Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

gdb/ChangeLog:

* gdb/aarch64-tdep.c (aarch64_dummy_id): Delete.
(aarch64_unwind_pc): Delete.
(aarch64_unwind_sp): Delete.
(aarch64_gdbarch_init): Don't register deleted functions with
gdbarch.

5 years agoTestsuite: Allow multiple lines of "as" in testsuite.
Matthew Malcomson [Wed, 27 Feb 2019 13:15:10 +0000 (13:15 +0000)] 
Testsuite: Allow multiple lines of "as" in testsuite.

Committed on behalf of Matthew Malcomson.

This allows checking the command line parsing more easily than before by
allowing many command line invokations from the same .d file.

Each line is used as a set of flags, and the tests are ran against the output
of the assembler with each set.
Each line of assembler is treated as another set of tests (as if the test file
were copied to another with a different #as: line).

This patch includes some example uses where multiple testcases can be merged
into one file using this new functionality.

binutils/ChangeLog:

* testsuite/lib/binutils-common.exp: Allow multiple "as" lines.

gas/ChangeLog:

* testsuite/gas/aarch64/dotproduct.d: Use multiple "as" lines.
* testsuite/gas/aarch64/dotproduct_armv8_4.d: Remove.
* testsuite/gas/aarch64/dotproduct_armv8_4.s: Remove.
* testsuite/gas/aarch64/illegal-dotproduct.d: Use multiple "as"
lines.
* testsuite/gas/aarch64/ldst-rcpc-armv8_2.d: Remove.
* testsuite/gas/aarch64/ldst-rcpc.d: Use multiple "as" lines.

5 years agogdb: Handle alignment for C++ structures with static members
Andrew Burgess [Fri, 22 Feb 2019 22:04:53 +0000 (22:04 +0000)] 
gdb: Handle alignment for C++ structures with static members

In 'type_align' when computing the alignment of a structure we should
not consider the alignment of static structure members, these are
usually stored outside of the structure and therefore don't have any
impact on the structures alignment requirements.

I've extended the existing alignment calculating test to compile in
both C and C++ now so that we can create structures with static
members.

gdb/ChangeLog:

* gdbtypes.c (type_align): Don't consider static members when
computing structure alignment.

gdb/testsuite/ChangeLog:

* gdb.base/align.exp: Extend to compile in both C and C++, and add
tests for structs with static members.

5 years agogdb: Restructure type_align and gdbarch_type_align
Andrew Burgess [Fri, 22 Feb 2019 20:49:04 +0000 (20:49 +0000)] 
gdb: Restructure type_align and gdbarch_type_align

This commit restructures the relationship between the type_align
function and the gdbarch_type_align method.

The problem being addressed with this commit is this; previously the
type_align function was structured so that for "basic" types (int,
float, etc) the gdbarch_type_align hook was called, which for
"compound" types (arrays, structs, etc) the common type_align code has
a fixed method for how to extract a "basic" type and would then call
itself on that "basic" type.

The problem is that if an architecture wants to modify the alignment
rules for a "compound" type then this is not currently possible.

In the revised structure, all types pass through the
gdbarch_type_align method.  If this method returns 0 then this
indicates that the architecture has no special rules for this type,
and GDB should apply the default rules for alignment.  However, the
architecture is free to provide an alignment for any type, both
"basic" and "compound".

After this commit the default alignment rules now all live in the
type_align function, the default_type_align only ever returns 0,
meaning apply the default rules.

I've updated the 3 targets (arc, i386, and nios2) that already
override the gdbarch_type_align method to fit the new scheme.

Tested on X86-64/GNU Linux with no regressions.

gdb/ChangeLog:

* arc-tdep.c (arc_type_align): Provide alignment for basic types,
return 0 for other types.
* arch-utils.c (default_type_align): Always return 0.
* gdbarch.h: Regenerate.
* gdbarch.sh (type_align): Extend comment.
* gdbtypes.c (type_align): Add additional comments, always call
gdbarch_type_align before applying the default rules.
* i386-tdep.c (i386_type_align): Return 0 as the default rule,
generic code will then apply a suitable default.
* nios2-tdep.c (nios2_type_align): Provide alignment for basic
types, return 0 for other types.

5 years agoUpdate NEWS post GDB 8.3 branch creation.
Joel Brobecker [Wed, 27 Feb 2019 04:59:50 +0000 (08:59 +0400)] 
Update NEWS post GDB 8.3 branch creation.

gdb/ChangeLog:

* NEWS: Create a new section for the next release branch.
Rename the section of the current branch, now that it has
been cut.

5 years agoBump version to 8.3.50.DATE-git.
Joel Brobecker [Wed, 27 Feb 2019 04:53:14 +0000 (08:53 +0400)] 
Bump version to 8.3.50.DATE-git.

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

gdb/ChangeLog:

GDB 8.3 branch created (143420fb0d5ae54323ba9953f0818c194635228d):
* version.in: Bump version to 8.3.50.DATE-git.

5 years agoFix build errors in aix-thread.c gdb-8.3-branchpoint
Simon Marchi [Wed, 27 Feb 2019 04:45:50 +0000 (23:45 -0500)] 
Fix build errors in aix-thread.c

This patch fixes a few instances of unused variable and shadowed local
variable errors.

gdb/ChangeLog:

* aix-thread.c (ptid_cmp): Remove unused variable.
(get_signaled_thread): Likewise.
(store_regs_user_thread): Likewise.
(store_regs_kernel_thread): Likewise.
(fetch_regs_kernel_thread): Remove shadowed variable.

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 Feb 2019 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agogdb/riscv: Use legacy register numbers in default target description
Andrew Burgess [Sat, 23 Feb 2019 20:07:47 +0000 (22:07 +0200)] 
gdb/riscv: Use legacy register numbers in default target description

When the target description support was added to RISC-V, the register
numbers assigned to the fflags, frm, and fcsr control registers in the
default target descriptions didn't match the register numbers used by
GDB before the target description support was added.

What this means is that if a tools exists in the wild that is using
hard-coded register number, setup to match GDB's old numbering, then
this will have been broken (for fflags, frm, and fcsr) by the move to
target descriptions.  QEMU is such a tool.

There are a couple of solutions that could be used to work around this
issue:

 - The user can create their own xml description file with the
   register numbers setup to match their old tool, then load this by
   telling GDB 'set tdesc filename FILENAME'.

 - Update their old tool to use the newer default numbering scheme, or
   better yet add proper target description support to their tool.

 - We could have RISC-V GDB change to maintain the old defaults.

This patch changes GDB back to using the old numbering scheme.

This change is only visible to remote targets that don't supply their
own xml description file and instead rely on GDB's default numbering.

Note that even though 32bit-cpu.xml and 64bit-cpu.xml have changed,
the corresponding .c file has not, this is because the numbering added
to the registers in the xml files is number 0, this doesn't result in
any new C code being generated .

gdb/ChangeLog:

* features/riscv/32bit-cpu.xml: Add register numbers.
* features/riscv/32bit-fpu.c: Regenerate.
* features/riscv/32bit-fpu.xml: Add register numbers.
* features/riscv/64bit-cpu.xml: Add register numbers.
* features/riscv/64bit-fpu.c: Regenerate.
* features/riscv/64bit-fpu.xml: Add register numbers.

5 years agoFix new py-value.exp test case
Tom Tromey [Tue, 26 Feb 2019 19:12:30 +0000 (12:12 -0700)] 
Fix new py-value.exp test case

The new test case in py-value.exp fails -- the code was changed to
throw ValueError, but the test still checks for TypeError.  This patch
fixes the problem.

I'm checking this in.  Tested on x86-64 Fedora 29.

gdb/testsuite/ChangeLog
2019-02-26  Tom Tromey  <tromey@adacore.com>

* gdb.python/py-value.exp (test_value_from_buffer): Check for
ValueError, not TypeError.

5 years agoDocument two argument form of gdb.Value constructor
Kevin Buettner [Sun, 17 Feb 2019 01:31:51 +0000 (18:31 -0700)] 
Document two argument form of gdb.Value constructor

gdb/ChangeLog:

* NEWS: Mention two argument form of gdb.Value constructor.

gdb/doc/ChangeLog:

* python.texi (Values From Inferior): Document second form
of Value.__init__.

5 years agoAdd tests for gdb.Value(bufobj, type) constructor
Kevin Buettner [Sun, 17 Feb 2019 01:07:51 +0000 (18:07 -0700)] 
Add tests for gdb.Value(bufobj, type) constructor

gdb/testsuite/ChangeLog:

* gdb.python/py-value.exp (test_value_from_buffer): New proc with
call from main program.

5 years agoDefine gdb.Value(bufobj, type) constructor
Kevin Buettner [Sun, 17 Feb 2019 00:46:33 +0000 (17:46 -0700)] 
Define gdb.Value(bufobj, type) constructor

Provided a buffer BUFOBJ and a type TYPE, construct a gdb.Value object
with type TYPE, where the value's contents are taken from BUFOBJ.

E.g...

(gdb) python import struct
(gdb) python unsigned_int_type=gdb.lookup_type('unsigned int')
(gdb) python b=struct.pack('=I',0xdeadbeef)
(gdb) python v=gdb.Value(b, unsigned_int_type) ; print("%#x" % v)
0xdeadbeef

This two argument form of the gdb.Value constructor may also be used
to obtain gdb values from selected portions of buffers read with
Inferior.read_memory().  The test case (which is in a separate patch)
demonstrates this use case.

gdb/ChangeLog:

* python/py-value.c (convert_buffer_and_type_to_value): New
function.
(valpy_new): Parse arguments via gdb_PyArg_ParseTupleAndKeywords.
Add support for handling an optional second argument.  Call
convert_buffer_and_type_to_value as appropriate.

5 years agoDefine unique_ptr specialization for Py_buffer.
Kevin Buettner [Sun, 17 Feb 2019 00:33:47 +0000 (17:33 -0700)] 
Define unique_ptr specialization for Py_buffer.

This patch causes PyBuffer_Release() to be called when the associated
buffer goes out of scope.  I've been using it as follows:

 ...
 Py_buffer_up buffer_up;
 Py_buffer py_buf;

 if (PyObject_CheckBuffer (obj)
     && PyObject_GetBuffer (obj, &py_buf, PyBUF_SIMPLE) == 0)
   {
      /* Got a buffer, py_buf, out of obj.  Cause it to released
         when it goes out of scope.  */
     buffer_up.reset (&py_buf);
   }
   ...

This snippet of code was taken directly from an upcoming patch to
python-value.c.

gdb/ChangeLog:

* python/python-internal.h (Py_buffer_deleter): New struct.
(Py_buffer_up): New typedef.

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 Feb 2019 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoFix BFD leak in dwarf2_get_dwz_file.
John Baldwin [Mon, 25 Feb 2019 22:25:01 +0000 (14:25 -0800)] 
Fix BFD leak in dwarf2_get_dwz_file.

Previously if build_id_verify failed, dwz_bfd was cleared to NULL via
release(), but the BFD object was not destroyed.  Use reset() with
nullptr instead to delete the BFD.

gdb/ChangeLog:

* dwarf2read.c (dwarf2_get_dwz_file): Reset dwz_bfd to nullptr
instead of releasing ownership.

5 years agoFix crash when loading dwp files
Jordan Rupprecht [Mon, 25 Feb 2019 20:21:01 +0000 (12:21 -0800)] 
Fix crash when loading dwp files

When loading dwp files, we create an array of ELF sections indexed by the ELF
section index in the dwp file. The size of this array is calculated by
section_count, as returned by bfd_count_sections, plus 1 (to account for the
null section at index 0). However, when loading the bfd file, strtab/symtab
sections are not added to the list, nor do they increment section_count, so
section_count is actually smaller than the number of ELF sections.

This happens to work when using GNU dwp, which lays out .debug section first,
with sections like .shstrtab coming at the end. Other tools, like llvm-dwp, put
.strtab first, and gdb crashes when loading those dwp files.

For instance, with the current state of gdb, loading a file like this:
$ readelf -SW <file.dwp>
[ 0] <empty>
[ 1] .debug_foo PROGBITS ...
[ 2] .strtab    STRTAB ...

... results in section_count = 2 (.debug is the only thing placed into
bfd->sections, so section_count + 1 == 2), and sectp->this_idx = 1 when mapping
over .debug_foo in dwarf2_locate_common_dwp_sections, which passes the
assertion that 1 < 2.

However, using a dwp file produced by llvm-dwp:
$ readelf -SW <file.dwp>
[ 0] <empty>
[ 1] .strtab    STRTAB ...
[ 2] .debug_foo PROGBITS ...

... results in section_count = 2 (.debug is the only thing placed into
bfd->sections, so section_count + 1 == 2), and sectp->this_idx = 2 when mapping
over .debug_foo in dwarf2_locate_common_dwp_sections, which fails the assertion
that 2 < 2.

The assertion hit is:

gdb/dwarf2read.c:13009: internal-error: void dwarf2_locate_common_dwp_sections(bfd*, asection*, void*): Assertion `elf_section_nr < dwp_file->num_sections' failed.

This patch changes the calculation of section_count to use elf_numsections,
which should return the actual number of ELF sections.

5 years agoFix BFD leak in solib-darwin.c
Tom Tromey [Thu, 21 Feb 2019 17:40:49 +0000 (10:40 -0700)] 
Fix BFD leak in solib-darwin.c

commit 192b62ce0b4bb5c61188f570e127a26d2c32f716 ("Use class to manage
BFD reference counts") changed darwin_get_dyld_bfd to use:

+ dyld_bfd.release ();

rather than

-      do_cleanups (cleanup);

However, using release here leaks the BFD.  Instead, simply assigning
"sub" to "dyld_bfd" achieves what was meant.

gdb/ChangeLog
2019-02-25  Tom Tromey  <tromey@adacore.com>

* solib-darwin.c (darwin_get_dyld_bfd): Don't release dyld_bfd.

5 years agoExtend objdump's --dwarf=follow-links option so that separate debug info files will...
Nick Clifton [Mon, 25 Feb 2019 12:15:41 +0000 (12:15 +0000)] 
Extend objdump's --dwarf=follow-links option so that separate debug info files will also be affected by other dump function, and symbol tables from separate debug info files will be used when disassembling the main file.

* objdump.c (sym_ok): New function.
(find_symbol_for_address): Use new function.
(disassemble_section): Compare sections by name, not pointer.
(dump_dwarf): Move code to initialise byte_get pointer and iterate
over separate debug files from here to ...
(dump_bfd): ... here.  Add parameter indicating that a separate
debug info file is being dumped.  For main file, pull in the
symbol tables from all separate debug info files.
(display_object): Update call to dump_bfd.
* doc/binutils.texi: Document extened behaviour of the
--dwarf=follow-links option.
* NEWS: Mention this new feature.
* testsuite/binutils-all/objdump.WK2: Update expected output.
* testsuite/binutils-all/objdump.exp (test_follow_debuglink): Add
options and dump file parameters.
Add extra test.
* testsuite/binutils-all/objdump.WK3: New file.
* testsuite/binutils-all/readelf.exp: Change expected output for
readelf -wKis test.
* testsuite/binutils-all/readelf.wKis: New file.

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 25 Feb 2019 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoRe: PowerPC __tls_get_addr arg parsing
Alan Modra [Sun, 24 Feb 2019 07:31:08 +0000 (18:01 +1030)] 
Re: PowerPC __tls_get_addr arg parsing

Fixes non-ELF powerpc build failure:
tc-ppc.c:3009:1: error: ‘parse_tls_arg’ defined but not used

* config/tc-ppc.c (parse_tls_arg): Wrap in #ifdef OBJ_ELF.

5 years agoPR24144, pdp11-ld overwriting section data with zeros
Alan Modra [Sun, 24 Feb 2019 06:14:48 +0000 (16:44 +1030)] 
PR24144, pdp11-ld overwriting section data with zeros

bfd/
PR 24144
* pdp11.c (set_section_contents): Revert 2015-02-24 change.
gas/
PR 24144
* config/obj-aout.c (obj_aout_frob_file_before_fix): Write to end
of section to ensure file contents cover aligned section size.

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 Feb 2019 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

5 years agoUse '--readnever' when invoking GDB from gcore.in
Sergio Durigan Junior [Sat, 23 Feb 2019 15:05:19 +0000 (10:05 -0500)] 
Use '--readnever' when invoking GDB from gcore.in

Back when I proposed the '--readnever' feature, I somehow forgot or
decided not to include the bits related to gcore.in in the original
patch.  This patch finally updates the gcore script to invoke GDB
using '--readnever'.

We've been carrying this patch on Fedora GDB for quite some time, and
as expected the corefiles generated by gcore on Fedora don't have
problems, which I think is the best indicator that the it's safe to
generate corefiles using '--readnever'.

gdb/ChangeLog:
2019-02-23  Sergio Durigan Junior  <sergiodj@redhat.com>

* gcore.in: Add '--readnever' option when invoking GDB.

5 years agoUpdate copyright year range in gdb.ada/mi_ref_changeable testcase
Joel Brobecker [Sat, 23 Feb 2019 12:23:22 +0000 (16:23 +0400)] 
Update copyright year range in gdb.ada/mi_ref_changeable testcase

This patch fixes the copyright year range which escaped
the 2019 update, because the patch was submitted in 2018, but
only really pushed in 2019.

    Pushed: https://www.sourceware.org/ml/gdb-patches/2019-02/msg00109.html
    Submitted: https://www.sourceware.org/ml/gdb-patches/2018-12/msg00444.html

We normally are pretty good at remembering those little things,
but this one fell through the cracks. This commit fixes this,
by re-running the copyright.py script and checking in the changes
made by that script.

gdb/testsuite/ChangeLog:

* gdb.ada/mi_ref_changeable.exp: Update copyright year range.
* gdb.ada/mi_ref_changeable/foo_rb20_056.adb: Likewise.
* gdb.ada/mi_ref_changeable/pck.adb: Likewise.
* gdb.ada/mi_ref_changeable/pck.ads: Likewise.
* gdb.dwarf2/inlined_subroutine-inheritance.exp: Likewise.

5 years agoUpdate copyright year range in gdb.texinfo and refcard.tex
Joel Brobecker [Sat, 23 Feb 2019 12:14:23 +0000 (16:14 +0400)] 
Update copyright year range in gdb.texinfo and refcard.tex

I missed those files which need to be updated manually when I did
the copyright year range update. The copyright.py script reminds
us of that fact with the following message at the end...

    REMINDER: Multiple copyright headers must be updated by hand:
       gdb/doc/gdb.texinfo
       gdb/doc/refcard.tex
       gdb/gdbarch.sh

... and somehow I missed this. This commit makes the change for
gdb.texinfo and refcard.tex. gdbarch.sh is being updated separately
by Andrew Burgess.

gdb/doc/ChangeLog:

* gdb.texinfo: Update copyright year ranges.
* refcard.tex: Likewise.

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 Feb 2019 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoUpdate my email address
Simon Marchi [Fri, 22 Feb 2019 20:53:52 +0000 (15:53 -0500)] 
Update my email address

Since this is my last day at Ericsson, I am changing my email for my
personal one in the MAINTAINERS file.

5 years agoLook for build-id-based separate debug files under the sysroot
Simon Marchi [Fri, 22 Feb 2019 20:09:23 +0000 (15:09 -0500)] 
Look for build-id-based separate debug files under the sysroot

When looking for a separate debug file that matches a given build-id,
GDB only looks in the host's debug dir (typically /usr/lib/debug).  This
patch makes it look in the sysroot as well.  This is to match the
behavior of GDB when using debuglink-based separate debug files,
introduced in :

402d2bfec42 ("Look for separate debug files in debug directories under a sysroot.")

In the following example, my sysroot is "/tmp/sysroot" and I am trying
to load symbols for
/tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so.  This is
the current behavior:

    (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so
    Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so...

    Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so
      Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path

    <snip>
    (No debugging symbols found in /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so)

With this patch:

    (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so
    Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so...

    Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so
      Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path
      Trying /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... yes!
    Reading symbols from /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug...

In the original code, there is a suspicious "abfd.release ()" in
build_id_to_debug_bfd, that I don't understand.  If a file with the
right name exists but its build-id note doesn't match, we release (leak)
our reference, meaning the file will stay open?  I removed it in the new
code, so that the reference is dropped if we end up not using that file.
I tested briefly by corrupting a separate debug file to trigger this
code, nothing exploded.

gdb/ChangeLog:

* build-id.c (build_id_to_debug_bfd_1): New function.
(build_id_to_debug_bfd): Look for separate debug file in
sysroot.

5 years agogdb: Update copyright year range generated by gdbarch.sh
Andrew Burgess [Fri, 22 Feb 2019 20:12:21 +0000 (20:12 +0000)] 
gdb: Update copyright year range generated by gdbarch.sh

The copyright year that gdbarch.sh places into the generated files
gdbarch.{c,h} wasn't updated at the start of the year.  After this
commit the gdbarch.{c,h} files regenerate as the currently are in the
tree.

gdb/ChangeLog:

* gdbarch.sh: Update the copyright year range that is placed into
generated files.

5 years agoAdd missing ChangeLog entries for commit bb995d00b3eef2f48d0be895c3509a7ddd8280a1
Keith Seitz [Fri, 22 Feb 2019 20:05:37 +0000 (12:05 -0800)] 
Add missing ChangeLog entries for commit bb995d00b3eef2f48d0be895c3509a7ddd8280a1

5 years agoFix symtab/23853: symlinked default symtab
Keith Seitz [Fri, 22 Feb 2019 17:39:35 +0000 (09:39 -0800)] 
Fix symtab/23853: symlinked default symtab

This patch attempts to fix a bug dealing with setting breakpoints
in default symtabs that are symlinks.  For example:

(gdb) list
11    GNU General Public License for more details.
12
13    You should have received a copy of the GNU General Public License
14    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
15
16 static int
17 foo (void)
18 {
19   return 0; /* break here  */
20 }
(gdb)
21
22 int
23 main (void)
24 {
25   return foo ();
26 }
(gdb) b 19
No line 19 in the current file.
Make breakpoint pending on future shared library load? (y or [n])

The problem here is that when create_sals_line_offset sets the default
symtab, it immediately calls symtab_to_fullname, passing that fullname
to collect_symtabs_from_filename to find all matching symtabs.  This
fails because we end up looking for a symtab with the name of the
actual file on disk (which is different in this case because of the
symlink) instead of the one stored in the debug info.

Since we already have the lookup name of the default symtab, use it
instead of the fullname. [This fullname thing was originally added
in 2007 in a series dealing with *displaying* absolute file names.
Clearly, this instance has nothing to do with the display of file names.]

gdb/ChangeLog

PR symtab/23853
* linespec.c (create_sals_line_offset): Search for the default
symtab's filename instead of its fullname.

gdb/testsuite/ChangeLog

PR symtab/23853
* gdb.base/symlink-sourcefile.c: New file.
* gdb.base/symlink-sourcefile.exp: New file.

5 years agoExtend readelf and objdump so that they will display and follow multiple links to...
Nick Clifton [Fri, 22 Feb 2019 10:36:24 +0000 (10:36 +0000)] 
Extend readelf and objdump so that they will display and follow multiple links to separate debug information files.

PR 23843
* dwarf.h (struct separate_info): New structure for containing
information on separate debug info files.
* dwarf.c (struct dwo_info): New structure for containing dwo
links.
(first_dwo_info): Chain of dwo_info structures.
(first_separate_file): Chain of separate_info structures.
(separate_debug_file, separate_debug_filename): Delete.
(fetch_alt_indirect_string): Scan all separate debug info files
for the requested string.
(add_dwo_info): New function.
(add_dwo_name): New function.
(add_dwo_dir): New function.
(add_dwo_id: New function.
(free_dwo_info): New function.
(read_and_display_attr_value): Store DWO data using the new
functions.
(load_debug_section_with_follow): If necessary, scan the list of
separate debug info files for the requested section.
(add_separate_debug_file): New function.
(load_separate_debug_info): Call add_separate_debug_file to store
the information on the newly loaded file.
(load_dwo_file): Likewise.
(load_separate_debif_file): Rename to load_separate_debug_files.
Change return type to boolean.  If following links then attempt to
load all separate debug info files, not just the first one.
(free_debug_memory): Release memory in dwo_info and separate_info
chains.
* objdump.c (dump_dwarf): Iterate over all loaded debg info files.
* readelf.c (process_object): Likewise.
* doc/debug.options.texi: Update descriptions of links and
follow-links options.
* testsuite/binutils-all/objdump.WK2: Update expected output.
* testsuite/binutils-all/readelf.k2: Likewise.
* NEWS: Announce the new feature.

5 years ago[arm][gas] Add support for Neoverse N1
Kyrylo Tkachov [Fri, 22 Feb 2019 09:59:05 +0000 (09:59 +0000)] 
[arm][gas] Add support for Neoverse N1

This adds support for the Neoverse N1 CPU [1] to gas.
This was previously enabled under the Ares codename, which remains as
a valid option for -mcpu for compatibility reasons.

make check-gas passes on arm-none-eabi.

[1] https://community.arm.com/processors/b/blog/posts/arm-neoverse-n1-platform-accelerating-the-transformation-to-a-scalable-cloud-to-edge-infrastructure

2019-02-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * config/tc-arm.c (arm_cpus): Add neoverse-n1.
    * doc/c-arm.texi (-mcpu): Document neoverse-n1 value.

5 years ago[AArch64][gas] Add support for Neoverse E1
Kyrylo Tkachov [Fri, 22 Feb 2019 09:57:45 +0000 (09:57 +0000)] 
[AArch64][gas] Add support for Neoverse E1

This adds support for the Neoverse E1 CPU [1] to gas.

make check-gas passes on aarch64-none-elf.

[1] https://community.arm.com/processors/b/blog/posts/arm-neoverse-e1-platform-empowering-the-infrastructure-to-meet-next-generation-throughput-demands

2019-02-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * config/tc-aarch64.c (aarch64_cpus): Add neoverse-e1.
    * doc/c-aarch64.texi (-mcpu): Document neoverse-e1 value.

5 years ago[AArch64][gas] Add support for Neoverse N1
Kyrylo Tkachov [Fri, 22 Feb 2019 09:56:50 +0000 (09:56 +0000)] 
[AArch64][gas] Add support for Neoverse N1

This adds support for the Neoverse N1 [1] CPU to gas.
This was previously enabled under the Ares codename, which remains as
a valid option for -mcpu for compatibility reasons.

make check-gas passes on aarch64-none-elf.

[1] https://community.arm.com/processors/b/blog/posts/arm-neoverse-n1-platform-accelerating-the-transformation-to-a-scalable-cloud-to-edge-infrastructure

2019-02-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * config/tc-aarch64.c (aarch64_cpus): Add neoverse-n1.
    * doc/c-aarch64.texi (-mcpu): Document neoverse-n1 value.

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 Feb 2019 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoDocument style behavior in batch mode.
Alan Hayward [Thu, 21 Feb 2019 18:20:21 +0000 (18:20 +0000)] 
Document style behavior in batch mode.

Style is disabled when running in batch mode.

gdb/ChangeLog:

* NEWS: Update style defaults.

gdb/doc/ChangeLog:

* gdb.texinfo: Update style defaults.

5 years agoFix typo in "show remotelogfile" docs
Tom Tromey [Thu, 21 Feb 2019 14:26:52 +0000 (07:26 -0700)] 
Fix typo in "show remotelogfile" docs

I noticed a trailing "." in the @item for "show remotelogfile".
This removes it.  Committing as obvious.

gdb/doc/ChangeLog
2019-02-21  Tom Tromey  <tromey@adacore.com>

* gdb.texinfo (Remote Configuration): Remove trailing "." from
@item.

5 years agoDisable styling when running in batch mode
Alan Hayward [Thu, 21 Feb 2019 13:17:32 +0000 (13:17 +0000)] 
Disable styling when running in batch mode

The GCC Guality testsuite within GCC compiles C/C++ files in GCC at
various optimization levels then debugs them in GDB, checking that
program values can be read.  This is done within the dejagnu framework.

The new style options in GDB have broken many of the tests due to the
testsuite being unable to process the new control characters.  The fix
in Guality is to either to improve the string matching or to disable
styling on the cli or init file (after checking gdb is recent enough
to support styling).

This fix will also need making an any other testsuites in the wild
that use GDB.

An alternative would be to automatically disable styling when using GDB
in batch mode.  The reasoning here is that batch mode is only used when
automating GDB and any output will be processed later either with text
processing tools or viewed in text editors, many of these will not
correctly handle the control characters by default.  This ensures GDB
continues to work as expected.  Anyone who explicitly wants styling in
batch mode can enable it either in the init file or adding to the batch
file - but that would not be the standard use case.

Patch simply disables style after reading the batch command flag, before
reading in the init file or batch file.

gdb/ChangeLog:

* main.c (captured_main_1): Disable styling in batch mode.

5 years agoFix illegal memory accesses by readelf when parsing corrupt IA64 unwind information.
Nick Clifton [Thu, 21 Feb 2019 10:54:12 +0000 (10:54 +0000)] 
Fix illegal memory accesses by readelf when parsing corrupt IA64 unwind information.

PR 24247
* unwind-ia64.c: Include sysdep.h.
(unw_decode_x1): Check current pointer against end pointer before
accessing memory.
(unw_decode_x2): Likewise.
(unw_decode_x3): Likewise.
(unw_decode_x4): Likewise.
(unw_decode_r2): Likewise.
(unw_decode_p2_p5): Likewise.
(unw_decode_p7_p10): Likewise.
(unw_decode): Likewise.

5 years agoPowerPC __tls_get_addr arg parsing
Alan Modra [Thu, 21 Feb 2019 07:11:47 +0000 (17:41 +1030)] 
PowerPC __tls_get_addr arg parsing

The syntax we ended up with for -m32 -fPIC calls to __tls_get_addr is
rather weird.
    bl __tls_get_addr+0x8000(gd0@tlsgd)@plt
This came about by accident, probably due to requiring the arg reloc
before the call reloc.

Of course the @plt really belongs with __tls_get_addr since it affects
the call rather than the call arg, and it isn't a great deal of
trouble to ensure the relocs are emitted in the correct order.  This
patch supports a newer syntax, like so:
    bl __tls_get_addr+0x8000@plt(gd0@tlsgd)

gas/
* config/tc-ppc.c (parse_tls_arg): New function, extracted..
(md_assembler): ..from here.  Call it after parsing other
suffix modifiers too.
ld/
* testsuite/ld-powerpc/tls32.s: Test new @plt syntax.

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 Feb 2019 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in