gdb/gdb-6.6-buildid-locate-solib-missing-ids.patch
Michael Matz c7081b119c - Rebase to gdb version 7.10.1 as of version in Fedora 23:
* reverse debugging on aarch64
  * new commands or subcommands:
    - info os cpu, set/show serial parity, info dll
    - maint print symbol-cache/symbol-cache-statistics,
      maint flush-symbol-cache
    - record btrace bts, record bts
    - compile print
    - show/set mpx bound
    - tui enable/disable
    - record btrace pt, record pt
    - maint info btrace,
      maint btrace packet-history/clear-packet-history/clear
  * s390 support for vector ABI
  * "set sysroot" improvements related to remote targets
  * better support for debugging containerized programs
    (without "set sysroot")
  * HISTSIZE environment variable is replaced by GDBHISTSIZE
  * python scripting:
    - it's possible to write frame unwinders
    - several new methods in Objfile, Type and Value classes
    - gdb can auto-load scripts contained in special sections
      named '.debug_gdb_scripts'.
  * extensions for the MI interface, new remote packet types
- Removed obsolete patches:
    0001-S390-Add-target-descriptions-for-vector-register-set.patch
    0001-S390-Fix-compiler-invocation-with-compile-command.patch
    0001-S390-Support-new-vector-register-sections.patch
    0002-S390-Add-vector-register-support-to-gdb.patch
    0003-S390-Add-vector-register-support-to-gdbserver.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=128
2016-01-14 17:05:52 +00:00

60 lines
2.3 KiB
Diff

Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
===================================================================
--- 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 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';
/* May get overwritten below. */
strcpy (newobj->so_name, newobj->so_original_name);
- build_id = build_id_addr_get (newobj->lm_info->l_ld);
+ /* In the case the main executable was found according to its build-id
+ (from a core file) prevent loading a different build of a library
+ with accidentally the same SO_NAME.
+
+ It suppresses bogus backtraces (and prints "??" there instead) if
+ the on-disk files no longer match the running program version.
+
+ If the main executable was not loaded according to its build-id do
+ not do any build-id checking of the libraries. There may be missing
+ build-ids dumped in the core file and we would map all the libraries
+ to the only existing file loaded that time - the executable. */
+ if (symfile_objfile != NULL
+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
if (build_id != NULL)
{
char *name, *build_id_filename;
@@ -1403,23 +1416,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
xfree (name);
}
else
- {
- 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
- a different build of a library with accidentally the
- same SO_NAME.
-
- It suppresses bogus backtraces (and prints "??" there
- instead) if the on-disk files no longer match the
- running program version. */
-
- if (symfile_objfile != NULL
- && (symfile_objfile->flags
- & OBJF_BUILD_ID_CORE_LOADED) != 0)
- newobj->so_name[0] = 0;
- }
+ debug_print_missing (newobj->so_name, build_id_filename);
xfree (build_id_filename);
xfree (build_id);