1 Index: gdb-7.4.50.20111218/gdb/event-top.c
2 ===================================================================
3 --- gdb-7.4.50.20111218.orig/gdb/event-top.c 2011-09-21 17:21:28.000000000 +0200
4 +++ gdb-7.4.50.20111218/gdb/event-top.c 2011-12-19 01:18:56.087539251 +0100
7 #include "continuations.h"
8 #include "gdbcmd.h" /* for dont_repeat() */
11 /* readline include files. */
12 #include "readline/readline.h"
13 @@ -176,6 +177,8 @@ rl_callback_read_char_wrapper (gdb_clien
15 cli_command_loop (void)
17 + debug_flush_missing ();
19 display_gdb_prompt (0);
21 /* Now it's time to start the event loop. */
22 @@ -241,6 +244,8 @@ display_gdb_prompt (char *new_prompt)
23 /* Reset the nesting depth used when trace-commands is set. */
24 reset_command_nest_depth ();
26 + debug_flush_missing ();
28 /* Each interpreter has its own rules on displaying the command
30 if (!current_interp_display_prompt_p ())
31 Index: gdb-7.4.50.20111218/gdb/elfread.c
32 ===================================================================
33 --- gdb-7.4.50.20111218.orig/gdb/elfread.c 2011-12-19 00:54:09.000000000 +0100
34 +++ gdb-7.4.50.20111218/gdb/elfread.c 2011-12-19 01:16:15.248455897 +0100
39 +#include "elf/external.h"
42 extern void _initialize_elfread (void);
43 @@ -1622,8 +1623,361 @@ build_id_to_filename (struct build_id *b
49 +#include <rpm/rpmlib.h>
50 +#include <rpm/rpmts.h>
51 +#include <rpm/rpmdb.h>
52 +#include <rpm/header.h>
57 +/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
58 + and avoid their duplicities during a single inferior run. */
60 +static struct htab *missing_rpm_hash;
62 +/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
63 + all the rpms right before the nearest GDB prompt. It gets cleared after
64 + each such print (it is questionable if we should clear it after the print).
69 + struct missing_rpm *next;
72 +static struct missing_rpm *missing_rpm_list;
73 +static int missing_rpm_list_entries;
75 +/* Returns the count of newly added rpms. */
78 +missing_rpm_enlist (const char *filename)
80 + static int rpm_init_done = 0;
82 + rpmdbMatchIterator mi;
86 + /* Duplicate here the declarations to verify they match. The same sanity
87 + check is present also in `configure.ac'. */
88 + extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
89 + static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
90 + extern int rpmReadConfigFiles(const char * file, const char * target);
91 + static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
92 + extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
93 + static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
94 + extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
95 + static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
96 + extern rpmts rpmtsCreate(void);
97 + static rpmts (*rpmtsCreate_p) (void);
98 + extern rpmts rpmtsFree(rpmts ts);
99 + static rpmts (*rpmtsFree_p) (rpmts ts);
100 + extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
101 + const void * keyp, size_t keylen);
102 + static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
106 +#else /* !DLOPEN_LIBRPM */
107 +# define headerFormat_p headerFormat
108 +# define rpmReadConfigFiles_p rpmReadConfigFiles
109 +# define rpmdbFreeIterator_p rpmdbFreeIterator
110 +# define rpmdbNextIterator_p rpmdbNextIterator
111 +# define rpmtsCreate_p rpmtsCreate
112 +# define rpmtsFree_p rpmtsFree
113 +# define rpmtsInitIterator_p rpmtsInitIterator
114 +#endif /* !DLOPEN_LIBRPM */
116 + gdb_assert (filename != NULL);
118 + if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
121 + if (filename[0] != '/')
123 + warning (_("Ignoring non-absolute filename: <%s>"), filename);
127 + if (!rpm_init_done)
129 + static int init_tried;
131 + /* Already failed the initialization before? */
136 +#ifdef DLOPEN_LIBRPM
140 + h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
143 + warning (_("Unable to open \"%s\" (%s), "
144 + "missing debuginfos notifications will not be displayed"),
145 + DLOPEN_LIBRPM, dlerror ());
149 + if (!((headerFormat_p = dlsym (h, "headerFormat"))
150 + && (rpmReadConfigFiles_p = dlsym (h, "rpmReadConfigFiles"))
151 + && (rpmdbFreeIterator_p = dlsym (h, "rpmdbFreeIterator"))
152 + && (rpmdbNextIterator_p = dlsym (h, "rpmdbNextIterator"))
153 + && (rpmtsCreate_p = dlsym (h, "rpmtsCreate"))
154 + && (rpmtsFree_p = dlsym (h, "rpmtsFree"))
155 + && (rpmtsInitIterator_p = dlsym (h, "rpmtsInitIterator"))))
157 + warning (_("Opened library \"%s\" is incompatible (%s), "
158 + "missing debuginfos notifications will not be displayed"),
159 + DLOPEN_LIBRPM, dlerror ());
161 + warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
166 +#endif /* DLOPEN_LIBRPM */
168 + if (rpmReadConfigFiles_p (NULL, NULL) != 0)
170 + warning (_("Error reading the rpm configuration files"));
177 + ts = rpmtsCreate_p ();
179 + mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
185 + char *debuginfo, **slot, *s, *s2;
187 + size_t srcrpmlen = sizeof (".src.rpm") - 1;
188 + size_t debuginfolen = sizeof ("-debuginfo") - 1;
189 + rpmdbMatchIterator mi_debuginfo;
191 + h = rpmdbNextIterator_p (mi);
195 + /* Verify the debuginfo file is not already installed. */
197 + debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
201 + warning (_("Error querying the rpm file `%s': %s"), filename,
205 + /* s = `.src.rpm-debuginfo.%{arch}' */
206 + s = strrchr (debuginfo, '-') - srcrpmlen;
208 + if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
210 + /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
211 + s2 = memrchr (debuginfo, '-', s - debuginfo);
215 + /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
216 + s2 = memrchr (debuginfo, '-', s2 - debuginfo);
220 + warning (_("Error querying the rpm file `%s': %s"), filename,
225 + /* s = `.src.rpm-debuginfo.%{arch}' */
226 + /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
227 + memmove (s2 + debuginfolen, s2, s - s2);
228 + memcpy (s2, "-debuginfo", debuginfolen);
229 + /* s = `XXXX.%{arch}' */
230 + /* strlen ("XXXX") == srcrpmlen + debuginfolen */
231 + /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
232 + /* strlen ("XX") == srcrpmlen */
233 + memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
234 + strlen (s + srcrpmlen + debuginfolen) + 1);
235 + /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
237 + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
238 + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
239 + mi_debuginfo = rpmtsInitIterator_p (ts, RPMDBI_LABEL, debuginfo, 0);
243 + rpmdbFreeIterator_p (mi_debuginfo);
248 + /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
249 + debuginfo = headerFormat_p (h,
250 + "%{name}-%{version}-%{release}.%{arch}",
254 + warning (_("Error querying the rpm file `%s': %s"), filename,
259 + /* Base package name for `debuginfo-install'. We do not use the
260 + `yum' command directly as the line
261 + yum --disablerepo='*' --enablerepo='*-debug*' \
262 + install NAME-debuginfo.ARCH
263 + would be more complicated than just:
264 + debuginfo-install NAME-VERSION-RELEASE.ARCH
265 + Do not supply the rpm base name (derived from .src.rpm name) as
266 + debuginfo-install is unable to install the debuginfo package if
267 + the base name PKG binary rpm is not installed while for example
268 + PKG-libs would be installed (RH Bug 467901).
269 + FUTURE: After multiple debuginfo versions simultaneously installed
270 + get supported the support for the VERSION-RELEASE tags handling
271 + may need an update. */
273 + if (missing_rpm_hash == NULL)
275 + /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
276 + should not deallocate the entries. */
278 + missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
279 + (int (*) (const void *, const void *)) streq,
280 + NULL, xcalloc, xfree);
282 + slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
283 + /* XCALLOC never returns NULL. */
284 + gdb_assert (slot != NULL);
287 + struct missing_rpm *missing_rpm;
291 + missing_rpm = xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
292 + strcpy (missing_rpm->rpm, debuginfo);
293 + missing_rpm->next = missing_rpm_list;
294 + missing_rpm_list = missing_rpm;
295 + missing_rpm_list_entries++;
302 + rpmdbFreeIterator_p (mi);
311 +missing_rpm_list_compar (const char *const *ap, const char *const *bp)
313 + return strcoll (*ap, *bp);
316 +/* It returns a NULL-terminated array of strings needing to be FREEd. It may
317 + also return only NULL. */
320 +missing_rpm_list_print (void)
322 + char **array, **array_iter;
323 + struct missing_rpm *list_iter;
324 + struct cleanup *cleanups;
326 + if (missing_rpm_list_entries == 0)
329 + array = xmalloc (sizeof (*array) * missing_rpm_list_entries);
330 + cleanups = make_cleanup (xfree, array);
332 + array_iter = array;
333 + for (list_iter = missing_rpm_list; list_iter != NULL;
334 + list_iter = list_iter->next)
336 + *array_iter++ = list_iter->rpm;
338 + gdb_assert (array_iter == array + missing_rpm_list_entries);
340 + qsort (array, missing_rpm_list_entries, sizeof (*array),
341 + (int (*) (const void *, const void *)) missing_rpm_list_compar);
343 + printf_unfiltered (_("Missing separate debuginfos, use: %s"),
344 + "debuginfo-install");
345 + for (array_iter = array; array_iter < array + missing_rpm_list_entries;
348 + putchar_unfiltered (' ');
349 + puts_unfiltered (*array_iter);
351 + putchar_unfiltered ('\n');
353 + while (missing_rpm_list != NULL)
355 + list_iter = missing_rpm_list;
356 + missing_rpm_list = list_iter->next;
359 + missing_rpm_list_entries = 0;
361 + do_cleanups (cleanups);
365 +missing_rpm_change (void)
367 + debug_flush_missing ();
369 + gdb_assert (missing_rpm_list == NULL);
370 + if (missing_rpm_hash != NULL)
372 + htab_delete (missing_rpm_hash);
373 + missing_rpm_hash = NULL;
379 + /* Init state. EXEC_BFD also still could be NULL. */
380 + MISSING_EXEC_NOT_TRIED,
381 + /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
382 + MISSING_EXEC_NOT_FOUND,
383 + /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
384 + or separate) or the main executable's RPM is now contained in
385 + MISSING_RPM_HASH. */
386 + MISSING_EXEC_ENLISTED
388 +static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
390 +#endif /* HAVE_LIBRPM */
393 +debug_flush_missing (void)
396 + missing_rpm_list_print ();
400 /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
401 - Try to install the hash file ...
402 + yum --disablerepo='*' --enablerepo='*-debug*' install ...
405 struct missing_filepair
406 @@ -1677,11 +2031,17 @@ missing_filepair_change (void)
407 /* All their memory came just from missing_filepair_OBSTACK. */
408 missing_filepair_hash = NULL;
411 + missing_exec = MISSING_EXEC_NOT_TRIED;
416 debug_print_executable_changed (void)
419 + missing_rpm_change ();
421 missing_filepair_change ();
424 @@ -1748,14 +2108,35 @@ debug_print_missing (const char *binary,
426 *slot = missing_filepair;
428 - /* We do not collect and flush these messages as each such message
429 - already requires its own separate lines. */
431 + if (missing_exec == MISSING_EXEC_NOT_TRIED)
433 + char *exec_filename;
435 - fprintf_unfiltered (gdb_stdlog,
436 - _("Missing separate debuginfo for %s\n"), binary);
438 - fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
440 + exec_filename = get_exec_file (0);
441 + if (exec_filename != NULL)
443 + if (missing_rpm_enlist (exec_filename) == 0)
444 + missing_exec = MISSING_EXEC_NOT_FOUND;
446 + missing_exec = MISSING_EXEC_ENLISTED;
449 + if (missing_exec != MISSING_EXEC_ENLISTED)
450 + if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
451 + && (debug == NULL || missing_rpm_enlist (debug) == 0))
452 +#endif /* HAVE_LIBRPM */
454 + /* We do not collect and flush these messages as each such message
455 + already requires its own separate lines. */
457 + fprintf_unfiltered (gdb_stdlog,
458 + _("Missing separate debuginfo for %s\n"), binary);
460 + fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
461 + "yum --disablerepo='*' --enablerepo='*-debug*'"
462 + " install", debug);
467 Index: gdb-7.4.50.20111218/gdb/symfile.h
468 ===================================================================
469 --- gdb-7.4.50.20111218.orig/gdb/symfile.h 2011-12-19 00:54:09.000000000 +0100
470 +++ gdb-7.4.50.20111218/gdb/symfile.h 2011-12-19 01:16:15.249455893 +0100
471 @@ -568,6 +568,8 @@ extern struct build_id *build_id_addr_ge
472 extern char *build_id_to_filename (struct build_id *build_id,
473 char **link_return, int add_debug_suffix);
474 extern void debug_print_missing (const char *binary, const char *debug);
475 +extern void debug_flush_missing (void);
476 +#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
478 /* From dwarf2read.c */
480 Index: gdb-7.4.50.20111218/gdb/testsuite/lib/gdb.exp
481 ===================================================================
482 --- gdb-7.4.50.20111218.orig/gdb/testsuite/lib/gdb.exp 2011-12-19 00:54:09.000000000 +0100
483 +++ gdb-7.4.50.20111218/gdb/testsuite/lib/gdb.exp 2011-12-19 01:16:15.250455889 +0100
484 @@ -1387,7 +1387,7 @@ proc default_gdb_start { } {
485 warning "Couldn't set the width to 0."
488 - # Turn off the missing warnings as the testsuite does not expect it.
489 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
490 send_gdb "set build-id-verbose 0\n"
492 -re "$gdb_prompt $" {
493 Index: gdb-7.4.50.20111218/gdb/testsuite/lib/mi-support.exp
494 ===================================================================
495 --- gdb-7.4.50.20111218.orig/gdb/testsuite/lib/mi-support.exp 2011-12-19 00:54:49.000000000 +0100
496 +++ gdb-7.4.50.20111218/gdb/testsuite/lib/mi-support.exp 2011-12-19 01:20:34.921163977 +0100
497 @@ -212,7 +212,7 @@ proc default_mi_gdb_start { args } {
498 warning "Couldn't set the width to 0."
501 - # Turn off the missing warnings as the testsuite does not expect it.
502 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
503 send_gdb "190-gdb-set build-id-verbose 0\n"
505 -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
506 Index: gdb-7.4.50.20111218/gdb/tui/tui-interp.c
507 ===================================================================
508 --- gdb-7.4.50.20111218.orig/gdb/tui/tui-interp.c 2011-09-12 23:24:51.000000000 +0200
509 +++ gdb-7.4.50.20111218/gdb/tui/tui-interp.c 2011-12-19 01:16:15.252455883 +0100
512 #include "tui/tui-io.h"
513 #include "exceptions.h"
514 +#include "symfile.h"
516 /* Set to 1 when the TUI mode must be activated when we first start
518 Index: gdb-7.4.50.20111218/gdb/aclocal.m4
519 ===================================================================
520 --- gdb-7.4.50.20111218.orig/gdb/aclocal.m4 2011-02-15 22:05:53.000000000 +0100
521 +++ gdb-7.4.50.20111218/gdb/aclocal.m4 2011-12-19 01:16:15.252455883 +0100
522 @@ -19,6 +19,162 @@ You have another version of autoconf. I
523 If you have problems, you may need to regenerate the build system entirely.
524 To do so, use the procedure documented by the package, typically `autoreconf'.])])
526 +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
528 +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
530 +# This program is free software; you can redistribute it and/or modify
531 +# it under the terms of the GNU General Public License as published by
532 +# the Free Software Foundation; either version 2 of the License, or
533 +# (at your option) any later version.
535 +# This program is distributed in the hope that it will be useful, but
536 +# WITHOUT ANY WARRANTY; without even the implied warranty of
537 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
538 +# General Public License for more details.
540 +# You should have received a copy of the GNU General Public License
541 +# along with this program; if not, write to the Free Software
542 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
544 +# As a special exception to the GNU General Public License, if you
545 +# distribute this file as part of a program that contains a
546 +# configuration script generated by Autoconf, you may include it under
547 +# the same distribution terms that you use for the rest of that program.
549 +# PKG_PROG_PKG_CONFIG([MIN-VERSION])
550 +# ----------------------------------
551 +AC_DEFUN([PKG_PROG_PKG_CONFIG],
552 +[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
553 +m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
554 +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
555 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
556 + AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
558 +if test -n "$PKG_CONFIG"; then
559 + _pkg_min_version=m4_default([$1], [0.9.0])
560 + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
561 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
562 + AC_MSG_RESULT([yes])
564 + AC_MSG_RESULT([no])
569 +])# PKG_PROG_PKG_CONFIG
571 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
573 +# Check to see whether a particular set of modules exists. Similar
574 +# to PKG_CHECK_MODULES(), but does not set variables or print errors.
577 +# Similar to PKG_CHECK_MODULES, make sure that the first instance of
578 +# this or PKG_CHECK_MODULES is called, or make sure to call
579 +# PKG_CHECK_EXISTS manually
580 +# --------------------------------------------------------------
581 +AC_DEFUN([PKG_CHECK_EXISTS],
582 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
583 +if test -n "$PKG_CONFIG" && \
584 + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
585 + m4_ifval([$2], [$2], [:])
586 +m4_ifvaln([$3], [else
591 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
592 +# ---------------------------------------------
593 +m4_define([_PKG_CONFIG],
594 +[if test -n "$$1"; then
596 + elif test -n "$PKG_CONFIG"; then
597 + PKG_CHECK_EXISTS([$3],
598 + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
605 +# _PKG_SHORT_ERRORS_SUPPORTED
606 +# -----------------------------
607 +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
608 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
609 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
610 + _pkg_short_errors_supported=yes
612 + _pkg_short_errors_supported=no
614 +])# _PKG_SHORT_ERRORS_SUPPORTED
617 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
618 +# [ACTION-IF-NOT-FOUND])
621 +# Note that if there is a possibility the first call to
622 +# PKG_CHECK_MODULES might not happen, you should be sure to include an
623 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
626 +# --------------------------------------------------------------
627 +AC_DEFUN([PKG_CHECK_MODULES],
628 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
629 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
630 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
633 +AC_MSG_CHECKING([for $1])
635 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
636 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])
638 +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
639 +and $1[]_LIBS to avoid the need to call pkg-config.
640 +See the pkg-config man page for more details.])
642 +if test $pkg_failed = yes; then
643 + _PKG_SHORT_ERRORS_SUPPORTED
644 + if test $_pkg_short_errors_supported = yes; then
645 + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
647 + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
649 + # Put the nasty error message in config.log where it belongs
650 + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
652 + ifelse([$4], , [AC_MSG_ERROR(dnl
653 +[Package requirements ($2) were not met:
657 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
658 +installed software in a non-standard prefix.
662 + [AC_MSG_RESULT([no])
664 +elif test $pkg_failed = untried; then
665 + ifelse([$4], , [AC_MSG_FAILURE(dnl
666 +[The pkg-config script could not be found or is too old. Make sure it
667 +is in your PATH or set the PKG_CONFIG environment variable to the full
672 +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
675 + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
676 + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
677 + AC_MSG_RESULT([yes])
678 + ifelse([$3], , :, [$3])
680 +])# PKG_CHECK_MODULES
682 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
684 # This file is free software; the Free Software Foundation
685 Index: gdb-7.4.50.20111218/gdb/config.in
686 ===================================================================
687 --- gdb-7.4.50.20111218.orig/gdb/config.in 2011-11-20 09:59:56.000000000 +0100
688 +++ gdb-7.4.50.20111218/gdb/config.in 2011-12-19 01:16:15.253455879 +0100
690 /* Define to BFD's default target vector. */
691 #undef DEFAULT_BFD_VEC
693 +/* librpm version specific library name to dlopen. */
694 +#undef DLOPEN_LIBRPM
696 /* Define to 1 if translation of program messages to the user's native
697 language is requested. */
700 /* Define if Python 2.7 is being used. */
701 #undef HAVE_LIBPYTHON2_7
703 +/* Define if librpm library is being used. */
706 /* Define if libunwind library is being used. */
707 #undef HAVE_LIBUNWIND
709 Index: gdb-7.4.50.20111218/gdb/configure
710 ===================================================================
711 --- gdb-7.4.50.20111218.orig/gdb/configure 2011-11-20 09:59:56.000000000 +0100
712 +++ gdb-7.4.50.20111218/gdb/configure 2011-12-19 01:16:15.256455867 +0100
713 @@ -684,6 +684,9 @@ REPORT_BUGS_TO
723 @@ -952,6 +955,7 @@ enable_dependency_tracking
724 with_separate_debug_dir
726 with_relocated_sources
731 @@ -995,6 +999,9 @@ LDFLAGS
741 @@ -1658,6 +1665,8 @@ Optional Packages:
743 --with-relocated-sources=PATH
744 automatically relocate this path for source files
745 + --with-rpm query rpm database for missing debuginfos (yes/no,
746 + def. auto=librpm.so)
747 --with-libunwind use libunwind frame unwinding support
748 --with-curses use the curses library instead of the termcap
750 @@ -1696,6 +1705,9 @@ Some influential environment variables:
751 CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
752 you have headers in a nonstandard directory <include dir>
754 + PKG_CONFIG path to pkg-config utility
755 + RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
756 + RPM_LIBS linker flags for RPM, overriding pkg-config
757 YACC The `Yet Another C Compiler' implementation to use. Defaults to
758 the first program found out of: `bison -y', `byacc', `yacc'.
759 YFLAGS The list of arguments that will be passed by default to $YACC.
760 @@ -7968,6 +7980,486 @@ _ACEOF
764 +# Integration with rpm library to support missing debuginfo suggestions.
765 +# --without-rpm: Disable any rpm support.
766 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
767 +# Even with runtime missing `libname.so' GDB will still other run correctly.
768 +# Missing `libname.so' during ./configure will abort the configuration.
769 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
770 +# minor version first such as `librpm-4.6.so' as minor version differences
771 +# mean API+ABI incompatibility. If the specific match versioned library name
772 +# could not be found still open dynamically at least `librpm.so'.
773 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
774 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
775 +# be probably linked with the version specific library (as `librpm-4.6.so').
776 +# Failure to find librpm by pkg-config will abort the configuration.
777 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
778 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
781 +# Check whether --with-rpm was given.
782 +if test "${with_rpm+set}" = set; then :
791 +if test "x$with_rpm" != "xno"; then
792 + if test "x$with_rpm" = "xyes"; then
795 + DLOPEN_REQUIRE=false
796 + elif test "x$with_rpm" = "xauto"; then
799 + DLOPEN_REQUIRE=false
803 + DLOPEN_REQUIRE=true
805 + LIBRPM_STRING='"'"$LIBRPM"'"'
807 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
808 +$as_echo_n "checking specific librpm version... " >&6; }
809 + HAVE_DLOPEN_LIBRPM=false
812 + if test "$cross_compiling" = yes; then :
813 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
814 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
815 +as_fn_error "cannot run test program while cross compiling
816 +See \`config.log' for more details." "$LINENO" 5; }
818 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
819 +/* end confdefs.h. */
821 +#include <rpm/rpmlib.h>
830 + const char *const *rpmverp;
833 + f = fopen ("conftest.out", "w");
836 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
840 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
843 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
846 + rpmverp = dlsym (h, "RPMVERSION");
849 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
852 + fprintf (stderr, "RPMVERSION is: \"");
853 + fprintf (stderr, "%s\"\n", *rpmverp);
855 + /* Try to find the specific librpm version only for "librpm.so" as we do
856 + not know how to assemble the version string otherwise. */
858 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
860 + fprintf (f, "%s\n", $LIBRPM_STRING);
869 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
871 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
872 + fprintf (f, "%s\n", $LIBRPM_STRING);
875 + /* Avoid the square brackets by malloc. */
876 + h2_name = malloc (64);
877 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
878 + h2 = dlopen (h2_name, RTLD_LAZY);
881 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
882 + fprintf (f, "%s\n", $LIBRPM_STRING);
887 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
888 + $LIBRPM_STRING, h2_name);
889 + fprintf (f, "%s\n", $LIBRPM_STRING);
892 + /* Found the valid .so name with a specific version. */
893 + fprintf (f, "%s\n", h2_name);
901 +if ac_fn_c_try_run "$LINENO"; then :
903 + DLOPEN_LIBRPM="`cat conftest.out`"
904 + if test "x$DLOPEN_LIBRPM" != "x"; then
905 + HAVE_DLOPEN_LIBRPM=true
906 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
907 +$as_echo "$DLOPEN_LIBRPM" >&6; }
911 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
912 + conftest.$ac_objext conftest.beam conftest.$ac_ext
919 + if $HAVE_DLOPEN_LIBRPM; then
921 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
922 +$as_echo_n "checking rpm library API compatibility... " >&6; }
923 + # The compilation requires -Werror to verify anything.
924 + save_CFLAGS="$CFLAGS"
925 + CFLAGS="$CFLAGS -Werror"
926 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
927 +/* end confdefs.h. */
929 +/* Duplicate here the declarations to verify they match "elfread.c". */
930 +#include <rpm/rpmlib.h>
931 +#include <rpm/rpmts.h>
932 +#include <rpm/rpmdb.h>
933 +#include <rpm/header.h>
934 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
935 +extern int rpmReadConfigFiles(const char * file, const char * target);
936 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
937 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
938 +extern rpmts rpmtsCreate(void);
939 +extern rpmts rpmtsFree(rpmts ts);
940 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
941 + const void * keyp, size_t keylen);
951 +if ac_fn_c_try_compile "$LINENO"; then :
954 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
955 +$as_echo "yes" >&6; }
959 + LIBRPM_COMPAT=false
960 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
961 +$as_echo "no" >&6; }
964 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
965 + CFLAGS="$save_CFLAGS"
967 + if ! $LIBRPM_COMPAT; then
968 + HAVE_DLOPEN_LIBRPM=false
972 + if $HAVE_DLOPEN_LIBRPM; then
973 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
975 +cat >>confdefs.h <<_ACEOF
976 +#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
980 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
983 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
984 +$as_echo "no" >&6; }
986 + if $DLOPEN_REQUIRE; then
987 + as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
991 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
992 + if test -n "$ac_tool_prefix"; then
993 + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
994 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
995 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
996 +$as_echo_n "checking for $ac_word... " >&6; }
997 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
998 + $as_echo_n "(cached) " >&6
1000 + case $PKG_CONFIG in
1001 + [\\/]* | ?:[\\/]*)
1002 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1005 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1006 +for as_dir in $PATH
1009 + test -z "$as_dir" && as_dir=.
1010 + for ac_exec_ext in '' $ac_executable_extensions; do
1011 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1012 + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1013 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1023 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
1024 +if test -n "$PKG_CONFIG"; then
1025 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
1026 +$as_echo "$PKG_CONFIG" >&6; }
1028 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1029 +$as_echo "no" >&6; }
1034 +if test -z "$ac_cv_path_PKG_CONFIG"; then
1035 + ac_pt_PKG_CONFIG=$PKG_CONFIG
1036 + # Extract the first word of "pkg-config", so it can be a program name with args.
1037 +set dummy pkg-config; ac_word=$2
1038 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1039 +$as_echo_n "checking for $ac_word... " >&6; }
1040 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
1041 + $as_echo_n "(cached) " >&6
1043 + case $ac_pt_PKG_CONFIG in
1044 + [\\/]* | ?:[\\/]*)
1045 + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
1048 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1049 +for as_dir in $PATH
1052 + test -z "$as_dir" && as_dir=.
1053 + for ac_exec_ext in '' $ac_executable_extensions; do
1054 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1055 + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1056 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1066 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
1067 +if test -n "$ac_pt_PKG_CONFIG"; then
1068 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
1069 +$as_echo "$ac_pt_PKG_CONFIG" >&6; }
1071 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1072 +$as_echo "no" >&6; }
1075 + if test "x$ac_pt_PKG_CONFIG" = x; then
1078 + case $cross_compiling:$ac_tool_warned in
1080 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
1081 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
1082 +ac_tool_warned=yes ;;
1084 + PKG_CONFIG=$ac_pt_PKG_CONFIG
1087 + PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1091 +if test -n "$PKG_CONFIG"; then
1092 + _pkg_min_version=0.9.0
1093 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
1094 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
1095 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1096 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1097 +$as_echo "yes" >&6; }
1099 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1100 +$as_echo "no" >&6; }
1107 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
1108 +$as_echo_n "checking for RPM... " >&6; }
1110 +if test -n "$RPM_CFLAGS"; then
1111 + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
1112 + elif test -n "$PKG_CONFIG"; then
1113 + if test -n "$PKG_CONFIG" && \
1114 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1115 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1117 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1118 + test $ac_status = 0; }; then
1119 + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
1124 + pkg_failed=untried
1126 +if test -n "$RPM_LIBS"; then
1127 + pkg_cv_RPM_LIBS="$RPM_LIBS"
1128 + elif test -n "$PKG_CONFIG"; then
1129 + if test -n "$PKG_CONFIG" && \
1130 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1131 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1133 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1134 + test $ac_status = 0; }; then
1135 + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
1140 + pkg_failed=untried
1145 +if test $pkg_failed = yes; then
1147 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1148 + _pkg_short_errors_supported=yes
1150 + _pkg_short_errors_supported=no
1152 + if test $_pkg_short_errors_supported = yes; then
1153 + RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
1155 + RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
1157 + # Put the nasty error message in config.log where it belongs
1158 + echo "$RPM_PKG_ERRORS" >&5
1160 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1161 +$as_echo "no" >&6; }
1163 +elif test $pkg_failed = untried; then
1166 + RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
1167 + RPM_LIBS=$pkg_cv_RPM_LIBS
1168 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1169 +$as_echo "yes" >&6; }
1173 + if $HAVE_LIBRPM; then
1175 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
1176 +$as_echo_n "checking rpm library API compatibility... " >&6; }
1177 + # The compilation requires -Werror to verify anything.
1178 + save_CFLAGS="$CFLAGS"
1179 + CFLAGS="$CFLAGS -Werror"
1180 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1181 +/* end confdefs.h. */
1183 +/* Duplicate here the declarations to verify they match "elfread.c". */
1184 +#include <rpm/rpmlib.h>
1185 +#include <rpm/rpmts.h>
1186 +#include <rpm/rpmdb.h>
1187 +#include <rpm/header.h>
1188 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1189 +extern int rpmReadConfigFiles(const char * file, const char * target);
1190 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1191 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1192 +extern rpmts rpmtsCreate(void);
1193 +extern rpmts rpmtsFree(rpmts ts);
1194 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1195 + const void * keyp, size_t keylen);
1205 +if ac_fn_c_try_compile "$LINENO"; then :
1207 + LIBRPM_COMPAT=true
1208 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1209 +$as_echo "yes" >&6; }
1213 + LIBRPM_COMPAT=false
1214 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1215 +$as_echo "no" >&6; }
1218 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1219 + CFLAGS="$save_CFLAGS"
1221 + if ! $LIBRPM_COMPAT; then
1223 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1227 + if $HAVE_LIBRPM; then
1229 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
1231 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1232 + LIBS="$LIBS $RPM_LIBS"
1234 + if $RPM_REQUIRE; then
1235 + as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
1237 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
1238 +$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
1246 subdirs="$subdirs testsuite"
1247 Index: gdb-7.4.50.20111218/gdb/configure.ac
1248 ===================================================================
1249 --- gdb-7.4.50.20111218.orig/gdb/configure.ac 2011-11-20 09:59:56.000000000 +0100
1250 +++ gdb-7.4.50.20111218/gdb/configure.ac 2011-12-19 01:16:15.257455863 +0100
1251 @@ -140,6 +140,199 @@ AS_HELP_STRING([--with-relocated-sources
1252 [Relocated directory for source files. ])
1255 +# Integration with rpm library to support missing debuginfo suggestions.
1256 +# --without-rpm: Disable any rpm support.
1257 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
1258 +# Even with runtime missing `libname.so' GDB will still other run correctly.
1259 +# Missing `libname.so' during ./configure will abort the configuration.
1260 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
1261 +# minor version first such as `librpm-4.6.so' as minor version differences
1262 +# mean API+ABI incompatibility. If the specific match versioned library name
1263 +# could not be found still open dynamically at least `librpm.so'.
1264 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
1265 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
1266 +# be probably linked with the version specific library (as `librpm-4.6.so').
1267 +# Failure to find librpm by pkg-config will abort the configuration.
1268 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
1269 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
1272 + [AS_HELP_STRING([--with-rpm],
1273 + [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
1275 +m4_pattern_allow([^AC_MSG_ERROR$])
1276 +m4_pattern_allow([^AC_MSG_WARN$])
1277 +if test "x$with_rpm" != "xno"; then
1278 + if test "x$with_rpm" = "xyes"; then
1279 + LIBRPM="librpm.so"
1281 + DLOPEN_REQUIRE=false
1282 + elif test "x$with_rpm" = "xauto"; then
1283 + LIBRPM="librpm.so"
1285 + DLOPEN_REQUIRE=false
1287 + LIBRPM="$with_rpm"
1289 + DLOPEN_REQUIRE=true
1291 + LIBRPM_STRING='"'"$LIBRPM"'"'
1293 + AC_MSG_CHECKING([specific librpm version])
1294 + HAVE_DLOPEN_LIBRPM=false
1297 + AC_RUN_IFELSE(AC_LANG_PROGRAM([[
1298 +#include <rpm/rpmlib.h>
1303 + const char *const *rpmverp;
1306 + f = fopen ("conftest.out", "w");
1309 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
1310 + strerror (errno));
1313 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
1316 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
1319 + rpmverp = dlsym (h, "RPMVERSION");
1322 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
1325 + fprintf (stderr, "RPMVERSION is: \"");
1326 + fprintf (stderr, "%s\"\n", *rpmverp);
1328 + /* Try to find the specific librpm version only for "librpm.so" as we do
1329 + not know how to assemble the version string otherwise. */
1331 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
1333 + fprintf (f, "%s\n", $LIBRPM_STRING);
1342 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
1344 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
1345 + fprintf (f, "%s\n", $LIBRPM_STRING);
1348 + /* Avoid the square brackets by malloc. */
1349 + h2_name = malloc (64);
1350 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
1351 + h2 = dlopen (h2_name, RTLD_LAZY);
1354 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
1355 + fprintf (f, "%s\n", $LIBRPM_STRING);
1360 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
1361 + $LIBRPM_STRING, h2_name);
1362 + fprintf (f, "%s\n", $LIBRPM_STRING);
1365 + /* Found the valid .so name with a specific version. */
1366 + fprintf (f, "%s\n", h2_name);
1370 + DLOPEN_LIBRPM="`cat conftest.out`"
1371 + if test "x$DLOPEN_LIBRPM" != "x"; then
1372 + HAVE_DLOPEN_LIBRPM=true
1373 + AC_MSG_RESULT($DLOPEN_LIBRPM)
1376 + rm -f conftest.out
1378 + m4_define([CHECK_LIBRPM_COMPAT], [
1379 + AC_MSG_CHECKING([rpm library API compatibility])
1380 + # The compilation requires -Werror to verify anything.
1381 + save_CFLAGS="$CFLAGS"
1382 + CFLAGS="$CFLAGS -Werror"
1383 + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
1384 +/* Duplicate here the declarations to verify they match "elfread.c". */
1385 +#include <rpm/rpmlib.h>
1386 +#include <rpm/rpmts.h>
1387 +#include <rpm/rpmdb.h>
1388 +#include <rpm/header.h>
1389 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1390 +extern int rpmReadConfigFiles(const char * file, const char * target);
1391 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1392 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1393 +extern rpmts rpmtsCreate(void);
1394 +extern rpmts rpmtsFree(rpmts ts);
1395 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1396 + const void * keyp, size_t keylen);
1398 + LIBRPM_COMPAT=true
1399 + AC_MSG_RESULT(yes)
1401 + LIBRPM_COMPAT=false
1404 + CFLAGS="$save_CFLAGS"
1407 + if $HAVE_DLOPEN_LIBRPM; then
1408 + CHECK_LIBRPM_COMPAT
1409 + if ! $LIBRPM_COMPAT; then
1410 + HAVE_DLOPEN_LIBRPM=false
1414 + if $HAVE_DLOPEN_LIBRPM; then
1415 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
1416 + AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
1417 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1421 + if $DLOPEN_REQUIRE; then
1422 + AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
1424 + PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
1426 + if $HAVE_LIBRPM; then
1427 + CHECK_LIBRPM_COMPAT
1428 + if ! $LIBRPM_COMPAT; then
1430 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1434 + if $HAVE_LIBRPM; then
1435 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1436 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1437 + LIBS="$LIBS $RPM_LIBS"
1439 + if $RPM_REQUIRE; then
1440 + AC_MSG_ERROR($RPM_PKG_ERRORS)
1442 + AC_MSG_WARN($RPM_PKG_ERRORS)
1448 AC_CONFIG_SUBDIRS(testsuite)
1450 # Check whether to support alternative target configurations
1451 Index: gdb-7.4.50.20111218/gdb/acinclude.m4
1452 ===================================================================
1453 --- gdb-7.4.50.20111218.orig/gdb/acinclude.m4 2010-05-27 05:40:45.000000000 +0200
1454 +++ gdb-7.4.50.20111218/gdb/acinclude.m4 2011-12-19 01:16:15.257455863 +0100
1458 dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
1459 dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
1461 @@ -81,8 +83,6 @@ AC_MSG_RESULT(yes)
1462 # Foundation, Inc., 51 Franklin Street, Fifth Floor,
1463 # Boston, MA 02110-1301, USA.
1467 # @defmac AC_PROG_CC_STDC
1468 # @maindex PROG_CC_STDC
1470 Index: gdb-7.4.50.20111218/gdb/corelow.c
1471 ===================================================================
1472 --- gdb-7.4.50.20111218.orig/gdb/corelow.c 2011-12-19 00:54:09.000000000 +0100
1473 +++ gdb-7.4.50.20111218/gdb/corelow.c 2011-12-19 01:16:15.258455859 +0100
1474 @@ -321,7 +321,7 @@ build_id_locate_exec (int from_tty)
1475 symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
1478 - debug_print_missing (_("the main executable file"), build_id_filename);
1479 + debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename);
1481 do_cleanups (back_to);