Rebase to FSF GDB 7.9.90.20150709 (7.10 branch snapshot).

This commit is contained in:
Jan Kratochvil 2015-07-10 10:25:09 +02:00
parent d92234971d
commit ae96b4a095
13 changed files with 546 additions and 870 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/gdb-libstdc++-v3-python-r225521.tar.xz
/gdb-7.9.50.20150531.tar.xz
/gdb-7.9.90.20150709.tar.xz

View File

@ -15,10 +15,10 @@ Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
NULL after it is free'd, otherwise the code below thinks that it is still
valid and doesn't print the necessary warning ("Try: yum install ...").
Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
===================================================================
--- /dev/null
+++ gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2015-07-09 22:22:26.278304653 +0200
@@ -0,0 +1,97 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+
@ -117,15 +117,19 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.
+
+# Leaving the link there will cause breakage in the next run.
+remote_exec build "rm -f ${objdir}/${subdir}/${build_id_without_debug}"
Index: gdb-7.7/gdb/build-id.c
Index: gdb-7.9.90.20150709/gdb/build-id.c
===================================================================
--- gdb-7.7.orig/gdb/build-id.c
+++ gdb-7.7/gdb/build-id.c
@@ -588,6 +588,7 @@ build_id_to_debug_bfd (size_t build_id_l
if (abfd == NULL)
{
xfree (filename);
+ filename = NULL;
continue;
}
--- gdb-7.9.90.20150709.orig/gdb/build-id.c 2015-07-09 22:22:26.278304653 +0200
+++ gdb-7.9.90.20150709/gdb/build-id.c 2015-07-09 22:22:51.398502329 +0200
@@ -589,7 +589,10 @@ build_id_to_debug_bfd (size_t build_id_l
do_cleanups (inner);
if (abfd == NULL)
- continue;
+ {
+ filename = NULL;
+ continue;
+ }
if (build_id_verify (abfd, build_id_len, build_id))
break;

View File

@ -1,7 +1,7 @@
Index: gdb-7.8.50.20141228/gdb/event-top.c
Index: gdb-7.9.90.20150709/gdb/event-top.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/event-top.c 2015-01-01 17:12:24.881489087 +0100
+++ gdb-7.8.50.20141228/gdb/event-top.c 2015-01-01 17:12:28.821486803 +0100
--- gdb-7.9.90.20150709.orig/gdb/event-top.c 2015-07-09 18:22:45.008383794 +0200
+++ gdb-7.9.90.20150709/gdb/event-top.c 2015-07-09 18:22:51.401438337 +0200
@@ -37,6 +37,7 @@
#include "gdbcmd.h" /* for dont_repeat() */
#include "annotate.h"
@ -28,24 +28,24 @@ Index: gdb-7.8.50.20141228/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.8.50.20141228/gdb/symfile.h
Index: gdb-7.9.90.20150709/gdb/symfile.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/symfile.h 2015-01-01 17:12:24.881489087 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.h 2015-01-01 17:12:28.822486802 +0100
@@ -577,6 +577,8 @@ void map_symbol_filenames (symbol_filena
--- gdb-7.9.90.20150709.orig/gdb/symfile.h 2015-07-09 18:22:45.009383802 +0200
+++ gdb-7.9.90.20150709/gdb/symfile.h 2015-07-09 18:22:51.402438346 +0200
@@ -587,6 +587,8 @@ void map_symbol_filenames (symbol_filena
/* build-id support. */
extern struct elf_build_id *build_id_addr_get (CORE_ADDR addr);
extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
extern void debug_print_missing (const char *binary, const char *debug);
+extern void debug_flush_missing (void);
+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
/* From dwarf2read.c */
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/gdb.exp 2015-01-01 17:12:24.883489085 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp 2015-01-01 17:12:28.823486801 +0100
@@ -1522,7 +1522,7 @@ proc default_gdb_start { } {
--- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/gdb.exp 2015-07-09 18:22:45.010383811 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp 2015-07-09 18:22:51.403438354 +0200
@@ -1573,7 +1573,7 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
}
@ -54,10 +54,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
send_gdb "set build-id-verbose 0\n"
gdb_expect 10 {
-re "$gdb_prompt $" {
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/mi-support.exp 2015-01-01 17:12:24.884489085 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp 2015-01-01 17:12:28.823486801 +0100
--- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/mi-support.exp 2015-07-09 18:22:45.012383828 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp 2015-07-09 18:22:51.404438363 +0200
@@ -214,7 +214,7 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
@ -67,10 +67,10 @@ Index: gdb-7.8.50.20141228/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.8.50.20141228/gdb/tui/tui-interp.c
Index: gdb-7.9.90.20150709/gdb/tui/tui-interp.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/tui/tui-interp.c 2015-01-01 17:12:28.824486801 +0100
+++ gdb-7.8.50.20141228/gdb/tui/tui-interp.c 2015-01-01 17:12:43.240478444 +0100
--- gdb-7.9.90.20150709.orig/gdb/tui/tui-interp.c 2015-07-09 18:22:45.012383828 +0200
+++ gdb-7.9.90.20150709/gdb/tui/tui-interp.c 2015-07-09 18:22:51.404438363 +0200
@@ -31,6 +31,7 @@
#include "tui/tui-io.h"
#include "infrun.h"
@ -79,10 +79,10 @@ Index: gdb-7.8.50.20141228/gdb/tui/tui-interp.c
static struct ui_out *tui_ui_out (struct interp *self);
Index: gdb-7.8.50.20141228/gdb/aclocal.m4
Index: gdb-7.9.90.20150709/gdb/aclocal.m4
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/aclocal.m4 2015-01-01 17:12:24.885489084 +0100
+++ gdb-7.8.50.20141228/gdb/aclocal.m4 2015-01-01 17:12:28.824486801 +0100
--- gdb-7.9.90.20150709.orig/gdb/aclocal.m4 2015-07-09 18:22:45.013383837 +0200
+++ gdb-7.9.90.20150709/gdb/aclocal.m4 2015-07-09 18:22:51.405438371 +0200
@@ -11,6 +11,221 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@ -305,10 +305,10 @@ Index: gdb-7.8.50.20141228/gdb/aclocal.m4
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
Index: gdb-7.8.50.20141228/gdb/config.in
Index: gdb-7.9.90.20150709/gdb/config.in
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/config.in 2015-01-01 17:12:24.885489084 +0100
+++ gdb-7.8.50.20141228/gdb/config.in 2015-01-01 17:12:28.824486801 +0100
--- gdb-7.9.90.20150709.orig/gdb/config.in 2015-07-09 18:22:45.013383837 +0200
+++ gdb-7.9.90.20150709/gdb/config.in 2015-07-09 18:22:51.405438371 +0200
@@ -33,6 +33,9 @@
/* Define to BFD's default target vector. */
#undef DEFAULT_BFD_VEC
@ -319,7 +319,7 @@ Index: gdb-7.8.50.20141228/gdb/config.in
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
@@ -207,6 +210,9 @@
@@ -258,6 +261,9 @@
/* Define if Python 2.7 is being used. */
#undef HAVE_LIBPYTHON2_7
@ -329,11 +329,11 @@ Index: gdb-7.8.50.20141228/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
Index: gdb-7.8.50.20141228/gdb/configure
Index: gdb-7.9.90.20150709/gdb/configure
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/configure 2015-01-01 17:12:24.891489081 +0100
+++ gdb-7.8.50.20141228/gdb/configure 2015-01-01 17:12:28.828486798 +0100
@@ -698,6 +698,11 @@ PKGVERSION
--- gdb-7.9.90.20150709.orig/gdb/configure 2015-07-09 18:22:45.020383896 +0200
+++ gdb-7.9.90.20150709/gdb/configure 2015-07-09 18:22:51.410438414 +0200
@@ -703,6 +703,11 @@ PKGVERSION
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
subdirs
@ -345,7 +345,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
GDB_DATADIR
DEBUGDIR
MAKEINFO_EXTRA_FLAGS
@@ -801,6 +806,7 @@ with_gdb_datadir
@@ -811,6 +816,7 @@ with_gdb_datadir
with_relocated_sources
with_auto_load_dir
with_auto_load_safe_path
@ -353,7 +353,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
enable_targets
enable_64_bit_bfd
enable_gdbcli
@@ -852,6 +858,11 @@ CPPFLAGS
@@ -867,6 +873,11 @@ CCC
CPP
MAKEINFO
MAKEINFOFLAGS
@ -365,7 +365,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
YACC
YFLAGS
XMKMF'
@@ -1522,6 +1533,8 @@ Optional Packages:
@@ -1538,6 +1549,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.8.50.20141228/gdb/configure
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
--with-curses use the curses library instead of the termcap
library
@@ -1571,6 +1584,13 @@ Some influential environment variables:
@@ -1592,6 +1605,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.8.50.20141228/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.
@@ -5267,6 +5287,491 @@ _ACEOF
@@ -5608,6 +5628,491 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@ -880,11 +880,11 @@ Index: gdb-7.8.50.20141228/gdb/configure
subdirs="$subdirs testsuite"
Index: gdb-7.8.50.20141228/gdb/configure.ac
Index: gdb-7.9.90.20150709/gdb/configure.ac
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/configure.ac 2015-01-01 17:12:24.893489079 +0100
+++ gdb-7.8.50.20141228/gdb/configure.ac 2015-01-01 17:12:28.829486798 +0100
@@ -172,6 +172,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
--- gdb-7.9.90.20150709.orig/gdb/configure.ac 2015-07-09 18:22:45.022383913 +0200
+++ gdb-7.9.90.20150709/gdb/configure.ac 2015-07-09 18:22:51.411438422 +0200
@@ -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 +1084,10 @@ Index: gdb-7.8.50.20141228/gdb/configure.ac
AC_CONFIG_SUBDIRS(testsuite)
# Check whether to support alternative target configurations
Index: gdb-7.8.50.20141228/gdb/corelow.c
Index: gdb-7.9.90.20150709/gdb/corelow.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/corelow.c 2015-01-01 17:12:24.894489079 +0100
+++ gdb-7.8.50.20141228/gdb/corelow.c 2015-01-01 17:12:28.829486798 +0100
--- gdb-7.9.90.20150709.orig/gdb/corelow.c 2015-07-09 18:22:45.022383913 +0200
+++ gdb-7.9.90.20150709/gdb/corelow.c 2015-07-09 18:22:51.412438431 +0200
@@ -310,7 +310,7 @@ build_id_locate_exec (int from_tty)
symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
}
@ -1097,19 +1097,19 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
do_cleanups (back_to);
Index: gdb-7.8.50.20141228/gdb/build-id.c
Index: gdb-7.9.90.20150709/gdb/build-id.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/build-id.c 2015-01-01 17:12:24.894489079 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.c 2015-01-01 17:12:28.830486797 +0100
@@ -31,6 +31,7 @@
#include "gdbcmd.h"
#include "observer.h"
--- gdb-7.9.90.20150709.orig/gdb/build-id.c 2015-07-09 18:22:45.023383922 +0200
+++ gdb-7.9.90.20150709/gdb/build-id.c 2015-07-09 18:22:51.412438431 +0200
@@ -35,6 +35,7 @@
#include "elf/common.h"
#include "elf-bfd.h"
#include <sys/stat.h>
+#include "elf/external.h"
#define BUILD_ID_VERBOSE_NONE 0
#define BUILD_ID_VERBOSE_FILENAMES 1
@@ -664,8 +665,363 @@ build_id_to_filename (const struct elf_b
@@ -669,8 +670,363 @@ build_id_to_filename (const struct bfd_b
return result;
}
@ -1474,7 +1474,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
avoidance. */
struct missing_filepair
@@ -719,11 +1072,17 @@ missing_filepair_change (void)
@@ -724,11 +1080,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL;
}
@ -1492,7 +1492,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
missing_filepair_change ();
}
@@ -790,14 +1149,34 @@ debug_print_missing (const char *binary,
@@ -795,14 +1157,34 @@ debug_print_missing (const char *binary,
*slot = missing_filepair;

View File

@ -1,13 +1,13 @@
Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
===================================================================
--- gdb-7.5.50.20130310.orig/gdb/solib-svr4.c 2013-03-10 16:37:49.000000000 +0100
+++ gdb-7.5.50.20130310/gdb/solib-svr4.c 2013-03-10 16:43:45.498585091 +0100
@@ -1225,14 +1225,27 @@ svr4_read_so_list (CORE_ADDR lm, struct
--- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 18:18:54.526417766 +0200
+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 18:19:33.074746586 +0200
@@ -1381,14 +1381,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
}
{
- struct elf_build_id *build_id;
+ struct elf_build_id *build_id = NULL;
- struct bfd_build_id *build_id;
+ struct bfd_build_id *build_id = NULL;
strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
@ -32,7 +32,7 @@ Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
if (build_id != NULL)
{
char *name, *build_id_filename;
@@ -1247,23 +1260,7 @@ svr4_read_so_list (CORE_ADDR lm, struct
@@ -1403,23 +1416,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
xfree (name);
}
else

View File

@ -1,7 +1,7 @@
Index: gdb-7.9.50.20150520/gdb/corelow.c
Index: gdb-7.9.90.20150709/gdb/corelow.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/corelow.c 2015-05-31 16:38:55.123112227 +0200
+++ gdb-7.9.50.20150520/gdb/corelow.c 2015-05-31 16:38:57.601130366 +0200
--- gdb-7.9.90.20150709.orig/gdb/corelow.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/corelow.c 2015-07-09 22:05:42.057222722 +0200
@@ -45,6 +45,10 @@
#include "gdb_bfd.h"
#include "completer.h"
@ -23,7 +23,7 @@ Index: gdb-7.9.50.20150520/gdb/corelow.c
+build_id_locate_exec (int from_tty)
+{
+ CORE_ADDR at_entry;
+ struct elf_build_id *build_id;
+ struct bfd_build_id *build_id;
+ char *execfilename, *debug_filename;
+ char *build_id_filename;
+ struct cleanup *back_to;
@ -94,11 +94,11 @@ Index: gdb-7.9.50.20150520/gdb/corelow.c
+ NULL, NULL, NULL,
+ &setlist, &showlist);
}
Index: gdb-7.9.50.20150520/gdb/doc/gdb.texinfo
Index: gdb-7.9.90.20150709/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/doc/gdb.texinfo 2015-05-31 16:38:55.137112330 +0200
+++ gdb-7.9.50.20150520/gdb/doc/gdb.texinfo 2015-05-31 16:38:57.612130447 +0200
@@ -18254,6 +18254,27 @@ information files.
--- gdb-7.9.90.20150709.orig/gdb/doc/gdb.texinfo 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/doc/gdb.texinfo 2015-07-09 22:05:42.067222806 +0200
@@ -18304,6 +18304,27 @@ information files.
@end table
@ -126,10 +126,10 @@ Index: gdb-7.9.50.20150520/gdb/doc/gdb.texinfo
@cindex @code{.gnu_debuglink} sections
@cindex debug link sections
A debug link is a special section of the executable file named
Index: gdb-7.9.50.20150520/gdb/solib-svr4.c
Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/solib-svr4.c 2015-05-31 16:38:55.142112366 +0200
+++ gdb-7.9.50.20150520/gdb/solib-svr4.c 2015-05-31 16:40:33.593819702 +0200
--- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 22:05:42.068222815 +0200
@@ -45,6 +45,7 @@
#include "auxv.h"
#include "gdb_bfd.h"
@ -146,7 +146,7 @@ Index: gdb-7.9.50.20150520/gdb/solib-svr4.c
- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (newobj->so_original_name, newobj->so_name);
+ {
+ struct elf_build_id *build_id;
+ struct bfd_build_id *build_id;
+
+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
@ -194,11 +194,11 @@ Index: gdb-7.9.50.20150520/gdb/solib-svr4.c
xfree (buffer);
/* If this entry has no name, or its name matches the name
Index: gdb-7.9.50.20150520/gdb/elfread.c
Index: gdb-7.9.90.20150709/gdb/elfread.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/elfread.c 2015-05-31 16:38:55.143112374 +0200
+++ gdb-7.9.50.20150520/gdb/elfread.c 2015-05-31 16:38:57.614130462 +0200
@@ -1341,9 +1341,10 @@ elf_symfile_read (struct objfile *objfil
--- gdb-7.9.90.20150709.orig/gdb/elfread.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/elfread.c 2015-07-09 22:05:42.068222815 +0200
@@ -1250,9 +1250,10 @@ elf_symfile_read (struct objfile *objfil
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@ -211,7 +211,7 @@ Index: gdb-7.9.50.20150520/gdb/elfread.c
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1357,6 +1358,12 @@ elf_symfile_read (struct objfile *objfil
@@ -1266,6 +1267,12 @@ elf_symfile_read (struct objfile *objfil
symbol_file_add_separate (abfd, debugfile, symfile_flags, objfile);
do_cleanups (cleanup);
}
@ -224,25 +224,25 @@ Index: gdb-7.9.50.20150520/gdb/elfread.c
}
}
Index: gdb-7.9.50.20150520/gdb/symfile.h
Index: gdb-7.9.90.20150709/gdb/symfile.h
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/symfile.h 2015-05-31 16:38:55.143112374 +0200
+++ gdb-7.9.50.20150520/gdb/symfile.h 2015-05-31 16:38:57.614130462 +0200
--- gdb-7.9.90.20150709.orig/gdb/symfile.h 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/symfile.h 2015-07-09 22:05:42.068222815 +0200
@@ -584,6 +584,10 @@ void expand_symtabs_matching (expand_sym
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
+/* build-id support. */
+extern struct elf_build_id *build_id_addr_get (CORE_ADDR addr);
+extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
+extern void debug_print_missing (const char *binary, const char *debug);
+
/* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.9.50.20150520/gdb/testsuite/lib/gdb.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/testsuite/lib/gdb.exp 2015-05-31 16:38:55.145112388 +0200
+++ gdb-7.9.50.20150520/gdb/testsuite/lib/gdb.exp 2015-05-31 16:38:57.615130469 +0200
--- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/gdb.exp 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp 2015-07-09 22:05:42.070222832 +0200
@@ -1573,6 +1573,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
@ -260,10 +260,10 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/lib/gdb.exp
return 0
}
Index: gdb-7.9.50.20150520/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/testsuite/lib/mi-support.exp 2015-05-31 16:38:55.146112396 +0200
+++ gdb-7.9.50.20150520/gdb/testsuite/lib/mi-support.exp 2015-05-31 16:38:57.616130476 +0200
--- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/mi-support.exp 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp 2015-07-09 22:05:42.070222832 +0200
@@ -214,6 +214,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
@ -281,10 +281,10 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/lib/mi-support.exp
# If allowing the inferior to have its own PTY then assign the inferior
# its own terminal device here.
if { $separate_inferior_pty } {
Index: gdb-7.9.50.20150520/gdb/objfiles.h
Index: gdb-7.9.90.20150709/gdb/objfiles.h
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/objfiles.h 2015-05-31 16:38:55.147112403 +0200
+++ gdb-7.9.50.20150520/gdb/objfiles.h 2015-05-31 16:38:57.616130476 +0200
--- gdb-7.9.90.20150709.orig/gdb/objfiles.h 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/objfiles.h 2015-07-09 22:05:42.071222840 +0200
@@ -459,6 +459,10 @@ struct objfile
#define OBJF_NOT_FILENAME (1 << 6)
@ -296,10 +296,10 @@ Index: gdb-7.9.50.20150520/gdb/objfiles.h
/* Declarations for functions defined in objfiles.c */
extern struct objfile *allocate_objfile (bfd *, const char *name, int);
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.base/corefile.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/testsuite/gdb.base/corefile.exp 2015-05-31 16:38:55.147112403 +0200
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.base/corefile.exp 2015-05-31 16:38:57.616130476 +0200
--- gdb-7.9.90.20150709.orig/gdb/testsuite/gdb.base/corefile.exp 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp 2015-07-09 22:05:42.071222840 +0200
@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile"
pass $test
}
@ -334,11 +334,11 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.base/corefile.exp
+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
+ pass $wholetest
+}
Index: gdb-7.9.50.20150520/gdb/build-id.c
Index: gdb-7.9.90.20150709/gdb/build-id.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/build-id.c 2015-05-31 16:38:55.148112410 +0200
+++ gdb-7.9.50.20150520/gdb/build-id.c 2015-05-31 16:45:35.025722142 +0200
@@ -27,11 +27,63 @@
--- gdb-7.9.90.20150709.orig/gdb/build-id.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/build-id.c 2015-07-09 22:19:35.022957009 +0200
@@ -26,11 +26,67 @@
#include "objfiles.h"
#include "filenames.h"
#include "gdbcore.h"
@ -346,6 +346,10 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
+#include "gdbcore.h"
+#include "gdbcmd.h"
+#include "observer.h"
+#include "elf/external.h"
+#include "elf/internal.h"
+#include "elf/common.h"
+#include "elf-bfd.h"
+#include <sys/stat.h>
+
+#define BUILD_ID_VERBOSE_NONE 0
@ -362,7 +366,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
+/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
+
+static struct elf_build_id *
+static struct bfd_build_id *
+build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
+{
+ bfd_byte *p;
@ -382,7 +386,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
+ {
+ size_t size = descsz;
+ gdb_byte *data = (void *) descdata;
+ struct elf_build_id *retval;
+ struct bfd_build_id *retval;
+
+ retval = xmalloc (sizeof *retval - 1 + size);
+ retval->size = size;
@ -397,26 +401,26 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
/* See build-id.h. */
const struct elf_build_id *
const struct bfd_build_id *
-build_id_bfd_get (bfd *abfd)
+build_id_bfd_shdr_get (bfd *abfd)
{
if (!bfd_check_format (abfd, bfd_object)
|| bfd_get_flavour (abfd) != bfd_target_elf_flavour
@@ -45,6 +97,348 @@ build_id_bfd_get (bfd *abfd)
return elf_tdata (abfd)->build_id;
if (!bfd_check_format (abfd, bfd_object))
return NULL;
@@ -42,6 +98,348 @@ build_id_bfd_get (bfd *abfd)
return NULL;
}
+/* Core files may have missing (corrupt) SHDR but PDHR is correct there.
+ bfd_elf_bfd_from_remote_memory () has too much overhead by
+ allocating/reading all the available ELF PT_LOADs. */
+
+static struct elf_build_id *
+static struct bfd_build_id *
+build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum,
+ Elf_Internal_Phdr *i_phdr)
+{
+ int i;
+ struct elf_build_id *retval = NULL;
+ struct bfd_build_id *retval = NULL;
+
+ for (i = 0; i < e_phnum; i++)
+ if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0)
@ -703,11 +707,11 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
+ }
+}
+
+struct elf_build_id *
+struct bfd_build_id *
+build_id_addr_get (CORE_ADDR addr)
+{
+ struct build_id_addr_sect *candidate;
+ struct elf_build_id *retval = NULL;
+ struct bfd_build_id *retval = NULL;
+ Elf_Internal_Phdr *i_phdr = NULL;
+ bfd_vma loadbase = 0;
+ unsigned e_phnum = 0;
@ -752,8 +756,8 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
/* See build-id.h. */
int
@@ -53,7 +447,7 @@ build_id_verify (bfd *abfd, size_t check
const struct elf_build_id *found;
@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check
const struct bfd_build_id *found;
int retval = 0;
- found = build_id_bfd_get (abfd);
@ -761,7 +765,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
@@ -68,20 +462,56 @@ build_id_verify (bfd *abfd, size_t check
@@ -65,20 +463,56 @@ build_id_verify (bfd *abfd, size_t check
return retval;
}
@ -822,12 +826,13 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
@@ -94,8 +524,11 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -91,9 +525,12 @@ build_id_to_debug_bfd (size_t build_id_l
size_t debugdir_len = strlen (debugdir);
const gdb_byte *data = build_id;
size_t size = build_id_len;
- char *s;
char *filename = NULL;
struct cleanup *inner;
+ unsigned seqno;
+ struct stat statbuf_trash;
+ /* Initialize it just to avoid a GCC false warning. */
@ -835,7 +840,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
memcpy (link, debugdir, debugdir_len);
s = &link[debugdir_len];
@@ -109,44 +542,282 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -107,47 +544,281 @@ build_id_to_debug_bfd (size_t build_id_l
*s++ = '/';
while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++);
@ -882,20 +887,22 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
+ continue;
+
+ /* We expect to be silent on the non-existing files. */
+ inner = make_cleanup (xfree, filename);
+ abfd = gdb_bfd_open (filename, gnutarget, -1);
+ if (abfd == NULL)
+ {
+ xfree (filename);
+ continue;
+ }
+ do_cleanups (inner);
- if (filename == NULL)
- continue;
+ if (abfd == NULL)
+ continue;
- /* We expect to be silent on the non-existing files. */
- inner = make_cleanup (xfree, filename);
- abfd = gdb_bfd_open (filename, gnutarget, -1);
- do_cleanups (inner);
+ if (build_id_verify (abfd, build_id_len, build_id))
+ break;
- /* We expect to be silent on the non-existing files. */
- abfd = gdb_bfd_open (filename, gnutarget, -1);
- if (abfd == NULL)
- continue;
+ gdb_bfd_unref (abfd);
@ -903,7 +910,6 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
- if (build_id_verify (abfd, build_id_len, build_id))
- break;
+ xfree (filename);
+ filename = NULL;
+ }
@ -961,7 +967,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
}
+char *
+build_id_to_filename (const struct elf_build_id *build_id, char **link_return)
+build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+{
+ bfd *abfd;
+ char *result;
@ -1118,7 +1124,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
+find_separate_debug_file_by_buildid (struct objfile *objfile,
+ char **build_id_filename_return)
{
const struct elf_build_id *build_id;
const struct bfd_build_id *build_id;
- build_id = build_id_bfd_get (objfile->obfd);
+ if (build_id_filename_return)
@ -1135,7 +1141,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd),
@@ -166,3 +837,21 @@ find_separate_debug_file_by_buildid (str
@@ -167,3 +838,21 @@ find_separate_debug_file_by_buildid (str
}
return NULL;
}
@ -1157,10 +1163,10 @@ Index: gdb-7.9.50.20150520/gdb/build-id.c
+
+ observer_attach_executable_changed (debug_print_executable_changed);
+}
Index: gdb-7.9.50.20150520/gdb/build-id.h
Index: gdb-7.9.90.20150709/gdb/build-id.h
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/build-id.h 2015-05-31 16:38:55.149112418 +0200
+++ gdb-7.9.50.20150520/gdb/build-id.h 2015-05-31 16:38:57.618130491 +0200
--- gdb-7.9.90.20150709.orig/gdb/build-id.h 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/build-id.h 2015-07-09 22:05:42.072222849 +0200
@@ -20,9 +20,10 @@
#ifndef BUILD_ID_H
#define BUILD_ID_H
@ -1169,8 +1175,8 @@ Index: gdb-7.9.50.20150520/gdb/build-id.h
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
-extern const struct elf_build_id *build_id_bfd_get (bfd *abfd);
+extern const struct elf_build_id *build_id_bfd_shdr_get (bfd *abfd);
-extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
+extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd);
/* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
Otherwise, issue a warning and return false. */
@ -1182,7 +1188,7 @@ Index: gdb-7.9.50.20150520/gdb/build-id.h
+ const bfd_byte *build_id, char **link_return,
+ int add_debug_suffix);
+
+extern char *build_id_to_filename (const struct elf_build_id *build_id,
+extern char *build_id_to_filename (const struct bfd_build_id *build_id,
+ char **link_return);
/* Find the separate debug file for OBJFILE, by using the build-id
@ -1195,11 +1201,11 @@ Index: gdb-7.9.50.20150520/gdb/build-id.h
+ char **build_id_filename_return);
#endif /* BUILD_ID_H */
Index: gdb-7.9.50.20150520/gdb/dwarf2read.c
Index: gdb-7.9.90.20150709/gdb/dwarf2read.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/dwarf2read.c 2015-05-31 16:38:55.156112469 +0200
+++ gdb-7.9.50.20150520/gdb/dwarf2read.c 2015-05-31 16:38:57.623130528 +0200
@@ -2504,7 +2504,7 @@ dwarf2_get_dwz_file (void)
--- gdb-7.9.90.20150709.orig/gdb/dwarf2read.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/dwarf2read.c 2015-07-09 22:05:42.077222891 +0200
@@ -2507,7 +2507,7 @@ dwarf2_get_dwz_file (void)
}
if (dwz_bfd == NULL)
@ -1208,11 +1214,11 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c
if (dwz_bfd == NULL)
error (_("could not find '.gnu_debugaltlink' file for %s"),
Index: gdb-7.9.50.20150520/gdb/python/py-objfile.c
Index: gdb-7.9.90.20150709/gdb/python/py-objfile.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/python/py-objfile.c 2015-05-31 16:38:55.157112476 +0200
+++ gdb-7.9.50.20150520/gdb/python/py-objfile.c 2015-05-31 16:38:57.623130528 +0200
@@ -140,7 +140,7 @@ objfpy_get_build_id (PyObject *self, voi
--- gdb-7.9.90.20150709.orig/gdb/python/py-objfile.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/python/py-objfile.c 2015-07-09 22:05:42.077222891 +0200
@@ -139,7 +139,7 @@ objfpy_get_build_id (PyObject *self, voi
TRY
{
@ -1221,7 +1227,7 @@ Index: gdb-7.9.50.20150520/gdb/python/py-objfile.c
}
CATCH (except, RETURN_MASK_ALL)
{
@@ -549,7 +549,7 @@ objfpy_lookup_objfile_by_build_id (const
@@ -548,7 +548,7 @@ objfpy_lookup_objfile_by_build_id (const
/* Don't return separate debug files. */
if (objfile->separate_debug_objfile_backlink != NULL)
continue;
@ -1230,3 +1236,16 @@ Index: gdb-7.9.50.20150520/gdb/python/py-objfile.c
if (obfd_build_id == NULL)
continue;
if (objfpy_build_id_matches (obfd_build_id, build_id))
Index: gdb-7.9.90.20150709/gdb/coffread.c
===================================================================
--- gdb-7.9.90.20150709.orig/gdb/coffread.c 2015-07-09 22:05:20.988044312 +0200
+++ gdb-7.9.90.20150709/gdb/coffread.c 2015-07-09 22:05:42.078222899 +0200
@@ -739,7 +739,7 @@ coff_symfile_read (struct objfile *objfi
{
char *debugfile;
- debugfile = find_separate_debug_file_by_buildid (objfile);
+ debugfile = find_separate_debug_file_by_buildid (objfile, NULL);
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);

View File

@ -1,7 +1,7 @@
Index: gdb-7.9.50.20150520/gdb/gdb_bfd.c
Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/gdb_bfd.c 2015-05-31 17:02:57.742303086 +0200
+++ gdb-7.9.50.20150520/gdb/gdb_bfd.c 2015-05-31 17:03:20.145444480 +0200
--- gdb-7.9.90.20150709.orig/gdb/gdb_bfd.c 2015-07-09 18:23:59.344017882 +0200
+++ gdb-7.9.90.20150709/gdb/gdb_bfd.c 2015-07-09 18:24:06.986083071 +0200
@@ -24,12 +24,14 @@
#include "hashtab.h"
#include "filestuff.h"
@ -16,8 +16,8 @@ Index: gdb-7.9.50.20150520/gdb/gdb_bfd.c
+#endif
#include "target.h"
#include "gdb/fileio.h"
@@ -408,6 +410,7 @@ free_one_bfd_section (bfd *abfd, asectio
#include "inferior.h"
@@ -397,6 +399,7 @@ free_one_bfd_section (bfd *abfd, asectio
if (sect != NULL && sect->data != NULL)
{
@ -25,7 +25,7 @@ Index: gdb-7.9.50.20150520/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (sect->map_addr != NULL)
{
@@ -418,6 +421,7 @@ free_one_bfd_section (bfd *abfd, asectio
@@ -407,6 +410,7 @@ free_one_bfd_section (bfd *abfd, asectio
}
else
#endif
@ -33,7 +33,7 @@ Index: gdb-7.9.50.20150520/gdb/gdb_bfd.c
xfree (sect->data);
}
}
@@ -569,6 +573,7 @@ gdb_bfd_map_section (asection *sectp, bf
@@ -558,6 +562,7 @@ gdb_bfd_map_section (asection *sectp, bf
if (descriptor->data != NULL)
goto done;
@ -41,7 +41,7 @@ Index: gdb-7.9.50.20150520/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (!bfd_is_section_compressed (abfd, sectp))
{
@@ -603,6 +608,7 @@ gdb_bfd_map_section (asection *sectp, bf
@@ -592,6 +597,7 @@ gdb_bfd_map_section (asection *sectp, bf
}
}
#endif /* HAVE_MMAP */

View File

@ -37,13 +37,13 @@ gdb/gdbserver/
(linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace.
Index: gdb-7.9.50.20150520/gdb/nat/linux-ptrace.c
Index: gdb-7.9.90.20150709/gdb/nat/linux-ptrace.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/nat/linux-ptrace.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/nat/linux-ptrace.c 2015-05-31 18:17:19.584046540 +0200
@@ -25,6 +25,10 @@
#include <stdint.h>
--- gdb-7.9.90.20150709.orig/gdb/nat/linux-ptrace.c 2015-07-09 18:24:13.705140384 +0200
+++ gdb-7.9.90.20150709/gdb/nat/linux-ptrace.c 2015-07-09 18:24:24.911235973 +0200
@@ -23,6 +23,10 @@
#include "buffer.h"
#include "gdb_wait.h"
+#ifdef HAVE_SELINUX_SELINUX_H
+# include <selinux/selinux.h>
@ -52,7 +52,7 @@ Index: gdb-7.9.50.20150520/gdb/nat/linux-ptrace.c
/* Stores the ptrace options supported by the running kernel.
A value of -1 means we did not check for features yet. A value
of 0 means there are no supported features. */
@@ -49,6 +53,8 @@ linux_ptrace_attach_fail_reason (pid_t p
@@ -47,6 +51,8 @@ linux_ptrace_attach_fail_reason (pid_t p
buffer_xml_printf (buffer, _("process %d is a zombie "
"- the process has already terminated"),
(int) pid);
@ -61,7 +61,7 @@ Index: gdb-7.9.50.20150520/gdb/nat/linux-ptrace.c
}
/* See linux-ptrace.h. */
@@ -583,6 +589,22 @@ linux_ptrace_init_warnings (void)
@@ -581,6 +587,22 @@ linux_ptrace_init_warnings (void)
linux_ptrace_test_ret_to_nx ();
}
@ -84,11 +84,11 @@ Index: gdb-7.9.50.20150520/gdb/nat/linux-ptrace.c
/* Extract extended ptrace event from wait status. */
int
Index: gdb-7.9.50.20150520/gdb/nat/linux-ptrace.h
Index: gdb-7.9.90.20150709/gdb/nat/linux-ptrace.h
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/nat/linux-ptrace.h 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/nat/linux-ptrace.h 2015-05-31 18:17:19.584046540 +0200
@@ -149,6 +149,7 @@ extern void linux_ptrace_attach_fail_rea
--- gdb-7.9.90.20150709.orig/gdb/nat/linux-ptrace.h 2015-07-09 18:24:13.706140392 +0200
+++ gdb-7.9.90.20150709/gdb/nat/linux-ptrace.h 2015-07-09 18:24:24.912235981 +0200
@@ -157,6 +157,7 @@ extern void linux_ptrace_attach_fail_rea
extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
extern void linux_ptrace_init_warnings (void);
@ -96,11 +96,11 @@ Index: gdb-7.9.50.20150520/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.9.50.20150520/gdb/configure.ac
Index: gdb-7.9.90.20150709/gdb/configure.ac
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/configure.ac 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/configure.ac 2015-05-31 18:17:19.585046546 +0200
@@ -2130,6 +2130,10 @@ case $host_os in
--- gdb-7.9.90.20150709.orig/gdb/configure.ac 2015-07-09 18:24:13.707140401 +0200
+++ gdb-7.9.90.20150709/gdb/configure.ac 2015-07-09 18:24:24.913235990 +0200
@@ -2150,6 +2150,10 @@ case $host_os in
esac
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
@ -111,10 +111,10 @@ Index: gdb-7.9.50.20150520/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.9.50.20150520/gdb/gdbserver/configure.ac
Index: gdb-7.9.90.20150709/gdb/gdbserver/configure.ac
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/configure.ac 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/configure.ac 2015-05-31 18:17:19.585046546 +0200
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/configure.ac 2015-07-09 18:24:13.707140401 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/configure.ac 2015-07-09 18:24:24.913235990 +0200
@@ -499,6 +499,10 @@ if $want_ipa ; then
fi
fi
@ -126,11 +126,11 @@ Index: gdb-7.9.50.20150520/gdb/gdbserver/configure.ac
AC_SUBST(GDBSERVER_DEPFILES)
AC_SUBST(GDBSERVER_LIBS)
AC_SUBST(srv_xmlbuiltin)
Index: gdb-7.9.50.20150520/gdb/gdbserver/linux-low.c
Index: gdb-7.9.90.20150709/gdb/gdbserver/linux-low.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/linux-low.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/linux-low.c 2015-05-31 18:17:19.587046558 +0200
@@ -749,6 +749,29 @@ add_lwp (ptid_t ptid)
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/linux-low.c 2015-07-09 18:24:13.709140418 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/linux-low.c 2015-07-09 18:24:24.914235998 +0200
@@ -755,6 +755,29 @@ add_lwp (ptid_t ptid)
return lwp;
}
@ -160,7 +160,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbserver/linux-low.c
/* Start an inferior process and returns its pid.
ALLARGS is a vector of program-name and args. */
@@ -772,7 +795,7 @@ linux_create_inferior (char *program, ch
@@ -778,7 +801,7 @@ linux_create_inferior (char *program, ch
if (pid == 0)
{
close_most_fds ();
@ -169,10 +169,10 @@ Index: gdb-7.9.50.20150520/gdb/gdbserver/linux-low.c
#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */
signal (__SIGRTMIN + 1, SIG_DFL);
Index: gdb-7.9.50.20150520/gdb/inf-ptrace.c
Index: gdb-7.9.90.20150709/gdb/inf-ptrace.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/inf-ptrace.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/inf-ptrace.c 2015-05-31 18:17:19.588046565 +0200
--- gdb-7.9.90.20150709.orig/gdb/inf-ptrace.c 2015-07-09 18:24:13.710140426 +0200
+++ gdb-7.9.90.20150709/gdb/inf-ptrace.c 2015-07-09 18:24:24.915236007 +0200
@@ -79,7 +79,15 @@ static void
inf_ptrace_me (void)
{
@ -189,11 +189,11 @@ Index: gdb-7.9.50.20150520/gdb/inf-ptrace.c
}
/* Start a new inferior Unix child process. EXEC_FILE is the file to
Index: gdb-7.9.50.20150520/gdb/linux-nat.c
Index: gdb-7.9.90.20150709/gdb/linux-nat.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/linux-nat.c 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/linux-nat.c 2015-05-31 18:17:56.214272683 +0200
@@ -1179,6 +1179,7 @@ linux_nat_create_inferior (struct target
--- gdb-7.9.90.20150709.orig/gdb/linux-nat.c 2015-07-09 18:24:13.712140443 +0200
+++ gdb-7.9.90.20150709/gdb/linux-nat.c 2015-07-09 18:24:24.916236015 +0200
@@ -1184,6 +1184,7 @@ linux_nat_create_inferior (struct target
{
struct cleanup *restore_personality
= maybe_disable_address_space_randomization (disable_randomization);
@ -201,7 +201,7 @@ Index: gdb-7.9.50.20150520/gdb/linux-nat.c
/* The fork_child mechanism is synchronous and calls target_wait, so
we have to mask the async mode. */
@@ -1186,7 +1187,28 @@ linux_nat_create_inferior (struct target
@@ -1191,7 +1192,28 @@ linux_nat_create_inferior (struct target
/* Make sure we report all signals during startup. */
linux_nat_pass_signals (ops, 0, NULL);
@ -231,11 +231,11 @@ Index: gdb-7.9.50.20150520/gdb/linux-nat.c
do_cleanups (restore_personality);
}
Index: gdb-7.9.50.20150520/gdb/config.in
Index: gdb-7.9.90.20150709/gdb/config.in
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/config.in 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/config.in 2015-05-31 18:17:19.589046571 +0200
@@ -261,6 +261,9 @@
--- gdb-7.9.90.20150709.orig/gdb/config.in 2015-07-09 18:24:13.713140452 +0200
+++ gdb-7.9.90.20150709/gdb/config.in 2015-07-09 18:24:24.916236015 +0200
@@ -264,6 +264,9 @@
/* Define if librpm library is being used. */
#undef HAVE_LIBRPM
@ -245,7 +245,7 @@ Index: gdb-7.9.50.20150520/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
@@ -393,6 +396,9 @@
@@ -396,6 +399,9 @@
/* Define to 1 if you have the `scm_new_smob' function. */
#undef HAVE_SCM_NEW_SMOB
@ -255,11 +255,11 @@ Index: gdb-7.9.50.20150520/gdb/config.in
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
Index: gdb-7.9.50.20150520/gdb/configure
Index: gdb-7.9.90.20150709/gdb/configure
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/configure 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/configure 2015-05-31 18:17:19.594046602 +0200
@@ -13730,6 +13730,64 @@ cat >>confdefs.h <<_ACEOF
--- gdb-7.9.90.20150709.orig/gdb/configure 2015-07-09 18:24:13.718140495 +0200
+++ gdb-7.9.90.20150709/gdb/configure 2015-07-09 18:24:24.920236049 +0200
@@ -14228,6 +14228,64 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
@ -324,10 +324,10 @@ Index: gdb-7.9.50.20150520/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.9.50.20150520/gdb/gdbserver/config.in
Index: gdb-7.9.90.20150709/gdb/gdbserver/config.in
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/config.in 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/config.in 2015-05-31 18:17:19.594046602 +0200
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/config.in 2015-07-09 18:24:13.719140503 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/config.in 2015-07-09 18:24:24.920236049 +0200
@@ -113,6 +113,9 @@
/* Define to 1 if you have the `mcheck' library (-lmcheck). */
#undef HAVE_LIBMCHECK
@ -338,9 +338,9 @@ Index: gdb-7.9.50.20150520/gdb/gdbserver/config.in
/* Define if the target supports branch tracing. */
#undef HAVE_LINUX_BTRACE
@@ -186,6 +189,9 @@
/* Define to 1 if you have the `pwrite' function. */
#undef HAVE_PWRITE
@@ -189,6 +192,9 @@
/* Define to 1 if you have the `setns' function. */
#undef HAVE_SETNS
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
+#undef HAVE_SELINUX_SELINUX_H
@ -348,10 +348,10 @@ Index: gdb-7.9.50.20150520/gdb/gdbserver/config.in
/* Define to 1 if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
Index: gdb-7.9.50.20150520/gdb/gdbserver/configure
Index: gdb-7.9.90.20150709/gdb/gdbserver/configure
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/gdbserver/configure 2015-05-31 18:16:54.348890746 +0200
+++ gdb-7.9.50.20150520/gdb/gdbserver/configure 2015-05-31 18:17:19.596046614 +0200
--- gdb-7.9.90.20150709.orig/gdb/gdbserver/configure 2015-07-09 18:24:13.721140520 +0200
+++ gdb-7.9.90.20150709/gdb/gdbserver/configure 2015-07-09 18:24:24.922236066 +0200
@@ -7022,6 +7022,64 @@ if $want_ipa ; then
fi
fi

View File

@ -1,20 +1,20 @@
Index: gdb-7.9.50.20150520/gdb/config/i386/linux64.mh
Index: gdb-7.9.90.20150709/gdb/config/i386/linux64.mh
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/config/i386/linux64.mh 2015-05-31 16:59:34.258018827 +0200
+++ gdb-7.9.50.20150520/gdb/config/i386/linux64.mh 2015-05-31 16:59:47.779104163 +0200
--- gdb-7.9.90.20150709.orig/gdb/config/i386/linux64.mh 2015-07-09 18:23:32.173786118 +0200
+++ gdb-7.9.90.20150709/gdb/config/i386/linux64.mh 2015-07-09 18:23:51.823953736 +0200
@@ -7,7 +7,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
linux-procfs.o linux-ptrace.o linux-btrace.o \
linux-waitpid.o linux-personality.o x86-linux.o \
x86-linux-dregs.o
x86-linux-dregs.o linux-namespaces.o
-NAT_FILE= config/nm-linux.h
+NAT_FILE= nm-linux64.h
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
Index: gdb-7.9.50.20150520/gdb/config/i386/linux.mh
Index: gdb-7.9.90.20150709/gdb/config/i386/linux.mh
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/config/i386/linux.mh 2015-05-31 16:56:12.869747796 +0200
+++ gdb-7.9.50.20150520/gdb/config/i386/linux.mh 2015-05-31 16:59:34.259018833 +0200
--- gdb-7.9.90.20150709.orig/gdb/config/i386/linux.mh 2015-07-09 18:23:30.527772078 +0200
+++ gdb-7.9.90.20150709/gdb/config/i386/linux.mh 2015-07-09 18:23:32.174786127 +0200
@@ -1,6 +1,6 @@
# Host: Intel 386 running GNU/Linux.
@ -23,10 +23,10 @@ Index: gdb-7.9.50.20150520/gdb/config/i386/linux.mh
NATDEPFILES= inf-ptrace.o fork-child.o \
x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
proc-service.o linux-thread-db.o \
Index: gdb-7.9.50.20150520/gdb/config/i386/nm-linux.h
Index: gdb-7.9.90.20150709/gdb/config/i386/nm-linux.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/config/i386/nm-linux.h 2015-05-31 16:59:34.259018833 +0200
+++ gdb-7.9.90.20150709/gdb/config/i386/nm-linux.h 2015-07-09 18:23:32.174786127 +0200
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux i386.
+
@ -56,10 +56,10 @@ Index: gdb-7.9.50.20150520/gdb/config/i386/nm-linux.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.9.50.20150520/gdb/config/i386/nm-linux64.h
Index: gdb-7.9.90.20150709/gdb/config/i386/nm-linux64.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/config/i386/nm-linux64.h 2015-05-31 16:59:34.259018833 +0200
+++ gdb-7.9.90.20150709/gdb/config/i386/nm-linux64.h 2015-07-09 18:23:32.174786127 +0200
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux amd64.
+
@ -89,11 +89,11 @@ Index: gdb-7.9.50.20150520/gdb/config/i386/nm-linux64.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.9.50.20150520/gdb/target.h
Index: gdb-7.9.90.20150709/gdb/target.h
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/target.h 2015-05-31 16:59:34.260018839 +0200
+++ gdb-7.9.50.20150520/gdb/target.h 2015-05-31 17:00:11.067251143 +0200
@@ -1820,9 +1820,11 @@ extern char *target_thread_name (struct
--- gdb-7.9.90.20150709.orig/gdb/target.h 2015-07-09 18:23:30.528772086 +0200
+++ gdb-7.9.90.20150709/gdb/target.h 2015-07-09 18:23:32.175786135 +0200
@@ -1849,9 +1849,11 @@ extern char *target_thread_name (struct
CNT is the number of such watchpoints used so far, including this
one. OTHERTYPE is who knows what... */
@ -105,10 +105,10 @@ Index: gdb-7.9.50.20150520/gdb/target.h
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2015-05-31 16:59:34.261018846 +0200
+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2015-07-09 18:23:32.175786135 +0200
@@ -0,0 +1,40 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc.
+

View File

@ -1,284 +0,0 @@
Last year a patch was submitted/approved/commited to eliminate
symbol_matches_domain which was causing this problem. It was later reverted
because it introduced a (severe) performance regression.
Recap:
(gdb) list
1 enum e {A,B,C} e;
2 int main (void) { return 0; }
3
(gdb) p e
Attempt to use a type name as an expression
The parser attempts to find a symbol named "e" of VAR_DOMAIN.
This gets passed down through lookup_symbol and (eventually) into
block_lookup_symbol_primary, which iterates over the block's dictionary
of symbols:
for (sym = dict_iter_name_first (block->dict, name, &dict_iter);
sym != NULL;
sym = dict_iter_name_next (name, &dict_iter))
{
if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
SYMBOL_DOMAIN (sym), domain))
return sym;
}
The problem here is that we have a symbol named "e" in both STRUCT_DOMAIN
and VAR_DOMAIN, and for languages like C++, Java, and Ada, where a tag name
may be used as an implicit typedef of the type, symbol_matches_domain ignores
the difference between VAR_DOMAIN and STRUCT_DOMAIN. As it happens, the
STRUCT_DOMAIN symbol is found first, considered a match, and that symbol is
returned to the parser, eliciting the (now dreaded) error message.
Since this bug exists specifically because we have both STRUCT and VAR_DOMAIN
symbols in a given block/CU, this patch rather simply/naively changes
block_lookup_symbol_primary so that it continues to search for an exact
domain match on the symbol if symbol_matches_domain returns a symbol
which does not exactly match the requested domain.
This "fixes" the immediate problem, but admittedly might uncover other,
related bugs. [Paranoia?] However, it causes no regressions (functional
or performance) in the test suite.
I have also resurrected the tests from the previous submission. However
since we can still be given a matching symbol with a different domain than
requested, we cannot say that a symbol "was not found." The error messages
today will still be the (dreaded) "Attempt to use a type name..." I've
updated the tests to reflect this.
ChangeLog
PR 16253
* block.c (block_lookup_symbol_primary): If a symbol is found
which does not exactly match the requested domain, keep searching
for an exact match. Otherwise, return the previously found "best"
symbol.
testsuite/ChangeLog
PR 16253
* gdb.cp/var-tag.cc: New file.
* gdb.cp/var-tag.exp: New file.
---
gdb/ChangeLog | 8 ++++
gdb/block.c | 16 +++++--
gdb/testsuite/ChangeLog | 6 +++
gdb/testsuite/gdb.cp/var-tag.cc | 44 +++++++++++++++++++
gdb/testsuite/gdb.cp/var-tag.exp | 94 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 165 insertions(+), 3 deletions(-)
create mode 100644 gdb/testsuite/gdb.cp/var-tag.cc
create mode 100644 gdb/testsuite/gdb.cp/var-tag.exp
### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,3 +1,11 @@
+2015-06-11 Keith Seitz <keiths@redhat.com>
+
+ PR 16253
+ * block.c (block_lookup_symbol_primary): If a symbol is found
+ which does not exactly match the requested domain, keep searching
+ for an exact match. Otherwise, return the previously found "best"
+ symbol.
+
2015-06-11 Gary Benson <gbenson@redhat.com>
* nat/linux-namespaces.c (mnsh_send_message): Use pulongest.
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -779,23 +779,33 @@ struct symbol *
block_lookup_symbol_primary (const struct block *block, const char *name,
const domain_enum domain)
{
- struct symbol *sym;
+ struct symbol *sym, *other;
struct dict_iterator dict_iter;
/* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */
gdb_assert (BLOCK_SUPERBLOCK (block) == NULL
|| BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL);
+ other = NULL;
for (sym = dict_iter_name_first (block->dict, name, &dict_iter);
sym != NULL;
sym = dict_iter_name_next (name, &dict_iter))
{
+ if (SYMBOL_DOMAIN (sym) == domain)
+ return sym;
+
+ /* This is a bit of a hack, but symbol_matches_domain might ignore
+ STRUCT vs VAR domain symbols. So if a matching symbol is found, make
+ sure there is no "better" matching symbol, i.e., one with
+ exactly the same domain. */
if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
SYMBOL_DOMAIN (sym), domain))
- return sym;
+ {
+ other = sym;
+ }
}
- return NULL;
+ return other;
}
/* See block.h. */
### a/gdb/testsuite/ChangeLog
### b/gdb/testsuite/ChangeLog
## -1,3 +1,9 @@
+2015-06-11 Keith Seitz <keiths@redhat.com>
+
+ PR 16253
+ * gdb.cp/var-tag.cc: New file.
+ * gdb.cp/var-tag.exp: New file.
+
2015-06-10 Walfred Tedeschi <walfred.tedeschi@intel.com>
Mircea Gherzan <mircea.gherzan@intel.com>
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/var-tag.cc
@@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2014 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int global = 3;
+
+class C {
+public:
+ struct C1 {} C1;
+ enum E1 {a1, b1, c1} E1;
+ union U1 {int a1; char b1;} U1;
+
+ C () : E1 (b1) {}
+ void global (void) const {}
+ int f (void) const { global (); return 0; }
+} C;
+
+struct S {} S;
+enum E {a, b, c} E;
+union U {int a; char b;} U;
+
+class CC {} cc;
+struct SS {} ss;
+enum EE {ea, eb, ec} ee;
+union UU {int aa; char bb;} uu;
+
+int
+main (void)
+{
+ return C.f ();
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/var-tag.exp
@@ -0,0 +1,94 @@
+# Copyright 2014, 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite
+
+# Test expressions in which variable names shadow tag names.
+
+if {[skip_cplus_tests]} { continue }
+
+standard_testfile .cc
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+ return -1
+}
+
+proc do_global_tests {lang} {
+ set invalid_print "Attempt to use a type name as an expression"
+ set ptypefmt "type = (class|enum|union|struct) %s {.*}"
+
+ with_test_prefix $lang {
+ gdb_test_no_output "set language $lang"
+ gdb_test "ptype C" "type = class C {.*}"
+ gdb_test "print E" "= a"
+ gdb_test "ptype E" "type = enum E {.*}"
+ gdb_test "print S" "= {<No data fields>}"
+ gdb_test "ptype S" "type = struct S {.*}"
+ gdb_test "print U" "= {.*}"
+ gdb_test "ptype U" "type = union U {.*}"
+ gdb_test "print cc" "= {.*}"
+ gdb_test "ptype cc" "type = class CC {.*}"
+ gdb_test "print CC" [format $invalid_print "CC"]
+ gdb_test "ptype CC" [format $ptypefmt "CC"]
+ gdb_test "print ss" "= {<No data fields>}"
+ gdb_test "ptype ss" "type = struct SS {.*}"
+ gdb_test "print SS" [format $invalid_print "SS"]
+ gdb_test "ptype SS" [format $ptypefmt "SS"]
+ gdb_test "print ee" "= .*"
+ gdb_test "ptype ee" "type = enum EE {.*}"
+ gdb_test "print EE" [format $invalid_print "EE"]
+ gdb_test "ptype EE" [format $ptypefmt "EE"]
+ gdb_test "print uu" "= {.*}"
+ gdb_test "ptype uu" "type = union UU {.*}"
+ gdb_test "print UU" [format $invalid_print "UU"]
+ gdb_test "ptype UU" [format $ptypefmt "UU"]
+ }
+}
+
+# First test expressions when there is no context.
+with_test_prefix "before start" {
+ do_global_tests c++
+ do_global_tests c
+}
+
+# Run to main and test again.
+if {![runto_main]} {
+ perror "couldn't run to main"
+ continue
+}
+
+with_test_prefix "in main" {
+ do_global_tests c++
+ do_global_tests c
+}
+
+# Finally run to C::f and test again
+gdb_breakpoint "C::f"
+gdb_continue_to_breakpoint "continue to C::f"
+with_test_prefix "in C::f" {
+ do_global_tests c++
+ do_global_tests c
+}
+
+# Another hard-to-guess-the-users-intent bug...
+# It would be really nice if we could query the user!
+with_test_prefix "global collision" {
+ gdb_test_no_output "set language c++"
+ setup_kfail "c++/16463" "*-*-*"
+ gdb_test "print global" "= 3"
+
+ # ... with a simple workaround:
+ gdb_test "print ::global" "= 3"
+}
--
2.1.0

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
From decf8d9a5f91912768d52cd075b6a25617a90d1c Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Thu, 2 Jul 2015 22:39:57 +0200
Subject: [PATCH] Fix GCC false warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
At least on
gcc-4.4.7-11.el6.i686
./configure --enable-64-bit-bfd --enable-targets=all
GDB does not build due to:
cc1: warnings being treated as errors
s390-linux-tdep.c: In function s390_handle_arg:
s390-linux-tdep.c:2575: error: val may be used uninitialized in this function
gdb/ChangeLog
2015-07-02 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix GCC false warning.
* s390-linux-tdep.c (s390_handle_arg): Initialize VAL.
---
gdb/ChangeLog | 5 +++++
gdb/s390-linux-tdep.c | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,3 +1,8 @@
+2015-07-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix GCC false warning.
+ * s390-linux-tdep.c (s390_handle_arg): Initialize VAL.
+
2015-07-02 Yao Qi <yao.qi@linaro.org>
* aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint): Fix
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -2572,7 +2572,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
}
else if (s390_function_arg_integer (type) && length <= word_size)
{
- ULONGEST val;
+ /* Initialize it just to avoid a GCC false warning. */
+ ULONGEST val = 0;
if (write_mode)
{
--
2.1.0

View File

@ -18,15 +18,15 @@ 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 20150531
%global snapsrc 20150709
# See timestamp of source gnulib installed into gdb/gnulib/ .
%global snapgnulib 20121213
%global tarname gdb-%{version}
Version: 7.9.50.%{snapsrc}
Version: 7.9.90.%{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: 5%{?dist}
Release: 6%{?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
@ -216,7 +216,7 @@ 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
@ -513,9 +513,6 @@ Patch927: gdb-python-gil.patch
# Fix jit-reader.h for multi-lib.
Patch978: gdb-jit-reader-multilib.patch
# Fix enum e e 'Attempt to use a type name as an expr.' (Keith Seitz, PR 16253).
Patch991: gdb-cxx-enum-tag.patch
# Fix 'info type-printers' Python error (Clem Dickey, RH BZ 1085576).
Patch992: gdb-type-printers-error.patch
@ -700,7 +697,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
@ -804,7 +801,6 @@ find -name "*.info*"|xargs rm -f
%patch925 -p1
%patch927 -p1
%patch978 -p1
%patch991 -p1
%patch992 -p1
%patch848 -p1
@ -1314,6 +1310,9 @@ then
fi
%changelog
* Fri Jul 10 2015 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.9.90.20150709-6.fc23
- Rebase to FSF GDB 7.9.90.20150709 (7.10 branch snapshot).
* Tue Jul 7 2015 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.9.50.20150531-5.fc23
- Upgrade libstdc++-v3-python to r225521 (RH BZ 1239290).

View File

@ -1,2 +1,2 @@
7ad32d3894aaf90d00a4343a735c3e1c gdb-libstdc++-v3-python-r225521.tar.xz
394dfbd87607c75e5c61f3e28105be54 gdb-7.9.50.20150531.tar.xz
da95e5ff2f5f50fb9d951c01c6f652fe gdb-7.9.90.20150709.tar.xz