Rebase to FSF GDB 7.9.50.20150531 (pre-7.10 trunk snapshot).

This commit is contained in:
Jan Kratochvil 2015-05-31 20:47:21 +02:00
commit 32f92b2e34
32 changed files with 1228 additions and 2609 deletions

View file

@ -1,7 +1,7 @@
Index: gdb-7.8.50.20141228/gdb/corelow.c
Index: gdb-7.9.50.20150520/gdb/corelow.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/corelow.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/corelow.c 2015-01-03 23:12:08.691349454 +0100
--- 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
@@ -45,6 +45,10 @@
#include "gdb_bfd.h"
#include "completer.h"
@ -67,7 +67,7 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */
static void
@@ -405,6 +456,14 @@ core_open (const char *arg, int from_tty
@@ -404,6 +455,14 @@ core_open (const char *arg, int from_tty
switch_to_thread (thread->ptid);
}
@ -82,7 +82,7 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
post_create_inferior (&core_ops, from_tty);
/* Now go through the target stack looking for threads since there
@@ -1035,4 +1094,11 @@ _initialize_corelow (void)
@@ -1058,4 +1117,11 @@ _initialize_corelow (void)
init_core_ops ();
add_target_with_completer (&core_ops, filename_completer);
@ -94,11 +94,11 @@ Index: gdb-7.8.50.20141228/gdb/corelow.c
+ NULL, NULL, NULL,
+ &setlist, &showlist);
}
Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
Index: gdb-7.9.50.20150520/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/doc/gdb.texinfo 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/doc/gdb.texinfo 2015-01-03 23:12:08.701349509 +0100
@@ -17930,6 +17930,27 @@ information files.
--- 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.
@end table
@ -126,10 +126,10 @@ Index: gdb-7.8.50.20141228/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.8.50.20141228/gdb/solib-svr4.c
Index: gdb-7.9.50.20150520/gdb/solib-svr4.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/solib-svr4.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/solib-svr4.c 2015-01-03 23:12:08.702349514 +0100
--- 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
@@ -45,6 +45,7 @@
#include "auxv.h"
#include "gdb_bfd.h"
@ -138,22 +138,22 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
@@ -1366,9 +1367,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
@@ -1379,9 +1380,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
continue;
}
- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (new->so_original_name, new->so_name);
- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (newobj->so_original_name, newobj->so_name);
+ {
+ struct elf_build_id *build_id;
+
+ strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ /* May get overwritten below. */
+ strcpy (new->so_name, new->so_original_name);
+ strcpy (newobj->so_name, newobj->so_original_name);
+
+ build_id = build_id_addr_get (new->lm_info->l_ld);
+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
+ if (build_id != NULL)
+ {
+ char *name, *build_id_filename;
@ -163,13 +163,13 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
+ name = build_id_to_filename (build_id, &build_id_filename);
+ if (name != NULL)
+ {
+ strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ xfree (name);
+ }
+ else
+ {
+ debug_print_missing (new->so_name, build_id_filename);
+ debug_print_missing (newobj->so_name, build_id_filename);
+
+ /* In the case the main executable was found according to
+ its build-id (from a core file) prevent loading
@ -183,7 +183,7 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
+ if (symfile_objfile != NULL
+ && (symfile_objfile->flags
+ & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ new->so_name[0] = 0;
+ newobj->so_name[0] = 0;
+ }
+
+ xfree (build_id_filename);
@ -194,11 +194,11 @@ Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
xfree (buffer);
/* If this entry has no name, or its name matches the name
Index: gdb-7.8.50.20141228/gdb/elfread.c
Index: gdb-7.9.50.20150520/gdb/elfread.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/elfread.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/elfread.c 2015-01-03 23:12:08.703349519 +0100
@@ -1339,9 +1339,10 @@ elf_symfile_read (struct objfile *objfil
--- 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
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@ -211,7 +211,7 @@ Index: gdb-7.8.50.20141228/gdb/elfread.c
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1355,6 +1356,12 @@ elf_symfile_read (struct objfile *objfil
@@ -1357,6 +1358,12 @@ elf_symfile_read (struct objfile *objfil
symbol_file_add_separate (abfd, debugfile, symfile_flags, objfile);
do_cleanups (cleanup);
}
@ -224,11 +224,11 @@ Index: gdb-7.8.50.20141228/gdb/elfread.c
}
}
Index: gdb-7.8.50.20141228/gdb/symfile.h
Index: gdb-7.9.50.20150520/gdb/symfile.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/symfile.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.h 2015-01-03 23:12:08.703349519 +0100
@@ -574,6 +574,10 @@ void expand_symtabs_matching (expand_sym
--- 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
@@ -584,6 +584,10 @@ void expand_symtabs_matching (expand_sym
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
@ -239,11 +239,11 @@ Index: gdb-7.8.50.20141228/gdb/symfile.h
/* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/gdb.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp 2015-01-03 23:12:08.704349525 +0100
@@ -1522,6 +1522,16 @@ proc default_gdb_start { } {
--- 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
@@ -1573,6 +1573,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
}
@ -260,10 +260,10 @@ Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
return 0
}
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/mi-support.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp 2015-01-03 23:12:08.705349530 +0100
--- 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
@@ -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.8.50.20141228/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.8.50.20141228/gdb/objfiles.h
Index: gdb-7.9.50.20150520/gdb/objfiles.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/objfiles.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/objfiles.h 2015-01-03 23:12:08.705349530 +0100
--- 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
@@ -459,6 +459,10 @@ struct objfile
#define OBJF_NOT_FILENAME (1 << 6)
@ -296,10 +296,10 @@ Index: gdb-7.8.50.20141228/gdb/objfiles.h
/* Declarations for functions defined in objfiles.c */
extern struct objfile *allocate_objfile (bfd *, const char *name, int);
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp
Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.base/corefile.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/gdb.base/corefile.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp 2015-01-03 23:12:08.705349530 +0100
--- 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
@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile"
pass $test
}
@ -334,14 +334,14 @@ Index: gdb-7.8.50.20141228/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.8.50.20141228/gdb/build-id.c
Index: gdb-7.9.50.20150520/gdb/build-id.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/build-id.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.c 2015-01-03 23:12:40.792523085 +0100
@@ -26,11 +26,64 @@
#include "symfile.h"
--- 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 @@
#include "objfiles.h"
#include "filenames.h"
#include "gdbcore.h"
+#include "libbfd.h"
+#include "gdbcore.h"
+#include "gdbcmd.h"
@ -359,8 +359,6 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
+ value);
+}
-/* See build-id.h. */
+/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
+
@ -389,23 +387,23 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ retval = xmalloc (sizeof *retval - 1 + size);
+ retval->size = size;
+ memcpy (retval->data, data, size);
+
+ return retval;
+ }
+ p = descdata + BFD_ALIGN (descsz, 4);
+ }
+ return NULL;
+}
+
+/* See build-id.h. */
+
/* See build-id.h. */
const struct elf_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
@@ -44,6 +97,348 @@ build_id_bfd_get (bfd *abfd)
@@ -45,6 +97,348 @@ build_id_bfd_get (bfd *abfd)
return elf_tdata (abfd)->build_id;
}
@ -754,7 +752,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
/* See build-id.h. */
int
@@ -52,7 +447,7 @@ build_id_verify (bfd *abfd, size_t check
@@ -53,7 +447,7 @@ build_id_verify (bfd *abfd, size_t check
const struct elf_build_id *found;
int retval = 0;
@ -763,7 +761,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
@@ -67,20 +462,56 @@ build_id_verify (bfd *abfd, size_t check
@@ -68,20 +462,56 @@ build_id_verify (bfd *abfd, size_t check
return retval;
}
@ -824,7 +822,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
@@ -93,8 +524,11 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -94,8 +524,11 @@ 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;
@ -837,7 +835,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
memcpy (link, debugdir, debugdir_len);
s = &link[debugdir_len];
@@ -108,44 +542,282 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -109,44 +542,282 @@ build_id_to_debug_bfd (size_t build_id_l
*s++ = '/';
while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++);
@ -884,7 +882,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ continue;
+
+ /* We expect to be silent on the non-existing files. */
+ abfd = gdb_bfd_open_maybe_remote (filename);
+ abfd = gdb_bfd_open (filename, gnutarget, -1);
+ if (abfd == NULL)
+ {
+ xfree (filename);
@ -897,7 +895,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+ break;
- /* We expect to be silent on the non-existing files. */
- abfd = gdb_bfd_open_maybe_remote (filename);
- abfd = gdb_bfd_open (filename, gnutarget, -1);
- if (abfd == NULL)
- continue;
+ gdb_bfd_unref (abfd);
@ -1137,7 +1135,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd),
@@ -165,3 +837,21 @@ find_separate_debug_file_by_buildid (str
@@ -166,3 +837,21 @@ find_separate_debug_file_by_buildid (str
}
return NULL;
}
@ -1159,10 +1157,10 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
+
+ observer_attach_executable_changed (debug_print_executable_changed);
+}
Index: gdb-7.8.50.20141228/gdb/build-id.h
Index: gdb-7.9.50.20150520/gdb/build-id.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/build-id.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.h 2015-01-03 23:12:08.706349536 +0100
--- 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
@@ -20,9 +20,10 @@
#ifndef BUILD_ID_H
#define BUILD_ID_H
@ -1197,11 +1195,11 @@ Index: gdb-7.8.50.20141228/gdb/build-id.h
+ char **build_id_filename_return);
#endif /* BUILD_ID_H */
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
Index: gdb-7.9.50.20150520/gdb/dwarf2read.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/dwarf2read.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/dwarf2read.c 2015-01-03 23:12:08.711349563 +0100
@@ -2443,7 +2443,7 @@ dwarf2_get_dwz_file (void)
--- 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)
}
if (dwz_bfd == NULL)
@ -1210,20 +1208,20 @@ Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
if (dwz_bfd == NULL)
error (_("could not find '.gnu_debugaltlink' file for %s"),
Index: gdb-7.8.50.20141228/gdb/python/py-objfile.c
Index: gdb-7.9.50.20150520/gdb/python/py-objfile.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/python/py-objfile.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/python/py-objfile.c 2015-01-03 23:12:08.712349568 +0100
@@ -118,7 +118,7 @@ objfpy_get_build_id (PyObject *self, voi
--- 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
TRY_CATCH (except, RETURN_MASK_ALL)
TRY
{
- build_id = build_id_bfd_get (objfile->obfd);
+ build_id = build_id_bfd_shdr_get (objfile->obfd);
}
GDB_PY_HANDLE_EXCEPTION (except);
@@ -467,7 +467,7 @@ objfpy_lookup_objfile_by_build_id (const
CATCH (except, RETURN_MASK_ALL)
{
@@ -549,7 +549,7 @@ objfpy_lookup_objfile_by_build_id (const
/* Don't return separate debug files. */
if (objfile->separate_debug_objfile_backlink != NULL)
continue;