- Fix `errno' resolving across separate debuginfo files.

- Fix segfault on no file loaded, `set debug solib 1', `info
    sharedlibrary'.
- Extend the testsuite run for all the languages if %{dist} is defined.
- Support gdb.fortran/ tests by substituting the g77 compiler by gfortran.
This commit is contained in:
Jan Kratochvil 2007-11-16 02:15:40 +00:00
parent b0ab3a801f
commit 92dc0e1867
3 changed files with 42 additions and 14 deletions

View File

@ -6,6 +6,10 @@
Port to post-GDB-6.7.1 multi-PC breakpoints. Port to post-GDB-6.7.1 multi-PC breakpoints.
2007-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* solib-svr4.c (svr4_current_sos): Fix segfault on NULL EXEC_BFD.
Index: gdb-6.7.1/gdb/dwarf2read.c Index: gdb-6.7.1/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-6.7.1.orig/gdb/dwarf2read.c 2007-11-02 15:24:10.000000000 +0100 --- gdb-6.7.1.orig/gdb/dwarf2read.c 2007-11-02 15:24:10.000000000 +0100
@ -375,16 +379,16 @@ Index: gdb-6.7.1/gdb/solib-svr4.c
@@ -704,6 +803,11 @@ svr4_current_sos (void) @@ -704,6 +803,11 @@ svr4_current_sos (void)
struct so_list **link_ptr = &head; struct so_list **link_ptr = &head;
CORE_ADDR ldsomap = 0; CORE_ADDR ldsomap = 0;
+ const char *filename = exec_bfd ? exec_bfd->filename : "<none>";
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: exec_bfd %s\n", + "svr4_current_sos: exec_bfd %s\n", filename);
+ exec_bfd->filename);
+ +
/* Make sure we've looked up the inferior's dynamic linker's base /* Make sure we've looked up the inferior's dynamic linker's base
structure. */ structure. */
if (! debug_base) if (! debug_base)
@@ -713,11 +817,21 @@ svr4_current_sos (void) @@ -713,11 +817,20 @@ svr4_current_sos (void)
/* If we can't find the dynamic linker's base structure, this /* If we can't find the dynamic linker's base structure, this
must not be a dynamically linked executable. Hmm. */ must not be a dynamically linked executable. Hmm. */
if (! debug_base) if (! debug_base)
@ -393,7 +397,7 @@ Index: gdb-6.7.1/gdb/solib-svr4.c
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: no DT_DEBUG found in %s -- return now\n", + "svr4_current_sos: no DT_DEBUG found in %s -- return now\n",
+ exec_bfd->filename); + filename);
+ return svr4_default_sos (); + return svr4_default_sos ();
+ } + }
} }
@ -402,8 +406,7 @@ Index: gdb-6.7.1/gdb/solib-svr4.c
`struct so_list' nodes. */ `struct so_list' nodes. */
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: walk link map in %s\n", + "svr4_current_sos: walk link map in %s\n", filename);
+ exec_bfd->filename);
lm = solib_svr4_r_map (); lm = solib_svr4_r_map ();
while (lm) while (lm)
@ -428,8 +431,9 @@ Index: gdb-6.7.1/gdb/solib-svr4.c
SVR4, it has no name. For others (Solaris 2.3 for example), it SVR4, it has no name. For others (Solaris 2.3 for example), it
does have a name, so we can no longer use a missing name to does have a name, so we can no longer use a missing name to
decide when to ignore it. */ decide when to ignore it. */
if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0) - if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
- free_so (new); - free_so (new);
+ if (exec_bfd != NULL && IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
+ { + {
+ /* It is the first link map entry, i.e. it is the main executable. */ + /* It is the first link map entry, i.e. it is the main executable. */
+ +
@ -564,14 +568,12 @@ Index: gdb-6.7.1/gdb/solib-svr4.c
} }
/* On Solaris, the dynamic linker is not in the normal list of /* On Solaris, the dynamic linker is not in the normal list of
@@ -789,6 +995,11 @@ svr4_current_sos (void) @@ -789,6 +995,9 @@ svr4_current_sos (void)
if (head == NULL) if (head == NULL)
return svr4_default_sos (); return svr4_default_sos ();
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "svr4_current_sos: ENDS %s\n", filename);
+ "svr4_current_sos: ENDS %s\n",
+ exec_bfd->filename);
+ +
return head; return head;
} }

View File

@ -160,7 +160,7 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/target.c gdb-6.7.1-patc
/* Using the objfile specified in BATON, find the address for the /* Using the objfile specified in BATON, find the address for the
current thread's thread-local storage with offset OFFSET. */ current thread's thread-local storage with offset OFFSET. */
CORE_ADDR CORE_ADDR
@@ -906,7 +925,22 @@ target_translate_tls_address (struct obj @@ -904,7 +923,28 @@ target_translate_tls_address (struct obj
/* It wouldn't be wrong here to try a gdbarch method, too; finding /* It wouldn't be wrong here to try a gdbarch method, too; finding
TLS is an ABI-specific thing. But we don't do that yet. */ TLS is an ABI-specific thing. But we don't do that yet. */
else else
@ -171,7 +171,13 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/target.c gdb-6.7.1-patc
+ msymbol = lookup_minimal_symbol ("errno", NULL, NULL); + msymbol = lookup_minimal_symbol ("errno", NULL, NULL);
+ if (msymbol != NULL + if (msymbol != NULL
+ && SYMBOL_VALUE_ADDRESS (msymbol) == offset + && SYMBOL_VALUE_ADDRESS (msymbol) == offset
+ && SYMBOL_BFD_SECTION (msymbol)->owner == objfile->obfd) + && (SYMBOL_BFD_SECTION (msymbol)->owner == objfile->obfd
+ || (objfile->separate_debug_objfile != NULL
+ && SYMBOL_BFD_SECTION (msymbol)->owner
+ == objfile->separate_debug_objfile->obfd)
+ || (objfile->separate_debug_objfile_backlink != NULL
+ && SYMBOL_BFD_SECTION (msymbol)->owner
+ == objfile->separate_debug_objfile_backlink->obfd)))
+ { + {
+ if (!catch_errors (resolve_errno, (void *) &addr, "", + if (!catch_errors (resolve_errno, (void *) &addr, "",
+ RETURN_MASK_ALL)) + RETURN_MASK_ALL))

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: 3%{?dist} Release: 4%{?dist}
License: GPL License: GPL
Group: Development/Debuggers Group: Development/Debuggers
@ -331,11 +331,21 @@ BuildRequires: flex bison sharutils expat-devel
Requires: readline Requires: readline
BuildRequires: readline-devel BuildRequires: readline-devel
# BuildRequires only for the complete testsuite run.
# Omit them on local user builds.
%if 0%{?dist:1}
# gcc-objc++ is not covered by the GDB testsuite.
BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc
# Copied from gcc-4.1.2-32
%ifarch %{ix86} x86_64 ia64 ppc alpha
BuildRequires: gcc-gnat
%endif
%define multilib_64_archs sparc64 ppc64 s390x x86_64 %define multilib_64_archs sparc64 ppc64 s390x x86_64
%ifarch %{multilib_64_archs} sparc ppc %ifarch %{multilib_64_archs} sparc ppc
# Ensure glibc{,-devel} is installed for both multilib arches # Ensure glibc{,-devel} is installed for both multilib arches
BuildRequires: /lib/libc.so.6 %{_exec_prefix}/lib/libc.so /lib64/libc.so.6 %{_exec_prefix}/lib64/libc.so BuildRequires: /lib/libc.so.6 %{_exec_prefix}/lib/libc.so /lib64/libc.so.6 %{_exec_prefix}/lib64/libc.so
%endif %endif
%endif
%ifarch ia64 %ifarch ia64
BuildRequires: libunwind-devel >= 0.99-0.1.frysk20070405cvs BuildRequires: libunwind-devel >= 0.99-0.1.frysk20070405cvs
@ -486,6 +496,10 @@ rm -fr %{gdb_build}
mkdir %{gdb_build} mkdir %{gdb_build}
cd %{gdb_build} cd %{gdb_build}
# g77 executable is no longer present in Fedora gcc-4.x+.
g77="`which gfortran 2>/dev/null`"
test -n "$g77" && ln -s "$g77" ./g77
# FIXME: The configure option --enable-gdb-build-warnings=,-Werror # FIXME: The configure option --enable-gdb-build-warnings=,-Werror
# below can conflict with user settings. For instance, passing a # below can conflict with user settings. For instance, passing a
# combination of -Wall and -O0 from the file rpmrc will always cause # combination of -Wall and -O0 from the file rpmrc will always cause
@ -615,6 +629,12 @@ 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
* Fri Nov 16 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.7.1-4
- Fix `errno' resolving across separate debuginfo files.
- Fix segfault on no file loaded, `set debug solib 1', `info sharedlibrary'.
- Extend the testsuite run for all the languages if %%{dist} is defined.
- Support gdb.fortran/ tests by substituting the g77 compiler by gfortran.
* Sun Nov 4 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.7.1-3 * Sun Nov 4 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.7.1-3
- Fix `errno' resolving on recent glibc with broken DW_AT_MIPS_linkage_name. - Fix `errno' resolving on recent glibc with broken DW_AT_MIPS_linkage_name.
- Imported new test for 6.7 PPC hiding of call-volatile parameter register. - Imported new test for 6.7 PPC hiding of call-volatile parameter register.