Rebase to pre-7.9 snapshot 7.8.50.20150108.

- Fix jit-reader.h for multi-lib.
This commit is contained in:
Jan Kratochvil 2015-01-08 21:53:17 +01:00
commit 2f7f533ae7
39 changed files with 2233 additions and 3918 deletions

View file

@ -1,8 +1,8 @@
Index: gdb-7.7.50.20140609/gdb/corelow.c
Index: gdb-7.8.50.20141228/gdb/corelow.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/corelow.c 2014-06-13 20:09:37.369745221 +0200
+++ gdb-7.7.50.20140609/gdb/corelow.c 2014-06-13 20:09:42.407750265 +0200
@@ -49,6 +49,10 @@
--- 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
@@ -45,6 +45,10 @@
#include "gdb_bfd.h"
#include "completer.h"
#include "filestuff.h"
@ -13,7 +13,7 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
@@ -272,6 +276,53 @@ add_to_thread_list (bfd *abfd, asection
@@ -266,6 +270,53 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = ptid; /* Yes, make it current. */
}
@ -67,7 +67,7 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */
static void
@@ -410,6 +461,14 @@ core_open (char *filename, int from_tty)
@@ -405,6 +456,14 @@ core_open (const char *arg, int from_tty
switch_to_thread (thread->ptid);
}
@ -82,7 +82,7 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
post_create_inferior (&core_ops, from_tty);
/* Now go through the target stack looking for threads since there
@@ -1029,4 +1088,11 @@ _initialize_corelow (void)
@@ -1035,4 +1094,11 @@ _initialize_corelow (void)
init_core_ops ();
add_target_with_completer (&core_ops, filename_completer);
@ -94,11 +94,11 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
+ NULL, NULL, NULL,
+ &setlist, &showlist);
}
Index: gdb-7.7.50.20140609/gdb/doc/gdb.texinfo
Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/doc/gdb.texinfo 2014-06-13 20:09:37.380745232 +0200
+++ gdb-7.7.50.20140609/gdb/doc/gdb.texinfo 2014-06-13 20:09:42.417750275 +0200
@@ -17547,6 +17547,27 @@ information files.
--- 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.
@end table
@ -126,19 +126,19 @@ Index: gdb-7.7.50.20140609/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.7.50.20140609/gdb/solib-svr4.c
Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/solib-svr4.c 2014-06-13 20:09:37.382745234 +0200
+++ gdb-7.7.50.20140609/gdb/solib-svr4.c 2014-06-13 20:09:42.418750276 +0200
@@ -48,6 +48,7 @@
#include "exceptions.h"
--- 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
@@ -45,6 +45,7 @@
#include "auxv.h"
#include "gdb_bfd.h"
#include "probe.h"
+#include "build-id.h"
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
@@ -1369,9 +1370,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
@@ -1366,9 +1367,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
continue;
}
@ -194,11 +194,11 @@ Index: gdb-7.7.50.20140609/gdb/solib-svr4.c
xfree (buffer);
/* If this entry has no name, or its name matches the name
Index: gdb-7.7.50.20140609/gdb/elfread.c
Index: gdb-7.8.50.20141228/gdb/elfread.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/elfread.c 2014-06-13 20:09:37.383745235 +0200
+++ gdb-7.7.50.20140609/gdb/elfread.c 2014-06-13 20:09:42.418750276 +0200
@@ -1335,9 +1335,10 @@ elf_symfile_read (struct objfile *objfil
--- 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
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@ -211,7 +211,7 @@ Index: gdb-7.7.50.20140609/gdb/elfread.c
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1351,6 +1352,12 @@ elf_symfile_read (struct objfile *objfil
@@ -1355,6 +1356,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.7.50.20140609/gdb/elfread.c
}
}
Index: gdb-7.7.50.20140609/gdb/symfile.h
Index: gdb-7.8.50.20141228/gdb/symfile.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/symfile.h 2014-06-13 20:09:42.419750277 +0200
+++ gdb-7.7.50.20140609/gdb/symfile.h 2014-06-13 20:10:04.478772510 +0200
@@ -570,6 +570,10 @@ void expand_symtabs_matching (expand_sym
--- 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
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
@ -239,11 +239,11 @@ Index: gdb-7.7.50.20140609/gdb/symfile.h
/* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/gdb.exp 2014-06-13 20:09:37.384745236 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp 2014-06-13 20:09:42.420750278 +0200
@@ -1492,6 +1492,16 @@ proc default_gdb_start { } {
--- 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 { } {
warning "Couldn't set the width to 0."
}
}
@ -260,11 +260,11 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp
return 0
}
Index: gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:09:37.385745237 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:09:42.421750279 +0200
@@ -212,6 +212,16 @@ proc default_mi_gdb_start { args } {
--- 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
@@ -214,6 +214,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
}
@ -281,11 +281,11 @@ Index: gdb-7.7.50.20140609/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.7.50.20140609/gdb/objfiles.h
Index: gdb-7.8.50.20141228/gdb/objfiles.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/objfiles.h 2014-06-13 20:09:37.385745237 +0200
+++ gdb-7.7.50.20140609/gdb/objfiles.h 2014-06-13 20:09:42.421750279 +0200
@@ -464,6 +464,10 @@ struct objfile
--- 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
@@ -459,6 +459,10 @@ struct objfile
#define OBJF_NOT_FILENAME (1 << 6)
@ -296,10 +296,10 @@ Index: gdb-7.7.50.20140609/gdb/objfiles.h
/* Declarations for functions defined in objfiles.c */
extern struct objfile *allocate_objfile (bfd *, const char *name, int);
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.base/corefile.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/gdb.base/corefile.exp 2014-06-13 20:09:37.385745237 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.base/corefile.exp 2014-06-13 20:09:42.421750279 +0200
--- 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
@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile"
pass $test
}
@ -334,11 +334,11 @@ Index: gdb-7.7.50.20140609/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.7.50.20140609/gdb/build-id.c
Index: gdb-7.8.50.20141228/gdb/build-id.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/build-id.c 2014-06-13 20:09:37.386745238 +0200
+++ gdb-7.7.50.20140609/gdb/build-id.c 2014-06-13 20:09:42.422750280 +0200
@@ -27,11 +27,65 @@
--- 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"
#include "objfiles.h"
#include "filenames.h"
@ -359,11 +359,11 @@ Index: gdb-7.7.50.20140609/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. */
-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+
+static struct elf_build_id *
+build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
+{
@ -389,24 +389,23 @@ Index: gdb-7.7.50.20140609/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;
+}
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+
+/* See build-id.h. */
+
static const struct elf_build_id *
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
@@ -45,6 +99,348 @@ build_id_bfd_get (bfd *abfd)
@@ -44,6 +97,348 @@ build_id_bfd_get (bfd *abfd)
return elf_tdata (abfd)->build_id;
}
@ -755,7 +754,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
/* See build-id.h. */
int
@@ -53,7 +449,7 @@ build_id_verify (bfd *abfd, size_t check
@@ -52,7 +447,7 @@ build_id_verify (bfd *abfd, size_t check
const struct elf_build_id *found;
int retval = 0;
@ -764,7 +763,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
@@ -68,20 +464,56 @@ build_id_verify (bfd *abfd, size_t check
@@ -67,20 +462,56 @@ build_id_verify (bfd *abfd, size_t check
return retval;
}
@ -825,7 +824,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
@@ -94,8 +526,11 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -93,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;
@ -838,7 +837,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
memcpy (link, debugdir, debugdir_len);
s = &link[debugdir_len];
@@ -109,44 +544,282 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -108,44 +542,282 @@ build_id_to_debug_bfd (size_t build_id_l
*s++ = '/';
while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++);
@ -909,7 +908,9 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+ xfree (filename);
+ filename = NULL;
+ }
+
- gdb_bfd_unref (abfd);
- abfd = NULL;
+ if (filename != NULL)
+ {
+ /* LINK_ALL is not used below in this non-NULL FILENAME case. */
@ -935,9 +936,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
+ its possible use as an argument for installation command. */
+ link_all[len_orig] = ' ';
- gdb_bfd_unref (abfd);
- abfd = NULL;
+
+ strcpy (&link_all[len_orig + 1], link0_resolved);
+ xfree (link0_resolved);
+ }
@ -1138,7 +1137,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd),
@@ -166,3 +839,21 @@ find_separate_debug_file_by_buildid (str
@@ -165,3 +837,21 @@ find_separate_debug_file_by_buildid (str
}
return NULL;
}
@ -1160,11 +1159,24 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+
+ observer_attach_executable_changed (debug_print_executable_changed);
+}
Index: gdb-7.7.50.20140609/gdb/build-id.h
Index: gdb-7.8.50.20141228/gdb/build-id.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/build-id.h 2014-06-13 20:09:37.386745238 +0200
+++ gdb-7.7.50.20140609/gdb/build-id.h 2014-06-13 20:09:42.422750280 +0200
@@ -32,13 +32,18 @@ extern int build_id_verify (bfd *abfd,
--- 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
@@ -20,9 +20,10 @@
#ifndef BUILD_ID_H
#define BUILD_ID_H
-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+/* 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);
/* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
Otherwise, issue a warning and return false. */
@@ -36,13 +37,18 @@ extern int build_id_verify (bfd *abfd,
the caller. */
extern bfd *build_id_to_debug_bfd (size_t build_id_len,
@ -1185,11 +1197,11 @@ Index: gdb-7.7.50.20140609/gdb/build-id.h
+ char **build_id_filename_return);
#endif /* BUILD_ID_H */
Index: gdb-7.7.50.20140609/gdb/dwarf2read.c
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/dwarf2read.c 2014-06-13 20:09:37.389745241 +0200
+++ gdb-7.7.50.20140609/gdb/dwarf2read.c 2014-06-13 20:09:42.425750283 +0200
@@ -2446,7 +2446,7 @@ dwarf2_get_dwz_file (void)
--- 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)
}
if (dwz_bfd == NULL)
@ -1198,3 +1210,25 @@ Index: gdb-7.7.50.20140609/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
===================================================================
--- 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
TRY_CATCH (except, RETURN_MASK_ALL)
{
- 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
/* Don't return separate debug files. */
if (objfile->separate_debug_objfile_backlink != NULL)
continue;
- obfd_build_id = build_id_bfd_get (objfile->obfd);
+ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd);
if (obfd_build_id == NULL)
continue;
if (objfpy_build_id_matches (obfd_build_id, build_id))