external/binutils.git
7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 25 Dec 2016 00:00:46 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 24 Dec 2016 00:00:35 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 23 Dec 2016 00:00:47 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 22 Dec 2016 00:00:53 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 21 Dec 2016 00:00:48 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agogdb: Fix C and C++03 builds
Pedro Alves [Tue, 20 Dec 2016 19:18:15 +0000 (19:18 +0000)]
gdb: Fix C and C++03 builds

The readline/sjlj-exceptions fix added an unconditional use of
noexcept, but that's only valid C++11, and 7.12 must build with C and
C++03 too.  Fix this by adding a GDB_EXCEPT macro that compiles away
to nothing in C, and to throw() in C++03, which I've confirmed fixes
the original issue just the same as noexcept, with GCC 7 + -std=gnu+03
+ sjlj-exceptions.

gdb/ChangeLog:
2016-12-20  Pedro Alves  <palves@redhat.com>

PR gdb/20977
* event-top.c (GDB_NOEXCEPT): Define.
(gdb_rl_callback_read_char_wrapper_noexcept): Use GDB_NOEXCEPT
instead of noexcept and use (void) instead of ().
(gdb_rl_callback_handler): Use GDB_NOEXCEPT instead of noexcept.

7 years agoFix longjmp across readline w/ --enable-sjlj-exceptions toolchains
Pedro Alves [Tue, 20 Dec 2016 16:25:54 +0000 (16:25 +0000)]
Fix longjmp across readline w/ --enable-sjlj-exceptions toolchains

Nowadays, GDB propagates C++ exceptions across readline using
setjmp/longjmp 89525768cd08 ("Propagate GDB/C++ exceptions across
readline using sj/lj-based TRY/CATCH") because DWARF-based unwinding
can't cross C functions compiled without -fexceptions (see details
from the commit above).

Unfortunately, toolchains that use SjLj-based C++ exceptions got
broken with that fix, because _Unwind_SjLj_Unregister, which is put at
the exit of a function, is not executed due to the longjmp added by
that commit.

 (gdb) [New Thread 2936.0xb80]
 kill

 Thread 1 received signal SIGSEGV, Segmentation fault.
 0x03ff662b in ?? ()
 top?bt 15
 #0  0x03ff662b in ?? ()
 #1  0x00526b92 in stdin_event_handler (error=0, client_data=0x172ed8)
    at ../../binutils-gdb/gdb/event-top.c:555
 #2  0x00525a94 in handle_file_event (ready_mask=<optimized out>,
    file_ptr=0x3ff5cb8) at ../../binutils-gdb/gdb/event-loop.c:733
 #3  gdb_wait_for_event (block=block@entry=1)
    at ../../binutils-gdb/gdb/event-loop.c:884
 #4  0x00525bfb in gdb_do_one_event ()
    at ../../binutils-gdb/gdb/event-loop.c:347
 #5  0x00525ce5 in start_event_loop ()
    at ../../binutils-gdb/gdb/event-loop.c:371
 #6  0x0051fada in captured_command_loop (data=0x0)
    at ../../binutils-gdb/gdb/main.c:324
 #7  0x0051cf5d in catch_errors (
    func=func@entry=0x51fab0 <captured_command_loop(void*)>,
    func_args=func_args@entry=0x0,
    errstring=errstring@entry=0x7922bf <VEC_interp_factory_p_quick_push(VEC_inte rp_factory_p*, interp_factory*, char const*, unsigned int)::__PRETTY_FUNCTION__+351> "", mask=mask@entry=RETURN_MASK_ALL)
    at ../../binutils-gdb/gdb/exceptions.c:236
 #8  0x00520f0c in captured_main (data=0x328feb4)
    at ../../binutils-gdb/gdb/main.c:1149
 #9  gdb_main (args=args@entry=0x328feb4) at ../../binutils-gdb/gdb/main.c:1159
 #10 0x0071e400 in main (argc=1, argv=0x171220)
    at ../../binutils-gdb/gdb/gdb.c:32

Fix this by making the functions involved in setjmp/longjmp as
noexcept, so that the compiler knows it doesn't need to emit the
_Unwind_SjLj_Register / _Unwind_SjLj_Unregister calls for C++
exceptions.

Tested on x86_64 Fedora 23 with:
 - GCC 5.3.1 w/ DWARF-based exceptions.
 - GCC 7 built with --enable-sjlj-exceptions.

gdb/ChangeLog:
2016-12-20  Pedro Alves  <palves@redhat.com>
    Yao Qi  <yao.qi@linaro.org>

PR gdb/20977
* event-top.c (gdb_rl_callback_read_char_wrapper_noexcept): New
noexcept function, factored out from ...
(gdb_rl_callback_read_char_wrapper): ... this.
(gdb_rl_callback_handler): Mark noexcept.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 20 Dec 2016 00:00:57 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 19 Dec 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 18 Dec 2016 00:00:44 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 17 Dec 2016 00:00:50 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 16 Dec 2016 00:00:48 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 15 Dec 2016 00:00:51 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 14 Dec 2016 00:00:54 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 13 Dec 2016 00:00:53 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoRemove assert on exec_bfd in cris_delayed_get_disassembler
Yao Qi [Mon, 12 Dec 2016 09:09:43 +0000 (09:09 +0000)]
Remove assert on exec_bfd in cris_delayed_get_disassembler

cris_delayed_get_disassembler has an assert that exec_bfd can't be
NULL, but this assert can be triggered like this,

(gdb) set architecture cris
The target architecture is assumed to be cris
(gdb) disassemble 0x0,+4
Dump of assembler code from 0x0 to 0x4:
   0x00000000:
../../binutils-gdb/gdb/cris-tdep.c:3798: internal-error: int cris_delayed_get_disassembler(bfd_vma, disassemble_info*): Assertion `exec_bfd != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

however, cris_get_disassembler does have code to handle the case that
bfd is NULL,

  /* If there's no bfd in sight, we return what is valid as input in all
     contexts if fed back to the assembler: disassembly *with* register
     prefix.  Unfortunately this will be totally wrong for v32.  */
  if (abfd == NULL)
    return print_insn_cris_with_register_prefix;

This patch is to remove this assert.

gdb:

2016-12-12  Yao Qi  <yao.qi@linaro.org>

PR tdep/20955
* cris-tdep.c (cris_delayed_get_disassembler): Remove the
assert.

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 12 Dec 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 11 Dec 2016 00:00:48 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 10 Dec 2016 00:00:47 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoCreate tdep->rx_psw_type and tdep->rx_fpsw_type lazily
Yao Qi [Fri, 9 Dec 2016 15:53:58 +0000 (15:53 +0000)]
Create tdep->rx_psw_type and tdep->rx_fpsw_type lazily

I build GDB with all targets enabled, and "set architecture rx",
GDB crashes,

(gdb) set architecture rx

Program received signal SIGSEGV, Segmentation fault.
append_flags_type_flag (type=0x20cc360, bitpos=bitpos@entry=0, name=name@entry=0xd27529 "C") at ../../binutils-gdb/gdb/gdbtypes.c:4926
4926                               name);
(gdb) bt 10
 #0  append_flags_type_flag (type=0x20cc360, bitpos=bitpos@entry=0, name=name@entry=0xd27529 "C") at ../../binutils-gdb/gdb/gdbtypes.c:4926
 #1  0x00000000004ce725 in rx_gdbarch_init (info=..., arches=<optimized out>) at ../../binutils-gdb/gdb/rx-tdep.c:1051
 #2  0x00000000006b05a4 in gdbarch_find_by_info (info=...) at ../../binutils-gdb/gdb/gdbarch.c:5269
 #3  0x000000000060eee4 in gdbarch_update_p (info=...) at ../../binutils-gdb/gdb/arch-utils.c:557
 #4  0x000000000060f8a8 in set_architecture (ignore_args=<optimized out>, from_tty=1, c=<optimized out>) at ../../binutils-gdb/gdb/arch-utils.c:531
 #5  0x0000000000593d0b in do_set_command (arg=<optimized out>, arg@entry=0x20bee81 "rx ", from_tty=from_tty@entry=1, c=c@entry=0x20b1540)
    at ../../binutils-gdb/gdb/cli/cli-setshow.c:455
 #6  0x00000000007665c3 in execute_command (p=<optimized out>, p@entry=0x20bee70 "set architecture rx ", from_tty=1) at ../../binutils-gdb/gdb/top.c:666
 #7  0x00000000006935f4 in command_handler (command=0x20bee70 "set architecture rx ") at ../../binutils-gdb/gdb/event-top.c:577
 #8  0x00000000006938d8 in command_line_handler (rl=<optimized out>) at ../../binutils-gdb/gdb/event-top.c:767
 #9  0x0000000000692c2c in gdb_rl_callback_handler (rl=0x20be7f0 "") at ../../binutils-gdb/gdb/event-top.c:200

The cause is that we want to access some builtin types in gdbarch init, but
it is not initialized yet.  I fix it by creating the type when it is to be
used.  We've already done this in sparc, sparc64 and m68k.

gdb:

2016-12-09  Yao Qi  <yao.qi@linaro.org>

PR tdep/20954
* rx-tdep.c (rx_psw_type): New function.
(rx_fpsw_type): New function.
(rx_register_type): Call rx_psw_type and rx_fpsw_type.
(rx_gdbarch_init): Move code to rx_psw_type and
rx_fpsw_type.

7 years agoCreate tdep->rl78_psw_type lazily
Yao Qi [Fri, 9 Dec 2016 15:52:37 +0000 (15:52 +0000)]
Create tdep->rl78_psw_type lazily

I build GDB for all targets enabled.  When I "set architecture rl78",
GDB crashes,

(gdb) set architecture rl78

Program received signal SIGSEGV, Segmentation fault.
append_flags_type_flag (type=0x20cc0e0, bitpos=bitpos@entry=0, name=name@entry=0x11dba3f "CY") at ../../binutils-gdb/gdb/gdbtypes.c:4926
4926                               name);
(gdb) bt 10
 #0  append_flags_type_flag (type=0x20cc0e0, bitpos=bitpos@entry=0, name=name@entry=0x11dba3f "CY") at ../../binutils-gdb/gdb/gdbtypes.c:4926
 #1  0x00000000004aaca8 in rl78_gdbarch_init (info=..., arches=<optimized out>) at ../../binutils-gdb/gdb/rl78-tdep.c:1410
 #2  0x00000000006b05a4 in gdbarch_find_by_info (info=...) at ../../binutils-gdb/gdb/gdbarch.c:5269
 #3  0x000000000060eee4 in gdbarch_update_p (info=...) at ../../binutils-gdb/gdb/arch-utils.c:557
 #4  0x000000000060f8a8 in set_architecture (ignore_args=<optimized out>, from_tty=1, c=<optimized out>) at ../../binutils-gdb/gdb/arch-utils.c:531
 #5  0x0000000000593d0b in do_set_command (arg=<optimized out>, arg@entry=0x20be851 "rl78", from_tty=from_tty@entry=1, c=c@entry=0x20b1540)
    at ../../binutils-gdb/gdb/cli/cli-setshow.c:455
 #6  0x00000000007665c3 in execute_command (p=<optimized out>, p@entry=0x20be840 "set architecture rl78", from_tty=1) at ../../binutils-gdb/gdb/top.c:666
 #7  0x00000000006935f4 in command_handler (command=0x20be840 "set architecture rl78") at ../../binutils-gdb/gdb/event-top.c:577
 #8  0x00000000006938d8 in command_line_handler (rl=<optimized out>) at ../../binutils-gdb/gdb/event-top.c:767
 #9  0x0000000000692c2c in gdb_rl_callback_handler (rl=0x20be890 "") at ../../binutils-gdb/gdb/event-top.c:200

The cause is that we want to access some builtin types in gdbarch init, but
it is not initialized yet.  I fix it by creating the type when it is to be
used.  We've already done this in sparc, sparc64 and m68k.

gdb:

2016-12-09  Yao Qi  <yao.qi@linaro.org>

PR tdep/20953
* rl78-tdep.c (rl78_psw_type): New function.
(rl78_register_type): Call rl78_psw_type.
(rl78_gdbarch_init): Move code to rl78_psw_type.

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 9 Dec 2016 00:00:47 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 8 Dec 2016 00:00:56 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 7 Dec 2016 00:00:49 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 6 Dec 2016 00:01:22 +0000 (00:01 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 5 Dec 2016 00:01:11 +0000 (00:01 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in users/ARM/embedded-gdb-7.12-branch-2016q4
GDB Administrator [Sun, 4 Dec 2016 00:01:07 +0000 (00:01 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 3 Dec 2016 00:01:11 +0000 (00:01 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 2 Dec 2016 00:00:58 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 1 Dec 2016 00:00:50 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 30 Nov 2016 00:00:46 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 29 Nov 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 28 Nov 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 27 Nov 2016 00:00:53 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 26 Nov 2016 00:00:43 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 25 Nov 2016 00:00:31 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 24 Nov 2016 00:00:57 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 23 Nov 2016 00:00:56 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 22 Nov 2016 00:00:43 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 21 Nov 2016 00:00:54 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 20 Nov 2016 00:00:48 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 19 Nov 2016 00:00:56 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 18 Nov 2016 00:00:47 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 17 Nov 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 16 Nov 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 15 Nov 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 14 Nov 2016 00:00:43 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 13 Nov 2016 00:00:43 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agosim: mips: add PR info to ChangeLog
Mike Frysinger [Sat, 12 Nov 2016 06:02:23 +0000 (01:02 -0500)]
sim: mips: add PR info to ChangeLog

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 12 Nov 2016 00:00:40 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agosim: mips: fix dv-tx3904cpu build error
Mike Frysinger [Fri, 11 Nov 2016 06:29:21 +0000 (01:29 -0500)]
sim: mips: fix dv-tx3904cpu build error

When building for mipstx39-rtems4.12 targets, some funcs use SD and CPU
implicitly.  Restore the defines for these to the local sd and cpu vars.

This was broken by the clean up in commit d47f5b30d8481272e9480118bdcb.

Reported-by: Joel Sherrill <joel.sherrill@oarcorp.com>
7 years agosim: mips: fix builds for r3900 cpus due to missing check_u64
Mike Frysinger [Fri, 11 Nov 2016 06:28:36 +0000 (01:28 -0500)]
sim: mips: fix builds for r3900 cpus due to missing check_u64

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 11 Nov 2016 00:00:36 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 10 Nov 2016 00:00:47 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 9 Nov 2016 00:00:48 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 8 Nov 2016 00:00:54 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 7 Nov 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 6 Nov 2016 00:00:46 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 5 Nov 2016 00:00:43 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 4 Nov 2016 00:00:44 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 3 Nov 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 2 Nov 2016 00:00:38 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 1 Nov 2016 00:00:44 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 31 Oct 2016 00:00:43 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 30 Oct 2016 00:00:44 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 29 Oct 2016 00:00:41 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 28 Oct 2016 00:00:46 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 27 Oct 2016 00:00:39 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 26 Oct 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAdded forgotten gdb/ChangeLog entry.
Rainer Orth [Tue, 25 Oct 2016 14:08:04 +0000 (16:08 +0200)]
Added forgotten gdb/ChangeLog entry.

7 years agoFix gdb C++ compilation on Solaris (PR build/20712)
Rainer Orth [Tue, 25 Oct 2016 13:51:40 +0000 (15:51 +0200)]
Fix gdb C++ compilation on Solaris (PR build/20712)

gdb 7.12 doesn't compile as C++ (tried with g++ 4.9) on Solaris (tried
10 and 12, sparc and x86).  The following patch (relative to the 7.12
release, though I expect most if not all issues to be present on trunk,
too) fixes this.

Only a few of the changes bear explanation:

* Initially, compilation failed whereever defs.h. was included:

In file included from /vol/src/gnu/gdb/gdb-7.12/gdb/gdb.c:19:0:
/vol/src/gnu/gdb/gdb-7.12/gdb/defs.h:630:33: error: 'double atof(const char*)' conflicts with a previous declaration
 extern double atof (const char *); /* X3.159-1989  4.10.1.1 */
                                 ^
In file included from /usr/include/stdlib.h:17:0,
                 from build-gnulib/import/stdlib.h:36,
                 from /vol/src/gnu/gdb/gdb-7.12/gdb/common/common-defs.h:32,
                 from /vol/src/gnu/gdb/gdb-7.12/gdb/defs.h:28,
                 from /vol/src/gnu/gdb/gdb-7.12/gdb/gdb.c:19:
/vol/gcc-4.9/lib/gcc/i386-pc-solaris2.10/4.9.0/include-fixed/iso/stdlib_iso.h:119:15: note: previous declaration 'double std::atof(const char*)'
 extern double atof(const char *);
               ^

  This is due to this gem in gdb/defs.h which seems to have been present
  like forever:

#ifndef atof
extern double atof (const char *); /* X3.159-1989  4.10.1.1 */
#endif

  In the Solaris headers, the appropriate functions are in namespace std,
  thus the conflict.  I've wrapped the defs.h declaration in !__cplusplus
  to avoid this; perhaps it can go completely instead.

* All the casts are necessary to appease g++ and should be pretty
  obvious.

* The sol-thread.c changes are here to handle

/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c: In function 'void _initialize_sol_thread()':
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1252:36: error: invalid conversion from 'void*' to 'void (*)(int)' [-fpermissive]
   if (!(p_##X = dlsym (dlhandle, #X))) \
                                    ^
/vol/src/gnu/gdb/gdb-7.12/gdb/sol-thread.c:1255:3: note: in expansion of macro 'resolve'
   resolve (td_log);
   ^

  and are modeled after linux-thread-db.c (try_thread_db_load_1).

The patch allowed both 32 and 64-bit C++ builds on sparc-sun-solaris2.10
and i386-pc-solaris2.10 to complete.  The resulting binary hasn't seen
more than a smoke test (invoke it on itself, b main, run) yet.

When investigating the failure to detect -static-libstdc++
support (more below), I found two more issues which only show up with
-Werror:

/vol/src/gnu/gdb/gdb/local/gdb/procfs.c: In function 'ssd* proc_get_LDT_entry(procinfo*, int)':
/vol/src/gnu/gdb/gdb/local/gdb/procfs.c:2487:19: error: variable 'old_chain' set but not used [-Werror=unused-but-set-variable]
   struct cleanup *old_chain = NULL;
                   ^

Unless I'm mistaken, you need to run do_cleanups on every return from
the function.

Afterwards, I ran a 32-bit compilation, which (after adding
--disable-largefile to avoid

In file included from /usr/include/sys/procfs.h:28:0,
                 from /vol/src/gnu/gdb/gdb/local/gdb/i386-sol2-nat.c:23:
/usr/include/sys/old_procfs.h:39:2: error: #error "Cannot use procfs in the large file compilation environment"
 #error "Cannot use procfs in the large file compilation environment"
  ^

and two more instances) revealed

/vol/src/gnu/gdb/gdb/local/gdb/top.c: In function 'void gdb_safe_append_history()':
/vol/src/gnu/gdb/gdb/local/gdb/top.c:1170:59: error: format '%d' expects argument of type 'int', but argument 3 has type 'pid_t {aka long int}' [-Werror=format=]
     = xstrprintf ("%s-gdb%d~", history_filename, getpid ());
                                                           ^

Fixed by casting pid_t to long and printing it as such.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 25 Oct 2016 00:00:43 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoPR gdb/20653 - small cleanup in string_to_explicit_location
Tom Tromey [Mon, 24 Oct 2016 11:06:39 +0000 (12:06 +0100)]
PR gdb/20653 - small cleanup in string_to_explicit_location

This bug points out that string_to_explicit_location compares a char*
against '\0'; whereas comparing against NULL is more normal.

2016-10-24  Tom Tromey  <tom@tromey.com>

PR breakpoints/20653:
* location.c (string_to_explicit_location): Use NULL, not '\0'.

7 years ago[GDBserver] Fix conversion warning
Yao Qi [Mon, 24 Oct 2016 09:59:11 +0000 (10:59 +0100)]
[GDBserver] Fix conversion warning

I got the following warning if I build GDBserver for aarch64_be-linux-gnu,

git/gdb/gdbserver/linux-aarch64-low.c:1539:39: error: invalid conversion from 'void*' to 'uint32_t* {aka unsigned int*}' [-fpermissive]
   uint32_t *le_buf = xmalloc (byte_len);
                                       ^
The patch is to fix the warning.

gdb/gdbserver:

2016-10-24  Yao Qi  <yao.qi@linaro.org>

PR server/20733
* linux-aarch64-low.c (append_insns): Cast the return value to
'uint32_t *'.

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 24 Oct 2016 00:00:40 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 23 Oct 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 22 Oct 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 21 Oct 2016 00:00:40 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Oct 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Oct 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 18 Oct 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 17 Oct 2016 00:00:45 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 16 Oct 2016 00:00:46 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 15 Oct 2016 00:00:39 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoInclude strings.h where available
Eli Zaretskii [Fri, 14 Oct 2016 07:08:25 +0000 (10:08 +0300)]
Include strings.h where available

gdb/ChangeLog

2016-10-14  Eli Zaretskii  <eliz@gnu.org>

* common/common-defs.h [HAVE_STRINGS_H]: Include strings.h if
available, to get prototypes of 'strcasecmp' and 'strncasecmp'.

(cherry picked from commit 8ffc1bb12a22e548835c9291871ad0eb68b7f6f0)

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 14 Oct 2016 00:00:48 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 13 Oct 2016 00:00:49 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years ago[AArch64] Track FP registers in prologue analyzer
Yao Qi [Wed, 12 Oct 2016 11:38:56 +0000 (12:38 +0100)]
[AArch64] Track FP registers in prologue analyzer

We don't track FP registers in aarch64 prologue analyzer, so this causes
an internal error when FP registers are saved by "stp" instruction in
prologue (stp d8, d9, [sp,#128]),

 tbreak _Unwind_RaiseException^M
 aarch64-tdep.c:335: internal-error: CORE_ADDR aarch64_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, aarch64_prologue_cache*): Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.^M
 A problem internal to GDB has been detected,

This patch teaches GDB to track FP registers (D registers) in prologue
analyzer.

gdb:

2016-10-12  Yao Qi  <yao.qi@linaro.org>

PR tdep/20682
* aarch64-tdep.c: Replace 32 with AARCH64_D_REGISTER_COUNT.
(aarch64_analyze_prologue): Extend array 'regs' for D registers.
Assert that operand 0 and 1 can be X or D registers.  Update
register number for D registers.  Update registers in frame
cache.
* aarch64-tdep.h (AARCH64_D_REGISTER_COUNT): New macro.

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 12 Oct 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 11 Oct 2016 00:00:42 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 10 Oct 2016 00:00:44 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 9 Oct 2016 00:00:53 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 8 Oct 2016 00:00:40 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoBump GDB version number to 7.12.0.DATE-git.
Joel Brobecker [Fri, 7 Oct 2016 17:27:09 +0000 (10:27 -0700)]
Bump GDB version number to 7.12.0.DATE-git.

gdb/ChangeLog:

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

7 years agoDocument the GDB 7.12 release in gdb/ChangeLog
Joel Brobecker [Fri, 7 Oct 2016 17:18:32 +0000 (10:18 -0700)]
Document the GDB 7.12 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.12 released.

7 years agoSet GDB version number to 7.12. gdb-7.12-release
Joel Brobecker [Fri, 7 Oct 2016 17:09:22 +0000 (10:09 -0700)]
Set GDB version number to 7.12.

gdb/ChangeLog:

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

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 7 Oct 2016 00:00:52 +0000 (00:00 +0000)]
Automatic date update in version.in

7 years agoframe.h: Forward-declare struct ui_out
Simon Marchi [Thu, 6 Oct 2016 17:01:37 +0000 (13:01 -0400)]
frame.h: Forward-declare struct ui_out

Fixes this failure when building in C mode.  I think it's relevant for master
as well, since it's a good practice to include (or forward-declare) what you
use.

In file included from ../../binutils-gdb/gdb/gdbarch.h:38:0,
                 from ../../binutils-gdb/gdb/defs.h:653,
                 from ../../binutils-gdb/gdb/dictionary.c:23:
../../binutils-gdb/gdb/frame.h:710:48: warning: ‘struct ui_out’ declared inside parameter list will not be visible outside of this definition or declaration
 extern void print_stack_frame_to_uiout (struct ui_out *uiout,

gdb/ChangeLog:

* frame.h: Forward-declare struct ui_out.

7 years agomips-tdep: Make FCRs always 32-bit
Maciej W. Rozycki [Thu, 6 Oct 2016 15:51:18 +0000 (16:51 +0100)]
mips-tdep: Make FCRs always 32-bit

Fix a regression from commit f8b73d13b7ca ("Target-described register
support for MIPS"),
<https://sourceware.org/ml/gdb-patches/2007-05/msg00340.html>,
<https://sourceware.org/ml/gdb-patches/2007-06/msg00256.html>, which
caused Floating Point Control Registers (FCRs) to be shown as 64-bit
with 64-bit targets.

This came from the legacy register format where all raw registers
matched the width of the architecture regardless of their actual size.
The correct size was then set in `mips_register_type' for cooked
registers presented to the user, which in the case of FCRs meant the
cooked size was always forced to 32 bits, reflecting their actual
hardware size, even though the raw format carried them in 64-bit
quantities on 64-bit targets.  The upper 32 bits carried in the raw FCR
format have always been don't-cares, not actually retrieved from
hardware and never written back.

With the introduction of XML register descriptions the layout of
previously defined raw registers has been preserved, so as to keep
existing register handling code unchanged and make it easier for GDB and
`gdbserver' to interact with each other whether neither, either or both
parties talking over RSP support XML register descriptions.  For the
XML-described case however `mips_register_type' is not used in raw to
cooked register conversion, so any special cases coded there are not
taken into account.

Instead a new function, `mips_pseudo_register_type', has been introduced
to handle size conversion, however lacking the special case for FCRs for
the Linux and the now defunct IRIX target.  The correct size has been
maintained for embedded targets however, due to the bundling of FCRs
with the embedded registers under the `rawnum >= MIPS_EMBED_FP0_REGNUM +
32' condition.

Add the missing case to `mips_pseudo_register_type' then, referring to
the FCR indices explicitly, and observing that between
`MIPS_EMBED_FP0_REGNUM + 32' and `MIPS_FIRST_EMBED_REGNUM' there is an
unused register slot whose contents are ignored so with the removal of
embedded FCRs from under that condition we don't have to care about it
and we can refer to the embedded registers starting from
MIPS_FIRST_EMBED_REGNUM instead.

Add a test case too so that we have means to check automatically that
the correct user-visible size of FCRs is maintained.

gdb/
* mips-tdep.c (mips_pseudo_register_type): Make FCRs always
32-bit.

gdb/testsuite/
* gdb.arch/mips-fcr.exp: New test.
* gdb.arch/mips-fcr.c: Source for the new test.
(cherry picked from commit 78b86327b5301231005b08a7c589b2b58e6b4322)

7 years agomips-tdep: Rearrange comments in `mips_pseudo_register_type'
Maciej W. Rozycki [Thu, 6 Oct 2016 15:19:38 +0000 (16:19 +0100)]
mips-tdep: Rearrange comments in `mips_pseudo_register_type'

Rearrange comments throughout `mips_pseudo_register_type', placing them
ahead the condtionals they apply to consistently.

gdb/
* mips-tdep.c (mips_pseudo_register_type): Rearrange comments
throughout.
(cherry picked from commit a6912260f813b1493efefd27cbcb6a73d933accc)