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

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

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

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

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

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

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

Change-Id: I18f180c17850f420e9b66afc67f9cb3d8dceb0b3

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

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

In this commit:

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

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

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

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

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

gdb/ChangeLog:

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

gdb/testsuite/ChangeLog:

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

Change-Id: I47c52a202fa74be138382646b695827940178689

4 years agomodified test code from info rocm devices to info agents
rohit pathania [Fri, 20 Dec 2019 10:59:13 +0000 (05:59 -0500)] 
modified test code from info rocm devices to info agents

Change-Id: I70c83c5cf3e1ca3b13dbd31e23cd38029f40bfd3

4 years agoUpdate copyright year
Laurent Morichetti [Thu, 2 Jan 2020 18:20:17 +0000 (10:20 -0800)] 
Update copyright year

Change-Id: I52f92931a188148074b46e956df8f14d5b2b81e7

4 years agoMerge branch 'gdb-9-branch' into amd-staging-rocgdb-9
Laurent Morichetti [Mon, 6 Jan 2020 18:22:01 +0000 (10:22 -0800)] 
Merge branch 'gdb-9-branch' into amd-staging-rocgdb-9

Change-Id: I76e59526bf7d95713536543d66356397a5737e82

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

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

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

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

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

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

libctf/ChangeLog:

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

(cherry picked from commit 3a657c600bde2d3bd84870f75968622bbdb69ce8)

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

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

libctf/ChangeLog:

        * Makefile.in, aclocal.m4: Regenerate.

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

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

gdb/ChangeLog:

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

gdb/doc/ChangeLog:

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

(cherry picked from commit e5d78223eaf178ebb23aa20f209f71497aaae722)

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

gdb/ChangeLog:

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

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

gdb/ChangeLog:

        * copyright.py: Convert to Python 3.

(cherry picked from commit 5f4def5cbd12e77075f64a6854fb002f34be8a01)

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

gdb/ChangeLog:

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

(cherry picked from commit 51fd40020e1e0b21642cdec9c749f2e3862939ea)

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

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

gdb/ChangeLog:

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

(cherry picked from commit 5fb651f2ddd54a1d3da6fcd172d9fab81893bbf9)

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

gdb/ChangeLog:

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

gdb/gdbserver/ChangeLog:

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

(cherry picked from commit 5dd8bf886a3f7535e0ad8b5218275efcf2cfff31)

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

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

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

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

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

4 years agoMerge branch 'gdb-9-branch' into amd-staging-rocgdb-9
Laurent Morichetti [Tue, 31 Dec 2019 14:58:47 +0000 (06:58 -0800)] 
Merge branch 'gdb-9-branch' into amd-staging-rocgdb-9

Change-Id: Ide7bbea659e5594e8ae21e722840a09e4ade37db

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

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

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

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

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

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

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

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

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

gdb/ChangeLog:

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

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

gdb/gdbserver/ChangeLog:

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

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

Change-Id: I220e78b52c7db88b9dd058eda604635b03464fac

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

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

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

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

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

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

(cherry picked from commit e76ff636537c6140bb9d0b0a39260d840f37ca7e)

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

4 years agoFix test failures (arch not recognized)
Laurent Morichetti [Sun, 22 Dec 2019 06:05:30 +0000 (22:05 -0800)] 
Fix test failures (arch not recognized)

The following tests:
  - gdb.base/all-architectures-0.exp
  - gdb.base/all-architectures-1.exp
  - gdb.base/all-architectures-3.exp

fail with an "arch not recognized" error.

GDB cannot select architectures that are not supported by the ROCdbgapi
library. Remove unsupported architectures from the arch_info struct.

bfd/ChangeLog:

        * cpu-amdgcn.c (arch_info_struct): Remove unsupported
        architectures.

Change-Id: Ie9c72499fecdd64223184864cfe425330b582cf3

4 years agoFix gdb.base/all-architectures-2.exp failures
Laurent Morichetti [Sun, 22 Dec 2019 05:52:59 +0000 (21:52 -0800)] 
Fix gdb.base/all-architectures-2.exp failures

print_insn_amdgcn fails to report an error if the memory is not mapped.

disassemble 0x0,+4 returns:
Dump of assembler code from 0x0 to 0x4:
   0x0000000000000000:  v_cndmask_b32_e32 v0, s0, v0, vcc

instead of:
Dump of assembler code from 0x0 to 0x4:
   0x0000000000000000:  Cannot access memory at address 0x0

print_insn_amdgcn should return -1 if target_read returns 0 or
TARGET_XFER_E_IO. Also, use TARGET_OBJECT_CODE_MEMORY since we are
disassembling code memory.

gdb/ChangeLog:

        * amdgcn-rocm-tdep.c (print_insn_amdgcn): Check target_read's
        return value and return -1 if it is 0 or TARGET_XFER_E_IO.
        (amdgcn_rocm_displaced_step_fixup): Fix indentation.
        (amdgcn_gdbarch_init): Fix indentation.

Change-Id: Iff607a45efd0d369d44e7a8b34c8eb612985b5de

4 years agoFix test failures (timeout)
Laurent Morichetti [Sun, 22 Dec 2019 05:07:31 +0000 (21:07 -0800)] 
Fix test failures (timeout)

The following tests:

  - gdb.base/catch-fork-kill.exp
  - gdb.base/coredump-filter.exp
  - gdb.base/corefile.exp
  - gdb.base/multi-forks.exp
  - gdb.multi/watchpoint-multi-exit.exp
  - gdb.threads/fork-plus-threads.exp
  - gdb.threads/gcore-thread.exp
  - gdb.threads/process-dies-while-detaching.exp

timeout after a target, for which amd_dbgapi_process_attach failed,
terminates. When amd_dbgapi_process_attach fails, the notifier file
desriptor is left uninitialized, and rocm_target_inferior_exit ends
up closing stdin. Without stdin, gdb no longer receives any input
and hangs.

amd_dbapi_notifier should have a default value of -1 (not a valid
file descriptor), and rocm_target_inferior_exit should test the
notifier file descriptor before closing it.

gdb/ChangeLog:

        * rocm-tdep.c (rocm_inferior_info::process_id): Initialize.
        (rocm_inferior_info::notifier): Initialize.
        (rocm_target_inferior_exit): Test notifier before closing.

Change-Id: Ib7e2404440cb377a1e5235d24844aab70f801eb7

4 years agoRename ROCm Threads AMDGPU Threads
Laurent Morichetti [Sun, 22 Dec 2019 00:32:00 +0000 (16:32 -0800)] 
Rename ROCm Threads AMDGPU Threads

Also rename ROCm DSOs AMDGPU shared objects.

gdb/ChangeLog:

        * amdgcn-rocm-tdep.c (amdgcn_rocm_displaced_step_fixup): Fix
        a typo.
        * rocm-tdep.c (rocm_target_ops::pid_to_str): Rename ROCm Thread
        AMDGPU Thread.
        * solib-rocm.c (ROCM_DSO_NAME_PREFIX): Rename ROCm-supplied DSO
        AMDGPU shared object.

Change-Id: I09dbebcc605be9829983247d09c57c3c267bbf6a

4 years agoMerge branch 'gdb-9-branch' of ssh://git.amd.com:29418/compute/ec/rocm-gdb into amd...
Laurent Morichetti [Sun, 22 Dec 2019 04:51:53 +0000 (20:51 -0800)] 
Merge branch 'gdb-9-branch' of ssh://git.amd.com:29418/compute/ec/rocm-gdb into amd-staging-rocgdb-9

Change-Id: Ib9df2cf09930325723e0a6447bac0700e9b2c92a

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

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

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

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

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

(cherry picked from commit 15b07e4f5672cf02487a26305ac3b2ddd0aec68e)

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

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

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

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

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

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

Tested by building on macOS High Sierra.

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

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

Change-Id: Ib09da6ac33958a0d843f65df2a528112356e7de6

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

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

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

This version also renames field_kind::SIGNED for consistency.

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

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

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

Change-Id: Iae9f36f1b793e22c61fee0de2ab2d508668ee7e4

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

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

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

Fix it by assigning the gdb_block_iter_tmp variable in the loop.

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

This was found because of an ASan report:

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

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

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

gdb/ChangeLog:

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

gdb/testsuite/ChangeLog:

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

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

4 years agoMerge branch 'gdb-9-branch' of ssh://git.amd.com:29418/compute/ec/rocm-gdb into amd...
Laurent Morichetti [Mon, 16 Dec 2019 19:46:03 +0000 (11:46 -0800)] 
Merge branch 'gdb-9-branch' of ssh://git.amd.com:29418/compute/ec/rocm-gdb into amd-staging-rocgdb-9

Change-Id: Ib897e9cc938543e70987b6dedbfde32b19460e8c

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

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

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

gdb/doc/ChangeLog:

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

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

Change-Id: I75b74c5da599e657ee94daa8c88b5a097bc58d15

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

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

In this commit:

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

      gdb/python: Introduce gdb.lookup_static_symbols

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

gdb/doc/ChangeLog:

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

Change-Id: I4457b42cf05bde39e5c0ff39f168af919cad1255

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

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

4 years agoInitial version of ROCgdb
Laurent Morichetti [Mon, 9 Dec 2019 04:28:44 +0000 (20:28 -0800)] 
Initial version of ROCgdb

Change-Id: I452a39b8de6892b6945e913d3144a29bb8119426

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

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

gdb/ChangeLog:

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

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

gdb/ChangeLog:

GDB 9.0.90 released.

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

gdb/ChangeLog:

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

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

gdb/ChangeLog:

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

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

bfd/ChangeLog:

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

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

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

gdb/ChangeLog:

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

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

gdb/doc/ChangeLog:

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

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

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

Committed on behalf of Wilco Dijkstra.

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

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

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

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

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

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

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

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

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

Change-Id: Id7bf28d99ca27a893a9fc87ebb90b15a9c2a9cb4

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

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

This patch fixes the build.  Tested by rebuilding.

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

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

Change-Id: Ic015f5fd3d88da6b5da8f7b4e1d11d5c981333db

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

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

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

Aimed at quietening ubsan.

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

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

And similarly for bfd_get_signed_8.

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

4 years agox86: further refine SSE check (SSE4a, SHA, GFNI)
Jan Beulich [Wed, 11 Dec 2019 08:42:29 +0000 (09:42 +0100)] 
x86: further refine SSE check (SSE4a, SHA, GFNI)

In  ("x86: extend SSE check to PCLMULQDQ, AES, and GFNI insns") I went
both a little too far and not quite far enough:
- GFNI insns also have AVX512 variants, which also shouldn't get
  diagnosed,
- SSE4a insns should get diagnosed just like SSE4.x ones,
- SHA insns should get diagnosed just like PCLMULQDQ or AES ones.

4 years agoImplement 'print -raw-values' and 'set print raw-values on|off'
Philippe Waroquiers [Wed, 7 Aug 2019 18:50:54 +0000 (20:50 +0200)] 
Implement 'print -raw-values' and 'set print raw-values on|off'

The option framework documentation was speaking about a 'print -raw'
option, but this option does not exist.

This patch implements -raw-values option that tells to ignore the
active pretty printers when printing a value.
As we already have -raw-frame-arguments, I thought -raw-values
was more clear, in particular to differentiate
   set print raw-values and set print raw-frame-arguments.

gdb/doc/ChangeLog
2019-12-11  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.texinfo (Command Options): Use -p and -pretty in the example,
as -r is ambiguous.  Update the print - TAB TAB completion result.
(Data): Document new option -raw-values.  Use -p and -pretty in the
 example, as -r is ambiguous.
(Print Settings): Document set print raw values.
(Pretty-Printer Commands): Document interaction between enabled
pretty printers and -raw-values/-raw-frame-arguments.

gdb/ChangeLog
2019-12-11  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* NEWS: Document -raw-values option and the related setting commands.
* printcmd.c (print_command_parse_format): Do not set opts->raw off,
only set it on when /r is given.
* valprint.c (value_print_option_defs): New element raw-values.
* Makefile.in: Add the new file.

gdb/testsuite/ChangeLog
2019-12-11  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.base/options.exp: Add -raw-values in the print completion list.
* gdb.python/py-prettyprint.exp: Add tests for -raw-values.

4 years agoRe: ubsan: ns32k: left shift cannot be represented in type
Alan Modra [Wed, 11 Dec 2019 02:41:07 +0000 (13:11 +1030)] 
Re: ubsan: ns32k: left shift cannot be represented in type

* ns32k-dis.c (sign_extend): Correct last patch.

4 years agoubsan: vax: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 22:27:45 +0000 (08:57 +1030)] 
ubsan: vax: left shift cannot be represented in type 'int'

* vax-dis.c (NEXTLONG): Avoid signed overflow.

4 years agoubsan: v850: left shift cannot be represented in type 'long'
Alan Modra [Tue, 10 Dec 2019 22:23:50 +0000 (08:53 +1030)] 
ubsan: v850: left shift cannot be represented in type 'long'

* v850-dis.c (get_operand_value): Use unsigned arithmetic.  Don't
sign extend using shifts.

4 years agoubsan: tic6x: shift left of int
Alan Modra [Tue, 10 Dec 2019 22:22:22 +0000 (08:52 +1030)] 
ubsan: tic6x: shift left of int

* tic6x-dis.c (tic6x_extract_32): Avoid signed overflow.

4 years agoubsan: tic4x: segv and signed shifts
Alan Modra [Tue, 10 Dec 2019 22:17:35 +0000 (08:47 +1030)] 
ubsan: tic4x: segv and signed shifts

* tic4x-dis.c (tic4x_print_register): Formatting.  Don't segfault
on NULL registertable entry.
(tic4x_hash_opcode): Use unsigned arithmetic.

4 years agoubsan: s12z: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 22:07:53 +0000 (08:37 +1030)] 
ubsan: s12z: left shift cannot be represented in type 'int'

* s12z-opc.c (z_decode_signed_value): Avoid signed overflow.

4 years agoubsan: ns32k: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 22:04:57 +0000 (08:34 +1030)] 
ubsan: ns32k: left shift cannot be represented in type 'int'

* ns32k-dis.c (bit_extract): Use unsigned arithmetic.
(bit_extract_simple, sign_extend): Likewise.

4 years agoubsan: nios2: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 22:02:18 +0000 (08:32 +1030)] 
ubsan: nios2: left shift cannot be represented in type 'int'

* nios2-dis.c (nios2_print_insn_arg): Use 1u << 31.

4 years agoubsan: moxie: left shift of negative value
Alan Modra [Tue, 10 Dec 2019 21:56:58 +0000 (08:26 +1030)] 
ubsan: moxie: left shift of negative value

* moxie-dis.c (INST2OFFSET): Don't sign extend using shifts.

4 years agoubsan: m68k: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 21:53:33 +0000 (08:23 +1030)] 
ubsan: m68k: left shift cannot be represented in type 'int'

* m68k-dis.c (COERCE32): Cast value first.
(NEXTLONG, NEXTULONG): Avoid signed overflow.

4 years agoubsan: h8300: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 13:23:57 +0000 (23:53 +1030)] 
ubsan: h8300: left shift cannot be represented in type 'int'

This is
  *cst = (data[0] << 24) + (data[1] << 16) + (data[2] << 8) + data[3];
data is unsigned char which promotes to int.

* h8300-dis.c (extract_immediate): Avoid signed overflow.
(bfd_h8_disassemble): Likewise.

4 years agoussan: d30v: index out of bounds
Alan Modra [Tue, 10 Dec 2019 13:20:02 +0000 (23:50 +1030)] 
ussan: d30v: index out of bounds

* d30v-dis.c (print_insn): Make opind unsigned.  Don't access
past end of operands array.

4 years agoubsan: csky: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 13:07:03 +0000 (23:37 +1030)] 
ubsan: csky: left shift cannot be represented in type 'int'

In the following buf is an unsigned char array, so elements are
promoted to int before arithmetic operations.

  if (dis_info.info->endian == BFD_ENDIAN_BIG)
    while (n--)
      val |= buf[n] << (n*8);
  else
    for (i = 0; i < n; i++)
      val |= buf[i] << (i*8);

* csky-dis.c (csky_chars_to_number): Rewrite.  Avoid signed
overflow when collecting bytes of a number.

4 years agoubsan: cris: signed integer overflow
Alan Modra [Tue, 10 Dec 2019 12:52:10 +0000 (23:22 +1030)] 
ubsan: cris: signed integer overflow

This was the following in print_with_operands
case 4:
  number
    = buffer[2] + buffer[3] * 256 + buffer[4] * 65536
    + buffer[5] * 0x1000000;
and buffer[5] * 0x1000000 can indeed overflow.  So to fix this we need
to use unsigned arithmetic where overflow semantics are specified.
But number is a long, and the expression is int which will be sign
extended to long.  If we make the expression unsigned it will be zero
extended.  So make number an int32_t and rearrange a little for some
of the places that need fixing.

* cris-dis.c (print_with_operands): Avoid signed integer
overflow when collecting bytes of a 32-bit integer.

4 years agoubsan: cr16: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 12:32:37 +0000 (23:02 +1030)] 
ubsan: cr16: left shift cannot be represented in type 'int'

This was:
  unsigned long mask = SBM (instruction->match_bits);
with
  #define SBM(offs)  ((((1 << (32 - offs)) -1) << (offs)))

Well, there are a couple of problems.  Firstly, the expression uses
int values (1 rather than 1u or 1ul) resulting in the ubsan error, and
secondly, a zero offs will result in a 32-bit shift which is undefined
if ints are only 32 bits.

* cr16-dis.c (EXTRACT, SBM): Rewrite.
(cr16_match_opcode): Delete duplicate bcond test.

4 years agoubsan: bfin: shift exponent is too large
Alan Modra [Tue, 10 Dec 2019 12:02:06 +0000 (22:32 +1030)] 
ubsan: bfin: shift exponent is too large

This was the following in fmtconst_val, x is unsigned int.
    x = SIGNEXTEND (x, constant_formats[cf].nbits);
Problem is, the SIGNEXTEND macro assumed its arg was a long and sign
extended by shifting left then shifting right, and didn't cast the
arg.  So don't do the silly shift thing.  It's not guaranteed to work
anyway according to the C standard.  ">>" might do a logical shift
even if its args are signed.

* bfin-dis.c (HOST_LONG_WORD_SIZE, XFIELD): Delete.
(SIGNBIT): New.
(MASKBITS, SIGNEXTEND): Rewrite.
(fmtconst): Don't use ? expression now that SIGNEXTEND uses
unsigned arithmetic, instead assign result of SIGNEXTEND back
to x.
(fmtconst_val): Use 1u in shift expression.

4 years agoubsan: arc: shift exponent 32 is too large for 32-bit type 'int'
Alan Modra [Tue, 10 Dec 2019 08:39:47 +0000 (19:09 +1030)] 
ubsan: arc: shift exponent 32 is too large for 32-bit type 'int'

When operand->bits is 32, the following results in UB.
value = (insn >> operand->shift) & ((1 << operand->bits) - 1);

* arc-dis.c (find_format_from_table): Use ull constant when
shifting by up to 32.

4 years agoaarch64 disassembler infinite loop
Alan Modra [Tue, 10 Dec 2019 08:34:37 +0000 (19:04 +1030)] 
aarch64 disassembler infinite loop

Assembling this to an object and trying to disassemble results in
objdump -d looping forever.

 .inst 0x45205120

PR 25270
* aarch64-dis.c (aarch64_decode_variant_using_iclass): Return
false when field is zero for sve_size_tsz_bhs.

4 years agoubsan: left shift of cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 08:28:38 +0000 (18:58 +1030)] 
ubsan: left shift of cannot be represented in type 'int'

* dis-asm.h (INSN_HAS_RELOC, DISASSEMBLE_DATA),
(USER_SPECIFIED_MACHINE_TYPE, WIDE_OUTPUT): Make unsigned.
* opcode/tic80.h (TIC80_OPERAND_*): Likewise.

4 years agoubsan: xtensa: left shift cannot be represented in type 'int'
Alan Modra [Tue, 10 Dec 2019 07:42:28 +0000 (18:12 +1030)] 
ubsan: xtensa: left shift cannot be represented in type 'int'

In Operand_soffsetx4_decode:
  soffsetx4_0 = 0x4 + ((((int) offset_0 << 14) >> 14) << 2);
and other places.

Don't sign extend with shifts!  This file also has many occurrences of
truncation via shifts, which aren't a problem due to using uint32, but
I dislike on principle enough to fix.

* xtensa-modules.c (Field_* functions): Don't mask using shifts.
(Operand_soffsetx4_decode, Operand_simm4_decode),
(Operand_simm8_decode, Operand_simm8x256_decode),
(Operand_simm12b_decode, Operand_label8_decode),
(Operand_label12_decode, Operand_soffset_decode),
(Operand_xt_wbr15_label_decode, Operand_xt_wbr18_label_decode): Don't
sign extend using shifts.
(Operand_immrx4_decode, Operand_uimm16x4_decode): Avoid UB in
constant.

4 years agoubsan: epiphany: left shift of negative value
Alan Modra [Tue, 10 Dec 2019 07:36:09 +0000 (18:06 +1030)] 
ubsan: epiphany: left shift of negative value

Two places in epiphany_cgen_extract_operand, "value" is a long.
        value = ((((value) << (1))) + (pc));

cpu/
* epiphany.cpu (f-simm8, f-simm24): Use multiply rather than
shift left to avoid UB on left shift of negative values.
opcodes/
* epiphany-ibld.c: Regenerate.

4 years agoubsan: ia64: left shift of negative value
Alan Modra [Tue, 10 Dec 2019 07:27:14 +0000 (17:57 +1030)] 
ubsan: ia64: left shift of negative value

Here, since val is signed:
   *valuep = (val << scale);

* cpu-ia64-opc.c (ext_imms_scaled): Avoid undefined left shift
of negative values by using unsigned vars.

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

4 years agoMinor fix to gdb.prompt documentation
Tom Tromey [Wed, 20 Nov 2019 23:07:46 +0000 (16:07 -0700)] 
Minor fix to gdb.prompt documentation

I noticed that an example in the gdb.prompt documentation used the
wrong kind of quotes -- because it is code, it should use a plain
ASCII quotation mark.  I also slightly shortened the sample text here,
so it would more clearly fit on a single line.

gdb/doc/ChangeLog
2019-12-10  Tom Tromey  <tom@tromey.com>

* python.texi (gdb.prompt): Use correct quotes in example.
Shorten sample text.

Change-Id: I4153928c0d88001244ad410f3943c952a6ebfeb1

4 years agoOpenMP parallel region scope tests
Kevin Buettner [Wed, 20 Sep 2017 22:40:14 +0000 (15:40 -0700)] 
OpenMP parallel region scope tests

Add tests which check for accessibility of variables from within
various OpenMP parallel regions.

Tested on Fedora 27, 28, 29, 30, and 31.  I also tested with my OpenMP
work on Fedora 30.  The test has been annotated with setup_xfail and
setup_kfail statements so that there are no unexpected failures on any
of these platforms when using gcc.  Better still, for my own testing
anyway, is that there are also no XPASSes or KPASSes either.  So,
regardless of platform, when using gcc, and regardless of whether my
(not yet public) OpenMP work is used, seeing a FAIL indicates a real
problem.

Fedora 27 results:

        # of expected passes            85
        # of expected failures          65

(Note: I have not retested F27 since v1 of the patch; it's possible
that the numbers will be slightly different for v2.)

Fedora 28, 29, 30 results:

        # of expected passes            131
        # of expected failures          4
        # of known failures             16

Fedora 30, 31 results w/ my OpenMP work:

        # of expected passes            151

The above results all use gcc, either the system gcc or a development
gcc (when testing against my OpenMP work in GDB).  I've also tested
with clang 9.0.0 and icc 19.0.5.281 20190815 on Fedora 31.

Fedora 31, clang:

FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print s1
FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print s3
FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print i1
FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print i3
FAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print s1
FAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print s3
FAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print i1
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i02
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i11
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i12
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i22
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i11
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: after parallel: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print num
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print l
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print k
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 2nd stop: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 2nd stop: print num
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print num
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print l
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print k
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print num
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print file_scope_var
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print i
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print j

Fedora 31, icc:

FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i12
FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i22
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print s1
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print i
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print j
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print s1
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print i
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print j
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print k
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print z
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print s1
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print i
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print j
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print s1
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print i
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print j
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print k
FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print z
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print l
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print k
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print l
FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print k

For both clang and icc, it turns out that there are some problems with
the DWARF that these compilers generate.  Of the two, icc does at
least nest the subprogram of the outlined function representing the
parallel region within the function that it's defined, but does not
handle inner scopes if they exist.  clang places the subprogram for
the outlined function at the same level as the containing function, so
variables declared within the function aren't visible at all.

I could call setup_xfail to avoid FAILs for clang and icc also, but I don't
want to further complicate the test.

gdb/testsuite/ChangeLog:

* gdb.threads/omp-par-scope.c: New file.
* gdb/threads/omp-par-scope.exp: New file.

Change-Id: Icb9c991730d84ca7509380af817dfcc778e764ea

4 years agoAdd gdb_caching_proc support_nested_function_tests to lib/gdb.exp
Kevin Buettner [Sat, 9 Nov 2019 18:09:41 +0000 (11:09 -0700)] 
Add gdb_caching_proc support_nested_function_tests to lib/gdb.exp

This commit adds the gdb_caching_proc, support_nested_function_tests,
to lib/gdb.exp.  It tests to see whether or not the C compiler has
support for nested function calls.

gdb/testsuite/ChangeLog:

* lib/gdb.exp (support_nested_function_tests): New proc.

Change-Id: Ic2c93bc4cc200e07e104a2398f89a9c0514bdc75

4 years agoAdd gdb_compile_openmp to lib/gdb.exp
Kevin Buettner [Thu, 22 Aug 2019 02:32:12 +0000 (19:32 -0700)] 
Add gdb_compile_openmp to lib/gdb.exp

gdb/testsuite/ChangeLog:

* lib/gdb.exp (gdb_compile_openmp): New proc.
(build_executable_from_specs): Add an "openmp" option.
(gdb_compile_pthreads): Add non-executable case.

Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101

4 years agoSuppress the "unused function" warning for select_strerror_r
Christian Biesinger [Tue, 10 Dec 2019 19:42:40 +0000 (13:42 -0600)] 
Suppress the "unused function" warning for select_strerror_r

We only ever use one of the two overloads, so to avoid breaking -Werror
builds, supress the warning.

gdb/ChangeLog:

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

* gdbsupport/safe-strerror.c: Supress the unused function warning
for select_strerror_r.

Change-Id: I344869a382bb36fe181b5b2a31838d1d20f58169

This page took 0.04661 seconds and 4 git commands to generate.