- build-id debug messages print now the library names unconditionally.

This commit is contained in:
Jan Kratochvil 2008-02-07 14:22:49 +00:00
parent 6a80c39af8
commit 4d1104a1ae
2 changed files with 20 additions and 22 deletions

View File

@ -10,6 +10,9 @@
Lookup also the main executable from the rpm database. Lookup also the main executable from the rpm database.
Suppress duplicite buil-id missing files warnings. Suppress duplicite buil-id missing files warnings.
2008-01-26 Jan Kratochvil <jan.kratochvil@redhat.com>
Print the shared libraries names unconditionally.
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/Makefile.in gdb-6.7.1-patch274/gdb/Makefile.in diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/Makefile.in gdb-6.7.1-patch274/gdb/Makefile.in
--- gdb-6.7.1/gdb/Makefile.in 2008-01-23 00:05:25.000000000 +0100 --- gdb-6.7.1/gdb/Makefile.in 2008-01-23 00:05:25.000000000 +0100
+++ gdb-6.7.1-patch274/gdb/Makefile.in 2008-01-23 00:00:31.000000000 +0100 +++ gdb-6.7.1-patch274/gdb/Makefile.in 2008-01-23 00:00:31.000000000 +0100
@ -56,7 +59,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/corelow.c gdb-6.7.1-pat
#ifndef O_LARGEFILE #ifndef O_LARGEFILE
@@ -251,6 +255,57 @@ add_to_thread_list (bfd *abfd, asection @@ -251,6 +255,56 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = pid_to_ptid (thread_id); /* Yes, make it current */ inferior_ptid = pid_to_ptid (thread_id); /* Yes, make it current */
} }
@ -84,8 +87,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/corelow.c gdb-6.7.1-pat
+ if (exec_filename != NULL) + if (exec_filename != NULL)
+ exec_file_attach (exec_filename, from_tty); + exec_file_attach (exec_filename, from_tty);
+ else + else
+ build_id_print_missing (_("the main executable file"), build_id_filename, + build_id_print_missing (_("the main executable file"), build_id_filename);
+ 1);
+ xfree (build_id_filename); + xfree (build_id_filename);
+ +
+ /* `.note.gnu.build-id' section exists even for files without a separate + /* `.note.gnu.build-id' section exists even for files without a separate
@ -102,7 +104,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/corelow.c gdb-6.7.1-pat
+ symbol_file_add_main (exec_filename, from_tty); + symbol_file_add_main (exec_filename, from_tty);
+ /* For EXEC_FILENAME NULL we were already complaining above. */ + /* For EXEC_FILENAME NULL we were already complaining above. */
+ if (symfile_objfile == NULL && exec_filename != NULL) + if (symfile_objfile == NULL && exec_filename != NULL)
+ build_id_print_missing (exec_filename, build_id_filename, 1); + build_id_print_missing (exec_filename, build_id_filename);
+ } + }
+ xfree (build_id_filename); + xfree (build_id_filename);
+ +
@ -174,8 +176,8 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/solib-svr4.c gdb-6.7.1-
+ xfree (name); + xfree (name);
+ } + }
+ else + else
+ build_id_print_missing (new->so_name, build_id_filename, + build_id_print_missing (new->so_name,
+ 1); + build_id_filename);
+ xfree (build_id_filename); + xfree (build_id_filename);
+ xfree (build_id); + xfree (build_id);
+ } + }
@ -667,7 +669,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.c gdb-6.7.1-pat
if (retval != NULL && !build_id_verify (retval, build_id)) if (retval != NULL && !build_id_verify (retval, build_id))
{ {
@@ -1326,9 +1723,203 @@ build_id_to_debug_filename (struct build @@ -1326,9 +1723,199 @@ build_id_to_debug_filename (struct build
retval = NULL; retval = NULL;
} }
@ -800,8 +802,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.c gdb-6.7.1-pat
+} +}
+ +
+void +void
+build_id_print_missing (const char *binary, const char *debug, +build_id_print_missing (const char *binary, const char *debug)
+ int print_filename)
+{ +{
+ char *exec_filename = NULL; + char *exec_filename = NULL;
+ size_t binary_len0 = strlen (binary) + 1; + size_t binary_len0 = strlen (binary) + 1;
@ -842,11 +843,8 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.c gdb-6.7.1-pat
+ } + }
+ *slot = missing_debuginfos; + *slot = missing_debuginfos;
+ +
+ if (print_filename) + fprintf_unfiltered (gdb_stdlog, _("Missing separate debuginfo for %s\n"),
+ fprintf_unfiltered (gdb_stdlog, _("Missing separate debuginfo for %s\n"), + binary);
+ binary);
+ else
+ fprintf_unfiltered (gdb_stdlog, _("(no separate debuginfo file found)\n"));
+ +
+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"), + fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
+ "yum --enablerepo='*-debuginfo' install", debug); + "yum --enablerepo='*-debuginfo' install", debug);
@ -948,15 +946,13 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.c gdb-6.7.1-pat
xfree (canon_name); xfree (canon_name);
xfree (basename); xfree (basename);
xfree (dir); xfree (dir);
@@ -1528,6 +2130,14 @@ find_separate_debug_file (struct objfile @@ -1528,6 +2130,12 @@ find_separate_debug_file (struct objfile
} }
} }
+ if (build_id_filename != NULL) + if (build_id_filename != NULL)
+ { + {
+ /* The filename is already printed for shared libraries. */ + build_id_print_missing (objfile->name, build_id_filename);
+ build_id_print_missing (objfile->name, build_id_filename,
+ !(objfile->flags & OBJF_SHARED));
+ xfree (build_id_filename); + xfree (build_id_filename);
+ } + }
+ +
@ -981,7 +977,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.c gdb-6.7.1-pat
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.h gdb-6.7.1-patch274/gdb/symfile.h diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.h gdb-6.7.1-patch274/gdb/symfile.h
--- gdb-6.7.1/gdb/symfile.h 2007-09-24 23:48:05.000000000 +0200 --- gdb-6.7.1/gdb/symfile.h 2007-09-24 23:48:05.000000000 +0200
+++ gdb-6.7.1-patch274/gdb/symfile.h 2008-01-22 23:59:10.000000000 +0100 +++ gdb-6.7.1-patch274/gdb/symfile.h 2008-01-22 23:59:10.000000000 +0100
@@ -353,6 +353,14 @@ extern int symfile_map_offsets_to_segmen @@ -353,6 +353,13 @@ extern int symfile_map_offsets_to_segmen
struct symfile_segment_data *get_symfile_segment_data (bfd *abfd); struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
void free_symfile_segment_data (struct symfile_segment_data *data); void free_symfile_segment_data (struct symfile_segment_data *data);
@ -990,8 +986,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/symfile.h gdb-6.7.1-pat
+extern struct build_id *build_id_addr_get (CORE_ADDR addr); +extern struct build_id *build_id_addr_get (CORE_ADDR addr);
+extern char *build_id_to_filename (struct build_id *build_id, +extern char *build_id_to_filename (struct build_id *build_id,
+ char **link_return, int add_debug_suffix); + char **link_return, int add_debug_suffix);
+extern void build_id_print_missing (const char *binary, const char *debug, +extern void build_id_print_missing (const char *binary, const char *debug);
+ int print_filename);
+ +
/* From dwarf2read.c */ /* From dwarf2read.c */

View File

@ -11,7 +11,7 @@ Name: gdb
Version: 6.7.1 Version: 6.7.1
# The release always contains a leading reserved number, start it at 1. # The release always contains a leading reserved number, start it at 1.
Release: 11%{?dist} Release: 12%{?dist}
License: GPL License: GPL
Group: Development/Debuggers Group: Development/Debuggers
@ -661,6 +661,9 @@ fi
# don't include the files in include, they are part of binutils # don't include the files in include, they are part of binutils
%changelog %changelog
* Thu Feb 7 2008 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.7.1-12
- build-id debug messages print now the library names unconditionally.
* Thu Jan 24 2008 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.7.1-11 * Thu Jan 24 2008 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.7.1-11
- Improve the text UI messages for the build-id debug files locating. - Improve the text UI messages for the build-id debug files locating.
- Require now the rpm libraries. - Require now the rpm libraries.