1 Index: gdb-6.8.50.20090909/gdb/event-top.c
2 ===================================================================
3 --- gdb-6.8.50.20090909.orig/gdb/event-top.c 2009-09-09 20:05:48.000000000 +0200
4 +++ gdb-6.8.50.20090909/gdb/event-top.c 2009-09-09 20:08:04.000000000 +0200
6 #include "cli/cli-script.h" /* for reset_command_nest_depth */
11 /* For dont_repeat() */
13 @@ -193,6 +194,8 @@ cli_command_loop (void)
15 char *gdb_prompt = get_prompt ();
17 + debug_flush_missing ();
19 /* Tell readline what the prompt to display is and what function it
20 will need to call after a whole line is read. This also displays
22 @@ -264,6 +267,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-6.8.50.20090909/gdb/symfile.c
32 ===================================================================
33 --- gdb-6.8.50.20090909.orig/gdb/symfile.c 2009-09-09 20:08:04.000000000 +0200
34 +++ gdb-6.8.50.20090909/gdb/symfile.c 2009-09-09 20:08:04.000000000 +0200
39 +#include "elf/external.h"
41 #include <sys/types.h>
47 +#include <sys/param.h>
50 int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
51 @@ -1673,8 +1675,352 @@ build_id_to_filename (struct build_id *b
57 +#include <rpm/rpmlib.h>
58 +#include <rpm/rpmts.h>
59 +#include <rpm/rpmdb.h>
60 +#include <rpm/header.h>
65 +/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
66 + and avoid their duplicities during a single inferior run. */
68 +static struct htab *missing_rpm_hash;
70 +/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
71 + all the rpms right before the nearest GDB prompt. It gets cleared after
72 + each such print (it is questionable if we should clear it after the print).
77 + struct missing_rpm *next;
80 +static struct missing_rpm *missing_rpm_list;
81 +static int missing_rpm_list_entries;
83 +/* Returns the count of newly added rpms. */
86 +missing_rpm_enlist (const char *filename)
88 + static int rpm_init_done = 0;
90 + rpmdbMatchIterator mi;
94 + /* Duplicate here the declarations to verify they match. The same sanity
95 + check is present also in `configure.ac'. */
96 + extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
97 + static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
98 + extern int rpmReadConfigFiles(const char * file, const char * target);
99 + static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
100 + extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
101 + static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
102 + extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
103 + static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
104 + extern rpmts rpmtsCreate(void);
105 + static rpmts (*rpmtsCreate_p) (void);
106 + extern rpmts rpmtsFree(rpmts ts);
107 + static rpmts (*rpmtsFree_p) (rpmts ts);
108 + extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
109 + const void * keyp, size_t keylen);
110 + static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
114 +#else /* !DLOPEN_LIBRPM */
115 +# define headerFormat_p headerFormat
116 +# define rpmReadConfigFiles_p rpmReadConfigFiles
117 +# define rpmdbFreeIterator_p rpmdbFreeIterator
118 +# define rpmdbNextIterator_p rpmdbNextIterator
119 +# define rpmtsCreate_p rpmtsCreate
120 +# define rpmtsFree_p rpmtsFree
121 +# define rpmtsInitIterator_p rpmtsInitIterator
122 +#endif /* !DLOPEN_LIBRPM */
124 + if (filename == NULL)
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 --enablerepo='*-debuginfo' install NAME-debuginfo.ARCH
262 + would be more complicated than just:
263 + debuginfo-install NAME-VERSION-RELEASE.ARCH
264 + Do not supply the rpm base name (derived from .src.rpm name) as
265 + debuginfo-install is unable to install the debuginfo package if
266 + the base name PKG binary rpm is not installed while for example
267 + PKG-libs would be installed (RH Bug 467901).
268 + FUTURE: After multiple debuginfo versions simultaneously installed
269 + get supported the support for the VERSION-RELEASE tags handling
270 + may need an update. */
272 + if (missing_rpm_hash == NULL)
274 + /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
275 + should not deallocate the entries. */
277 + missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
278 + (int (*) (const void *, const void *)) streq,
279 + NULL, xcalloc, xfree);
281 + slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
282 + /* XCALLOC never returns NULL. */
283 + gdb_assert (slot != NULL);
286 + struct missing_rpm *missing_rpm;
290 + missing_rpm = xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
291 + strcpy (missing_rpm->rpm, debuginfo);
292 + missing_rpm->next = missing_rpm_list;
293 + missing_rpm_list = missing_rpm;
294 + missing_rpm_list_entries++;
301 + rpmdbFreeIterator_p (mi);
310 +missing_rpm_list_compar (const char *const *ap, const char *const *bp)
312 + return strcoll (*ap, *bp);
315 +/* It returns a NULL-terminated array of strings needing to be FREEd. It may
316 + also return only NULL. */
319 +missing_rpm_list_print (void)
321 + char **array, **array_iter;
322 + struct missing_rpm *list_iter;
323 + struct cleanup *cleanups;
325 + if (missing_rpm_list_entries == 0)
328 + array = xmalloc (sizeof (*array) * missing_rpm_list_entries);
329 + cleanups = make_cleanup (xfree, array);
331 + array_iter = array;
332 + for (list_iter = missing_rpm_list; list_iter != NULL;
333 + list_iter = list_iter->next)
335 + *array_iter++ = list_iter->rpm;
337 + gdb_assert (array_iter == array + missing_rpm_list_entries);
339 + qsort (array, missing_rpm_list_entries, sizeof (*array),
340 + (int (*) (const void *, const void *)) missing_rpm_list_compar);
342 + printf_unfiltered (_("Missing separate debuginfos, use: %s"),
343 + "debuginfo-install");
344 + for (array_iter = array; array_iter < array + missing_rpm_list_entries;
347 + putchar_unfiltered (' ');
348 + puts_unfiltered (*array_iter);
350 + putchar_unfiltered ('\n');
352 + while (missing_rpm_list != NULL)
354 + list_iter = missing_rpm_list;
355 + missing_rpm_list = list_iter->next;
358 + missing_rpm_list_entries = 0;
360 + do_cleanups (cleanups);
364 +missing_rpm_change (void)
366 + debug_flush_missing ();
368 + gdb_assert (missing_rpm_list == NULL);
369 + if (missing_rpm_hash != NULL)
371 + htab_delete (missing_rpm_hash);
372 + missing_rpm_hash = NULL;
378 + /* Init state. EXEC_BFD also still could be NULL. */
379 + MISSING_EXEC_NOT_TRIED,
380 + /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
381 + MISSING_EXEC_NOT_FOUND,
382 + /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
383 + or separate) or the main executable's RPM is now contained in
384 + MISSING_RPM_HASH. */
385 + MISSING_EXEC_ENLISTED
387 +static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
389 +#endif /* HAVE_LIBRPM */
392 +debug_flush_missing (void)
395 + missing_rpm_list_print ();
399 /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
400 - Try to install the hash file ...
401 + yum --enablerepo='*-debuginfo' install ...
404 struct missing_filepair
405 @@ -1728,11 +2074,17 @@ missing_filepair_change (void)
406 /* All their memory came just from missing_filepair_OBSTACK. */
407 missing_filepair_hash = NULL;
410 + missing_exec = MISSING_EXEC_NOT_TRIED;
415 debug_print_executable_changed (void)
418 + missing_rpm_change ();
420 missing_filepair_change ();
423 @@ -1799,14 +2151,33 @@ debug_print_missing (const char *binary,
425 *slot = missing_filepair;
427 - /* We do not collect and flush these messages as each such message
428 - already requires its own separate lines. */
430 + if (missing_exec == MISSING_EXEC_NOT_TRIED)
432 + char *exec_filename;
434 - fprintf_unfiltered (gdb_stdlog,
435 - _("Missing separate debuginfo for %s\n"), binary);
437 - fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
439 + exec_filename = get_exec_file (0);
440 + if (exec_filename != NULL)
442 + if (missing_rpm_enlist (exec_filename) == 0)
443 + missing_exec = MISSING_EXEC_NOT_FOUND;
445 + missing_exec = MISSING_EXEC_ENLISTED;
448 + if (missing_exec != MISSING_EXEC_ENLISTED)
449 + if (missing_rpm_enlist (binary) == 0 && missing_rpm_enlist (debug) == 0)
450 +#endif /* HAVE_LIBRPM */
452 + /* We do not collect and flush these messages as each such message
453 + already requires its own separate lines. */
455 + fprintf_unfiltered (gdb_stdlog,
456 + _("Missing separate debuginfo for %s\n"), binary);
458 + fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
459 + "yum --enablerepo='*-debuginfo' install", debug);
464 Index: gdb-6.8.50.20090909/gdb/symfile.h
465 ===================================================================
466 --- gdb-6.8.50.20090909.orig/gdb/symfile.h 2009-09-09 20:08:04.000000000 +0200
467 +++ gdb-6.8.50.20090909/gdb/symfile.h 2009-09-09 20:08:04.000000000 +0200
468 @@ -387,6 +387,7 @@ extern struct build_id *build_id_addr_ge
469 extern char *build_id_to_filename (struct build_id *build_id,
470 char **link_return, int add_debug_suffix);
471 extern void debug_print_missing (const char *binary, const char *debug);
472 +extern void debug_flush_missing (void);
474 /* From dwarf2read.c */
476 Index: gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp
477 ===================================================================
478 --- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/gdb.exp 2009-09-09 20:08:04.000000000 +0200
479 +++ gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp 2009-09-09 20:08:04.000000000 +0200
480 @@ -1248,7 +1248,7 @@ proc default_gdb_start { } {
481 warning "Couldn't set the width to 0."
484 - # Turn off the missing warnings as the testsuite does not expect it.
485 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
486 send_gdb "set build-id-verbose 0\n"
488 -re "$gdb_prompt $" {
489 Index: gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp
490 ===================================================================
491 --- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/mi-support.exp 2009-09-09 20:08:04.000000000 +0200
492 +++ gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp 2009-09-09 20:08:04.000000000 +0200
493 @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } {
497 - # Turn off the missing warnings as the testsuite does not expect it.
498 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
499 send_gdb "190-gdb-set build-id-verbose 0\n"
501 -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
502 Index: gdb-6.8.50.20090909/gdb/tui/tui-interp.c
503 ===================================================================
504 --- gdb-6.8.50.20090909.orig/gdb/tui/tui-interp.c 2009-09-09 20:05:48.000000000 +0200
505 +++ gdb-6.8.50.20090909/gdb/tui/tui-interp.c 2009-09-09 20:08:04.000000000 +0200
508 #include "tui/tui-io.h"
509 #include "exceptions.h"
510 +#include "symfile.h"
512 /* Set to 1 when the TUI mode must be activated when we first start
514 @@ -128,6 +129,8 @@ tui_command_loop (void *data)
516 char *gdb_prompt = get_prompt ();
518 + debug_flush_missing ();
520 /* Tell readline what the prompt to display is and what function
521 it will need to call after a whole line is read. This also
522 displays the first prompt. */
523 Index: gdb-6.8.50.20090909/gdb/aclocal.m4
524 ===================================================================
525 --- gdb-6.8.50.20090909.orig/gdb/aclocal.m4 2009-09-09 20:05:48.000000000 +0200
526 +++ gdb-6.8.50.20090909/gdb/aclocal.m4 2009-09-09 20:09:32.000000000 +0200
527 @@ -19,6 +19,162 @@ You have another version of autoconf. I
528 If you have problems, you may need to regenerate the build system entirely.
529 To do so, use the procedure documented by the package, typically `autoreconf'.])])
531 +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
533 +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
535 +# This program is free software; you can redistribute it and/or modify
536 +# it under the terms of the GNU General Public License as published by
537 +# the Free Software Foundation; either version 2 of the License, or
538 +# (at your option) any later version.
540 +# This program is distributed in the hope that it will be useful, but
541 +# WITHOUT ANY WARRANTY; without even the implied warranty of
542 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
543 +# General Public License for more details.
545 +# You should have received a copy of the GNU General Public License
546 +# along with this program; if not, write to the Free Software
547 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
549 +# As a special exception to the GNU General Public License, if you
550 +# distribute this file as part of a program that contains a
551 +# configuration script generated by Autoconf, you may include it under
552 +# the same distribution terms that you use for the rest of that program.
554 +# PKG_PROG_PKG_CONFIG([MIN-VERSION])
555 +# ----------------------------------
556 +AC_DEFUN([PKG_PROG_PKG_CONFIG],
557 +[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
558 +m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
559 +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
560 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
561 + AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
563 +if test -n "$PKG_CONFIG"; then
564 + _pkg_min_version=m4_default([$1], [0.9.0])
565 + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
566 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
567 + AC_MSG_RESULT([yes])
569 + AC_MSG_RESULT([no])
574 +])# PKG_PROG_PKG_CONFIG
576 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
578 +# Check to see whether a particular set of modules exists. Similar
579 +# to PKG_CHECK_MODULES(), but does not set variables or print errors.
582 +# Similar to PKG_CHECK_MODULES, make sure that the first instance of
583 +# this or PKG_CHECK_MODULES is called, or make sure to call
584 +# PKG_CHECK_EXISTS manually
585 +# --------------------------------------------------------------
586 +AC_DEFUN([PKG_CHECK_EXISTS],
587 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
588 +if test -n "$PKG_CONFIG" && \
589 + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
590 + m4_ifval([$2], [$2], [:])
591 +m4_ifvaln([$3], [else
596 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
597 +# ---------------------------------------------
598 +m4_define([_PKG_CONFIG],
599 +[if test -n "$$1"; then
601 + elif test -n "$PKG_CONFIG"; then
602 + PKG_CHECK_EXISTS([$3],
603 + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
610 +# _PKG_SHORT_ERRORS_SUPPORTED
611 +# -----------------------------
612 +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
613 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
614 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
615 + _pkg_short_errors_supported=yes
617 + _pkg_short_errors_supported=no
619 +])# _PKG_SHORT_ERRORS_SUPPORTED
622 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
623 +# [ACTION-IF-NOT-FOUND])
626 +# Note that if there is a possibility the first call to
627 +# PKG_CHECK_MODULES might not happen, you should be sure to include an
628 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
631 +# --------------------------------------------------------------
632 +AC_DEFUN([PKG_CHECK_MODULES],
633 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
634 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
635 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
638 +AC_MSG_CHECKING([for $1])
640 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
641 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])
643 +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
644 +and $1[]_LIBS to avoid the need to call pkg-config.
645 +See the pkg-config man page for more details.])
647 +if test $pkg_failed = yes; then
648 + _PKG_SHORT_ERRORS_SUPPORTED
649 + if test $_pkg_short_errors_supported = yes; then
650 + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
652 + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
654 + # Put the nasty error message in config.log where it belongs
655 + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
657 + ifelse([$4], , [AC_MSG_ERROR(dnl
658 +[Package requirements ($2) were not met:
662 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
663 +installed software in a non-standard prefix.
667 + [AC_MSG_RESULT([no])
669 +elif test $pkg_failed = untried; then
670 + ifelse([$4], , [AC_MSG_FAILURE(dnl
671 +[The pkg-config script could not be found or is too old. Make sure it
672 +is in your PATH or set the PKG_CONFIG environment variable to the full
677 +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
680 + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
681 + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
682 + AC_MSG_RESULT([yes])
683 + ifelse([$3], , :, [$3])
685 +])# PKG_CHECK_MODULES
687 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
689 # This file is free software; the Free Software Foundation
690 Index: gdb-6.8.50.20090909/gdb/config.in
691 ===================================================================
692 --- gdb-6.8.50.20090909.orig/gdb/config.in 2009-09-09 20:08:04.000000000 +0200
693 +++ gdb-6.8.50.20090909/gdb/config.in 2009-09-09 20:08:04.000000000 +0200
695 /* Define to BFD's default target vector. */
696 #undef DEFAULT_BFD_VEC
698 +/* librpm version specific library name to dlopen. */
699 +#undef DLOPEN_LIBRPM
701 /* Define to 1 if translation of program messages to the user's native
702 language is requested. */
705 /* Define if Python 2.6 is being used. */
706 #undef HAVE_LIBPYTHON2_6
708 +/* Define if librpm library is being used. */
711 /* Define if libunwind library is being used. */
712 #undef HAVE_LIBUNWIND
714 Index: gdb-6.8.50.20090909/gdb/configure
715 ===================================================================
716 --- gdb-6.8.50.20090909.orig/gdb/configure 2009-09-09 20:08:04.000000000 +0200
717 +++ gdb-6.8.50.20090909/gdb/configure 2009-09-09 20:09:35.000000000 +0200
718 @@ -676,6 +676,9 @@ REPORT_BUGS_TO
728 @@ -886,6 +889,7 @@ with_separate_debug_dir
730 with_relocated_sources
736 @@ -925,6 +929,9 @@ LDFLAGS
746 @@ -1588,6 +1595,8 @@ Optional Packages:
748 --with-pythondir install Python data files in this path
750 + --with-rpm query rpm database for missing debuginfos (yes/no,
751 + def. auto=librpm.so)
752 --with-libunwind use libunwind frame unwinding support
753 --with-curses use the curses library instead of the termcap
755 @@ -1621,6 +1630,9 @@ Some influential environment variables:
756 CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
757 you have headers in a nonstandard directory <include dir>
759 + PKG_CONFIG path to pkg-config utility
760 + RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
761 + RPM_LIBS linker flags for RPM, overriding pkg-config
762 YACC The `Yet Another C Compiler' implementation to use. Defaults to
763 the first program found out of: `bison -y', `byacc', `yacc'.
764 YFLAGS The list of arguments that will be passed by default to $YACC.
765 @@ -6675,6 +6687,486 @@ _ACEOF
769 +# Integration with rpm library to support missing debuginfo suggestions.
770 +# --without-rpm: Disable any rpm support.
771 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
772 +# Even with runtime missing `libname.so' GDB will still other run correctly.
773 +# Missing `libname.so' during ./configure will abort the configuration.
774 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
775 +# minor version first such as `librpm-4.6.so' as minor version differences
776 +# mean API+ABI incompatibility. If the specific match versioned library name
777 +# could not be found still open dynamically at least `librpm.so'.
778 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
779 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
780 +# be probably linked with the version specific library (as `librpm-4.6.so').
781 +# Failure to find librpm by pkg-config will abort the configuration.
782 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
783 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
786 +# Check whether --with-rpm was given.
787 +if test "${with_rpm+set}" = set; then :
796 +if test "x$with_rpm" != "xno"; then
797 + if test "x$with_rpm" = "xyes"; then
800 + DLOPEN_REQUIRE=false
801 + elif test "x$with_rpm" = "xauto"; then
804 + DLOPEN_REQUIRE=false
808 + DLOPEN_REQUIRE=true
810 + LIBRPM_STRING='"'"$LIBRPM"'"'
812 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
813 +$as_echo_n "checking specific librpm version... " >&6; }
814 + HAVE_DLOPEN_LIBRPM=false
817 + if test "$cross_compiling" = yes; then :
818 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
819 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
820 +as_fn_error "cannot run test program while cross compiling
821 +See \`config.log' for more details." "$LINENO" 5; }
823 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
824 +/* end confdefs.h. */
826 +#include <rpm/rpmlib.h>
835 + const char *const *rpmverp;
838 + f = fopen ("conftest.out", "w");
841 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
845 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
848 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
851 + rpmverp = dlsym (h, "RPMVERSION");
854 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
857 + fprintf (stderr, "RPMVERSION is: \"");
858 + fprintf (stderr, "%s\"\n", *rpmverp);
860 + /* Try to find the specific librpm version only for "librpm.so" as we do
861 + not know how to assemble the version string otherwise. */
863 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
865 + fprintf (f, "%s\n", $LIBRPM_STRING);
874 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
876 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
877 + fprintf (f, "%s\n", $LIBRPM_STRING);
880 + /* Avoid the square brackets by malloc. */
881 + h2_name = malloc (64);
882 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
883 + h2 = dlopen (h2_name, RTLD_LAZY);
886 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
887 + fprintf (f, "%s\n", $LIBRPM_STRING);
892 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
893 + $LIBRPM_STRING, h2_name);
894 + fprintf (f, "%s\n", $LIBRPM_STRING);
897 + /* Found the valid .so name with a specific version. */
898 + fprintf (f, "%s\n", h2_name);
906 +if ac_fn_c_try_run "$LINENO"; then :
908 + DLOPEN_LIBRPM="`cat conftest.out`"
909 + if test "x$DLOPEN_LIBRPM" != "x"; then
910 + HAVE_DLOPEN_LIBRPM=true
911 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
912 +$as_echo "$DLOPEN_LIBRPM" >&6; }
916 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
917 + conftest.$ac_objext conftest.beam conftest.$ac_ext
924 + if $HAVE_DLOPEN_LIBRPM; then
926 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
927 +$as_echo_n "checking rpm library API compatibility... " >&6; }
928 + # The compilation requires -Werror to verify anything.
929 + save_CFLAGS="$CFLAGS"
930 + CFLAGS="$CFLAGS -Werror"
931 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
932 +/* end confdefs.h. */
934 +/* Duplicate here the declarations to verify they match "symfile.c". */
935 +#include <rpm/rpmlib.h>
936 +#include <rpm/rpmts.h>
937 +#include <rpm/rpmdb.h>
938 +#include <rpm/header.h>
939 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
940 +extern int rpmReadConfigFiles(const char * file, const char * target);
941 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
942 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
943 +extern rpmts rpmtsCreate(void);
944 +extern rpmts rpmtsFree(rpmts ts);
945 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
946 + const void * keyp, size_t keylen);
956 +if ac_fn_c_try_compile "$LINENO"; then :
959 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
960 +$as_echo "yes" >&6; }
964 + LIBRPM_COMPAT=false
965 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
966 +$as_echo "no" >&6; }
969 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
970 + CFLAGS="$save_CFLAGS"
972 + if ! $LIBRPM_COMPAT; then
973 + HAVE_DLOPEN_LIBRPM=false
977 + if $HAVE_DLOPEN_LIBRPM; then
978 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
980 +cat >>confdefs.h <<_ACEOF
981 +#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
985 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
988 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
989 +$as_echo "no" >&6; }
991 + if $DLOPEN_REQUIRE; then
992 + as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
996 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
997 + if test -n "$ac_tool_prefix"; then
998 + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
999 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
1000 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1001 +$as_echo_n "checking for $ac_word... " >&6; }
1002 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
1003 + $as_echo_n "(cached) " >&6
1005 + case $PKG_CONFIG in
1006 + [\\/]* | ?:[\\/]*)
1007 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1010 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1011 +for as_dir in $PATH
1014 + test -z "$as_dir" && as_dir=.
1015 + for ac_exec_ext in '' $ac_executable_extensions; do
1016 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1017 + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1018 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1028 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
1029 +if test -n "$PKG_CONFIG"; then
1030 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
1031 +$as_echo "$PKG_CONFIG" >&6; }
1033 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1034 +$as_echo "no" >&6; }
1039 +if test -z "$ac_cv_path_PKG_CONFIG"; then
1040 + ac_pt_PKG_CONFIG=$PKG_CONFIG
1041 + # Extract the first word of "pkg-config", so it can be a program name with args.
1042 +set dummy pkg-config; ac_word=$2
1043 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1044 +$as_echo_n "checking for $ac_word... " >&6; }
1045 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
1046 + $as_echo_n "(cached) " >&6
1048 + case $ac_pt_PKG_CONFIG in
1049 + [\\/]* | ?:[\\/]*)
1050 + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
1053 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1054 +for as_dir in $PATH
1057 + test -z "$as_dir" && as_dir=.
1058 + for ac_exec_ext in '' $ac_executable_extensions; do
1059 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1060 + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1061 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1071 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
1072 +if test -n "$ac_pt_PKG_CONFIG"; then
1073 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
1074 +$as_echo "$ac_pt_PKG_CONFIG" >&6; }
1076 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1077 +$as_echo "no" >&6; }
1080 + if test "x$ac_pt_PKG_CONFIG" = x; then
1083 + case $cross_compiling:$ac_tool_warned in
1085 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
1086 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
1087 +ac_tool_warned=yes ;;
1089 + PKG_CONFIG=$ac_pt_PKG_CONFIG
1092 + PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1096 +if test -n "$PKG_CONFIG"; then
1097 + _pkg_min_version=0.9.0
1098 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
1099 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
1100 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1101 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1102 +$as_echo "yes" >&6; }
1104 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1105 +$as_echo "no" >&6; }
1112 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
1113 +$as_echo_n "checking for RPM... " >&6; }
1115 +if test -n "$RPM_CFLAGS"; then
1116 + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
1117 + elif test -n "$PKG_CONFIG"; then
1118 + if test -n "$PKG_CONFIG" && \
1119 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1120 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1122 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1123 + test $ac_status = 0; }; then
1124 + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
1129 + pkg_failed=untried
1131 +if test -n "$RPM_LIBS"; then
1132 + pkg_cv_RPM_LIBS="$RPM_LIBS"
1133 + elif test -n "$PKG_CONFIG"; then
1134 + if test -n "$PKG_CONFIG" && \
1135 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1136 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1138 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1139 + test $ac_status = 0; }; then
1140 + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
1145 + pkg_failed=untried
1150 +if test $pkg_failed = yes; then
1152 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1153 + _pkg_short_errors_supported=yes
1155 + _pkg_short_errors_supported=no
1157 + if test $_pkg_short_errors_supported = yes; then
1158 + RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
1160 + RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
1162 + # Put the nasty error message in config.log where it belongs
1163 + echo "$RPM_PKG_ERRORS" >&5
1165 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1166 +$as_echo "no" >&6; }
1168 +elif test $pkg_failed = untried; then
1171 + RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
1172 + RPM_LIBS=$pkg_cv_RPM_LIBS
1173 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1174 +$as_echo "yes" >&6; }
1178 + if $HAVE_LIBRPM; then
1180 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
1181 +$as_echo_n "checking rpm library API compatibility... " >&6; }
1182 + # The compilation requires -Werror to verify anything.
1183 + save_CFLAGS="$CFLAGS"
1184 + CFLAGS="$CFLAGS -Werror"
1185 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1186 +/* end confdefs.h. */
1188 +/* Duplicate here the declarations to verify they match "symfile.c". */
1189 +#include <rpm/rpmlib.h>
1190 +#include <rpm/rpmts.h>
1191 +#include <rpm/rpmdb.h>
1192 +#include <rpm/header.h>
1193 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1194 +extern int rpmReadConfigFiles(const char * file, const char * target);
1195 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1196 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1197 +extern rpmts rpmtsCreate(void);
1198 +extern rpmts rpmtsFree(rpmts ts);
1199 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1200 + const void * keyp, size_t keylen);
1210 +if ac_fn_c_try_compile "$LINENO"; then :
1212 + LIBRPM_COMPAT=true
1213 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1214 +$as_echo "yes" >&6; }
1218 + LIBRPM_COMPAT=false
1219 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1220 +$as_echo "no" >&6; }
1223 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1224 + CFLAGS="$save_CFLAGS"
1226 + if ! $LIBRPM_COMPAT; then
1228 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1232 + if $HAVE_LIBRPM; then
1234 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
1236 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1237 + LIBS="$LIBS $RPM_LIBS"
1239 + if $RPM_REQUIRE; then
1240 + as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
1242 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
1243 +$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
1252 @@ -9721,265 +10213,25 @@ $as_echo "#define STDC_HEADERS 1" >>conf
1258 for ac_header in sys/user32.h sys/procfs32.h
1260 -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
1261 -if eval "test \"\${$as_ac_Header+set}\" = set"; then
1262 - echo "$as_me:$LINENO: checking for $ac_header" >&5
1263 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
1264 -if eval "test \"\${$as_ac_Header+set}\" = set"; then
1265 - echo $ECHO_N "(cached) $ECHO_C" >&6
1267 -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
1268 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
1270 - # Is the header compilable?
1271 -echo "$as_me:$LINENO: checking $ac_header usability" >&5
1272 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
1273 -cat >conftest.$ac_ext <<_ACEOF
1276 -cat confdefs.h >>conftest.$ac_ext
1277 -cat >>conftest.$ac_ext <<_ACEOF
1278 -/* end confdefs.h. */
1279 -$ac_includes_default
1280 -#include <$ac_header>
1282 -rm -f conftest.$ac_objext
1283 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1284 - (eval $ac_compile) 2>conftest.er1
1286 - grep -v '^ *+' conftest.er1 >conftest.err
1287 - rm -f conftest.er1
1288 - cat conftest.err >&5
1289 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1290 - (exit $ac_status); } &&
1291 - { ac_try='test -z "$ac_c_werror_flag"
1292 - || test ! -s conftest.err'
1293 - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1294 - (eval $ac_try) 2>&5
1296 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1297 - (exit $ac_status); }; } &&
1298 - { ac_try='test -s conftest.$ac_objext'
1299 - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1300 - (eval $ac_try) 2>&5
1302 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1303 - (exit $ac_status); }; }; then
1304 - ac_header_compiler=yes
1306 - echo "$as_me: failed program was:" >&5
1307 -sed 's/^/| /' conftest.$ac_ext >&5
1309 -ac_header_compiler=no
1311 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1312 -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
1313 -echo "${ECHO_T}$ac_header_compiler" >&6
1315 -# Is the header present?
1316 -echo "$as_me:$LINENO: checking $ac_header presence" >&5
1317 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
1318 -cat >conftest.$ac_ext <<_ACEOF
1321 -cat confdefs.h >>conftest.$ac_ext
1322 -cat >>conftest.$ac_ext <<_ACEOF
1323 -/* end confdefs.h. */
1324 -#include <$ac_header>
1326 -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
1327 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1329 - grep -v '^ *+' conftest.er1 >conftest.err
1330 - rm -f conftest.er1
1331 - cat conftest.err >&5
1332 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1333 - (exit $ac_status); } >/dev/null; then
1334 - if test -s conftest.err; then
1335 - ac_cpp_err=$ac_c_preproc_warn_flag
1336 - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
1343 -if test -z "$ac_cpp_err"; then
1344 - ac_header_preproc=yes
1346 - echo "$as_me: failed program was:" >&5
1347 -sed 's/^/| /' conftest.$ac_ext >&5
1349 - ac_header_preproc=no
1351 -rm -f conftest.err conftest.$ac_ext
1352 -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
1353 -echo "${ECHO_T}$ac_header_preproc" >&6
1355 -# So? What about this header?
1356 -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
1358 - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
1359 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
1360 - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
1361 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
1362 - ac_header_preproc=yes
1365 - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
1366 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
1367 - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
1368 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
1369 - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
1370 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
1371 - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
1372 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
1373 - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
1374 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
1375 - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
1376 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
1379 -## ------------------------------------------ ##
1380 -## Report this to the AC_PACKAGE_NAME lists. ##
1381 -## ------------------------------------------ ##
1384 - sed "s/^/$as_me: WARNING: /" >&2
1387 -echo "$as_me:$LINENO: checking for $ac_header" >&5
1388 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
1389 -if eval "test \"\${$as_ac_Header+set}\" = set"; then
1390 - echo $ECHO_N "(cached) $ECHO_C" >&6
1392 - eval "$as_ac_Header=\$ac_header_preproc"
1394 -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
1395 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
1398 -if test `eval echo '${'$as_ac_Header'}'` = yes; then
1400 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1401 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
1402 +eval as_val=\$$as_ac_Header
1403 + if test "x$as_val" = x""yes; then :
1404 cat >>confdefs.h <<_ACEOF
1405 -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
1406 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
1413 -echo "$as_me:$LINENO: checking for struct elf_prstatus32.pr_reg" >&5
1414 -echo $ECHO_N "checking for struct elf_prstatus32.pr_reg... $ECHO_C" >&6
1415 -if test "${ac_cv_member_struct_elf_prstatus32_pr_reg+set}" = set; then
1416 - echo $ECHO_N "(cached) $ECHO_C" >&6
1418 - cat >conftest.$ac_ext <<_ACEOF
1421 -cat confdefs.h >>conftest.$ac_ext
1422 -cat >>conftest.$ac_ext <<_ACEOF
1423 -/* end confdefs.h. */
1424 -#include <sys/procfs.h>
1429 -static struct elf_prstatus32 ac_aggr;
1430 -if (ac_aggr.pr_reg)
1436 -rm -f conftest.$ac_objext
1437 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1438 - (eval $ac_compile) 2>conftest.er1
1440 - grep -v '^ *+' conftest.er1 >conftest.err
1441 - rm -f conftest.er1
1442 - cat conftest.err >&5
1443 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1444 - (exit $ac_status); } &&
1445 - { ac_try='test -z "$ac_c_werror_flag"
1446 - || test ! -s conftest.err'
1447 - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1448 - (eval $ac_try) 2>&5
1450 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1451 - (exit $ac_status); }; } &&
1452 - { ac_try='test -s conftest.$ac_objext'
1453 - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1454 - (eval $ac_try) 2>&5
1456 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1457 - (exit $ac_status); }; }; then
1458 - ac_cv_member_struct_elf_prstatus32_pr_reg=yes
1460 - echo "$as_me: failed program was:" >&5
1461 -sed 's/^/| /' conftest.$ac_ext >&5
1463 -cat >conftest.$ac_ext <<_ACEOF
1466 -cat confdefs.h >>conftest.$ac_ext
1467 -cat >>conftest.$ac_ext <<_ACEOF
1468 -/* end confdefs.h. */
1469 -#include <sys/procfs.h>
1474 -static struct elf_prstatus32 ac_aggr;
1475 -if (sizeof ac_aggr.pr_reg)
1481 -rm -f conftest.$ac_objext
1482 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1483 - (eval $ac_compile) 2>conftest.er1
1485 - grep -v '^ *+' conftest.er1 >conftest.err
1486 - rm -f conftest.er1
1487 - cat conftest.err >&5
1488 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1489 - (exit $ac_status); } &&
1490 - { ac_try='test -z "$ac_c_werror_flag"
1491 - || test ! -s conftest.err'
1492 - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1493 - (eval $ac_try) 2>&5
1495 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1496 - (exit $ac_status); }; } &&
1497 - { ac_try='test -s conftest.$ac_objext'
1498 - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1499 - (eval $ac_try) 2>&5
1501 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
1502 - (exit $ac_status); }; }; then
1503 - ac_cv_member_struct_elf_prstatus32_pr_reg=yes
1505 - echo "$as_me: failed program was:" >&5
1506 -sed 's/^/| /' conftest.$ac_ext >&5
1508 -ac_cv_member_struct_elf_prstatus32_pr_reg=no
1510 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1512 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1514 -echo "$as_me:$LINENO: result: $ac_cv_member_struct_elf_prstatus32_pr_reg" >&5
1515 -echo "${ECHO_T}$ac_cv_member_struct_elf_prstatus32_pr_reg" >&6
1516 -if test $ac_cv_member_struct_elf_prstatus32_pr_reg = yes; then
1517 +ac_fn_c_check_member "$LINENO" "struct elf_prstatus32" "pr_reg" "ac_cv_member_struct_elf_prstatus32_pr_reg" "#include <sys/procfs.h>
1519 +if test "x$ac_cv_member_struct_elf_prstatus32_pr_reg" = x""yes; then :
1521 -cat >>confdefs.h <<\_ACEOF
1522 -#define HAVE_ELF_PRSTATUS32 1
1524 +$as_echo "#define HAVE_ELF_PRSTATUS32 1" >>confdefs.h
1528 Index: gdb-6.8.50.20090909/gdb/configure.ac
1529 ===================================================================
1530 --- gdb-6.8.50.20090909.orig/gdb/configure.ac 2009-09-09 20:08:04.000000000 +0200
1531 +++ gdb-6.8.50.20090909/gdb/configure.ac 2009-09-09 20:08:04.000000000 +0200
1532 @@ -151,6 +151,199 @@ else
1536 +# Integration with rpm library to support missing debuginfo suggestions.
1537 +# --without-rpm: Disable any rpm support.
1538 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
1539 +# Even with runtime missing `libname.so' GDB will still other run correctly.
1540 +# Missing `libname.so' during ./configure will abort the configuration.
1541 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
1542 +# minor version first such as `librpm-4.6.so' as minor version differences
1543 +# mean API+ABI incompatibility. If the specific match versioned library name
1544 +# could not be found still open dynamically at least `librpm.so'.
1545 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
1546 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
1547 +# be probably linked with the version specific library (as `librpm-4.6.so').
1548 +# Failure to find librpm by pkg-config will abort the configuration.
1549 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
1550 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
1553 + [AS_HELP_STRING([--with-rpm],
1554 + [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
1556 +m4_pattern_allow([^AC_MSG_ERROR$])
1557 +m4_pattern_allow([^AC_MSG_WARN$])
1558 +if test "x$with_rpm" != "xno"; then
1559 + if test "x$with_rpm" = "xyes"; then
1560 + LIBRPM="librpm.so"
1562 + DLOPEN_REQUIRE=false
1563 + elif test "x$with_rpm" = "xauto"; then
1564 + LIBRPM="librpm.so"
1566 + DLOPEN_REQUIRE=false
1568 + LIBRPM="$with_rpm"
1570 + DLOPEN_REQUIRE=true
1572 + LIBRPM_STRING='"'"$LIBRPM"'"'
1574 + AC_MSG_CHECKING([specific librpm version])
1575 + HAVE_DLOPEN_LIBRPM=false
1578 + AC_RUN_IFELSE(AC_LANG_PROGRAM([[
1579 +#include <rpm/rpmlib.h>
1584 + const char *const *rpmverp;
1587 + f = fopen ("conftest.out", "w");
1590 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
1591 + strerror (errno));
1594 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
1597 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
1600 + rpmverp = dlsym (h, "RPMVERSION");
1603 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
1606 + fprintf (stderr, "RPMVERSION is: \"");
1607 + fprintf (stderr, "%s\"\n", *rpmverp);
1609 + /* Try to find the specific librpm version only for "librpm.so" as we do
1610 + not know how to assemble the version string otherwise. */
1612 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
1614 + fprintf (f, "%s\n", $LIBRPM_STRING);
1623 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
1625 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
1626 + fprintf (f, "%s\n", $LIBRPM_STRING);
1629 + /* Avoid the square brackets by malloc. */
1630 + h2_name = malloc (64);
1631 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
1632 + h2 = dlopen (h2_name, RTLD_LAZY);
1635 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
1636 + fprintf (f, "%s\n", $LIBRPM_STRING);
1641 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
1642 + $LIBRPM_STRING, h2_name);
1643 + fprintf (f, "%s\n", $LIBRPM_STRING);
1646 + /* Found the valid .so name with a specific version. */
1647 + fprintf (f, "%s\n", h2_name);
1651 + DLOPEN_LIBRPM="`cat conftest.out`"
1652 + if test "x$DLOPEN_LIBRPM" != "x"; then
1653 + HAVE_DLOPEN_LIBRPM=true
1654 + AC_MSG_RESULT($DLOPEN_LIBRPM)
1657 + rm -f conftest.out
1659 + m4_define([CHECK_LIBRPM_COMPAT], [
1660 + AC_MSG_CHECKING([rpm library API compatibility])
1661 + # The compilation requires -Werror to verify anything.
1662 + save_CFLAGS="$CFLAGS"
1663 + CFLAGS="$CFLAGS -Werror"
1664 + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
1665 +/* Duplicate here the declarations to verify they match "symfile.c". */
1666 +#include <rpm/rpmlib.h>
1667 +#include <rpm/rpmts.h>
1668 +#include <rpm/rpmdb.h>
1669 +#include <rpm/header.h>
1670 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1671 +extern int rpmReadConfigFiles(const char * file, const char * target);
1672 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1673 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1674 +extern rpmts rpmtsCreate(void);
1675 +extern rpmts rpmtsFree(rpmts ts);
1676 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1677 + const void * keyp, size_t keylen);
1679 + LIBRPM_COMPAT=true
1680 + AC_MSG_RESULT(yes)
1682 + LIBRPM_COMPAT=false
1685 + CFLAGS="$save_CFLAGS"
1688 + if $HAVE_DLOPEN_LIBRPM; then
1689 + CHECK_LIBRPM_COMPAT
1690 + if ! $LIBRPM_COMPAT; then
1691 + HAVE_DLOPEN_LIBRPM=false
1695 + if $HAVE_DLOPEN_LIBRPM; then
1696 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
1697 + AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
1698 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1702 + if $DLOPEN_REQUIRE; then
1703 + AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
1705 + PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
1707 + if $HAVE_LIBRPM; then
1708 + CHECK_LIBRPM_COMPAT
1709 + if ! $LIBRPM_COMPAT; then
1711 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1715 + if $HAVE_LIBRPM; then
1716 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1717 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1718 + LIBS="$LIBS $RPM_LIBS"
1720 + if $RPM_REQUIRE; then
1721 + AC_MSG_ERROR($RPM_PKG_ERRORS)
1723 + AC_MSG_WARN($RPM_PKG_ERRORS)
1730 AC_CONFIG_SUBDIRS(doc testsuite)
1732 Index: gdb-6.8.50.20090909/gdb/acinclude.m4
1733 ===================================================================
1734 --- gdb-6.8.50.20090909.orig/gdb/acinclude.m4 2009-09-09 20:05:48.000000000 +0200
1735 +++ gdb-6.8.50.20090909/gdb/acinclude.m4 2009-09-09 20:08:04.000000000 +0200
1739 dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
1740 dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
1742 @@ -79,8 +81,6 @@ AC_MSG_RESULT(yes)
1743 # Foundation, Inc., 51 Franklin Street, Fifth Floor,
1744 # Boston, MA 02110-1301, USA.
1748 # @defmac AC_PROG_CC_STDC
1749 # @maindex PROG_CC_STDC