]> git.pld-linux.org Git - packages/gdb.git/blobdiff - gdb-6.6-buildid-locate-rpm.patch
- fix build on x32
[packages/gdb.git] / gdb-6.6-buildid-locate-rpm.patch
index 8dc4bccf4dc4e0868b7c6872c1344da94f4c2619..56ce7db2b336b9772be5608d764366874c8d57d2 100644 (file)
@@ -1,25 +1,16 @@
-Index: gdb-7.8.50.20141228/gdb/event-top.c
+Index: gdb-7.11.50.20160630/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
-@@ -37,6 +37,7 @@
- #include "gdbcmd.h"           /* for dont_repeat() */
- #include "annotate.h"
- #include "maint.h"
+--- gdb-7.11.50.20160630.orig/gdb/event-top.c  2016-07-02 23:43:24.085214144 +0200
++++ gdb-7.11.50.20160630/gdb/event-top.c       2016-07-03 14:37:12.572130734 +0200
+@@ -40,6 +40,7 @@
+ #include "buffer.h"
+ #include "ser-event.h"
+ #include "gdb_select.h"
 +#include "symfile.h"
  
  /* readline include files.  */
  #include "readline/readline.h"
-@@ -180,6 +181,8 @@ rl_callback_read_char_wrapper (gdb_clien
- void
- cli_command_loop (void *data)
- {
-+  debug_flush_missing ();
-+
-   display_gdb_prompt (0);
-   /* Now it's time to start the event loop.  */
-@@ -298,6 +301,8 @@ display_gdb_prompt (const char *new_prom
+@@ -347,6 +348,8 @@
    /* Reset the nesting depth used when trace-commands is set.  */
    reset_command_nest_depth ();
  
@@ -28,61 +19,35 @@ 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
+@@ -794,7 +797,10 @@
+       command_handler (cmd);
+       if (ui->prompt_state != PROMPTED)
+-      display_gdb_prompt (0);
++      {
++        debug_flush_missing ();
++        display_gdb_prompt (0);
++      }
+     }
+ }
+Index: gdb-7.11.50.20160630/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.11.50.20160630.orig/gdb/symfile.h    2016-07-03 14:34:32.032753668 +0200
++++ gdb-7.11.50.20160630/gdb/symfile.h 2016-07-03 14:37:12.573130742 +0200
+@@ -592,6 +592,8 @@
  /* 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
-===================================================================
---- 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 { } {
-           warning "Couldn't set the width to 0."
-       }
-     }
--    # Turn off the missing warnings as the testsuite does not expect it.
-+    # Turn off the missing RPMs warnings as the testsuite does not expect it.
-     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.11.50.20160630/gdb/aclocal.m4
 ===================================================================
---- 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
-@@ -214,7 +214,7 @@ proc default_mi_gdb_start { args } {
-           warning "Couldn't set the width to 0."
-       }
-     }
--    # Turn off the missing warnings as the testsuite does not expect it.
-+    # Turn off the missing RPMs warnings as the testsuite does not expect it.
-     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
-===================================================================
---- 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
-@@ -31,6 +31,7 @@
- #include "tui/tui-io.h"
- #include "infrun.h"
- #include "observer.h"
-+#include "symfile.h"
- static struct ui_out *tui_ui_out (struct interp *self);
-Index: gdb-7.8.50.20141228/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.11.50.20160630.orig/gdb/aclocal.m4   2016-07-02 23:43:24.085214144 +0200
++++ gdb-7.11.50.20160630/gdb/aclocal.m4        2016-07-03 14:37:12.576130768 +0200
 @@ -11,6 +11,221 @@
  # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  # PARTICULAR PURPOSE.
@@ -305,10 +270,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.11.50.20160630/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.11.50.20160630.orig/gdb/config.in    2016-07-02 23:43:24.085214144 +0200
++++ gdb-7.11.50.20160630/gdb/config.in 2016-07-03 14:37:12.576130768 +0200
 @@ -33,6 +33,9 @@
  /* Define to BFD's default target vector. */
  #undef DEFAULT_BFD_VEC
@@ -319,7 +284,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 @@
+@@ -261,6 +264,9 @@
  /* Define if Python 2.7 is being used. */
  #undef HAVE_LIBPYTHON2_7
  
@@ -329,11 +294,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.11.50.20160630/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.11.50.20160630.orig/gdb/configure    2016-07-02 23:43:24.085214144 +0200
++++ gdb-7.11.50.20160630/gdb/configure 2016-07-03 14:37:12.581130811 +0200
+@@ -705,6 +705,11 @@
  HAVE_NATIVE_GCORE_TARGET
  TARGET_OBS
  subdirs
@@ -345,7 +310,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
  GDB_DATADIR
  DEBUGDIR
  MAKEINFO_EXTRA_FLAGS
-@@ -801,6 +806,7 @@ with_gdb_datadir
+@@ -814,6 +819,7 @@
  with_relocated_sources
  with_auto_load_dir
  with_auto_load_safe_path
@@ -353,7 +318,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
  enable_targets
  enable_64_bit_bfd
  enable_gdbcli
-@@ -852,6 +858,11 @@ CPPFLAGS
+@@ -870,6 +876,11 @@
  CPP
  MAKEINFO
  MAKEINFOFLAGS
@@ -365,7 +330,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
  YACC
  YFLAGS
  XMKMF'
-@@ -1522,6 +1533,8 @@ Optional Packages:
+@@ -1541,6 +1552,8 @@
                            [--with-auto-load-dir]
    --without-auto-load-safe-path
                            do not restrict auto-loaded files locations
@@ -374,7 +339,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:
+@@ -1595,6 +1608,13 @@
    MAKEINFO    Parent configure detects if it is of sufficient version.
    MAKEINFOFLAGS
                Parameters for MAKEINFO.
@@ -388,7 +353,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
+@@ -5613,6 +5633,494 @@
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
  $as_echo "$with_auto_load_safe_path" >&6; }
  
@@ -623,6 +588,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
 +
 +
 +
++
 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 +      if test -n "$ac_tool_prefix"; then
 +  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
@@ -751,6 +717,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
 +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
 +  test $ac_status = 0; }; then
 +  pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
++                    test "x$?" != "x0" && pkg_failed=yes
 +else
 +  pkg_failed=yes
 +fi
@@ -767,6 +734,7 @@ Index: gdb-7.8.50.20141228/gdb/configure
 +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
 +  test $ac_status = 0; }; then
 +  pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
++                    test "x$?" != "x0" && pkg_failed=yes
 +else
 +  pkg_failed=yes
 +fi
@@ -786,9 +754,9 @@ Index: gdb-7.8.50.20141228/gdb/configure
 +        _pkg_short_errors_supported=no
 +fi
 +        if test $_pkg_short_errors_supported = yes; then
-+              RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
++              RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1`
 +        else
-+              RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
++              RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1`
 +        fi
 +      # Put the nasty error message in config.log where it belongs
 +      echo "$RPM_PKG_ERRORS" >&5
@@ -880,11 +848,11 @@ Index: gdb-7.8.50.20141228/gdb/configure
  
  
  subdirs="$subdirs testsuite"
-Index: gdb-7.8.50.20141228/gdb/configure.ac
+Index: gdb-7.11.50.20160630/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.11.50.20160630.orig/gdb/configure.ac 2016-07-02 23:43:24.085214144 +0200
++++ gdb-7.11.50.20160630/gdb/configure.ac      2016-07-03 14:37:12.582130819 +0200
+@@ -177,6 +177,199 @@
              [Directories safe to hold auto-loaded files.])
  AC_MSG_RESULT([$with_auto_load_safe_path])
  
@@ -1084,11 +1052,11 @@ 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.11.50.20160630/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
-@@ -310,7 +310,7 @@ build_id_locate_exec (int from_tty)
+--- gdb-7.11.50.20160630.orig/gdb/corelow.c    2016-07-03 14:34:32.022753582 +0200
++++ gdb-7.11.50.20160630/gdb/corelow.c 2016-07-03 14:37:12.582130819 +0200
+@@ -310,7 +310,7 @@
          symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
      }
    else
@@ -1097,19 +1065,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.11.50.20160630/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.11.50.20160630.orig/gdb/build-id.c   2016-07-03 14:36:50.124938187 +0200
++++ gdb-7.11.50.20160630/gdb/build-id.c        2016-07-03 14:42:25.171812134 +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,360 @@ build_id_to_filename (const struct elf_b
+@@ -665,8 +666,366 @@
    return result;
  }
  
@@ -1187,6 +1155,9 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +  if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
 +    return 0;
 +
++  if (is_target_filename (filename))
++    return 0;
++
 +  if (filename[0] != '/')
 +    {
 +      warning (_("Ignoring non-absolute filename: <%s>"), filename);
@@ -1215,13 +1186,13 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +          return 0;
 +        }
 +
-+      if (!((headerFormat_p = dlsym (h, "headerFormat"))
-+            && (rpmReadConfigFiles_p = dlsym (h, "rpmReadConfigFiles"))
-+            && (rpmdbFreeIterator_p = dlsym (h, "rpmdbFreeIterator"))
-+            && (rpmdbNextIterator_p = dlsym (h, "rpmdbNextIterator"))
-+            && (rpmtsCreate_p = dlsym (h, "rpmtsCreate"))
-+            && (rpmtsFree_p = dlsym (h, "rpmtsFree"))
-+            && (rpmtsInitIterator_p = dlsym (h, "rpmtsInitIterator"))))
++      if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
++            && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
++            && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
++            && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
++            && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
++            && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
++            && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
 +        {
 +          warning (_("Opened library \"%s\" is incompatible (%s), "
 +                    "missing debuginfos notifications will not be displayed"),
@@ -1277,12 +1248,12 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +        if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
 +          {
 +            /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
-+            s2 = memrchr (debuginfo, '-', s - debuginfo);
++            s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
 +          }
 +        if (s2)
 +          {
 +            /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
-+            s2 = memrchr (debuginfo, '-', s2 - debuginfo);
++            s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
 +          }
 +        if (!s2)
 +          {
@@ -1305,7 +1276,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +
 +        /* RPMDBI_PACKAGES requires keylen == sizeof (int).  */
 +        /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel().  */
-+        mi_debuginfo = rpmtsInitIterator_p (ts, RPMDBI_LABEL, debuginfo, 0);
++        mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
 +        xfree (debuginfo);
 +        if (mi_debuginfo)
 +          {
@@ -1356,7 +1327,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +
 +            *slot = debuginfo;
 +
-+            missing_rpm = xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
++            missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
 +            strcpy (missing_rpm->rpm, debuginfo);
 +            missing_rpm->next = missing_rpm_list;
 +            missing_rpm_list = missing_rpm;
@@ -1394,7 +1365,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +  if (missing_rpm_list_entries == 0)
 +    return;
 +
-+  array = xmalloc (sizeof (*array) * missing_rpm_list_entries);
++  array = (char **) xmalloc (sizeof (*array) * missing_rpm_list_entries);
 +  cleanups = make_cleanup (xfree, array);
 +
 +  array_iter = array;
@@ -1409,6 +1380,9 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +       (int (*) (const void *, const void *)) missing_rpm_list_compar);
 +
 +  printf_unfiltered (_("Missing separate debuginfos, use: %s"),
++#ifdef DNF_DEBUGINFO_INSTALL
++                   "dnf "
++#endif
 +                   "debuginfo-install");
 +  for (array_iter = array; array_iter < array + missing_rpm_list_entries;
 +       array_iter++)
@@ -1471,7 +1445,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
     avoidance.  */
  
  struct missing_filepair
-@@ -719,11 +1072,17 @@ missing_filepair_change (void)
+@@ -720,11 +1079,17 @@
        /* All their memory came just from missing_filepair_OBSTACK.  */
        missing_filepair_hash = NULL;
      }
@@ -1489,7 +1463,7 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
    missing_filepair_change ();
  }
  
-@@ -790,14 +1149,34 @@ debug_print_missing (const char *binary,
+@@ -791,14 +1156,39 @@
  
    *slot = missing_filepair;
  
@@ -1526,7 +1500,12 @@ Index: gdb-7.8.50.20141228/gdb/build-id.c
 +                          _("Missing separate debuginfo for %s\n"), binary);
 +        if (debug != NULL)
 +        fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
-+                            "yum --enablerepo='*debug*' install", debug);
++#ifdef DNF_DEBUGINFO_INSTALL
++                            "dnf"
++#else
++                            "yum"
++#endif
++                            " --enablerepo='*debug*' install", debug);
 +      }
  }
  
This page took 0.046582 seconds and 4 git commands to generate.