From 536aae5e6aeee21b55bc4c40293c51b22c7b6abc Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Jun 22 2009 11:19:51 +0000 Subject: - Fix backtraces from core files with the executable found+loaded via build-id. - Due to F-11 GCC no longer needlessly duplicating .eh_frame as .debug_frame. --- diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 6668ce4..36a5147 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -13,7 +13,7 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c #ifndef O_LARGEFILE -@@ -267,6 +271,56 @@ add_to_thread_list (bfd *abfd, asection +@@ -267,6 +271,50 @@ add_to_thread_list (bfd *abfd, asection inferior_ptid = ptid; /* Yes, make it current */ } @@ -26,6 +26,7 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c + struct build_id *build_id; + char *exec_filename, *debug_filename; + char *build_id_filename; ++ struct cleanup *back_to; + + if (exec_bfd != NULL) + return; @@ -37,32 +38,25 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c + if (build_id == NULL) + return; + ++ /* SYMFILE_OBJFILE should refer to the main executable (not only to its ++ separate debug info file). gcc44+ keeps .eh_frame only in the main ++ executable without its duplicate .debug_frame in the separate debug info ++ file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer ++ directly to the separate debug info file. */ ++ + exec_filename = build_id_to_filename (build_id, &build_id_filename, 0); -+ if (exec_filename != NULL) -+ exec_file_attach (exec_filename, from_tty); -+ else -+ debug_print_missing (_("the main executable file"), build_id_filename); -+ xfree (build_id_filename); ++ back_to = make_cleanup (xfree, build_id_filename); + -+ /* `.note.gnu.build-id' section exists even for files without a separate -+ debuginfo. */ -+ debug_filename = build_id_to_filename (build_id, &build_id_filename, 1); -+ if (debug_filename != NULL) ++ if (exec_filename != NULL) + { -+ symbol_file_add_main (debug_filename, from_tty); -+ xfree (debug_filename); ++ make_cleanup (xfree, exec_filename); ++ exec_file_attach (exec_filename, from_tty); ++ symbol_file_add_main (exec_filename, from_tty); + } + else -+ { -+ if (exec_filename != NULL) -+ symbol_file_add_main (exec_filename, from_tty); -+ /* For EXEC_FILENAME NULL we were already complaining above. */ -+ if (symfile_objfile == NULL && exec_filename != NULL) -+ debug_print_missing (exec_filename, build_id_filename); -+ } -+ xfree (build_id_filename); ++ debug_print_missing (_("the main executable file"), build_id_filename); + -+ xfree (exec_filename); ++ do_cleanups (back_to); + + /* No automatic SOLIB_ADD as the libraries would get read twice. */ +} diff --git a/gdb.spec b/gdb.spec index 4df3521..96ccf37 100644 --- a/gdb.spec +++ b/gdb.spec @@ -15,7 +15,7 @@ Version: 6.8.50.20090302 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 33%{?_with_upstream:.upstream}%{?dist} +Release: 34%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -891,6 +891,10 @@ fi %endif %changelog +* Mon Jun 22 2009 Jan Kratochvil - 6.8.50.20090302-34 +- Fix backtraces from core files with the executable found+loaded via build-id. + - Due to F-11 GCC no longer needlessly duplicating .eh_frame as .debug_frame. + * Tue Jun 16 2009 Jan Kratochvil - 6.8.50.20090302-33 - Archer update to the snapshot: 05c402a02716177c4ddd272a6e312cbd2908ed68 - Archer backport: 05c402a02716177c4ddd272a6e312cbd2908ed68