Package: gdb / 7.12-6

Metadata

Package Version Patches format
gdb 7.12-6 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
gdb fortran main.patch | (download)

gdb/symtab.c | 9 7 + 2 - 0 !
gdb/testsuite/gdb.fortran/lang.exp | 40 40 + 0 - 0 !
2 files changed, 47 insertions(+), 2 deletions(-)

---
solve_PATH_MAX_issue.patch | (download)

gdb/nto-tdep.c | 12 9 + 3 - 0 !
1 file changed, 9 insertions(+), 3 deletions(-)

 patch out a path_max usage, for hurd's benefit

gdb 6.5 bz185337 resolve tls without debuginfo v2.patch | (download)

gdb/printcmd.c | 2 2 + 0 - 0 !
gdb/testsuite/gdb.dwarf2/dw2-errno.c | 28 28 + 0 - 0 !
gdb/testsuite/gdb.dwarf2/dw2-errno.exp | 60 60 + 0 - 0 !
3 files changed, 90 insertions(+)

---
python config.patch | (download)

gdb/configure | 106 100 + 6 - 0 !
gdb/configure.ac | 14 8 + 6 - 0 !
2 files changed, 108 insertions(+), 12 deletions(-)

 use system python-config if available
gdb glibc vdso workaround.patch | (download)

gdb/solib.c | 7 5 + 2 - 0 !
1 file changed, 5 insertions(+), 2 deletions(-)

 [rfc] work around pr libc/13097 "linux-vdso.so.1" #2

Hi,

missed the x86_64-m32 case:

gdb/
2011-08-16  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Work around PR libc/13097.
	* solib.c (update_solib_list): Ignore "linux-vdso.so.1".

load versioned libcc1.patch | (download)

include/gcc-c-interface.h | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

---
0001 Hurd Adjust to Per inferior Inferior qualified threa.patch | (download)

gdb/gnu-nat.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 01/65] hurd: adjust to "per-inferior/inferior-qualified thread
 IDs" changes

    [...]/gdb/gnu-nat.c: In function 'set_sig_thread_cmd':
    [...]/gdb/gnu-nat.c:2973:7: warning: implicit declaration of function 'thread_id_to_pid' [-Wimplicit-function-declaration]
           ptid_t ptid = thread_id_to_pid (atoi (args));
           ^
    [...]/gdb/gnu-nat.c:2973:7: error: invalid initializer

That's commit 5d5658a1d3c3eb2a09c03f2f0662a1c01963c869, which renamed
`thread_id_to_pid` to `global_thread_id_to_ptid`.

	gdb/
	* gnu-nat.c (set_sig_thread_cmd): Call global_thread_id_to_ptid
	instead of thread_id_to_pid.

0004 Hurd C Avoid GNU C nested functions.patch | (download)

gdb/gnu-nat.c | 20 11 + 9 - 0 !
1 file changed, 11 insertions(+), 9 deletions(-)

 [patch 04/65] hurd, c++: avoid gnu c nested functions

..., which C++ doesn't allow, so...

	gdb/
	* gnu-nat.c (gnu_create_inferior): Move nested "trace_me"
	function...
	(gnu_ptrace_me): ... here.

0005 Hurd C Avoid const char to char casts.patch | (download)

gdb/gnu-nat.c | 39 28 + 11 - 0 !
1 file changed, 28 insertions(+), 11 deletions(-)

 [patch 05/65] hurd, c++: avoid "const char *" to "char *" casts

... by a bit of code refactoring:

	gdb/
	* gnu-nat.c (set_task_pause_cmd, set_signals_cmd)
	(set_exceptions_cmd): Add variants taking an "int arg" instead of
	a "char *".  Make the "char *" variants use the former.
	(set_noninvasive_cmd): Also use the "int arg" variants.

0006 Hurd C kern_return_t vs. error_t.patch | (download)

gdb/gnu-nat.c | 66 33 + 33 - 0 !
gdb/i386gnu-nat.c | 8 4 + 4 - 0 !
2 files changed, 37 insertions(+), 37 deletions(-)

 [patch 06/65] hurd, c++: kern_return_t vs. error_t

GNU/Hurd uses its own "typedef enum __error_t_codes error_t;"
([glibc]/sysdeps/mach/hurd/bits/errno.h), contrary to the default
"typedef int error_t;" ([glibc]/stdlib/errno.h).

The Mach/Hurd RPCs return kern_return_t values, for which, upon assigning them
to an error_t variable, GCC in C++ mode tells us "error: invalid conversion
from 'kern_return_t {aka int}' to 'error_t {aka __error_t_codes}'".  Instead of
casting all these RPC return values to "error_t", just use "kern_return_t"
variables:

	gdb/
	* gnu-nat.c (proc_get_exception_port, proc_set_exception_port)
	(INF_RESUME_MSGPORT_RPC, proc_get_state, _proc_get_exc_port)
	(proc_steal_exc_port, proc_restore_exc_port, make_proc)
	(inf_startup, inf_set_pid, inf_validate_procinfo)
	(inf_validate_task_sc, inf_set_traced, inf_validate_procs)
	(inf_signal, inf_continue, gnu_wait, S_exception_raise_request)
	(do_mach_notify_dead_name, S_proc_wait_reply)
	(S_msg_sig_post_untraced_reply, S_msg_sig_post_reply)
	(port_msgs_queued, gnu_read_inferior, gnu_write_inferior)
	(gnu_find_memory_regions, steal_exc_port, thread_takeover_sc_cmd)
	(flush_inferior_icache): Instead of "error_t" use "kern_return_t".
	* i386-gnu-nat.c (fetch_fpregs, store_fpregs, i386_gnu_dr_get)
	(i386_gnu_dr_set): Likewise.

0007 Hurd C Mach Hurd headers and MIG stubs are not yet f.patch | (download)

gdb/config/i386/i386gnu.mh | 3 3 + 0 - 0 !
gdb/gnu-nat.c | 35 22 + 13 - 0 !
gdb/i386gnu-nat.c | 14 9 + 5 - 0 !
3 files changed, 34 insertions(+), 18 deletions(-)

 [patch 07/65] hurd, c++: mach/hurd headers and mig stubs are not yet
 fit for C++

..., so handle these in "C" mode still:

	gdb/
	* config/i386/i386gnu.mh (%_S.o %_U.o): Add "-x c" to
	"COMPILE.post".
	* gnu-nat.c: #include Mach/Hurd headers before all others.  Wrap
	Mach/Hurd headers and MIG stubs' prototypes in 'extern "C"'.
	* i386-gnu-nat.c: Likewise.

0008 Hurd In the CLI use parse_thread_id instead of globa.patch | (download)

gdb/gnu-nat.c | 12 4 + 8 - 0 !
1 file changed, 4 insertions(+), 8 deletions(-)

 [patch 08/65] hurd: in the cli, use parse_thread_id instead of
 global_thread_id_to_ptid

Follow-up to commit 14f6890677849172a4b13779acd9089c9baa3a81.
global_thread_id_to_ptid expects global thread numbers, which are nowadays only
used in MI, never presented to the user in the CLI.  Since this is a CLI
command, it should accept the inferior-qualified format instead.

	gdb/
	* gnu-nat.c (set_sig_thread_cmd): Use parse_thread_id instead of
	global_thread_id_to_ptid.

0021 Avoid PATH_MAX usage.patch | (download)

gdb/inferior.c | 15 5 + 10 - 0 !
1 file changed, 5 insertions(+), 10 deletions(-)

 [patch 21/65] avoid path_max usage

On GNU/Hurd, there is no "#define PATH_MAX", so this failed to build.

	gdb/
	* inferior.c (print_selected_inferior): Avoid PATH_MAX usage.

0022 Hurd Adjust to changes to push pruning old threads d.patch | (download)

gdb/gnu-nat.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch 22/65] hurd: adjust to changes to "push pruning old threads
 down to the target"

For "info threads", we currently run into:

    $ gdb/gdb -q -nw -nx --batch -ex start -ex info\ threads bfd/doc/chew
    Temporary breakpoint 1 at 0x80486e0: file ../../../W._C._Handy/bfd/doc/chew.c, line 1535.
    [New Thread 10656.5]

    Thread 4 hit Temporary breakpoint 1, main (ac=1, av=0x102cd84) at ../../../W._C._Handy/bfd/doc/chew.c:1535
    1535    {
      Id   Target Id         Frame
      1    bogus thread id 1 Can't fetch registers from thread bogus thread id 1: No such thread

Before commit e8032dde10b743253125d7defb5f5503b21c1d26,
gdb/thread.c:update_thread_list used to call prune_threads, after that change
it doesn't anymore, and we don't implement the to_update_thread_list target
method where the prune_threads call got moved.  For now, apply a fix, related
to commit c82f56d9d760a9b4034eeaac44f2f0fa5779ff69 "Hurd: Adjust to
startup-with-shell changes", which restores the previous behavior:

      Id   Target Id         Frame
    * 4    Thread 10688.4    main (ac=1, av=0x102cd84) at ../../../W._C._Handy/bfd/doc/chew.c:1535
      5    Thread 10688.5    0x0106096c in ?? () from /lib/i386-gnu/libc.so.0.3

Not perfect, but at least better.

	gdb/
	* gnu-nat.c (gnu_create_inferior): After startup_inferior, call
	prune_threads.

explicit cast void.patch | (download)

gdb/i386gnu-nat.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

---
hurd backport for 7.12 branch.patch | (download)

gdb/inferior.c | 2 1 + 1 - 0 !
gdb/remote.c | 4 2 + 2 - 0 !
2 files changed, 3 insertions(+), 3 deletions(-)

 hurd support
 gdb (7.12-2+hurd1) UNRELEASED; urgency=medium
 .
   * Patches for hurd
0001 Document the GDB 7.12 release in gdb ChangeLog.patch | (download)

gdb/ChangeLog | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 [patch 001/122] document the gdb 7.12 release in gdb/changelog

gdb/ChangeLog:

	GDB 7.12 released.

0002 Bump GDB version number to 7.12.0.DATE git.patch | (download)

gdb/ChangeLog | 4 4 + 0 - 0 !
gdb/version.in | 2 1 + 1 - 0 !
2 files changed, 5 insertions(+), 1 deletion(-)

 [patch 002/122] bump gdb version number to 7.12.0.date-git.

gdb/ChangeLog:

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

0008 AArch64 Track FP registers in prologue analyzer.patch | (download)

gdb/ChangeLog | 10 10 + 0 - 0 !
gdb/aarch64-tdep.c | 38 31 + 7 - 0 !
gdb/aarch64-tdep.h | 2 2 + 0 - 0 !
3 files changed, 43 insertions(+), 7 deletions(-)

 [patch 008/122] [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.

0011 Include strings.h where available.patch | (download)

gdb/ChangeLog | 5 5 + 0 - 0 !
gdb/common/common-defs.h | 3 3 + 0 - 0 !
2 files changed, 8 insertions(+)

 [patch 011/122] 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)

0022 GDBserver Fix conversion warning.patch | (download)

gdb/gdbserver/ChangeLog | 6 6 + 0 - 0 !
gdb/gdbserver/linux-aarch64-low.c | 2 1 + 1 - 0 !
2 files changed, 7 insertions(+), 1 deletion(-)

 [patch 022/122] [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 *'.

0023 PR gdb 20653 small cleanup in string_to_explicit_loc.patch | (download)

gdb/ChangeLog | 5 5 + 0 - 0 !
gdb/location.c | 2 1 + 1 - 0 !
2 files changed, 6 insertions(+), 1 deletion(-)

 [patch 023/122] 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'.

0025 Fix gdb C compilation on Solaris PR build 20712.patch | (download)

gdb/defs.h | 8 1 + 7 - 0 !
gdb/procfs.c | 23 14 + 9 - 0 !
gdb/sol-thread.c | 128 77 + 51 - 0 !
gdb/top.c | 2 1 + 1 - 0 !
4 files changed, 93 insertions(+), 68 deletions(-)

 [patch 025/122] 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.

0026 Added forgotten gdb ChangeLog entry.patch | (download)

gdb/ChangeLog | 35 35 + 0 - 0 !
1 file changed, 35 insertions(+)

 [patch 026/122] added forgotten gdb/changelog entry.


0044 sim mips fix builds for r3900 cpus due to missing ch.patch | (download)

sim/mips/ChangeLog | 4 4 + 0 - 0 !
sim/mips/mips.igen | 1 1 + 0 - 0 !
2 files changed, 5 insertions(+)

 [patch 044/122] sim: mips: fix builds for r3900 cpus due to missing
 check_u64


0045 sim mips fix dv tx3904cpu build error.patch | (download)

sim/mips/ChangeLog | 5 5 + 0 - 0 !
sim/mips/dv-tx3904cpu.c | 5 5 + 0 - 0 !
2 files changed, 10 insertions(+)

 [patch 045/122] 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>

0047 sim mips add PR info to ChangeLog.patch | (download)

sim/mips/ChangeLog | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch 047/122] sim: mips: add pr info to changelog


0075 Create tdep rl78_psw_type lazily.patch | (download)

gdb/ChangeLog | 7 7 + 0 - 0 !
gdb/rl78-tdep.c | 36 25 + 11 - 0 !
2 files changed, 32 insertions(+), 11 deletions(-)

 [patch 075/122] 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.

0076 Create tdep rx_psw_type and tdep rx_fpsw_type lazily.patch | (download)

gdb/ChangeLog | 9 9 + 0 - 0 !
gdb/rx-tdep.c | 103 62 + 41 - 0 !
2 files changed, 71 insertions(+), 41 deletions(-)

 [patch 076/122] 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.

0080 Remove assert on exec_bfd in cris_delayed_get_disass.patch | (download)

gdb/ChangeLog | 6 6 + 0 - 0 !
gdb/cris-tdep.c | 5 1 + 4 - 0 !
2 files changed, 7 insertions(+), 4 deletions(-)

 [patch 080/122] 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.

0089 Fix longjmp across readline w enable sjlj exceptions.patch | (download)

gdb/ChangeLog | 9 9 + 0 - 0 !
gdb/event-top.c | 23 18 + 5 - 0 !
2 files changed, 27 insertions(+), 5 deletions(-)

 [patch 089/122] 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.

0090 gdb Fix C and C 03 builds.patch | (download)

gdb/ChangeLog | 8 8 + 0 - 0 !
gdb/event-top.c | 12 10 + 2 - 0 !
2 files changed, 18 insertions(+), 2 deletions(-)

 [patch 090/122] 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.

0115 Fix some error handling bugs in python frame filters.patch | (download)

gdb/ChangeLog | 5 5 + 0 - 0 !
gdb/python/py-framefilter.c | 18 15 + 3 - 0 !
gdb/testsuite/ChangeLog | 5 5 + 0 - 0 !
gdb/testsuite/gdb.python/py-framefilter.py | 6 6 + 0 - 0 !
4 files changed, 31 insertions(+), 3 deletions(-)

 [patch 115/122] fix some error-handling bugs in python frame filters

While writing a Python frame filter, I found a few bugs in the current
frame filter code.  In particular:

* One spot converts a Python long to a CORE_ADDR using PyLong_AsLong.
  However, this can fail on overflow.  I changed this to use
  get_addr_from_python.

* Another spot is doing the same but with PyLong_AsUnsignedLongLong; I
  changed this as well just for consistency.

* Converting line numbers can print "-1" if conversion from long
  fails.  This isn't fatal but just a bit ugly.

I've included a test case for the first issue.  The line number one
didn't seem important enough to bother with.

2016-11-08  Tom Tromey  <tom@tromey.com>

	* python/py-framefilter.c (py_print_frame): Use
	get_addr_from_python.  Check for errors when getting line number.

2016-11-08  Tom Tromey  <tom@tromey.com>

	* gdb.python/py-framefilter.py (ElidingFrameDecorator.address):
	New method.