1 Index: gdb-7.4.50.20120602/gdb/event-top.c
2 ===================================================================
3 --- gdb-7.4.50.20120602.orig/gdb/event-top.c 2012-06-02 21:08:08.651227347 +0200
4 +++ gdb-7.4.50.20120602/gdb/event-top.c 2012-06-02 21:08:23.479221885 +0200
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.20120602/gdb/elfread.c
32 ===================================================================
33 --- gdb-7.4.50.20120602.orig/gdb/elfread.c 2012-06-02 21:08:08.651227347 +0200
34 +++ gdb-7.4.50.20120602/gdb/elfread.c 2012-06-02 21:08:23.482221882 +0200
39 +#include "elf/external.h"
42 extern void _initialize_elfread (void);
43 @@ -1647,8 +1648,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 @@ -1702,11 +2056,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 @@ -1773,14 +2133,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.20120602/gdb/symfile.h
468 ===================================================================
469 --- gdb-7.4.50.20120602.orig/gdb/symfile.h 2012-06-02 21:08:08.651227347 +0200
470 +++ gdb-7.4.50.20120602/gdb/symfile.h 2012-06-02 21:08:23.499221877 +0200
471 @@ -621,6 +621,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.20120602/gdb/testsuite/lib/gdb.exp
481 ===================================================================
482 --- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/gdb.exp 2012-06-02 21:08:08.651227347 +0200
483 +++ gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp 2012-06-02 21:08:23.510221873 +0200
484 @@ -1388,7 +1388,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.20120602/gdb/testsuite/lib/mi-support.exp
494 ===================================================================
495 --- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:08:08.651227347 +0200
496 +++ gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:08:23.523221869 +0200
497 @@ -213,7 +213,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.20120602/gdb/tui/tui-interp.c
507 ===================================================================
508 --- gdb-7.4.50.20120602.orig/gdb/tui/tui-interp.c 2012-06-02 21:08:08.651227347 +0200
509 +++ gdb-7.4.50.20120602/gdb/tui/tui-interp.c 2012-06-02 21:08:23.524221869 +0200
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.20120602/gdb/aclocal.m4
519 ===================================================================
520 --- gdb-7.4.50.20120602.orig/gdb/aclocal.m4 2012-06-02 21:08:08.651227347 +0200
521 +++ gdb-7.4.50.20120602/gdb/aclocal.m4 2012-06-02 21:08:23.545221858 +0200
523 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
524 # PARTICULAR PURPOSE.
526 +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
527 +# serial 1 (pkg-config-0.24)
529 +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
531 +# This program is free software; you can redistribute it and/or modify
532 +# it under the terms of the GNU General Public License as published by
533 +# the Free Software Foundation; either version 2 of the License, or
534 +# (at your option) any later version.
536 +# This program is distributed in the hope that it will be useful, but
537 +# WITHOUT ANY WARRANTY; without even the implied warranty of
538 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
539 +# General Public License for more details.
541 +# You should have received a copy of the GNU General Public License
542 +# along with this program; if not, write to the Free Software
543 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
545 +# As a special exception to the GNU General Public License, if you
546 +# distribute this file as part of a program that contains a
547 +# configuration script generated by Autoconf, you may include it under
548 +# the same distribution terms that you use for the rest of that program.
550 +# PKG_PROG_PKG_CONFIG([MIN-VERSION])
551 +# ----------------------------------
552 +AC_DEFUN([PKG_PROG_PKG_CONFIG],
553 +[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
554 +m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
555 +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
556 +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
557 +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
559 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
560 + AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
562 +if test -n "$PKG_CONFIG"; then
563 + _pkg_min_version=m4_default([$1], [0.9.0])
564 + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
565 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
566 + AC_MSG_RESULT([yes])
568 + AC_MSG_RESULT([no])
572 +])# PKG_PROG_PKG_CONFIG
574 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
576 +# Check to see whether a particular set of modules exists. Similar
577 +# to PKG_CHECK_MODULES(), but does not set variables or print errors.
579 +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
580 +# only at the first occurence in configure.ac, so if the first place
581 +# it's called might be skipped (such as if it is within an "if", you
582 +# have to call PKG_CHECK_EXISTS manually
583 +# --------------------------------------------------------------
584 +AC_DEFUN([PKG_CHECK_EXISTS],
585 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
586 +if test -n "$PKG_CONFIG" && \
587 + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
588 + m4_default([$2], [:])
589 +m4_ifvaln([$3], [else
593 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
594 +# ---------------------------------------------
595 +m4_define([_PKG_CONFIG],
596 +[if test -n "$$1"; then
598 + elif test -n "$PKG_CONFIG"; then
599 + PKG_CHECK_EXISTS([$3],
600 + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
607 +# _PKG_SHORT_ERRORS_SUPPORTED
608 +# -----------------------------
609 +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
610 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
611 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
612 + _pkg_short_errors_supported=yes
614 + _pkg_short_errors_supported=no
616 +])# _PKG_SHORT_ERRORS_SUPPORTED
619 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
620 +# [ACTION-IF-NOT-FOUND])
623 +# Note that if there is a possibility the first call to
624 +# PKG_CHECK_MODULES might not happen, you should be sure to include an
625 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
628 +# --------------------------------------------------------------
629 +AC_DEFUN([PKG_CHECK_MODULES],
630 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
631 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
632 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
635 +AC_MSG_CHECKING([for $1])
637 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
638 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])
640 +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
641 +and $1[]_LIBS to avoid the need to call pkg-config.
642 +See the pkg-config man page for more details.])
644 +if test $pkg_failed = yes; then
645 + AC_MSG_RESULT([no])
646 + _PKG_SHORT_ERRORS_SUPPORTED
647 + if test $_pkg_short_errors_supported = yes; then
648 + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
650 + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
652 + # Put the nasty error message in config.log where it belongs
653 + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
655 + m4_default([$4], [AC_MSG_ERROR(
656 +[Package requirements ($2) were not met:
660 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
661 +installed software in a non-standard prefix.
665 +elif test $pkg_failed = untried; then
666 + AC_MSG_RESULT([no])
667 + m4_default([$4], [AC_MSG_FAILURE(
668 +[The pkg-config script could not be found or is too old. Make sure it
669 +is in your PATH or set the PKG_CONFIG environment variable to the full
674 +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
677 + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
678 + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
679 + AC_MSG_RESULT([yes])
682 +])# PKG_CHECK_MODULES
684 # AM_CONDITIONAL -*- Autoconf -*-
686 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
687 Index: gdb-7.4.50.20120602/gdb/config.in
688 ===================================================================
689 --- gdb-7.4.50.20120602.orig/gdb/config.in 2012-06-02 21:08:08.651227347 +0200
690 +++ gdb-7.4.50.20120602/gdb/config.in 2012-06-02 21:08:23.546221859 +0200
692 /* Define to BFD's default target vector. */
693 #undef DEFAULT_BFD_VEC
695 +/* librpm version specific library name to dlopen. */
696 +#undef DLOPEN_LIBRPM
698 /* Define to 1 if translation of program messages to the user's native
699 language is requested. */
702 /* Define if Python 2.7 is being used. */
703 #undef HAVE_LIBPYTHON2_7
705 +/* Define if librpm library is being used. */
708 /* Define to 1 if you have the <libunwind-ia64.h> header file. */
709 #undef HAVE_LIBUNWIND_IA64_H
711 Index: gdb-7.4.50.20120602/gdb/configure
712 ===================================================================
713 --- gdb-7.4.50.20120602.orig/gdb/configure 2012-06-02 21:08:08.651227347 +0200
714 +++ gdb-7.4.50.20120602/gdb/configure 2012-06-02 21:20:53.245838121 +0200
715 @@ -680,6 +680,11 @@ REPORT_BUGS_TO
727 @@ -780,6 +785,7 @@ with_gdb_datadir
728 with_relocated_sources
730 with_auto_load_safe_path
735 @@ -825,6 +831,11 @@ CPPFLAGS
747 @@ -1494,6 +1505,8 @@ Optional Packages:
748 [--with-auto-load-dir]
749 --without-auto-load-safe-path
750 do not restrict auto-loaded files locations
751 + --with-rpm query rpm database for missing debuginfos (yes/no,
752 + def. auto=librpm.so)
753 --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
754 --with-curses use the curses library instead of the termcap
756 @@ -1535,6 +1548,13 @@ Some influential environment variables:
757 MAKEINFO Parent configure detects if it is of sufficient version.
759 Parameters for MAKEINFO.
760 + PKG_CONFIG path to pkg-config utility
762 + directories to add to pkg-config's search path
764 + path overriding pkg-config's built-in search path
765 + RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
766 + RPM_LIBS linker flags for RPM, overriding pkg-config
767 YACC The `Yet Another C Compiler' implementation to use. Defaults to
768 the first program found out of: `bison -y', `byacc', `yacc'.
769 YFLAGS The list of arguments that will be passed by default to $YACC.
770 @@ -5015,6 +5035,491 @@ _ACEOF
771 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
772 $as_echo "$with_auto_load_safe_path" >&6; }
774 +# Integration with rpm library to support missing debuginfo suggestions.
775 +# --without-rpm: Disable any rpm support.
776 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
777 +# Even with runtime missing `libname.so' GDB will still other run correctly.
778 +# Missing `libname.so' during ./configure will abort the configuration.
779 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
780 +# minor version first such as `librpm-4.6.so' as minor version differences
781 +# mean API+ABI incompatibility. If the specific match versioned library name
782 +# could not be found still open dynamically at least `librpm.so'.
783 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
784 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
785 +# be probably linked with the version specific library (as `librpm-4.6.so').
786 +# Failure to find librpm by pkg-config will abort the configuration.
787 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
788 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
791 +# Check whether --with-rpm was given.
792 +if test "${with_rpm+set}" = set; then :
801 +if test "x$with_rpm" != "xno"; then
802 + if test "x$with_rpm" = "xyes"; then
805 + DLOPEN_REQUIRE=false
806 + elif test "x$with_rpm" = "xauto"; then
809 + DLOPEN_REQUIRE=false
813 + DLOPEN_REQUIRE=true
815 + LIBRPM_STRING='"'"$LIBRPM"'"'
817 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
818 +$as_echo_n "checking specific librpm version... " >&6; }
819 + HAVE_DLOPEN_LIBRPM=false
822 + if test "$cross_compiling" = yes; then :
823 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
824 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
825 +as_fn_error "cannot run test program while cross compiling
826 +See \`config.log' for more details." "$LINENO" 5; }
828 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
829 +/* end confdefs.h. */
831 +#include <rpm/rpmlib.h>
840 + const char *const *rpmverp;
843 + f = fopen ("conftest.out", "w");
846 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
850 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
853 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
856 + rpmverp = dlsym (h, "RPMVERSION");
859 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
862 + fprintf (stderr, "RPMVERSION is: \"");
863 + fprintf (stderr, "%s\"\n", *rpmverp);
865 + /* Try to find the specific librpm version only for "librpm.so" as we do
866 + not know how to assemble the version string otherwise. */
868 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
870 + fprintf (f, "%s\n", $LIBRPM_STRING);
879 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
881 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
882 + fprintf (f, "%s\n", $LIBRPM_STRING);
885 + /* Avoid the square brackets by malloc. */
886 + h2_name = malloc (64);
887 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
888 + h2 = dlopen (h2_name, RTLD_LAZY);
891 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
892 + fprintf (f, "%s\n", $LIBRPM_STRING);
897 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
898 + $LIBRPM_STRING, h2_name);
899 + fprintf (f, "%s\n", $LIBRPM_STRING);
902 + /* Found the valid .so name with a specific version. */
903 + fprintf (f, "%s\n", h2_name);
911 +if ac_fn_c_try_run "$LINENO"; then :
913 + DLOPEN_LIBRPM="`cat conftest.out`"
914 + if test "x$DLOPEN_LIBRPM" != "x"; then
915 + HAVE_DLOPEN_LIBRPM=true
916 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
917 +$as_echo "$DLOPEN_LIBRPM" >&6; }
921 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
922 + conftest.$ac_objext conftest.beam conftest.$ac_ext
929 + if $HAVE_DLOPEN_LIBRPM; then
931 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
932 +$as_echo_n "checking rpm library API compatibility... " >&6; }
933 + # The compilation requires -Werror to verify anything.
934 + save_CFLAGS="$CFLAGS"
935 + CFLAGS="$CFLAGS -Werror"
936 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
937 +/* end confdefs.h. */
939 +/* Duplicate here the declarations to verify they match "elfread.c". */
940 +#include <rpm/rpmlib.h>
941 +#include <rpm/rpmts.h>
942 +#include <rpm/rpmdb.h>
943 +#include <rpm/header.h>
944 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
945 +extern int rpmReadConfigFiles(const char * file, const char * target);
946 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
947 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
948 +extern rpmts rpmtsCreate(void);
949 +extern rpmts rpmtsFree(rpmts ts);
950 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
951 + const void * keyp, size_t keylen);
961 +if ac_fn_c_try_compile "$LINENO"; then :
964 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
965 +$as_echo "yes" >&6; }
969 + LIBRPM_COMPAT=false
970 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
971 +$as_echo "no" >&6; }
974 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
975 + CFLAGS="$save_CFLAGS"
977 + if ! $LIBRPM_COMPAT; then
978 + HAVE_DLOPEN_LIBRPM=false
982 + if $HAVE_DLOPEN_LIBRPM; then
983 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
985 +cat >>confdefs.h <<_ACEOF
986 +#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
990 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
993 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
994 +$as_echo "no" >&6; }
996 + if $DLOPEN_REQUIRE; then
997 + as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
1005 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1006 + if test -n "$ac_tool_prefix"; then
1007 + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
1008 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
1009 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1010 +$as_echo_n "checking for $ac_word... " >&6; }
1011 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
1012 + $as_echo_n "(cached) " >&6
1014 + case $PKG_CONFIG in
1015 + [\\/]* | ?:[\\/]*)
1016 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1019 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1020 +for as_dir in $PATH
1023 + test -z "$as_dir" && as_dir=.
1024 + for ac_exec_ext in '' $ac_executable_extensions; do
1025 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1026 + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1027 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1037 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
1038 +if test -n "$PKG_CONFIG"; then
1039 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
1040 +$as_echo "$PKG_CONFIG" >&6; }
1042 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1043 +$as_echo "no" >&6; }
1048 +if test -z "$ac_cv_path_PKG_CONFIG"; then
1049 + ac_pt_PKG_CONFIG=$PKG_CONFIG
1050 + # Extract the first word of "pkg-config", so it can be a program name with args.
1051 +set dummy pkg-config; ac_word=$2
1052 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1053 +$as_echo_n "checking for $ac_word... " >&6; }
1054 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
1055 + $as_echo_n "(cached) " >&6
1057 + case $ac_pt_PKG_CONFIG in
1058 + [\\/]* | ?:[\\/]*)
1059 + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
1062 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1063 +for as_dir in $PATH
1066 + test -z "$as_dir" && as_dir=.
1067 + for ac_exec_ext in '' $ac_executable_extensions; do
1068 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1069 + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1070 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1080 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
1081 +if test -n "$ac_pt_PKG_CONFIG"; then
1082 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
1083 +$as_echo "$ac_pt_PKG_CONFIG" >&6; }
1085 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1086 +$as_echo "no" >&6; }
1089 + if test "x$ac_pt_PKG_CONFIG" = x; then
1092 + case $cross_compiling:$ac_tool_warned in
1094 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
1095 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
1096 +ac_tool_warned=yes ;;
1098 + PKG_CONFIG=$ac_pt_PKG_CONFIG
1101 + PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1105 +if test -n "$PKG_CONFIG"; then
1106 + _pkg_min_version=0.9.0
1107 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
1108 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
1109 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1110 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1111 +$as_echo "yes" >&6; }
1113 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1114 +$as_echo "no" >&6; }
1120 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
1121 +$as_echo_n "checking for RPM... " >&6; }
1123 +if test -n "$RPM_CFLAGS"; then
1124 + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
1125 + elif test -n "$PKG_CONFIG"; then
1126 + if test -n "$PKG_CONFIG" && \
1127 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1128 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1130 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1131 + test $ac_status = 0; }; then
1132 + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
1137 + pkg_failed=untried
1139 +if test -n "$RPM_LIBS"; then
1140 + pkg_cv_RPM_LIBS="$RPM_LIBS"
1141 + elif test -n "$PKG_CONFIG"; then
1142 + if test -n "$PKG_CONFIG" && \
1143 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1144 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1146 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1147 + test $ac_status = 0; }; then
1148 + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
1153 + pkg_failed=untried
1158 +if test $pkg_failed = yes; then
1159 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1160 +$as_echo "no" >&6; }
1162 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1163 + _pkg_short_errors_supported=yes
1165 + _pkg_short_errors_supported=no
1167 + if test $_pkg_short_errors_supported = yes; then
1168 + RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
1170 + RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
1172 + # Put the nasty error message in config.log where it belongs
1173 + echo "$RPM_PKG_ERRORS" >&5
1176 +elif test $pkg_failed = untried; then
1177 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1178 +$as_echo "no" >&6; }
1181 + RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
1182 + RPM_LIBS=$pkg_cv_RPM_LIBS
1183 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1184 +$as_echo "yes" >&6; }
1188 + if $HAVE_LIBRPM; then
1190 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
1191 +$as_echo_n "checking rpm library API compatibility... " >&6; }
1192 + # The compilation requires -Werror to verify anything.
1193 + save_CFLAGS="$CFLAGS"
1194 + CFLAGS="$CFLAGS -Werror"
1195 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1196 +/* end confdefs.h. */
1198 +/* Duplicate here the declarations to verify they match "elfread.c". */
1199 +#include <rpm/rpmlib.h>
1200 +#include <rpm/rpmts.h>
1201 +#include <rpm/rpmdb.h>
1202 +#include <rpm/header.h>
1203 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1204 +extern int rpmReadConfigFiles(const char * file, const char * target);
1205 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1206 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1207 +extern rpmts rpmtsCreate(void);
1208 +extern rpmts rpmtsFree(rpmts ts);
1209 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1210 + const void * keyp, size_t keylen);
1220 +if ac_fn_c_try_compile "$LINENO"; then :
1222 + LIBRPM_COMPAT=true
1223 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1224 +$as_echo "yes" >&6; }
1228 + LIBRPM_COMPAT=false
1229 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1230 +$as_echo "no" >&6; }
1233 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1234 + CFLAGS="$save_CFLAGS"
1236 + if ! $LIBRPM_COMPAT; then
1238 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1242 + if $HAVE_LIBRPM; then
1244 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
1246 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1247 + LIBS="$LIBS $RPM_LIBS"
1249 + if $RPM_REQUIRE; then
1250 + as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
1252 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
1253 +$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
1261 subdirs="$subdirs testsuite"
1262 Index: gdb-7.4.50.20120602/gdb/configure.ac
1263 ===================================================================
1264 --- gdb-7.4.50.20120602.orig/gdb/configure.ac 2012-06-02 21:08:08.651227347 +0200
1265 +++ gdb-7.4.50.20120602/gdb/configure.ac 2012-06-02 21:08:23.560221855 +0200
1266 @@ -166,6 +166,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
1267 [Directories safe to hold auto-loaded files.])
1268 AC_MSG_RESULT([$with_auto_load_safe_path])
1270 +# Integration with rpm library to support missing debuginfo suggestions.
1271 +# --without-rpm: Disable any rpm support.
1272 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
1273 +# Even with runtime missing `libname.so' GDB will still other run correctly.
1274 +# Missing `libname.so' during ./configure will abort the configuration.
1275 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
1276 +# minor version first such as `librpm-4.6.so' as minor version differences
1277 +# mean API+ABI incompatibility. If the specific match versioned library name
1278 +# could not be found still open dynamically at least `librpm.so'.
1279 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
1280 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
1281 +# be probably linked with the version specific library (as `librpm-4.6.so').
1282 +# Failure to find librpm by pkg-config will abort the configuration.
1283 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
1284 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
1287 + [AS_HELP_STRING([--with-rpm],
1288 + [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
1290 +m4_pattern_allow([^AC_MSG_ERROR$])
1291 +m4_pattern_allow([^AC_MSG_WARN$])
1292 +if test "x$with_rpm" != "xno"; then
1293 + if test "x$with_rpm" = "xyes"; then
1294 + LIBRPM="librpm.so"
1296 + DLOPEN_REQUIRE=false
1297 + elif test "x$with_rpm" = "xauto"; then
1298 + LIBRPM="librpm.so"
1300 + DLOPEN_REQUIRE=false
1302 + LIBRPM="$with_rpm"
1304 + DLOPEN_REQUIRE=true
1306 + LIBRPM_STRING='"'"$LIBRPM"'"'
1308 + AC_MSG_CHECKING([specific librpm version])
1309 + HAVE_DLOPEN_LIBRPM=false
1312 + AC_RUN_IFELSE(AC_LANG_PROGRAM([[
1313 +#include <rpm/rpmlib.h>
1318 + const char *const *rpmverp;
1321 + f = fopen ("conftest.out", "w");
1324 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
1325 + strerror (errno));
1328 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
1331 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
1334 + rpmverp = dlsym (h, "RPMVERSION");
1337 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
1340 + fprintf (stderr, "RPMVERSION is: \"");
1341 + fprintf (stderr, "%s\"\n", *rpmverp);
1343 + /* Try to find the specific librpm version only for "librpm.so" as we do
1344 + not know how to assemble the version string otherwise. */
1346 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
1348 + fprintf (f, "%s\n", $LIBRPM_STRING);
1357 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
1359 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
1360 + fprintf (f, "%s\n", $LIBRPM_STRING);
1363 + /* Avoid the square brackets by malloc. */
1364 + h2_name = malloc (64);
1365 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
1366 + h2 = dlopen (h2_name, RTLD_LAZY);
1369 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
1370 + fprintf (f, "%s\n", $LIBRPM_STRING);
1375 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
1376 + $LIBRPM_STRING, h2_name);
1377 + fprintf (f, "%s\n", $LIBRPM_STRING);
1380 + /* Found the valid .so name with a specific version. */
1381 + fprintf (f, "%s\n", h2_name);
1385 + DLOPEN_LIBRPM="`cat conftest.out`"
1386 + if test "x$DLOPEN_LIBRPM" != "x"; then
1387 + HAVE_DLOPEN_LIBRPM=true
1388 + AC_MSG_RESULT($DLOPEN_LIBRPM)
1391 + rm -f conftest.out
1393 + m4_define([CHECK_LIBRPM_COMPAT], [
1394 + AC_MSG_CHECKING([rpm library API compatibility])
1395 + # The compilation requires -Werror to verify anything.
1396 + save_CFLAGS="$CFLAGS"
1397 + CFLAGS="$CFLAGS -Werror"
1398 + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
1399 +/* Duplicate here the declarations to verify they match "elfread.c". */
1400 +#include <rpm/rpmlib.h>
1401 +#include <rpm/rpmts.h>
1402 +#include <rpm/rpmdb.h>
1403 +#include <rpm/header.h>
1404 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1405 +extern int rpmReadConfigFiles(const char * file, const char * target);
1406 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1407 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1408 +extern rpmts rpmtsCreate(void);
1409 +extern rpmts rpmtsFree(rpmts ts);
1410 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1411 + const void * keyp, size_t keylen);
1413 + LIBRPM_COMPAT=true
1414 + AC_MSG_RESULT(yes)
1416 + LIBRPM_COMPAT=false
1419 + CFLAGS="$save_CFLAGS"
1422 + if $HAVE_DLOPEN_LIBRPM; then
1423 + CHECK_LIBRPM_COMPAT
1424 + if ! $LIBRPM_COMPAT; then
1425 + HAVE_DLOPEN_LIBRPM=false
1429 + if $HAVE_DLOPEN_LIBRPM; then
1430 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
1431 + AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
1432 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1436 + if $DLOPEN_REQUIRE; then
1437 + AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
1439 + PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
1441 + if $HAVE_LIBRPM; then
1442 + CHECK_LIBRPM_COMPAT
1443 + if ! $LIBRPM_COMPAT; then
1445 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1449 + if $HAVE_LIBRPM; then
1450 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1451 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1452 + LIBS="$LIBS $RPM_LIBS"
1454 + if $RPM_REQUIRE; then
1455 + AC_MSG_ERROR($RPM_PKG_ERRORS)
1457 + AC_MSG_WARN($RPM_PKG_ERRORS)
1463 AC_CONFIG_SUBDIRS(testsuite)
1465 # Check whether to support alternative target configurations
1466 Index: gdb-7.4.50.20120602/gdb/corelow.c
1467 ===================================================================
1468 --- gdb-7.4.50.20120602.orig/gdb/corelow.c 2012-06-02 21:08:08.651227347 +0200
1469 +++ gdb-7.4.50.20120602/gdb/corelow.c 2012-06-02 21:08:23.561221855 +0200
1470 @@ -317,7 +317,7 @@ build_id_locate_exec (int from_tty)
1471 symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
1474 - debug_print_missing (_("the main executable file"), build_id_filename);
1475 + debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename);
1477 do_cleanups (back_to);