From c296a6a29eb16279ab9cf6c8b47cae1c2e7bca13 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 14 Nov 2015 17:06:06 +0100 Subject: [PATCH] Rebase to FSF GDB 7.10.50.20151113 (trunk snapshot). - [testsuite] BuildRequire libmpx for --with testsuite. - Force libncursesw over libncurses to match the includes (RH BZ 1270534). --- .gitignore | 2 +- gdb-6.3-bz231832-obstack-2gb.patch | 177 ----------------- gdb-6.6-buildid-locate-rpm.patch | 89 ++++----- gdb-attach-fail-reasons-5of5.patch | 82 ++++---- gdb-fedora-libncursesw.patch | 63 ++++++ gdb-fortran-allocate-not-inited.patch | 61 ------ gdb-nonstop-scratchpad.patch | 268 -------------------------- gdb-upstream.patch | 69 ------- gdb.spec | 31 ++- sources | 2 +- 10 files changed, 167 insertions(+), 677 deletions(-) delete mode 100644 gdb-6.3-bz231832-obstack-2gb.patch create mode 100644 gdb-fedora-libncursesw.patch delete mode 100644 gdb-fortran-allocate-not-inited.patch delete mode 100644 gdb-nonstop-scratchpad.patch delete mode 100644 gdb-upstream.patch diff --git a/.gitignore b/.gitignore index d732fd4..522a14d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /gdb-libstdc++-v3-python-r225521.tar.xz -/gdb-7.10.50.20151027.tar.xz +/gdb-7.10.50.20151113.tar.xz diff --git a/gdb-6.3-bz231832-obstack-2gb.patch b/gdb-6.3-bz231832-obstack-2gb.patch deleted file mode 100644 index 1a19d34..0000000 --- a/gdb-6.3-bz231832-obstack-2gb.patch +++ /dev/null @@ -1,177 +0,0 @@ -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832 - - -Index: gdb-7.8.50.20141228/include/obstack.h -=================================================================== ---- gdb-7.8.50.20141228.orig/include/obstack.h 2015-01-01 17:02:53.254820447 +0100 -+++ gdb-7.8.50.20141228/include/obstack.h 2015-01-01 17:02:53.880820084 +0100 -@@ -188,31 +188,31 @@ struct obstack /* control current objec - - /* Declare the external functions we use; they are in obstack.c. */ - --extern void _obstack_newchunk (struct obstack *, int); -+extern void _obstack_newchunk (struct obstack *, PTR_INT_TYPE); - extern void _obstack_free (struct obstack *, void *); --extern int _obstack_begin (struct obstack *, int, int, -+extern int _obstack_begin (struct obstack *, PTR_INT_TYPE, int, - void *(*) (long), void (*) (void *)); --extern int _obstack_begin_1 (struct obstack *, int, int, -+extern int _obstack_begin_1 (struct obstack *, PTR_INT_TYPE, int, - void *(*) (void *, long), - void (*) (void *, void *), void *); --extern int _obstack_memory_used (struct obstack *); -+extern PTR_INT_TYPE _obstack_memory_used (struct obstack *); - - /* Do the function-declarations after the structs - but before defining the macros. */ - - void obstack_init (struct obstack *obstack); - --void * obstack_alloc (struct obstack *obstack, int size); -+void * obstack_alloc (struct obstack *obstack, PTR_INT_TYPE size); - --void * obstack_copy (struct obstack *obstack, void *address, int size); --void * obstack_copy0 (struct obstack *obstack, void *address, int size); -+void * obstack_copy (struct obstack *obstack, void *address, PTR_INT_TYPE size); -+void * obstack_copy0 (struct obstack *obstack, void *address, PTR_INT_TYPE size); - - void obstack_free (struct obstack *obstack, void *block); - --void obstack_blank (struct obstack *obstack, int size); -+void obstack_blank (struct obstack *obstack, PTR_INT_TYPE size); - --void obstack_grow (struct obstack *obstack, void *data, int size); --void obstack_grow0 (struct obstack *obstack, void *data, int size); -+void obstack_grow (struct obstack *obstack, void *data, PTR_INT_TYPE size); -+void obstack_grow0 (struct obstack *obstack, void *data, PTR_INT_TYPE size); - - void obstack_1grow (struct obstack *obstack, int data_char); - void obstack_ptr_grow (struct obstack *obstack, void *data); -@@ -220,20 +220,20 @@ void obstack_int_grow (struct obstack *o - - void * obstack_finish (struct obstack *obstack); - --int obstack_object_size (struct obstack *obstack); -+PTR_INT_TYPE obstack_object_size (struct obstack *obstack); - --int obstack_room (struct obstack *obstack); --void obstack_make_room (struct obstack *obstack, int size); -+PTR_INT_TYPE obstack_room (struct obstack *obstack); -+void obstack_make_room (struct obstack *obstack, PTR_INT_TYPE size); - void obstack_1grow_fast (struct obstack *obstack, int data_char); - void obstack_ptr_grow_fast (struct obstack *obstack, void *data); - void obstack_int_grow_fast (struct obstack *obstack, int data); --void obstack_blank_fast (struct obstack *obstack, int size); -+void obstack_blank_fast (struct obstack *obstack, PTR_INT_TYPE size); - - void * obstack_base (struct obstack *obstack); - void * obstack_next_free (struct obstack *obstack); - int obstack_alignment_mask (struct obstack *obstack); --int obstack_chunk_size (struct obstack *obstack); --int obstack_memory_used (struct obstack *obstack); -+size_t obstack_chunk_size (struct obstack *obstack); -+size_t obstack_memory_used (struct obstack *obstack); - - /* Error handler called when `obstack_chunk_alloc' failed to allocate - more memory. This can be set to a user defined function. The -@@ -318,7 +318,7 @@ extern int obstack_exit_failure; - # define obstack_make_room(OBSTACK,length) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ -- int __len = (length); \ -+ PTR_INT_TYPE __len = (length); \ - if (__o->chunk_limit - __o->next_free < __len) \ - _obstack_newchunk (__o, __len); \ - (void) 0; }) -@@ -331,7 +331,7 @@ __extension__ \ - # define obstack_grow(OBSTACK,where,length) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ -- int __len = (length); \ -+ PTR_INT_TYPE __len = (length); \ - if (__o->next_free + __len > __o->chunk_limit) \ - _obstack_newchunk (__o, __len); \ - _obstack_memcpy (__o->next_free, (where), __len); \ -@@ -341,7 +341,7 @@ __extension__ \ - # define obstack_grow0(OBSTACK,where,length) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ -- int __len = (length); \ -+ PTR_INT_TYPE __len = (length); \ - if (__o->next_free + __len + 1 > __o->chunk_limit) \ - _obstack_newchunk (__o, __len + 1); \ - _obstack_memcpy (__o->next_free, (where), __len); \ -@@ -392,7 +392,7 @@ __extension__ \ - # define obstack_blank(OBSTACK,length) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ -- int __len = (length); \ -+ PTR_INT_TYPE __len = (length); \ - if (__o->chunk_limit - __o->next_free < __len) \ - _obstack_newchunk (__o, __len); \ - obstack_blank_fast (__o, __len); \ -Index: gdb-7.8.50.20141228/libiberty/obstack.c -=================================================================== ---- gdb-7.8.50.20141228.orig/libiberty/obstack.c 2015-01-01 17:02:53.254820447 +0100 -+++ gdb-7.8.50.20141228/libiberty/obstack.c 2015-01-01 17:02:53.880820084 +0100 -@@ -44,9 +44,11 @@ - #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 - #include - #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION -+#if 0 /* 64-bit obstack is not compatible with any glibc implementation. */ - #define ELIDE_CODE - #endif - #endif -+#endif - - - #ifndef ELIDE_CODE -@@ -139,7 +141,7 @@ struct obstack *_obstack; - free up some memory, then call this again. */ - - int --_obstack_begin (struct obstack *h, int size, int alignment, -+_obstack_begin (struct obstack *h, PTR_INT_TYPE size, int alignment, - POINTER (*chunkfun) (long), void (*freefun) (void *)) - { - register struct _obstack_chunk *chunk; /* points to new chunk */ -@@ -183,7 +185,7 @@ _obstack_begin (struct obstack *h, int s - } - - int --_obstack_begin_1 (struct obstack *h, int size, int alignment, -+_obstack_begin_1 (struct obstack *h, PTR_INT_TYPE size, int alignment, - POINTER (*chunkfun) (POINTER, long), - void (*freefun) (POINTER, POINTER), POINTER arg) - { -@@ -235,7 +237,7 @@ _obstack_begin_1 (struct obstack *h, int - to the beginning of the new one. */ - - void --_obstack_newchunk (struct obstack *h, int length) -+_obstack_newchunk (struct obstack *h, PTR_INT_TYPE length) - { - register struct _obstack_chunk *old_chunk = h->chunk; - register struct _obstack_chunk *new_chunk; -@@ -388,11 +390,11 @@ obstack_free (struct obstack *h, POINTER - abort (); - } - --int -+PTR_INT_TYPE - _obstack_memory_used (struct obstack *h) - { - register struct _obstack_chunk* lp; -- register int nbytes = 0; -+ register PTR_INT_TYPE nbytes = 0; - - for (lp = h->chunk; lp != 0; lp = lp->prev) - { -@@ -421,6 +423,7 @@ print_and_abort (void) - } - - #if 0 -+/* These functions are now broken for 64-bit obstack! */ - /* These are now turned off because the applications do not use it - and it uses bcopy via obstack_grow, which causes trouble on sysV. */ - diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 9e850dd..d4843a5 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,7 +1,7 @@ -Index: gdb-7.9.90.20150717/gdb/event-top.c +Index: gdb-7.10.50.20151113/gdb/event-top.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/event-top.c 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/event-top.c 2015-08-01 20:07:15.822993674 +0200 +--- gdb-7.10.50.20151113.orig/gdb/event-top.c 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/event-top.c 2015-11-14 16:09:19.785362435 +0100 @@ -37,6 +37,7 @@ #include "gdbcmd.h" /* for dont_repeat() */ #include "annotate.h" @@ -28,10 +28,10 @@ Index: gdb-7.9.90.20150717/gdb/event-top.c old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt); /* Do not call the python hook on an explicit prompt change as -Index: gdb-7.9.90.20150717/gdb/symfile.h +Index: gdb-7.10.50.20151113/gdb/symfile.h =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/symfile.h 2015-08-01 20:07:15.787993404 +0200 -+++ gdb-7.9.90.20150717/gdb/symfile.h 2015-08-01 20:07:15.822993674 +0200 +--- gdb-7.10.50.20151113.orig/gdb/symfile.h 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/symfile.h 2015-11-14 16:09:19.786362441 +0100 @@ -587,6 +587,8 @@ void map_symbol_filenames (symbol_filena /* build-id support. */ extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); @@ -41,11 +41,11 @@ Index: gdb-7.9.90.20150717/gdb/symfile.h /* From dwarf2read.c */ -Index: gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp +Index: gdb-7.10.50.20151113/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/testsuite/lib/gdb.exp 2015-08-01 20:07:15.789993420 +0200 -+++ gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp 2015-08-01 20:07:15.824993689 +0200 -@@ -1573,7 +1573,7 @@ proc default_gdb_start { } { +--- gdb-7.10.50.20151113.orig/gdb/testsuite/lib/gdb.exp 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/testsuite/lib/gdb.exp 2015-11-14 16:09:19.786362441 +0100 +@@ -1640,7 +1640,7 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -54,11 +54,11 @@ Index: gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp send_gdb "set build-id-verbose 0\n" gdb_expect 10 { -re "$gdb_prompt $" { -Index: gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.10.50.20151113/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/testsuite/lib/mi-support.exp 2015-08-01 20:07:15.789993420 +0200 -+++ gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp 2015-08-01 20:07:15.824993689 +0200 -@@ -214,7 +214,7 @@ proc default_mi_gdb_start { args } { +--- gdb-7.10.50.20151113.orig/gdb/testsuite/lib/mi-support.exp 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/testsuite/lib/mi-support.exp 2015-11-14 16:09:19.787362447 +0100 +@@ -204,7 +204,7 @@ proc default_mi_gdb_start { args } { warning "Couldn't set the width to 0." } } @@ -67,10 +67,10 @@ Index: gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp send_gdb "190-gdb-set build-id-verbose 0\n" gdb_expect 10 { -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { -Index: gdb-7.9.90.20150717/gdb/tui/tui-interp.c +Index: gdb-7.10.50.20151113/gdb/tui/tui-interp.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/tui/tui-interp.c 2015-07-17 03:59:13.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/tui/tui-interp.c 2015-08-01 20:07:15.825993697 +0200 +--- gdb-7.10.50.20151113.orig/gdb/tui/tui-interp.c 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/tui/tui-interp.c 2015-11-14 16:09:19.787362447 +0100 @@ -31,6 +31,7 @@ #include "tui/tui-io.h" #include "infrun.h" @@ -79,10 +79,10 @@ Index: gdb-7.9.90.20150717/gdb/tui/tui-interp.c static struct ui_out *tui_ui_out (struct interp *self); -Index: gdb-7.9.90.20150717/gdb/aclocal.m4 +Index: gdb-7.10.50.20151113/gdb/aclocal.m4 =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/aclocal.m4 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/aclocal.m4 2015-08-01 20:07:15.825993697 +0200 +--- gdb-7.10.50.20151113.orig/gdb/aclocal.m4 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/aclocal.m4 2015-11-14 16:09:19.787362447 +0100 @@ -11,6 +11,221 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @@ -305,10 +305,10 @@ Index: gdb-7.9.90.20150717/gdb/aclocal.m4 # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -Index: gdb-7.9.90.20150717/gdb/config.in +Index: gdb-7.10.50.20151113/gdb/config.in =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/config.in 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/config.in 2015-08-01 20:07:15.826993704 +0200 +--- gdb-7.10.50.20151113.orig/gdb/config.in 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/config.in 2015-11-14 16:09:19.787362447 +0100 @@ -33,6 +33,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -329,11 +329,11 @@ Index: gdb-7.9.90.20150717/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -Index: gdb-7.9.90.20150717/gdb/configure +Index: gdb-7.10.50.20151113/gdb/configure =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/configure 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/configure 2015-08-01 20:07:15.830993735 +0200 -@@ -703,6 +703,11 @@ PKGVERSION +--- gdb-7.10.50.20151113.orig/gdb/configure 2015-11-14 16:09:10.050302377 +0100 ++++ gdb-7.10.50.20151113/gdb/configure 2015-11-14 16:09:30.651429470 +0100 +@@ -705,6 +705,11 @@ PKGVERSION HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs @@ -345,7 +345,7 @@ Index: gdb-7.9.90.20150717/gdb/configure GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -811,6 +816,7 @@ with_gdb_datadir +@@ -813,6 +818,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -353,7 +353,7 @@ Index: gdb-7.9.90.20150717/gdb/configure enable_targets enable_64_bit_bfd enable_gdbcli -@@ -867,6 +873,11 @@ CCC +@@ -869,6 +875,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -365,7 +365,7 @@ Index: gdb-7.9.90.20150717/gdb/configure YACC YFLAGS XMKMF' -@@ -1538,6 +1549,8 @@ Optional Packages: +@@ -1540,6 +1551,8 @@ Optional Packages: [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -374,7 +374,7 @@ Index: gdb-7.9.90.20150717/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1592,6 +1605,13 @@ Some influential environment variables: +@@ -1595,6 +1608,13 @@ Some influential environment variables: MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -388,7 +388,7 @@ Index: gdb-7.9.90.20150717/gdb/configure YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. -@@ -5608,6 +5628,491 @@ _ACEOF +@@ -5656,6 +5676,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -623,6 +623,7 @@ Index: gdb-7.9.90.20150717/gdb/configure + + + ++ +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -751,6 +752,7 @@ Index: gdb-7.9.90.20150717/gdb/configure + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi @@ -767,6 +769,7 @@ Index: gdb-7.9.90.20150717/gdb/configure + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi @@ -786,9 +789,9 @@ Index: gdb-7.9.90.20150717/gdb/configure + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then -+ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1` ++ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1` + else -+ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1` ++ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$RPM_PKG_ERRORS" >&5 @@ -880,10 +883,10 @@ Index: gdb-7.9.90.20150717/gdb/configure subdirs="$subdirs testsuite" -Index: gdb-7.9.90.20150717/gdb/configure.ac +Index: gdb-7.10.50.20151113/gdb/configure.ac =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/configure.ac 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/configure.ac 2015-08-01 20:07:15.831993743 +0200 +--- gdb-7.10.50.20151113.orig/gdb/configure.ac 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/configure.ac 2015-11-14 16:09:19.790362466 +0100 @@ -177,6 +177,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -1084,10 +1087,10 @@ Index: gdb-7.9.90.20150717/gdb/configure.ac AC_CONFIG_SUBDIRS(testsuite) # Check whether to support alternative target configurations -Index: gdb-7.9.90.20150717/gdb/corelow.c +Index: gdb-7.10.50.20151113/gdb/corelow.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/corelow.c 2015-08-01 20:07:15.775993312 +0200 -+++ gdb-7.9.90.20150717/gdb/corelow.c 2015-08-01 20:07:15.831993743 +0200 +--- gdb-7.10.50.20151113.orig/gdb/corelow.c 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/corelow.c 2015-11-14 16:09:19.791362472 +0100 @@ -310,7 +310,7 @@ build_id_locate_exec (int from_tty) symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } @@ -1097,10 +1100,10 @@ Index: gdb-7.9.90.20150717/gdb/corelow.c do_cleanups (back_to); -Index: gdb-7.9.90.20150717/gdb/build-id.c +Index: gdb-7.10.50.20151113/gdb/build-id.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/build-id.c 2015-08-01 20:07:15.791993435 +0200 -+++ gdb-7.9.90.20150717/gdb/build-id.c 2015-08-01 20:08:27.735546630 +0200 +--- gdb-7.10.50.20151113.orig/gdb/build-id.c 2015-11-14 16:08:57.874227260 +0100 ++++ gdb-7.10.50.20151113/gdb/build-id.c 2015-11-14 16:09:19.791362472 +0100 @@ -35,6 +35,7 @@ #include "elf/common.h" #include "elf-bfd.h" diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index c4cd84e..1fb970a 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -37,10 +37,10 @@ gdb/gdbserver/ (linux_create_inferior, linux_tracefork_child): Call it instead of direct ptrace. -Index: gdb-7.10.50.20151022/gdb/nat/linux-ptrace.c +Index: gdb-7.10.50.20151113/gdb/nat/linux-ptrace.c =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/nat/linux-ptrace.c 2015-10-22 22:35:00.474917139 +0200 -+++ gdb-7.10.50.20151022/gdb/nat/linux-ptrace.c 2015-10-22 22:35:08.120962729 +0200 +--- gdb-7.10.50.20151113.orig/gdb/nat/linux-ptrace.c 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/nat/linux-ptrace.c 2015-11-14 16:11:22.902121970 +0100 @@ -24,6 +24,10 @@ #include "gdb_wait.h" #include "gdb_ptrace.h" @@ -84,10 +84,10 @@ Index: gdb-7.10.50.20151022/gdb/nat/linux-ptrace.c /* Extract extended ptrace event from wait status. */ int -Index: gdb-7.10.50.20151022/gdb/nat/linux-ptrace.h +Index: gdb-7.10.50.20151113/gdb/nat/linux-ptrace.h =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/nat/linux-ptrace.h 2015-10-22 22:35:00.474917139 +0200 -+++ gdb-7.10.50.20151022/gdb/nat/linux-ptrace.h 2015-10-22 22:35:08.120962729 +0200 +--- gdb-7.10.50.20151113.orig/gdb/nat/linux-ptrace.h 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/nat/linux-ptrace.h 2015-11-14 16:11:22.902121970 +0100 @@ -164,6 +164,7 @@ extern void linux_ptrace_attach_fail_rea extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err); @@ -96,10 +96,10 @@ Index: gdb-7.10.50.20151022/gdb/nat/linux-ptrace.h extern void linux_check_ptrace_features (void); extern void linux_enable_event_reporting (pid_t pid, int attached); extern void linux_disable_event_reporting (pid_t pid); -Index: gdb-7.10.50.20151022/gdb/configure.ac +Index: gdb-7.10.50.20151113/gdb/configure.ac =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/configure.ac 2015-10-22 22:35:00.475917145 +0200 -+++ gdb-7.10.50.20151022/gdb/configure.ac 2015-10-22 22:35:08.121962735 +0200 +--- gdb-7.10.50.20151113.orig/gdb/configure.ac 2015-11-14 16:11:22.610120168 +0100 ++++ gdb-7.10.50.20151113/gdb/configure.ac 2015-11-14 16:11:22.902121970 +0100 @@ -2096,6 +2096,10 @@ case $host_os in esac AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.]) @@ -111,10 +111,10 @@ Index: gdb-7.10.50.20151022/gdb/configure.ac dnl Handle optional features that can be enabled. # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, -Index: gdb-7.10.50.20151022/gdb/gdbserver/configure.ac +Index: gdb-7.10.50.20151113/gdb/gdbserver/configure.ac =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/gdbserver/configure.ac 2015-10-22 22:35:00.475917145 +0200 -+++ gdb-7.10.50.20151022/gdb/gdbserver/configure.ac 2015-10-22 22:35:08.121962735 +0200 +--- gdb-7.10.50.20151113.orig/gdb/gdbserver/configure.ac 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/gdbserver/configure.ac 2015-11-14 16:11:22.903121976 +0100 @@ -502,6 +502,10 @@ if $want_ipa ; then fi fi @@ -126,11 +126,11 @@ Index: gdb-7.10.50.20151022/gdb/gdbserver/configure.ac AC_SUBST(GDBSERVER_DEPFILES) AC_SUBST(GDBSERVER_LIBS) AC_SUBST(srv_xmlbuiltin) -Index: gdb-7.10.50.20151022/gdb/gdbserver/linux-low.c +Index: gdb-7.10.50.20151113/gdb/gdbserver/linux-low.c =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/gdbserver/linux-low.c 2015-10-22 22:35:00.476917151 +0200 -+++ gdb-7.10.50.20151022/gdb/gdbserver/linux-low.c 2015-10-22 22:35:08.122962741 +0200 -@@ -843,6 +843,29 @@ add_lwp (ptid_t ptid) +--- gdb-7.10.50.20151113.orig/gdb/gdbserver/linux-low.c 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/gdbserver/linux-low.c 2015-11-14 16:11:22.904121982 +0100 +@@ -833,6 +833,29 @@ add_lwp (ptid_t ptid) return lwp; } @@ -160,7 +160,7 @@ Index: gdb-7.10.50.20151022/gdb/gdbserver/linux-low.c /* Start an inferior process and returns its pid. ALLARGS is a vector of program-name and args. */ -@@ -866,7 +889,7 @@ linux_create_inferior (char *program, ch +@@ -856,7 +879,7 @@ linux_create_inferior (char *program, ch if (pid == 0) { close_most_fds (); @@ -169,10 +169,10 @@ Index: gdb-7.10.50.20151022/gdb/gdbserver/linux-low.c #ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */ signal (__SIGRTMIN + 1, SIG_DFL); -Index: gdb-7.10.50.20151022/gdb/inf-ptrace.c +Index: gdb-7.10.50.20151113/gdb/inf-ptrace.c =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/inf-ptrace.c 2015-10-22 22:35:00.477917156 +0200 -+++ gdb-7.10.50.20151022/gdb/inf-ptrace.c 2015-10-22 22:35:08.122962741 +0200 +--- gdb-7.10.50.20151113.orig/gdb/inf-ptrace.c 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/inf-ptrace.c 2015-11-14 16:11:22.904121982 +0100 @@ -79,7 +79,15 @@ static void inf_ptrace_me (void) { @@ -189,10 +189,10 @@ Index: gdb-7.10.50.20151022/gdb/inf-ptrace.c } /* Start a new inferior Unix child process. EXEC_FILE is the file to -Index: gdb-7.10.50.20151022/gdb/linux-nat.c +Index: gdb-7.10.50.20151113/gdb/linux-nat.c =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/linux-nat.c 2015-10-22 22:35:00.477917156 +0200 -+++ gdb-7.10.50.20151022/gdb/linux-nat.c 2015-10-22 22:35:08.123962747 +0200 +--- gdb-7.10.50.20151113.orig/gdb/linux-nat.c 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/linux-nat.c 2015-11-14 16:11:22.905121988 +0100 @@ -1184,6 +1184,7 @@ linux_nat_create_inferior (struct target { struct cleanup *restore_personality @@ -231,10 +231,10 @@ Index: gdb-7.10.50.20151022/gdb/linux-nat.c do_cleanups (restore_personality); } -Index: gdb-7.10.50.20151022/gdb/config.in +Index: gdb-7.10.50.20151113/gdb/config.in =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/config.in 2015-10-22 22:35:00.478917162 +0200 -+++ gdb-7.10.50.20151022/gdb/config.in 2015-10-22 22:35:08.123962747 +0200 +--- gdb-7.10.50.20151113.orig/gdb/config.in 2015-11-14 16:11:22.607120150 +0100 ++++ gdb-7.10.50.20151113/gdb/config.in 2015-11-14 16:11:22.905121988 +0100 @@ -264,6 +264,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -255,11 +255,11 @@ Index: gdb-7.10.50.20151022/gdb/config.in /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -Index: gdb-7.10.50.20151022/gdb/configure +Index: gdb-7.10.50.20151113/gdb/configure =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/configure 2015-10-22 22:35:00.480917174 +0200 -+++ gdb-7.10.50.20151022/gdb/configure 2015-10-22 22:35:08.125962759 +0200 -@@ -14691,6 +14691,64 @@ cat >>confdefs.h <<_ACEOF +--- gdb-7.10.50.20151113.orig/gdb/configure 2015-11-14 16:11:22.610120168 +0100 ++++ gdb-7.10.50.20151113/gdb/configure 2015-11-14 16:11:22.907122001 +0100 +@@ -14694,6 +14694,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -324,10 +324,10 @@ Index: gdb-7.10.50.20151022/gdb/configure # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, # except that the argument to --with-sysroot is optional. -Index: gdb-7.10.50.20151022/gdb/gdbserver/config.in +Index: gdb-7.10.50.20151113/gdb/gdbserver/config.in =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/gdbserver/config.in 2015-10-22 22:35:00.481917180 +0200 -+++ gdb-7.10.50.20151022/gdb/gdbserver/config.in 2015-10-22 22:35:08.126962765 +0200 +--- gdb-7.10.50.20151113.orig/gdb/gdbserver/config.in 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/gdbserver/config.in 2015-11-14 16:13:15.974819541 +0100 @@ -117,6 +117,9 @@ /* Define to 1 if you have the `mcheck' library (-lmcheck). */ #undef HAVE_LIBMCHECK @@ -338,20 +338,20 @@ Index: gdb-7.10.50.20151022/gdb/gdbserver/config.in /* Define if the target supports branch tracing. */ #undef HAVE_LINUX_BTRACE -@@ -196,6 +199,9 @@ - /* Define to 1 if you have the `setns' function. */ - #undef HAVE_SETNS +@@ -193,6 +196,9 @@ + /* Define to 1 if you have the `pwrite' function. */ + #undef HAVE_PWRITE +/* Define to 1 if you have the header file. */ +#undef HAVE_SELINUX_SELINUX_H + - /* Define to 1 if you have the header file. */ - #undef HAVE_SGTTY_H + /* Define to 1 if you have the `setns' function. */ + #undef HAVE_SETNS -Index: gdb-7.10.50.20151022/gdb/gdbserver/configure +Index: gdb-7.10.50.20151113/gdb/gdbserver/configure =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/gdbserver/configure 2015-10-22 22:35:00.482917186 +0200 -+++ gdb-7.10.50.20151022/gdb/gdbserver/configure 2015-10-22 22:35:08.127962770 +0200 +--- gdb-7.10.50.20151113.orig/gdb/gdbserver/configure 2015-11-13 02:48:40.000000000 +0100 ++++ gdb-7.10.50.20151113/gdb/gdbserver/configure 2015-11-14 16:13:14.866812706 +0100 @@ -7290,6 +7290,64 @@ if $want_ipa ; then fi fi diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch new file mode 100644 index 0000000..a2a2960 --- /dev/null +++ b/gdb-fedora-libncursesw.patch @@ -0,0 +1,63 @@ +Fedora: Force libncursesw over libncurses to match the includes. +https://bugzilla.redhat.com/show_bug.cgi?id=1270534 + +diff -dup -rup gdb-7.10.50.20151113-orig/gdb/configure gdb-7.10.50.20151113/gdb/configure +--- gdb-7.10.50.20151113-orig/gdb/configure 2015-11-14 16:14:04.404118312 +0100 ++++ gdb-7.10.50.20151113/gdb/configure 2015-11-14 16:17:59.074566047 +0100 +@@ -8463,6 +8463,7 @@ if test x"$prefer_curses" = xyes; then + # search /usr/local/include, if ncurses is installed in /usr/local. A + # default installation of ncurses on alpha*-dec-osf* will lead to such + # a situation. ++ # Fedora: Force libncursesw over libncurses to match the includes. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 + $as_echo_n "checking for library containing waddstr... " >&6; } + if test "${ac_cv_search_waddstr+set}" = set; then : +@@ -8487,7 +8488,7 @@ return waddstr (); + return 0; + } + _ACEOF +-for ac_lib in '' ncurses cursesX curses; do ++for ac_lib in '' ncursesw; do + if test -z "$ac_lib"; then + ac_res="none required" + else +@@ -8561,6 +8562,7 @@ case $host_os in + esac + + # These are the libraries checked by Readline. ++# Fedora: Force libncursesw over libncurses to match the includes. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 + $as_echo_n "checking for library containing tgetent... " >&6; } + if test "${ac_cv_search_tgetent+set}" = set; then : +@@ -8585,7 +8587,7 @@ return tgetent (); + return 0; + } + _ACEOF +-for ac_lib in '' termcap tinfo curses ncurses; do ++for ac_lib in '' termcap tinfo ncursesw; do + if test -z "$ac_lib"; then + ac_res="none required" + else +diff -dup -rup gdb-7.10.50.20151113-orig/gdb/configure.ac gdb-7.10.50.20151113/gdb/configure.ac +--- gdb-7.10.50.20151113-orig/gdb/configure.ac 2015-11-14 16:14:04.404118312 +0100 ++++ gdb-7.10.50.20151113/gdb/configure.ac 2015-11-14 16:17:54.898540284 +0100 +@@ -771,7 +771,8 @@ if test x"$prefer_curses" = xyes; then + # search /usr/local/include, if ncurses is installed in /usr/local. A + # default installation of ncurses on alpha*-dec-osf* will lead to such + # a situation. +- AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses]) ++ # Fedora: Force libncursesw over libncurses to match the includes. ++ AC_SEARCH_LIBS(waddstr, [ncursesw]) + + if test "$ac_cv_search_waddstr" != no; then + curses_found=yes +@@ -813,7 +814,8 @@ case $host_os in + esac + + # These are the libraries checked by Readline. +-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses]) ++# Fedora: Force libncursesw over libncurses to match the includes. ++AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw]) + + if test "$ac_cv_search_tgetent" = no; then + CONFIG_OBS="$CONFIG_OBS stub-termcap.o" diff --git a/gdb-fortran-allocate-not-inited.patch b/gdb-fortran-allocate-not-inited.patch deleted file mode 100644 index 5b27165..0000000 --- a/gdb-fortran-allocate-not-inited.patch +++ /dev/null @@ -1,61 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2015-11/msg00127.html -Subject: [testsuite patch] Fortran: allocate()d memory is uninitialized - - ---mP3DRpeJDSE+ciuQ -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline - -Hi, - - allocate (vla1 (5)) ! vla1-not-allocated - l = allocated(vla1) ! vla1-allocated <------------------ - -Expecting: ^(510-data-evaluate-expression vla1[^M -]+)?(510\^done,value="\(0, 0, 0, 0, 0\)"[^M -]+[(]gdb[)] ^M -[ ]*) -510-data-evaluate-expression vla1^M -510^done,value="(1.82987403e-09, 7.8472714e-44, 1.82987403e-09, 7.8472714e-44, 2.67929926e+20)"^M -(gdb) ^M -FAIL: gdb.mi/mi-vla-fortran.exp: evaluate allocated vla - -gcc-4.9.2-6.fc21.x86_64 - -I think some older gfortran did initialize allocated memory but that is an -unspecified behavior. I haven't found any initialization mentioned -in Fortran 90 standard (draft) and it is also clearly stated here: - https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/268786 - Initialization to 0 of allocated arrays (of integers) is an - implementation issue. i.e. do not rely on it. - -OK for check-in? - - -Jan - ---mP3DRpeJDSE+ciuQ -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline; filename=1 - -gdb/testsuite/ChangeLog -2015-11-03 Jan Kratochvil - - * gdb.mi/mi-vla-fortran.exp (evaluate allocated vla): Remove test. - -diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp -index d191623..baee7f8 100644 ---- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp -+++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp -@@ -68,8 +68,6 @@ mi_create_breakpoint "-t vla.f90:$bp_lineno" 2 "del" "vla" ".*vla.f90" \ - mi_run_cmd - mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ - { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" --mi_gdb_test "510-data-evaluate-expression vla1" \ -- "510\\^done,value=\"\\(0, 0, 0, 0, 0\\)\"" "evaluate allocated vla" - - mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \ - "create local variable vla1_allocated" - ---mP3DRpeJDSE+ciuQ-- - diff --git a/gdb-nonstop-scratchpad.patch b/gdb-nonstop-scratchpad.patch deleted file mode 100644 index 5229e56..0000000 --- a/gdb-nonstop-scratchpad.patch +++ /dev/null @@ -1,268 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2015-10/msg00601.html -Subject: [PATCH] [PATCH] Don't displaced step when there's a breakpoint in the scratch pad range - -Assuming displaced stepping is enabled, and a breakpoint is set in the -memory region of the scratch pad, things break. One of two cases can -happen: - -#1 - The breakpoint wasn't inserted yet (all threads were stopped), so - after setting up the displaced stepping scratch pad with the - adjusted copy of the instruction we're trying to single-step, we - insert the breakpoint, which corrupts the scratch pad, and the - inferior executes the wrong instruction. (Example below.) - This is clearly unacceptable. - -#2 - The breakpoint was already inserted, so setting up the displaced - stepping scratch pad overwrites the breakpoint. This is OK in - the sense that we already assume that no thread is going to - executes the code in the scratch pad range (after initial - startup) anyway. - -This commit addresses both cases by simply punting on displaced -stepping if we have a breakpoint in the scratch pad range. - -The #1 case above explains a few regressions exposed by the AS/NS -series on x86: - - Running ./gdb.dwarf2/callframecfa.exp ... - FAIL: gdb.dwarf2/callframecfa.exp: set display for call-frame-cfa - FAIL: gdb.dwarf2/callframecfa.exp: step 1 for call-frame-cfa - FAIL: gdb.dwarf2/callframecfa.exp: step 2 for call-frame-cfa - FAIL: gdb.dwarf2/callframecfa.exp: step 3 for call-frame-cfa - FAIL: gdb.dwarf2/callframecfa.exp: step 4 for call-frame-cfa - Running ./gdb.dwarf2/typeddwarf.exp ... - FAIL: gdb.dwarf2/typeddwarf.exp: continue to breakpoint: continue to typeddwarf.c:53 - FAIL: gdb.dwarf2/typeddwarf.exp: check value of x at typeddwarf.c:53 - FAIL: gdb.dwarf2/typeddwarf.exp: check value of y at typeddwarf.c:53 - FAIL: gdb.dwarf2/typeddwarf.exp: check value of z at typeddwarf.c:53 - FAIL: gdb.dwarf2/typeddwarf.exp: continue to breakpoint: continue to typeddwarf.c:73 - FAIL: gdb.dwarf2/typeddwarf.exp: check value of w at typeddwarf.c:73 - FAIL: gdb.dwarf2/typeddwarf.exp: check value of x at typeddwarf.c:73 - FAIL: gdb.dwarf2/typeddwarf.exp: check value of y at typeddwarf.c:73 - FAIL: gdb.dwarf2/typeddwarf.exp: check value of z at typeddwarf.c:73 - -Enabling "maint set target-non-stop on" implies displaced stepping -enabled as well, and it's the latter that's to blame here. We can see -the same failures with "maint set target-non-stop off + set displaced -on". - -Diffing (good/bad) gdb.log for callframecfa.exp shows: - - @@ -99,29 +99,29 @@ Breakpoint 2 at 0x80481b0: file q.c, lin - continue - Continuing. - - -Breakpoint 2, func (arg=77) at q.c:2 - +Breakpoint 2, func (arg=52301) at q.c:2 - 2 in q.c - (gdb) PASS: gdb.dwarf2/callframecfa.exp: continue to breakpoint: continue to breakpoint for call-frame-cfa - display arg - -1: arg = 77 - -(gdb) PASS: gdb.dwarf2/callframecfa.exp: set display for call-frame-cfa - +1: arg = 52301 - +(gdb) FAIL: gdb.dwarf2/callframecfa.exp: set display for call-frame-cfa - -The problem is here, when setting up the func call: - - Breakpoint 1, main (argc=-13345, argv=0x0) at q.c:7 - 7 in q.c - - (gdb) disassemble - Dump of assembler code for function main: - 0x080481bb <+0>: push %ebp - 0x080481bc <+1>: mov %esp,%ebp - 0x080481be <+3>: sub $0x4,%esp - => 0x080481c1 <+6>: movl $0x4d,(%esp) - 0x080481c8 <+13>: call 0x80481b0 - 0x080481cd <+18>: leave - 0x080481ce <+19>: ret - End of assembler dump. - (gdb) disassemble /r - Dump of assembler code for function main: - 0x080481bb <+0>: 55 push %ebp - 0x080481bc <+1>: 89 e5 mov %esp,%ebp - 0x080481be <+3>: 83 ec 04 sub $0x4,%esp - => 0x080481c1 <+6>: c7 04 24 4d 00 00 00 movl $0x4d,(%esp) - 0x080481c8 <+13>: e8 e3 ff ff ff call 0x80481b0 - 0x080481cd <+18>: c9 leave - 0x080481ce <+19>: c3 ret - End of assembler dump. - -Note the breakpoint at main is set at 0x080481c1. Right at the -instruction that sets up func's argument. Executing that instruction -should write 0x4d to the address pointed at by $esp. However, if we -stepi, the program manages to write 52301/0xcc4d there instead (0xcc -is int3, the x86 breakpoint instruction), because the breakpoint -address is 4 bytes inside the scratch pad location, which is -0x080481bd: - - (gdb) p 0x080481c1 - 0x080481bd - $1 = 4 - -IOW, instead of executing: - - "c7 04 24 4d 00 00 00" [ movl $0x4d,(%esp) ] - -the inferior executes: - - "c7 04 24 4d cc 00 00" [movl $0xcc4d,(%esp) ] - -gdb/ChangeLog: -2015-10-26 Pedro Alves - - * breakpoint.c (breakpoint_in_range_p) - (breakpoint_location_address_range_overlap): New functions. - * breakpoint.h (breakpoint_in_range_p): New declaration. - * infrun.c (displaced_step_prepare_throw): If there's a breakpoint - in the scratch pad range, don't displaced step. ---- - gdb/breakpoint.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - gdb/breakpoint.h | 5 +++++ - gdb/infrun.c | 23 ++++++++++++++++++++++ - 3 files changed, 88 insertions(+) - -diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 2c901ff..5863573 100644 ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -173,6 +173,10 @@ static int breakpoint_location_address_match (struct bp_location *bl, - struct address_space *aspace, - CORE_ADDR addr); - -+static int breakpoint_location_address_range_overlap (struct bp_location *, -+ struct address_space *, -+ CORE_ADDR, int); -+ - static void breakpoints_info (char *, int); - - static void watchpoints_info (char *, int); -@@ -4243,6 +4247,40 @@ breakpoint_here_p (struct address_space *aspace, CORE_ADDR pc) - return any_breakpoint_here ? ordinary_breakpoint_here : no_breakpoint_here; - } - -+/* See breakpoint.h. */ -+ -+int -+breakpoint_in_range_p (struct address_space *aspace, -+ CORE_ADDR addr, ULONGEST len) -+{ -+ struct bp_location *bl, **blp_tmp; -+ -+ ALL_BP_LOCATIONS (bl, blp_tmp) -+ { -+ if (bl->loc_type != bp_loc_software_breakpoint -+ && bl->loc_type != bp_loc_hardware_breakpoint) -+ continue; -+ -+ if ((breakpoint_enabled (bl->owner) -+ || bl->permanent) -+ && breakpoint_location_address_range_overlap (bl, aspace, -+ addr, len)) -+ { -+ if (overlay_debugging -+ && section_is_overlay (bl->section) -+ && !section_is_mapped (bl->section)) -+ { -+ /* Unmapped overlay -- can't be a match. */ -+ continue; -+ } -+ -+ return 1; -+ } -+ } -+ -+ return 0; -+} -+ - /* Return true if there's a moribund breakpoint at PC. */ - - int -@@ -7079,6 +7117,28 @@ breakpoint_location_address_match (struct bp_location *bl, - aspace, addr))); - } - -+/* Returns true if the [ADDR,ADDR+LEN) range in ASPACE overlaps -+ breakpoint BL. BL may be a ranged breakpoint. In most targets, a -+ match happens only if ASPACE matches the breakpoint's address -+ space. On targets that have global breakpoints, the address space -+ doesn't really matter. */ -+ -+static int -+breakpoint_location_address_range_overlap (struct bp_location *bl, -+ struct address_space *aspace, -+ CORE_ADDR addr, int len) -+{ -+ if (gdbarch_has_global_breakpoints (target_gdbarch ()) -+ || bl->pspace->aspace == aspace) -+ { -+ int bl_len = bl->length != 0 ? bl->length : 1; -+ -+ if (mem_ranges_overlap (addr, len, bl->address, bl_len)) -+ return 1; -+ } -+ return 0; -+} -+ - /* If LOC1 and LOC2's owners are not tracepoints, returns false directly. - Then, if LOC1 and LOC2 represent the same tracepoint location, returns - true, otherwise returns false. */ -diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h -index 896d3eb..ee8b2e0 100644 ---- a/gdb/breakpoint.h -+++ b/gdb/breakpoint.h -@@ -1146,6 +1146,11 @@ extern int program_breakpoint_here_p (struct gdbarch *gdbarch, CORE_ADDR address - extern enum breakpoint_here breakpoint_here_p (struct address_space *, - CORE_ADDR); - -+/* Return true if an enabled breakpoint exists in the range defined by -+ ADDR and LEN, in ASPACE. */ -+extern int breakpoint_in_range_p (struct address_space *aspace, -+ CORE_ADDR addr, ULONGEST len); -+ - extern int moribund_breakpoint_here_p (struct address_space *, CORE_ADDR); - - extern int breakpoint_inserted_here_p (struct address_space *, CORE_ADDR); -diff --git a/gdb/infrun.c b/gdb/infrun.c -index 917f9be..ef4ccb4 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -1729,6 +1729,7 @@ displaced_step_prepare_throw (ptid_t ptid) - struct thread_info *tp = find_thread_ptid (ptid); - struct regcache *regcache = get_thread_regcache (ptid); - struct gdbarch *gdbarch = get_regcache_arch (regcache); -+ struct address_space *aspace = get_regcache_aspace (regcache); - CORE_ADDR original, copy; - ULONGEST len; - struct displaced_step_closure *closure; -@@ -1784,6 +1785,28 @@ displaced_step_prepare_throw (ptid_t ptid) - copy = gdbarch_displaced_step_location (gdbarch); - len = gdbarch_max_insn_length (gdbarch); - -+ if (breakpoint_in_range_p (aspace, copy, len)) -+ { -+ /* There's a breakpoint set in the scratch pad location range -+ (which is usually around the entry point). We'd either -+ install it before resuming, which would overwrite/corrupt the -+ scratch pad, or if it was already inserted, this displaced -+ step would overwrite it. The latter is OK in the sense that -+ we already assume that no thread is going to execute the code -+ in the scratch pad range (after initial startup) anyway, but -+ the former is unacceptable. Simply punt and fallback to -+ stepping over this breakpoint in-line. */ -+ if (debug_displaced) -+ { -+ fprintf_unfiltered (gdb_stdlog, -+ "displaced: breakpoint set in scratch pad. " -+ "Stepping over breakpoint in-line instead.\n"); -+ } -+ -+ do_cleanups (old_cleanups); -+ return -1; -+ } -+ - /* Save the original contents of the copy area. */ - displaced->step_saved_copy = (gdb_byte *) xmalloc (len); - ignore_cleanups = make_cleanup (free_current_contents, --- -1.9.3 - diff --git a/gdb-upstream.patch b/gdb-upstream.patch deleted file mode 100644 index 3e53d46..0000000 --- a/gdb-upstream.patch +++ /dev/null @@ -1,69 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2015-10/msg00510.html -Subject: [patch] Fix access_to_packed_array.exp typos/errors [Re: [PATCH] [Ada] Fix the evaluation of access to packed array subscript] - - ---r5Pyd7+fXNt84Ff3 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline - -On Mon, 14 Sep 2015 16:18:00 +0200, Joel Brobecker wrote: -> > * gdb.ada/access_to_packed_array.exp: New testcase. -> -> Looks good to me. Please go ahead and push. - -Running ./gdb.ada/access_to_packed_array.exp ... -ERROR: tcl error sourcing ./gdb.ada/access_to_packed_array.exp. -ERROR: extra characters after close-quote - while executing -"gdb_test "print pack.a" "\\(0 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\)")" - (file "./gdb.ada/access_to_packed_array.exp" line 29) - invoked from within -"source ./gdb.ada/access_to_packed_array.exp" - ("uplevel" body line 1) - invoked from within -"uplevel #0 source ./gdb.ada/access_to_packed_array.exp" - invoked from within -"catch "uplevel #0 source $test_file_name"" - -Attaching a fix of the typos. - -Unrelated to the typos I have changed the print expectations s/"x"/" = x"/ -as for example expectation "3" should not match " = 43". - -On Fedora 21 x86_64 it then: -# of expected passes 5 - -OK for check-in? - - -Jan - ---r5Pyd7+fXNt84Ff3 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline; filename=1 - -gdb/testsuite/ChangeLog -2015-10-25 Jan Kratochvil - - * gdb.ada/access_to_packed_array.exp: Fix typos erroring the testfile. - -diff --git a/gdb/testsuite/gdb.ada/access_to_packed_array.exp b/gdb/testsuite/gdb.ada/access_to_packed_array.exp -index 0dca780..1bf3e22 100644 ---- a/gdb/testsuite/gdb.ada/access_to_packed_array.exp -+++ b/gdb/testsuite/gdb.ada/access_to_packed_array.exp -@@ -26,8 +26,8 @@ clean_restart ${testfile} - set bp_location [gdb_get_line_number "BREAK" ${testdir}/foo.adb] - runto "foo.adb:$bp_location" - --gdb_test "print pack.a" "\\(0 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\)") --gdb_test "pack.aa" "\\(access pack\\.array_type\\) 0x.* ") -+gdb_test "print pack.a" " = \\(0 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\)" -+gdb_test "print pack.aa" " = \\(access pack\\.array_type\\) 0x.* " - --gdb_test "pack.a(2)" "3" --gdb_test "pack.aa(2)" "3" -+gdb_test "print pack.a(2)" " = 3" -+gdb_test "print pack.aa(2)" " = 3" - ---r5Pyd7+fXNt84Ff3-- - diff --git a/gdb.spec b/gdb.spec index 7bfe983..d6bb1df 100644 --- a/gdb.spec +++ b/gdb.spec @@ -19,7 +19,7 @@ Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20151027 +%global snapsrc 20151113 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20150822 %global tarname gdb-%{version} @@ -27,7 +27,7 @@ Version: 7.10.50.%{snapsrc} # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 32%{?dist} +Release: 33%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -245,16 +245,12 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch # Backported fixups post the source tarball. #Xdrop: Just backports. -Patch232: gdb-upstream.patch +#Patch232: gdb-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). #=fedoratest+ppc Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch -# Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832) -#=push+work: Upstream should have backward compat. API: libc-alpha: <20070127104539.GA9444@.*> -Patch235: gdb-6.3-bz231832-obstack-2gb.patch - # Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). #=fedoratest Patch245: gdb-6.6-bz229517-gcore-without-terminal.patch @@ -545,11 +541,8 @@ Patch978: gdb-jit-reader-multilib.patch # Fix the pahole command breakage due to its Python3 port (RH BZ 1264532). Patch1044: gdb-pahole-python2.patch -# Fix callframecfa.exp and typeddwarf.exp rebase regression. -Patch1054: gdb-nonstop-scratchpad.patch - -# testsuite: Fortran: allocate()d memory is uninitialized. -Patch1056: gdb-fortran-allocate-not-inited.patch +# Force libncursesw over libncurses to match the includes (RH BZ 1270534). +Patch1056: gdb-fedora-libncursesw.patch %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: @@ -645,6 +638,9 @@ BuildRequires: prelink %endif %endif %endif +%if 0%{!?rhel:1} || 0%{?rhel} > 7 +BuildRequires: libmpx%{bits_local} libmpx%{bits_other} +%endif %if 0%{!?rhel:1} # Fedora arm+ppc64le do not yet have fpc built. %ifnarch %{arm} ppc64le @@ -742,7 +738,7 @@ find -name "*.info*"|xargs rm -f # Match the Fedora's version info. %patch2 -p1 -%patch232 -p1 +#patch232 -p1 %patch349 -p1 %patch888 -p1 %patch983 -p1 @@ -774,7 +770,6 @@ find -name "*.info*"|xargs rm -f %patch229 -p1 %patch231 -p1 %patch234 -p1 -%patch235 -p1 %patch245 -p1 %patch247 -p1 %patch254 -p1 @@ -846,7 +841,6 @@ find -name "*.info*"|xargs rm -f %patch925 -p1 %patch927 -p1 %patch978 -p1 -%patch1054 -p1 %patch1056 -p1 %patch848 -p1 @@ -1363,7 +1357,12 @@ then fi %changelog -* Thu Nov 12 2015 Fedora Release Engineering - 7.10.50.20151027-32 +* Sat Nov 14 2015 Jan Kratochvil - 7.10.50.20151113-33.fc24 +- Rebase to FSF GDB 7.10.50.20151113 (trunk snapshot). +- [testsuite] BuildRequire libmpx for --with testsuite. +- Force libncursesw over libncurses to match the includes (RH BZ 1270534). + +* Thu Nov 12 2015 Fedora Release Engineering - 7.10.50.20151027-32.fc24 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Sun Nov 8 2015 Jan Kratochvil - 7.10.50.20151027-31.fc24 diff --git a/sources b/sources index bf7aa02..f5ca67b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 7ad32d3894aaf90d00a4343a735c3e1c gdb-libstdc++-v3-python-r225521.tar.xz -08819fb3e231bbd986695bb4edcd271d gdb-7.10.50.20151027.tar.xz +36efc821ddc40656ed50ae7cf34904d1 gdb-7.10.50.20151113.tar.xz