Hello community, here is the log from the commit of package gdb for openSUSE:Factory checked in at Thu Aug 11 15:47:45 CEST 2011. -------- --- gdb/gdb.changes 2011-03-09 15:24:58.000000000 +0100 +++ /mounts/work_src_done/STABLE/gdb/gdb.changes 2011-08-04 12:30:11.000000000 +0200 @@ -1,0 +2,115 @@ +Thu Aug 4 10:28:50 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.3-41.fc15.src.rpm. [fate#310741] + + * Tue Jul 26 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.3-41.fc15 + - Rebase to the final FSF GDB 7.3 release. + - Improve gcc-4.6 stdarg false prologue end workaround (GDB PR 12435 + GCC PR 47471). + + * Sun Jul 3 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110703-40.fc15 + - Rebase to FSF GDB 7.2.90.20110703 (which is a 7.3 pre-release). + - Adjust the `print errno' patch due to the DW_AT_linkage_name following again. + + * Fri Jun 24 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110525-39.fc15 + - Fix install-info for the gdb-doc subpackage (BZ 715228). + +------------------------------------------------------------------- +Thu Jun 16 09:18:33 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.2.90.20110525-38.fc15.src.rpm. [fate#310741] + + * Wed May 25 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110525-38.fc15 + - Rebase to FSF GDB 7.2.90.20110525 (which is a 7.3 pre-release). + - [stap] Fix double free (Sergio Durigan Junior). + + * Tue May 3 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-37.fc15 + - Search also for .<seqno> files in /usr/lib/debug/.build-id (BZ 641377). + +------------------------------------------------------------------- +Wed May 18 11:01:03 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.2.90.20110429-36.fc15.src.rpm. + + * Mon May 2 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-36.fc15 + - Bundle readline-6.2 with a workaround of skipped "ask" (BZ 701131). + - Use --without-system-readline, disable Requires and BuildRequires of readline. + - Drop gdb-6.5-readline-long-line-crash.patch and gdb-readline-6.0-signal.patch. + + * Fri Apr 29 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-35.fc15 + - Rebase to FSF GDB 7.2.90.20110429 (which is a 7.3 pre-release). + - Fix -O2 -g breakpoints internal error + prologue skipping (BZ 612253). + - Fix case insensitive symbols for Fortran by iFort (BZ 645773). + - Fix physname-related CU expansion issue for C++ (PR 12708). + - Fix Python access to inlined frames (BZ 694824). + + * Mon Apr 11 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110411-34.fc15 + - Rebase to FSF GDB 7.2.90.20110411 (which is a 7.3 pre-release). + - Include the proper fix for anonymous struct typedefs (Tom Tromey, BZ 672230). + + * Wed Mar 30 2011 Fabio M. Di Nitto <fdinitto@redhat.com> - 7.2.50.20110328-33.fc15 + - Cleanup spec file to add sparc|sparcv9|sparc64. + - Add sparc specific workarounds to toolchain badness: + - disable mmap in bdf/ via --without-mmap configure option. + - add patch to not build mmap support on sparc for gdb/. + - gdb code is NOT at fault, but we need a working gdb while we sort out + the toolchain and rebuild all packages. this workaround is NOT for upstream. + + * Tue Mar 29 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110328-32.fc15 + - Fix occasional crash on `print errno' with no -pthread and no -g3 (BZ 690908). + +------------------------------------------------------------------- +Thu Apr 14 12:50:20 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.2.50.20110328-31.fc15.src.rpm. + + * Mon Mar 28 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110328-31.fc15 + - Rebase to FSF GDB 7.2.50.20110328 (which is a 7.3 pre-release). + - Bundle %%{libstdcxxpython}.tar.bz2 unconditionally - for rebulds on RHELs. + + * Sun Mar 20 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110320-30.fc15 + - Fix threading internal error on corrupted memory (BZ 677654). + - Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). + + * Sun Mar 20 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110320-29.fc15 + - Rebase to FSF GDB 7.2.50.20110320 (which is a 7.3 pre-release). + - Merge archer-sergiodj-stap, the SystemTap probes breakpoints feature. + - [stap] Fix -O2 warnings. + - Fix Ada support crash on uninitialized gdbarch. + + * Sat Mar 5 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110305-28.fc15 + - Rebase to FSF GDB 7.2.50.20110305 (which is a 7.3 pre-release). + + * Fri Feb 25 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110222-27.fc15 + - Include doc also in the PDF form; new BuildRequires: texinfo-tex. + + * Wed Feb 23 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110222-26.fc15 + - Rebase to FSF GDB 7.2.50.20110222 (which is a 7.3 pre-release). + - Fix attach/core-load of {,un}prelinked i386 libs (bugreport by Michal Toman). + + * Mon Feb 21 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110218-25.fc15 + - Drop %%{_datadir}/gdb/syscalls/* for unsupported arches. + + * Fri Feb 18 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110218-24.fc15 + - Rebase to FSF GDB 7.2.50.20110218 (which is a 7.3 pre-release). + - [vla] Fox Fortran vector slices for allocated arrays (for BZ 609782). + + * Tue Feb 15 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110213-23.fc15 + - Move the GFDL License to gdb-doc. + + * Tue Feb 15 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110213-22.fc15 + - Fix gdb-doc Group to be Documentation, also provide it as noarch. + + * Tue Feb 15 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110213-21.fc15 + - Drop non-user (gdbint) and obsolete (stabs) documentation. + - Install also HTML files besides the INFO file. + - Create new subpackage gdb-doc for both INFO and HTML files. + + * Sun Feb 13 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110213-20.fc15 + - Rebase to FSF GDB 7.2.50.20110213 (which is a 7.3 pre-release). + - Fix occasionall unfound source lines (affecting at least glibc debugging). + - Fix const/volatile qualifiers of C++ types (PR c++/12328). + - Be backward compatible for --rebuild with <=fc14 librpm.so.1. + +- Revert documentation split. + +------------------------------------------------------------------- @@ -195,0 +311,3 @@ +- Re-write history to match SLE11 SP1 changelog + * Drop some more strange RHEL stuff. + * Fix build for SLE10. @@ -198 +316 @@ -Thu Mar 11 15:45:22 CET 2010 - rguenther@novell.com +Mon Mar 15 11:21:05 CET 2010 - rguenther@novell.com @@ -200 +318 @@ -- Merge from gdb-7.0.1-33.fc12.src.rpm. +- Fix info documentation registering. [bnc#588278] @@ -206,20 +323,0 @@ - -------------------------------------------------------------------- -Fri Jan 15 16:18:42 CET 2010 - rguenther@suse.de - -- Drop some more strange RHEL stuff. - -------------------------------------------------------------------- -Mon Jan 11 11:39:20 CET 2010 - rguenther@suse.de - -- Merge from gdb-7.0.1-19.fc12.src.rpm. - -------------------------------------------------------------------- -Fri Nov 20 16:16:32 CET 2009 - rguenther@suse.de - -- Fix build for SLE10. - -------------------------------------------------------------------- -Mon Oct 26 17:27:34 CET 2009 - rguenther@suse.de - -- Merge from gdb-7.0-3.fc12.src.rpm. calling whatdependson for head-i586 Old: ---- gdb-6.5-readline-long-line-crash.patch gdb-7.2.50.20110206.tar.bz2 gdb-bz539590-gnu-ifunc-fix-cond.patch gdb-dwarf3-accessibility.patch gdb-false-gcc-warning.patch gdb-physname-pr11734-1of2.patch gdb-physname-pr11734-2of2.patch gdb-physname-pr12273.patch gdb-python-newbacktrace.patch gdb-readline-6.0-signal.patch readline-5.1-random.patch New: ---- gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch gdb-7.3.tar.bz2 gdb-bz645773-case-insensitive-1of5.patch gdb-bz645773-case-insensitive-2of5.patch gdb-bz645773-case-insensitive-3of5.patch gdb-bz645773-case-insensitive-4of5.patch gdb-bz701131-readline62-1of3.patch gdb-bz701131-readline62-2of3.patch gdb-bz701131-readline62-3of3.patch gdb-core-thread-internalerr-1of3.patch gdb-core-thread-internalerr-2of3.patch gdb-core-thread-internalerr-3of3.patch gdb-prelink-rela.patch gdb-stap-double-free.patch libstdc++-v3-python-r155978.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gdb.spec ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -23,13 +23,13 @@ # Set version to contents of gdb/version.in. # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). -Version: 7.2.50.20110206 +Version: 7.3 Release: 1 # 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. -License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain +License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers # Do not provide URL for snapshots as the file lasts there only for 2 days. # ftp://sourceware.org/pub/gdb/snapshots/current/gdb-%{version}.tar.bz2 @@ -42,6 +42,7 @@ # For our convenience %define gdb_src gdb-%{version} %define gdb_build build-%{_target_platform} +%define gdb_docdir %{_docdir}/%{name}-doc-%{version} %if 0%{?_with_debug:1} # Define this if you want to skip the strip step and preserve debug info. @@ -80,6 +81,10 @@ #=fedora Source4: gdbinit +# libstdc++ pretty printers from GCC SVN HEAD (4.5 experimental). +%define libstdcxxpython libstdc++-v3-python-r155978 +Source5: %{libstdcxxpython}.tar.bz2 + # Work around out-of-date dejagnu that does not have KFAIL #=drop: That dejagnu is too old to be supported. Patch1: gdb-6.3-rh-dummykfail-20041202.patch @@ -215,8 +220,6 @@ Patch208: gdb-6.5-BEA-testsuite.patch # Fix readline segfault on excessively long hand-typed lines. -#=drop: After upstream's readline rebase it will be obsolete. -Patch209: gdb-6.5-readline-long-line-crash.patch #=fedoratest Patch213: gdb-6.5-readline-long-line-crash-test.patch @@ -399,9 +402,6 @@ #=push+work: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> Patch382: gdb-core-open-vdso-warning.patch -# Fix callback-mode readline-6.0 regression for CTRL-C (for RHEL-6.0). -Patch390: gdb-readline-6.0-signal.patch - # Fix syscall restarts for amd64->i386 biarch. #=push Patch391: gdb-x86_64-i386-syscall-restart.patch @@ -437,13 +437,10 @@ Patch412: gdb-unused-revert.patch # Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). +# Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). #=push+work: It should be fixed properly instead. Patch417: gdb-bz541866-rwatch-before-run.patch -# Fix crash when using GNU IFUNC call from breakpoint condition. -#=drop: After archer-jankratochvil-ifunc gets in this one gets obsoleted. -Patch454: gdb-bz539590-gnu-ifunc-fix-cond.patch - # Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). #=push+work: Currently it is still not fully safe. Patch459: gdb-moribund-utrace-workaround.patch @@ -474,10 +471,6 @@ #=drop+work: Inferior objects should be read in parts, then this patch gets obsoleted. Patch496: gdb-bz568248-oom-is-error.patch -# Workaround false GCC warning(s). -#=push -Patch497: gdb-false-gcc-warning.patch - # Fix gcore writer for -Wl,-z,relro (PR corefiles/11804). #=push: There is different patch on gdb-patches, waiting now for resolution in kernel. Patch504: gdb-bz623749-gcore-relro.patch @@ -508,10 +501,6 @@ # =fedoratest Patch548: gdb-test-expr-cumulative-archer.patch -# Fix DWARF-3+ DW_AT_accessibility default assumption for F15 gcc-4.6. -# =push -Patch554: gdb-dwarf3-accessibility.patch - # Temporary fix of F15 gcc-4.6 child DIEs of DW_TAG_typedef (BZ 672230). # =push Patch555: gdb-gcc46-typedef.patch @@ -520,17 +509,41 @@ # =push Patch556: gdb-gcc46-stdarg-prologue.patch -# Fix Python new-backtrace command (BZ 672235, Phil Muldoon). -# =push -Patch557: gdb-python-newbacktrace.patch +# Fix attach/core-load of {,un}prelinked i386 libs (bugreport by Michal Toman). +Patch571: gdb-prelink-rela.patch + +# Fix threading internal error on corrupted memory (BZ 677654). +Patch572: gdb-core-thread-internalerr-1of3.patch +Patch573: gdb-core-thread-internalerr-2of3.patch +Patch574: gdb-core-thread-internalerr-3of3.patch + +# Toolchain on sparc is slightly broken and debuginfo files are generated +# with non 64bit aligned tables/offsets. +# See for example readelf -S ../Xvnc.debug. +# +# As a consenquence calculation of sectp->filepos as used in +# dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer +# that cannot be used directly as done with MMAP. +# Usage will result in a BusError. +# +# While we figure out what's wrong in the toolchain and do a full archive +# rebuild to fix it, we need to be able to use gdb :) +Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch + +# Fix case insensitive symbols for Fortran by iFort (BZ 645773). +Patch580: gdb-bz645773-case-insensitive-1of5.patch +Patch581: gdb-bz645773-case-insensitive-2of5.patch +Patch582: gdb-bz645773-case-insensitive-3of5.patch +Patch583: gdb-bz645773-case-insensitive-4of5.patch + +# Bundle readline-6.2 with a workaround of skipped "ask" (BZ 701131). +Patch591: gdb-bz701131-readline62-1of3.patch +Patch592: gdb-bz701131-readline62-2of3.patch +Patch593: gdb-bz701131-readline62-3of3.patch -# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). -Patch565: gdb-physname-pr11734-1of2.patch -Patch566: gdb-physname-pr11734-2of2.patch -Patch567: gdb-physname-pr12273.patch +# [stap] Fix double free. +Patch594: gdb-stap-double-free.patch -# Fix readline 5.1 warnings -Patch1000: readline-5.1-random.patch # Upstream patch to fix gcc -Werror Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch @@ -597,7 +610,7 @@ %if %{suse_version} > 1010 %package -n gdbserver -License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain + Summary: A standalone server for GDB (the GNU source-level debugger) Group: Development/Debuggers @@ -617,6 +630,17 @@ %setup -q -n %{gdb_src} +%if 0%{?rhel:1} +# libstdc++ pretty printers. +tar xjf %{SOURCE5} +%endif # 0%{?rhel:1} + +# Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh . +rm -f gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c +rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c + +# Apply patches defined above. + # Match the Fedora's version info. %patch2 -p1 @@ -654,7 +678,6 @@ %patch196 -p1 %patch199 -p1 %patch208 -p1 -%patch209 -p1 %patch211 -p1 %patch213 -p1 %patch214 -p1 @@ -711,7 +734,6 @@ %patch408 -p1 %patch412 -p1 %patch417 -p1 -%patch454 -p1 %patch459 -p1 %patch470 -p1 %patch475 -p1 @@ -720,7 +742,6 @@ %patch490 -p1 %patch491 -p1 %patch496 -p1 -%patch497 -p1 %patch504 -p1 %patch510 -p1 %patch511 -p1 @@ -729,24 +750,26 @@ %patch542 -p1 %patch547 -p1 %patch548 -p1 -%patch554 -p1 %patch555 -p1 %patch556 -p1 -%patch557 -p1 -%patch565 -p1 -%patch566 -p1 -%patch567 -p1 -%patch390 -p1 -readline="$(readlink -f %{_libdir}/libreadline.so)" -if [ "$readline" = "${readline%/libreadline.so.6.0}" ] -then -%patch390 -p1 -R -fi +%patch571 -p1 +%patch572 -p1 +%patch573 -p1 +%patch574 -p1 +%patch579 -p1 +%patch580 -p1 +%patch581 -p1 +%patch582 -p1 +%patch583 -p1 +%patch591 -p1 +%patch592 -p1 +%patch593 -p1 +%patch594 -p1 + %if 0%{?rhel:1} %patch487 -p1 %endif # 0%{?rhel:1} -%patch1000 %patch1002 -p1 find -name "*.orig" | xargs rm -f @@ -801,10 +824,12 @@ --sysconfdir=%{_sysconfdir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ + --htmldir=%{gdb_docdir} \ + --pdfdir=%{gdb_docdir} \ --with-system-gdbinit=%{_sysconfdir}/gdbinit \ --with-gdb-datadir=%{_datadir}/gdb \ --enable-gdb-build-warnings=,-Wno-unused \ -%ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparcv9 sparc64 +%ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparc sparcv9 sparc64 --disable-werror \ %else %if 0%{?_with_upstream:1} @@ -816,7 +841,7 @@ --with-separate-debug-dir=/usr/lib/debug \ --disable-sim \ --disable-rpath \ - --with-system-readline \ + --without-system-readline \ --with-expat \ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ --without-libexpat-prefix \ @@ -832,11 +857,14 @@ %else --without-libunwind \ %endif +%ifarch sparc sparcv9 sparc64 + --without-mmap \ +%endif --enable-64-bit-bfd \ %if 0%{?_with_debug:1} --enable-static --disable-shared --enable-debug \ %endif -%ifarch sparcv9 +%ifarch sparc sparcv9 sparc-%{_vendor}-%{_target_os}%{?_gnu} %else %{_target_platform} @@ -892,7 +920,7 @@ cd %{gdb_build} -make %{?_smp_mflags} info +#make %{?_smp_mflags} -C gdb/doc {gdb,annotate}{.info,/index.html,.pdf} MAKEHTMLFLAGS=--no-split grep '#define HAVE_ZLIB_H 1' gdb/config.h @@ -1041,6 +1069,8 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/standard* rm -f $RPM_BUILD_ROOT%{_infodir}/mmalloc* rm -f $RPM_BUILD_ROOT%{_infodir}/configure* +rm -f $RPM_BUILD_ROOT%{_infodir}/gdbint* +rm -f $RPM_BUILD_ROOT%{_infodir}/stabs* rm -rf $RPM_BUILD_ROOT%{_includedir} rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*,mmalloc*} @@ -1055,6 +1085,23 @@ cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1 %endif # 0%{!?_with_upstream:1} +# Packaged GDB is not a cross-target one. +(cd $RPM_BUILD_ROOT%{_datadir}/gdb/syscalls + rm -f mips*.xml +%ifnarch sparc sparcv9 sparc64 + rm -f sparc*.xml +%endif +%ifnarch x86_64 + rm -f amd64-linux.xml +%endif +%ifnarch %{ix86} x86_64 + rm -f i386-linux.xml +%endif +%ifnarch ppc ppc64 + rm -f ppc{,64}-linux.xml +%endif +) + %clean rm -rf $RPM_BUILD_ROOT @@ -1067,8 +1114,6 @@ then %install_info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz - %install_info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz - %install_info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz fi %preun @@ -1079,8 +1124,6 @@ then %install_info_delete --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz %install_info_delete --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz - %install_info_delete --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz - %install_info_delete --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz fi fi @@ -1102,8 +1145,6 @@ %{_datadir}/gdb %{_infodir}/annotate.info* %{_infodir}/gdb.info* -%{_infodir}/gdbint.info* -%{_infodir}/stabs.info* # In SLE10 gdbserver is not in a separate package %if %{suse_version} <= 1010 %{_bindir}/gdbserver ++++++ gdb-6.3-bz202689-exec-from-pthread-test.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -92,7 +92,7 @@ +gdb_run_cmd + +gdb_test_multiple {} "Program exited" { -+ -re "\r\nProgram exited normally.\r\n$gdb_prompt $" { ++ -re "\r\n\[Inferior .* exited normally\]\r\n$gdb_prompt $" { + pass "Program exited" + } +} ++++++ gdb-6.3-inferior-notification-20050721.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -9,10 +9,10 @@ * gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set. -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.c +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.c 2008-12-07 10:06:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.c 2011-03-20 20:15:57.000000000 +0100 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -34,10 +34,10 @@ + } + return 0; +} -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.exp +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.exp 2008-12-07 10:08:52.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp 2011-03-20 20:20:03.000000000 +0100 @@ -0,0 +1,245 @@ +# Copyright 2005 Free Software Foundation, Inc. + @@ -153,7 +153,7 @@ + + # Allow the test process to exit, to cleanup after ourselves. + -+ gdb_test "continue" "Program exited normally." "after attach-32, exit" ++ gdb_test "continue" {[Inferior .* exited normally]} "after attach-32, exit" + + # Make sure we don't leave a process around to confuse + # the next test run (and prevent the compile by keeping @@ -234,7 +234,7 @@ + # Get rid of the process + + gdb_test "p should_exit = 1" -+ gdb_test "c" "Program exited normally." ++ gdb_test "c" {[Inferior .* exited normally]} + + # Be paranoid + @@ -284,10 +284,10 @@ +do_call_attach_tests + +return 0 -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32b.c +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32b.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32b.c 2008-12-07 10:06:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32b.c 2011-03-20 20:15:57.000000000 +0100 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop ++++++ gdb-6.3-readnever-20050907.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -11,10 +11,10 @@ * gdb.texinfo (File Options): Document --readnever. -Index: gdb-7.2.50.20110117/gdb/doc/gdb.texinfo +Index: gdb-7.2.90.20110411/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/doc/gdb.texinfo 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/doc/gdb.texinfo 2011-01-17 15:50:41.000000000 +0100 +--- gdb-7.2.90.20110411.orig/gdb/doc/gdb.texinfo 2011-04-11 19:11:55.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/doc/gdb.texinfo 2011-04-11 19:15:51.000000000 +0200 @@ -1007,6 +1007,12 @@ Read each symbol file's entire symbol ta the default, which is to read it incrementally as it is needed. This makes startup slower, but makes future operations faster. @@ -28,11 +28,11 @@ @end table @node Mode Options -Index: gdb-7.2.50.20110117/gdb/main.c +Index: gdb-7.2.90.20110411/gdb/main.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/main.c 2011-01-17 15:50:21.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/main.c 2011-01-17 15:50:41.000000000 +0100 -@@ -395,6 +395,7 @@ captured_main (void *data) +--- gdb-7.2.90.20110411.orig/gdb/main.c 2011-04-11 19:11:56.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/main.c 2011-04-11 19:15:51.000000000 +0200 +@@ -398,6 +398,7 @@ captured_main (void *data) {"xdb", no_argument, &xdb_commands, 1}, {"dbx", no_argument, &dbx_commands, 1}, {"readnow", no_argument, &readnow_symbol_files, 1}, @@ -40,7 +40,7 @@ {"r", no_argument, &readnow_symbol_files, 1}, {"quiet", no_argument, &quiet, 1}, {"q", no_argument, &quiet, 1}, -@@ -1061,6 +1062,7 @@ Options:\n\n\ +@@ -1064,6 +1065,7 @@ Options:\n\n\ fputs_unfiltered (_("\ --quiet Do not print version number on startup.\n\ --readnow Fully read symbol files on first access.\n\ @@ -48,10 +48,10 @@ "), stream); fputs_unfiltered (_("\ --se=FILE Use FILE as symbol file and executable file.\n\ -Index: gdb-7.2.50.20110117/gdb/symfile.c +Index: gdb-7.2.90.20110411/gdb/symfile.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/symfile.c 2011-01-11 22:53:24.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/symfile.c 2011-01-17 15:50:53.000000000 +0100 +--- gdb-7.2.90.20110411.orig/gdb/symfile.c 2011-03-23 19:23:55.000000000 +0100 ++++ gdb-7.2.90.20110411/gdb/symfile.c 2011-04-11 19:15:51.000000000 +0200 @@ -81,6 +81,7 @@ static void clear_symtab_users_cleanup ( /* Global variables owned by this file. */ @@ -60,19 +60,19 @@ /* External variables and functions referenced. */ -Index: gdb-7.2.50.20110117/gdb/dwarf2read.c +Index: gdb-7.2.90.20110411/gdb/dwarf2read.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 15:50:41.000000000 +0100 -@@ -57,6 +57,7 @@ - #include "vec.h" +--- gdb-7.2.90.20110411.orig/gdb/dwarf2read.c 2011-04-11 19:11:55.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/dwarf2read.c 2011-04-11 19:16:01.000000000 +0200 +@@ -58,6 +58,7 @@ #include "c-lang.h" #include "valprint.h" + #include <ctype.h> +#include "top.h" #include <fcntl.h> #include "gdb_string.h" -@@ -1350,8 +1351,9 @@ dwarf2_has_info (struct objfile *objfile +@@ -1351,8 +1352,9 @@ dwarf2_has_info (struct objfile *objfile bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL); dwarf2_per_objfile->objfile = objfile; } @@ -84,10 +84,10 @@ } /* When loading sections, we can either look for ".<name>", or for -Index: gdb-7.2.50.20110117/gdb/top.h +Index: gdb-7.2.90.20110411/gdb/top.h =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/top.h 2011-01-01 16:33:18.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/top.h 2011-01-17 15:50:41.000000000 +0100 +--- gdb-7.2.90.20110411.orig/gdb/top.h 2011-01-01 16:33:18.000000000 +0100 ++++ gdb-7.2.90.20110411/gdb/top.h 2011-04-11 19:15:51.000000000 +0200 @@ -61,6 +61,7 @@ extern void set_prompt (char *); /* From random places. */ ++++++ gdb-6.3-test-pie-20050107.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -1,40 +1,40 @@ -Index: gdb-7.2.50.20110117/gdb/testsuite/configure.ac +Index: gdb-7.2.50.20110320/gdb/testsuite/configure.ac =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/testsuite/configure.ac 2011-01-05 06:09:55.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/testsuite/configure.ac 2011-01-17 15:50:03.000000000 +0100 -@@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \ - gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ - gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile \ +--- gdb-7.2.50.20110320.orig/gdb/testsuite/configure.ac 2011-03-03 17:57:55.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/configure.ac 2011-03-20 20:21:43.000000000 +0100 +@@ -97,6 +97,6 @@ AC_OUTPUT([Makefile \ + gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile \ + gdb.hp/gdb.defects/Makefile \ gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \ - gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile \ + gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ - gdb.python/Makefile gdb.reverse/Makefile \ + gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \ gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile]) -Index: gdb-7.2.50.20110117/gdb/testsuite/configure +Index: gdb-7.2.50.20110320/gdb/testsuite/configure =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/testsuite/configure 2011-01-07 03:51:09.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/testsuite/configure 2011-01-17 15:50:09.000000000 +0100 -@@ -3515,7 +3515,7 @@ done +--- gdb-7.2.50.20110320.orig/gdb/testsuite/configure 2011-03-03 17:57:55.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/configure 2011-03-20 20:21:43.000000000 +0100 +@@ -3448,7 +3448,7 @@ done --ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" -+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" +-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" ++ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" cat >confcache <<_ACEOF # This file is a shell script that caches the results of configure -@@ -4233,6 +4233,7 @@ do +@@ -4173,6 +4173,7 @@ do "gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;; "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; + "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;; - "gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.c + "gdb.stabs/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.stabs/Makefile" ;; +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.c 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.c 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -56,10 +56,10 @@ + } + return 0; +} -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach2.c +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach2.c 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach2.c 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -85,10 +85,10 @@ + } + return (0); +} -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.c +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.c 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.c 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,146 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -236,10 +236,10 @@ + } + return 0; +} -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break1.c +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break1.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break1.c 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break1.c 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,44 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -285,10 +285,10 @@ +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */ +#endif -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/coremaker.c +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/coremaker.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/coremaker.c 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/coremaker.c 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,142 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + Free Software Foundation, Inc. @@ -432,11 +432,11 @@ + return 0; +} + -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.exp +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.exp 2011-01-17 15:50:03.000000000 +0100 -@@ -0,0 +1,423 @@ ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.exp 2011-03-20 20:25:53.000000000 +0100 +@@ -0,0 +1,417 @@ +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -699,13 +699,7 @@ + + # Allow the test process to exit, to cleanup after ourselves. + # -+ send_gdb "continue\n" -+ gdb_expect { -+ -re "Program exited normally.*$gdb_prompt $"\ -+ {pass "after attach2, exit"} -+ -re "$gdb_prompt $" {fail "after attach2, exit"} -+ timeout {fail "(timeout) after attach2, exit"} -+ } ++ gdb_test "continue" {[Inferior .* exited normally]} "after attach2, exit" + + # Make sure we don't leave a process around to confuse + # the next test run (and prevent the compile by keeping @@ -831,7 +825,7 @@ + # Get rid of the process + # + gdb_test "p should_exit = 1" ".*" -+ gdb_test "c" ".*Program exited normally.*" ++ gdb_test "c" {[Inferior .* exited normally]} + + # Be paranoid + # @@ -860,10 +854,10 @@ +do_call_attach_tests + +return 0 -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.exp +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.exp 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.exp 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,966 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2002, 2003, 2004 @@ -1831,10 +1825,10 @@ + send_gdb "set args main\n" + gdb_expect -re ".*$gdb_prompt $" {} +} -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/corefile.exp +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/corefile.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/corefile.exp 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/corefile.exp 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,233 @@ +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. @@ -2069,10 +2063,10 @@ +gdb_test "up" "#[0-9]* *[0-9xa-fH']* in .* \(.*\).*" "up in corefile.exp (reinit)" + +gdb_test "core" "No core file now." -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/Makefile.in +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/Makefile.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/Makefile.in 2011-01-17 15:50:03.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/Makefile.in 2011-03-20 20:21:43.000000000 +0100 @@ -0,0 +1,19 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ ++++++ gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -19,6 +19,8 @@ Attached suggestion patch how to deal with the most common "errno" symbol for the most common under-ggdb3 compiled programs. +Original patch hooked into target_translate_tls_address. But its inferior +call invalidates `struct frame *' in the callers - RH BZ 690908. 2007-11-03 Jan Kratochvil <jan.kratochvil@redhat.com> @@ -30,114 +32,21 @@ <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location -Index: gdb-7.2.50.20101116/gdb/gdbtypes.c -=================================================================== ---- gdb-7.2.50.20101116.orig/gdb/gdbtypes.c 2010-11-16 07:53:59.000000000 +0100 -+++ gdb-7.2.50.20101116/gdb/gdbtypes.c 2010-11-16 08:01:33.000000000 +0100 -@@ -4262,6 +4262,9 @@ gdbtypes_post_init (struct gdbarch *gdba - = arch_type (gdbarch, TYPE_CODE_INTERNAL_FUNCTION, 0, - "<internal function>"); - -+ builtin_type->nodebug_text_symbol_errno_location -+ = lookup_function_type (lookup_pointer_type (builtin_type->builtin_int)); -+ - return builtin_type; - } - -Index: gdb-7.2.50.20101116/gdb/gdbtypes.h -=================================================================== ---- gdb-7.2.50.20101116.orig/gdb/gdbtypes.h 2010-11-16 07:53:59.000000000 +0100 -+++ gdb-7.2.50.20101116/gdb/gdbtypes.h 2010-11-16 08:01:33.000000000 +0100 -@@ -1294,6 +1294,8 @@ struct builtin_type - - /* This type is used to represent a GDB internal function. */ - struct type *internal_fn; -+ -+ struct type *nodebug_text_symbol_errno_location; - }; - - /* Return the type table for the specified architecture. */ -Index: gdb-7.2.50.20101116/gdb/parse.c -=================================================================== ---- gdb-7.2.50.20101116.orig/gdb/parse.c 2010-11-16 07:53:59.000000000 +0100 -+++ gdb-7.2.50.20101116/gdb/parse.c 2010-11-16 08:01:33.000000000 +0100 -@@ -530,7 +530,11 @@ write_exp_msymbol (struct minimal_symbol - case mst_text: - case mst_file_text: - case mst_solib_trampoline: -- write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol); -+ if (builtin_type (gdbarch)->nodebug_text_symbol_errno_location != NULL -+ && strcmp (SYMBOL_LINKAGE_NAME (msymbol), "__errno_location") == 0) -+ write_exp_elt_type (builtin_type (gdbarch)->nodebug_text_symbol_errno_location); -+ else -+ write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol); - break; - - case mst_text_gnu_ifunc: -Index: gdb-7.2.50.20101116/gdb/target.c -=================================================================== ---- gdb-7.2.50.20101116.orig/gdb/target.c 2010-11-16 08:00:37.000000000 +0100 -+++ gdb-7.2.50.20101116/gdb/target.c 2010-11-16 08:01:52.000000000 +0100 -@@ -1067,6 +1067,25 @@ target_is_pushed (struct target_ops *t) - return 0; - } - -+static int -+resolve_errno (void *arg) -+{ -+ CORE_ADDR *arg_addr = arg; -+ struct expression *expr; -+ struct cleanup *old_chain = 0; -+ struct value *val; -+ -+ expr = parse_expression ("__errno_location()"); -+ old_chain = make_cleanup (free_current_contents, &expr); -+ val = evaluate_expression (expr); -+ *arg_addr = value_as_address (val); -+ release_value (val); -+ value_free (val); -+ do_cleanups (old_chain); -+ -+ return 1; -+} -+ - /* Using the objfile specified in OBJFILE, find the address for the - current thread's thread-local storage with offset OFFSET. */ - CORE_ADDR -@@ -1157,7 +1176,28 @@ target_translate_tls_address (struct obj - /* 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. */ - else -- error (_("Cannot find thread-local variables on this target")); -+ { -+ struct minimal_symbol *msymbol; -+ -+ msymbol = lookup_minimal_symbol ("errno", NULL, NULL); -+ if (msymbol != NULL -+ && SYMBOL_VALUE_ADDRESS (msymbol) == offset -+ && (SYMBOL_OBJ_SECTION (msymbol)->objfile == objfile -+ || (objfile->separate_debug_objfile != NULL -+ && SYMBOL_OBJ_SECTION (msymbol)->objfile -+ == objfile->separate_debug_objfile) -+ || (objfile->separate_debug_objfile_backlink != NULL -+ && SYMBOL_OBJ_SECTION (msymbol)->objfile -+ == objfile->separate_debug_objfile_backlink))) -+ { -+ if (!catch_errors (resolve_errno, (void *) &addr, "", -+ RETURN_MASK_ALL)) -+ error (_("TLS symbol `errno' not resolved for non-TLS program." -+ " You should compile the program with `gcc -pthread'.")); -+ } -+ else -+ error (_("Cannot find thread-local variables on this target")); -+ } - - return addr; - } -Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.c +--- a/gdb/printcmd.c ++++ b/gdb/printcmd.c +@@ -967,6 +967,8 @@ print_command_1 (char *exp, int inspect, int voidprint) + + if (exp && *exp) + { ++ if (strcmp (exp, "errno") == 0) ++ exp = "*((int *(*) (void)) __errno_location) ()"; + expr = parse_expression (exp); + old_chain = make_cleanup (free_current_contents, &expr); + cleanup = 1; +Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2010-11-16 08:01:33.000000000 +0100 ++++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2011-03-29 10:55:35.000000000 +0200 @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -167,10 +76,10 @@ + + return 0; /* breakpoint */ +} -Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.exp +Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2010-11-16 08:01:33.000000000 +0100 ++++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2011-03-29 10:55:35.000000000 +0200 @@ -0,0 +1,60 @@ +# Copyright 2007 Free Software Foundation, Inc. + ++++++ gdb-6.6-buildid-locate-rpm.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -1,7 +1,7 @@ -Index: gdb-7.2.50.20101231/gdb/event-top.c +Index: gdb-7.2.90.20110429/gdb/event-top.c =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/event-top.c 2010-12-29 01:58:14.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/event-top.c 2011-01-01 01:07:37.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/event-top.c 2011-03-16 16:18:58.000000000 +0100 ++++ gdb-7.2.90.20110429/gdb/event-top.c 2011-05-03 05:21:11.000000000 +0200 @@ -33,6 +33,7 @@ #include "cli/cli-script.h" /* for reset_command_nest_depth */ #include "main.h" @@ -28,19 +28,19 @@ /* Each interpreter has its own rules on displaying the command prompt. */ if (!current_interp_display_prompt_p ()) -Index: gdb-7.2.50.20101231/gdb/elfread.c +Index: gdb-7.2.90.20110429/gdb/elfread.c =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/elfread.c 2011-01-01 01:05:01.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/elfread.c 2011-01-01 01:05:10.000000000 +0100 -@@ -42,6 +42,7 @@ +--- gdb-7.2.90.20110429.orig/gdb/elfread.c 2011-05-03 05:19:27.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/elfread.c 2011-05-03 05:21:22.000000000 +0200 +@@ -53,6 +53,7 @@ #include "gdbcore.h" #include "gdbcmd.h" #include "observer.h" +#include "elf/external.h" + #include <sys/stat.h> extern void _initialize_elfread (void); - -@@ -1371,8 +1372,361 @@ build_id_to_filename (struct build_id *b +@@ -1655,8 +1656,361 @@ build_id_to_filename (struct build_id *b return retval; } @@ -403,7 +403,7 @@ avoidance. */ struct missing_filepair -@@ -1426,11 +1780,17 @@ missing_filepair_change (void) +@@ -1710,11 +2064,17 @@ missing_filepair_change (void) /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -421,7 +421,7 @@ missing_filepair_change (); } -@@ -1497,14 +1857,35 @@ debug_print_missing (const char *binary, +@@ -1781,14 +2141,35 @@ debug_print_missing (const char *binary, *slot = missing_filepair; @@ -464,11 +464,11 @@ } static char * -Index: gdb-7.2.50.20101231/gdb/symfile.h +Index: gdb-7.2.90.20110429/gdb/symfile.h =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/symfile.h 2011-01-01 01:05:01.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/symfile.h 2011-01-01 01:05:10.000000000 +0100 -@@ -559,6 +559,8 @@ extern struct build_id *build_id_addr_ge +--- gdb-7.2.90.20110429.orig/gdb/symfile.h 2011-05-03 05:14:57.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/symfile.h 2011-05-03 05:21:11.000000000 +0200 +@@ -611,6 +611,8 @@ extern struct build_id *build_id_addr_ge extern char *build_id_to_filename (struct build_id *build_id, char **link_return, int add_debug_suffix); extern void debug_print_missing (const char *binary, const char *debug); @@ -477,11 +477,11 @@ /* From dwarf2read.c */ -Index: gdb-7.2.50.20101231/gdb/testsuite/lib/gdb.exp +Index: gdb-7.2.90.20110429/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/testsuite/lib/gdb.exp 2011-01-01 01:05:01.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/testsuite/lib/gdb.exp 2011-01-01 01:05:10.000000000 +0100 -@@ -1389,7 +1389,7 @@ proc default_gdb_start { } { +--- gdb-7.2.90.20110429.orig/gdb/testsuite/lib/gdb.exp 2011-05-03 05:14:57.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/testsuite/lib/gdb.exp 2011-05-03 05:21:11.000000000 +0200 +@@ -1381,7 +1381,7 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -490,10 +490,10 @@ send_gdb "set build-id-verbose 0\n" gdb_expect 10 { -re "$gdb_prompt $" { -Index: gdb-7.2.50.20101231/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.2.90.20110429/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/testsuite/lib/mi-support.exp 2011-01-01 01:05:01.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/testsuite/lib/mi-support.exp 2011-01-01 01:05:10.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/testsuite/lib/mi-support.exp 2011-05-03 05:14:57.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/testsuite/lib/mi-support.exp 2011-05-03 05:21:11.000000000 +0200 @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } { } } @@ -503,11 +503,11 @@ send_gdb "190-gdb-set build-id-verbose 0\n" gdb_expect 10 { -re ".*190-gdb-set build-id-verbose 0\r\n190\^done\r\n$mi_gdb_prompt$" { -Index: gdb-7.2.50.20101231/gdb/tui/tui-interp.c +Index: gdb-7.2.90.20110429/gdb/tui/tui-interp.c =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/tui/tui-interp.c 2010-05-18 00:21:43.000000000 +0200 -+++ gdb-7.2.50.20101231/gdb/tui/tui-interp.c 2011-01-01 01:05:10.000000000 +0100 -@@ -30,6 +30,7 @@ +--- gdb-7.2.90.20110429.orig/gdb/tui/tui-interp.c 2011-01-01 16:33:52.000000000 +0100 ++++ gdb-7.2.90.20110429/gdb/tui/tui-interp.c 2011-05-03 05:21:11.000000000 +0200 +@@ -31,6 +31,7 @@ #include "tui/tui.h" #include "tui/tui-io.h" #include "exceptions.h" @@ -515,7 +515,7 @@ /* Set to 1 when the TUI mode must be activated when we first start gdb. */ -@@ -146,6 +147,8 @@ tui_command_loop (void *data) +@@ -147,6 +148,8 @@ tui_command_loop (void *data) char *a_prompt; char *gdb_prompt = get_prompt (); @@ -524,10 +524,10 @@ /* Tell readline what the prompt to display is and what function it will need to call after a whole line is read. This also displays the first prompt. */ -Index: gdb-7.2.50.20101231/gdb/aclocal.m4 +Index: gdb-7.2.90.20110429/gdb/aclocal.m4 =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/aclocal.m4 2010-05-23 02:56:59.000000000 +0200 -+++ gdb-7.2.50.20101231/gdb/aclocal.m4 2011-01-01 01:05:10.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/aclocal.m4 2011-02-15 22:05:53.000000000 +0100 ++++ gdb-7.2.90.20110429/gdb/aclocal.m4 2011-05-03 05:21:11.000000000 +0200 @@ -19,6 +19,162 @@ You have another version of autoconf. I If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -691,10 +691,10 @@ # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation -Index: gdb-7.2.50.20101231/gdb/config.in +Index: gdb-7.2.90.20110429/gdb/config.in =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/config.in 2010-09-02 19:12:35.000000000 +0200 -+++ gdb-7.2.50.20101231/gdb/config.in 2011-01-01 01:05:10.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/config.in 2011-03-17 14:19:09.000000000 +0100 ++++ gdb-7.2.90.20110429/gdb/config.in 2011-05-03 05:21:11.000000000 +0200 @@ -46,6 +46,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -705,7 +705,7 @@ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -232,6 +235,9 @@ +@@ -233,6 +236,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -715,11 +715,11 @@ /* Define if libunwind library is being used. */ #undef HAVE_LIBUNWIND -Index: gdb-7.2.50.20101231/gdb/configure +Index: gdb-7.2.90.20110429/gdb/configure =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/configure 2010-12-14 08:17:14.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/configure 2011-01-01 01:08:50.000000000 +0100 -@@ -680,6 +680,9 @@ REPORT_BUGS_TO +--- gdb-7.2.90.20110429.orig/gdb/configure 2011-04-03 18:32:40.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/configure 2011-05-03 05:21:11.000000000 +0200 +@@ -682,6 +682,9 @@ REPORT_BUGS_TO PKGVERSION TARGET_OBS subdirs @@ -729,7 +729,7 @@ GDB_DATADIR DEBUGDIR am__fastdepCC_FALSE -@@ -946,6 +949,7 @@ enable_dependency_tracking +@@ -948,6 +951,7 @@ enable_dependency_tracking with_separate_debug_dir with_gdb_datadir with_relocated_sources @@ -737,7 +737,7 @@ enable_targets enable_64_bit_bfd enable_gdbcli -@@ -987,6 +991,9 @@ LDFLAGS +@@ -989,6 +993,9 @@ LDFLAGS LIBS CPPFLAGS CPP @@ -747,7 +747,7 @@ YACC YFLAGS XMKMF' -@@ -1650,6 +1657,8 @@ Optional Packages: +@@ -1652,6 +1659,8 @@ Optional Packages: [DATADIR/gdb] --with-relocated-sources=PATH automatically relocate this path for source files @@ -756,7 +756,7 @@ --with-libunwind use libunwind frame unwinding support --with-curses use the curses library instead of the termcap library -@@ -1685,6 +1694,9 @@ Some influential environment variables: +@@ -1687,6 +1696,9 @@ Some influential environment variables: CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor @@ -766,7 +766,7 @@ YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. -@@ -7882,6 +7894,486 @@ _ACEOF +@@ -7884,6 +7896,486 @@ _ACEOF fi @@ -1253,10 +1253,10 @@ subdirs="$subdirs testsuite" -Index: gdb-7.2.50.20101231/gdb/configure.ac +Index: gdb-7.2.90.20110429/gdb/configure.ac =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/configure.ac 2010-12-14 08:17:15.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/configure.ac 2011-01-01 01:08:28.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/configure.ac 2011-04-03 18:32:40.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/configure.ac 2011-05-03 05:21:11.000000000 +0200 @@ -108,6 +108,199 @@ AS_HELP_STRING([--with-relocated-sources [Relocated directory for source files. ]) ]) @@ -1457,10 +1457,10 @@ AC_CONFIG_SUBDIRS(testsuite) # Check whether to support alternative target configurations -Index: gdb-7.2.50.20101231/gdb/acinclude.m4 +Index: gdb-7.2.90.20110429/gdb/acinclude.m4 =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/acinclude.m4 2010-05-27 05:40:45.000000000 +0200 -+++ gdb-7.2.50.20101231/gdb/acinclude.m4 2011-01-01 01:05:10.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/acinclude.m4 2010-05-27 05:40:45.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/acinclude.m4 2011-05-03 05:21:11.000000000 +0200 @@ -1,3 +1,5 @@ +# serial 1 + @@ -1476,11 +1476,11 @@ # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC -Index: gdb-7.2.50.20101231/gdb/corelow.c +Index: gdb-7.2.90.20110429/gdb/corelow.c =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/corelow.c 2011-01-01 01:05:01.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/corelow.c 2011-01-01 01:05:10.000000000 +0100 -@@ -317,7 +317,7 @@ build_id_locate_exec (int from_tty) +--- gdb-7.2.90.20110429.orig/gdb/corelow.c 2011-05-03 05:14:57.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/corelow.c 2011-05-03 05:21:11.000000000 +0200 +@@ -320,7 +320,7 @@ build_id_locate_exec (int from_tty) symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } else ++++++ gdb-6.6-buildid-locate.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -1,7 +1,7 @@ -Index: gdb-7.2.50.20110117/gdb/corelow.c +Index: gdb-7.2.90.20110429/gdb/corelow.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/corelow.c 2011-01-05 23:22:47.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/corelow.c 2011-01-17 15:52:06.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/corelow.c 2011-02-26 03:07:07.000000000 +0100 ++++ gdb-7.2.90.20110429/gdb/corelow.c 2011-05-03 05:14:57.000000000 +0200 @@ -47,6 +47,9 @@ #include "filenames.h" #include "progspace.h" @@ -90,11 +90,11 @@ + NULL, NULL, NULL, + &setlist, &showlist); } -Index: gdb-7.2.50.20110117/gdb/doc/gdb.texinfo +Index: gdb-7.2.90.20110429/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/doc/gdb.texinfo 2011-01-17 15:50:41.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/doc/gdb.texinfo 2011-01-17 15:52:06.000000000 +0100 -@@ -15220,6 +15220,27 @@ information files. +--- gdb-7.2.90.20110429.orig/gdb/doc/gdb.texinfo 2011-05-03 05:14:56.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/doc/gdb.texinfo 2011-05-03 05:14:57.000000000 +0200 +@@ -15356,6 +15356,27 @@ information files. @end table @@ -122,10 +122,10 @@ @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named -Index: gdb-7.2.50.20110117/gdb/solib-svr4.c +Index: gdb-7.2.90.20110429/gdb/solib-svr4.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/solib-svr4.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/solib-svr4.c 2011-01-17 15:52:06.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/solib-svr4.c 2011-05-03 05:14:56.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/solib-svr4.c 2011-05-03 05:14:57.000000000 +0200 @@ -1179,9 +1179,49 @@ svr4_current_sos (void) safe_strerror (errcode)); else @@ -179,28 +179,26 @@ } xfree (buffer); -Index: gdb-7.2.50.20110117/gdb/elfread.c +Index: gdb-7.2.90.20110429/gdb/elfread.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/elfread.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/elfread.c 2011-01-17 15:52:06.000000000 +0100 -@@ -38,6 +38,10 @@ - #include "demangle.h" - #include "psympriv.h" - #include "gdbtypes.h" +--- gdb-7.2.90.20110429.orig/gdb/elfread.c 2011-05-03 05:14:56.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/elfread.c 2011-05-03 05:19:27.000000000 +0200 +@@ -49,6 +49,11 @@ + #include "infcall.h" + #include "gdbthread.h" + #include "regcache.h" +#include "libbfd.h" +#include "gdbcore.h" +#include "gdbcmd.h" +#include "observer.h" ++#include <sys/stat.h> extern void _initialize_elfread (void); -@@ -823,16 +827,65 @@ resolve_gnu_ifunc (const char *function_ - return 0; +@@ -1077,16 +1082,65 @@ elf_gnu_ifunc_resolver_return_stop (stru + update_breakpoint_locations (b, sals, sals_end); } -+/* Locate NT_GNU_BUILD_ID and return its matching debug filename. -+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */ -+ +#define BUILD_ID_VERBOSE_NONE 0 +#define BUILD_ID_VERBOSE_FILENAMES 1 +#define BUILD_ID_VERBOSE_BINARY_PARSE 2 @@ -220,6 +218,9 @@ }; -/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */ ++/* Locate NT_GNU_BUILD_ID and return its matching debug filename. ++ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */ ++ +struct build_id * +build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size) +{ @@ -262,7 +263,7 @@ { struct build_id *retval; -@@ -848,6 +901,348 @@ build_id_bfd_get (bfd *abfd) +@@ -1102,6 +1156,348 @@ build_id_bfd_get (bfd *abfd) return retval; } @@ -611,7 +612,7 @@ /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */ static int -@@ -862,7 +1257,7 @@ build_id_verify (const char *filename, s +@@ -1116,7 +1512,7 @@ build_id_verify (const char *filename, s if (abfd == NULL) return 0; @@ -620,7 +621,7 @@ if (found == NULL) warning (_("File "%s" has no build-id, file skipped"), filename); -@@ -880,14 +1275,16 @@ build_id_verify (const char *filename, s +@@ -1134,14 +1530,15 @@ build_id_verify (const char *filename, s return retval; } @@ -636,24 +637,69 @@ /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */ - link = alloca (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1 - + 2 * build_id->size + (sizeof ".debug" - 1) + 1); -+ link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1 -+ + 2 * build_id->size + (sizeof ".debug" - 1) + 1); ++ link = xmalloc (strlen (debug_file_directory) + 2 * build_id->size + 50); /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will cause "/.build-id/..." lookups. */ -@@ -918,7 +1315,10 @@ build_id_to_debug_filename (struct build +@@ -1152,6 +1549,8 @@ build_id_to_debug_filename (struct build + char *s, *debugdir_end; + gdb_byte *data = build_id->data; + size_t size = build_id->size; ++ unsigned seqno; ++ struct stat statbuf_trash; + + while (*debugdir == DIRNAME_SEPARATOR) + debugdir++; +@@ -1172,39 +1571,242 @@ build_id_to_debug_filename (struct build *s++ = '/'; while (size-- > 0) s += sprintf (s, "%02x", (unsigned) *data++); - strcpy (s, ".debug"); -+ if (add_debug_suffix) -+ strcpy (s, ".debug"); -+ else -+ *s = 0; - - /* lrealpath() is expensive even for the usually non-existent files. */ - if (access (link, F_OK) == 0) -@@ -931,26 +1331,201 @@ build_id_to_debug_filename (struct build +- +- /* lrealpath() is expensive even for the usually non-existent files. */ +- if (access (link, F_OK) == 0) +- retval = lrealpath (link); + +- if (retval != NULL && !build_id_verify (retval, build_id)) ++ for (seqno = 0;; seqno++) + { +- xfree (retval); +- retval = NULL; ++ char *s2; ++ ++ if (seqno) ++ { ++ /* There can be multiple build-id symlinks pointing to real files ++ with the same build-id (such as hard links). Some of the real ++ files may not be installed. */ ++ ++ s2 = s + sprintf (s, ".%u", seqno); ++ } ++ else ++ s2 = s; ++ ++ if (add_debug_suffix) ++ strcpy (s2, ".debug"); ++ else ++ *s2 = 0; ++ ++ /* `access' automatically dereferences LINK. */ ++ if (lstat (link, &statbuf_trash) != 0) ++ { ++ /* Stop increasing SEQNO. */ ++ break; ++ } ++ ++ retval = lrealpath (link); ++ ++ if (retval != NULL && !build_id_verify (retval, build_id)) ++ { ++ xfree (retval); ++ retval = NULL; ++ } ++ ++ if (retval) ++ break; } if (retval != NULL) @@ -858,8 +904,8 @@ + 1); xfree (build_id); /* Prevent looping on a stripped .debug file. */ - if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0) -@@ -960,7 +1535,7 @@ find_separate_debug_file_by_buildid (str + if (build_id_name != NULL +@@ -1215,7 +1817,7 @@ find_separate_debug_file_by_buildid (str xfree (build_id_name); } else if (build_id_name != NULL) @@ -868,9 +914,9 @@ } return NULL; } -@@ -1148,9 +1723,10 @@ elf_symfile_read (struct objfile *objfil +@@ -1418,9 +2020,10 @@ elf_symfile_read (struct objfile *objfil `.note.gnu.build-id'. */ - if (!objfile_has_partial_symbols (objfile)) + else if (!objfile_has_partial_symbols (objfile)) { - char *debugfile; + char *debugfile, *build_id_filename; @@ -881,7 +927,7 @@ if (debugfile == NULL) debugfile = find_separate_debug_file_by_debuglink (objfile); -@@ -1162,6 +1738,12 @@ elf_symfile_read (struct objfile *objfil +@@ -1432,6 +2035,12 @@ elf_symfile_read (struct objfile *objfil symbol_file_add_separate (abfd, symfile_flags, objfile); xfree (debugfile); } @@ -894,10 +940,10 @@ } } -@@ -1337,4 +1919,16 @@ void - _initialize_elfread (void) - { - add_symtab_fns (&elf_sym_fns); +@@ -1911,4 +2520,16 @@ _initialize_elfread (void) + + elf_objfile_gnu_ifunc_cache_data = register_objfile_data (); + gnu_ifunc_fns_p = &elf_gnu_ifunc_fns; + + add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose, + _("\ @@ -911,11 +957,11 @@ + + observer_attach_executable_changed (debug_print_executable_changed); } -Index: gdb-7.2.50.20110117/gdb/symfile.h +Index: gdb-7.2.90.20110429/gdb/symfile.h =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/symfile.h 2011-01-11 22:53:24.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/symfile.h 2011-01-17 15:52:06.000000000 +0100 -@@ -554,6 +554,13 @@ void free_symfile_segment_data (struct s +--- gdb-7.2.90.20110429.orig/gdb/symfile.h 2011-05-03 05:14:56.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/symfile.h 2011-05-03 05:14:57.000000000 +0200 +@@ -605,6 +605,13 @@ void free_symfile_segment_data (struct s extern struct cleanup *increment_reading_symtab (void); @@ -929,11 +975,11 @@ /* From dwarf2read.c */ extern int dwarf2_has_info (struct objfile *); -Index: gdb-7.2.50.20110117/gdb/testsuite/lib/gdb.exp +Index: gdb-7.2.90.20110429/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/testsuite/lib/gdb.exp 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/testsuite/lib/gdb.exp 2011-01-17 15:52:06.000000000 +0100 -@@ -1395,6 +1395,16 @@ proc default_gdb_start { } { +--- gdb-7.2.90.20110429.orig/gdb/testsuite/lib/gdb.exp 2011-05-03 05:14:56.000000000 +0200 ++++ gdb-7.2.90.20110429/gdb/testsuite/lib/gdb.exp 2011-05-03 05:14:57.000000000 +0200 +@@ -1381,6 +1381,16 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -950,10 +996,10 @@ return 0; } -Index: gdb-7.2.50.20110117/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.2.90.20110429/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/testsuite/lib/mi-support.exp 2011-01-01 16:33:52.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/testsuite/lib/mi-support.exp 2011-01-17 15:52:06.000000000 +0100 +--- gdb-7.2.90.20110429.orig/gdb/testsuite/lib/mi-support.exp 2011-03-07 17:03:04.000000000 +0100 ++++ gdb-7.2.90.20110429/gdb/testsuite/lib/mi-support.exp 2011-05-03 05:14:57.000000000 +0200 @@ -221,6 +221,16 @@ proc default_mi_gdb_start { args } { } } @@ -971,13 +1017,13 @@ detect_async -Index: gdb-7.2.50.20110117/gdb/objfiles.h +Index: gdb-7.2.90.20110429/gdb/objfiles.h =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/objfiles.h 2011-01-10 21:38:49.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/objfiles.h 2011-01-17 15:52:26.000000000 +0100 -@@ -434,6 +434,10 @@ struct objfile +--- gdb-7.2.90.20110429.orig/gdb/objfiles.h 2011-03-07 17:17:29.000000000 +0100 ++++ gdb-7.2.90.20110429/gdb/objfiles.h 2011-05-03 05:14:57.000000000 +0200 +@@ -441,6 +441,10 @@ struct objfile - #define OBJF_USERLOADED (1 << 3) /* User loaded */ + #define OBJF_PSYMTABS_READ (1 << 4) +/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */ + ++++++ gdb-6.6-bz235197-fork-detach-info.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:29.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:29.000000000 +0200 @@ -3,11 +3,11 @@ Port to GDB-6.8pre. Remove the `[' character from the GDB-6.8 default message. -Index: gdb-7.0.50.20100115/gdb/linux-nat.c +Index: gdb-7.2.50.20110320/gdb/linux-nat.c =================================================================== ---- gdb-7.0.50.20100115.orig/gdb/linux-nat.c 2010-01-15 03:22:31.000000000 +0100 -+++ gdb-7.0.50.20100115/gdb/linux-nat.c 2010-01-15 03:23:28.000000000 +0100 -@@ -724,7 +724,7 @@ holding the child stopped. Try "set de +--- gdb-7.2.50.20110320.orig/gdb/linux-nat.c 2011-03-20 16:59:51.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/linux-nat.c 2011-03-20 16:59:51.000000000 +0100 +@@ -716,7 +716,7 @@ holding the child stopped. Try "set de remove_breakpoints_pid (GET_PID (inferior_ptid)); } @@ -16,10 +16,10 @@ { target_terminal_ours (); fprintf_filtered (gdb_stdlog, -Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.c +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.c 2010-01-15 03:22:52.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c 2011-03-20 16:59:51.000000000 +0100 @@ -0,0 +1,57 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -78,10 +78,10 @@ + } + return 0; +} -Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.exp +Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.exp 2010-01-15 03:22:52.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp 2011-03-20 17:12:22.000000000 +0100 @@ -0,0 +1,36 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -117,5 +117,5 @@ +gdb_run_cmd +# `Starting program: .*' prefix is available since gdb-6.7. +gdb_test "" \ -+ "Detaching after fork from child process.*Program exited normally\..*" \ ++ "Detaching after fork from child process.*\[Inferior .* exited normally\]" \ + "Info message caught" ++++++ gdb-6.8-bz254229-gcore-prpsinfo.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -1,8 +1,8 @@ -Index: gdb-7.1.90.20100711/bfd/elf-bfd.h +Index: gdb-7.2.50.20110320/bfd/elf-bfd.h =================================================================== ---- gdb-7.1.90.20100711.orig/bfd/elf-bfd.h 2010-06-27 06:07:51.000000000 +0200 -+++ gdb-7.1.90.20100711/bfd/elf-bfd.h 2010-07-12 23:00:04.000000000 +0200 -@@ -2171,8 +2171,10 @@ extern Elf_Internal_Phdr * _bfd_elf_find +--- gdb-7.2.50.20110320.orig/bfd/elf-bfd.h 2011-03-20 15:17:42.000000000 +0100 ++++ gdb-7.2.50.20110320/bfd/elf-bfd.h 2011-03-20 15:24:02.000000000 +0100 +@@ -2193,8 +2193,10 @@ extern Elf_Internal_Phdr * _bfd_elf_find /* Exported interface for writing elf corefile notes. */ extern char *elfcore_write_note (bfd *, char *, int *, const char *, int, const void *, int); @@ -14,11 +14,11 @@ extern char *elfcore_write_prstatus (bfd *, char *, int *, long, int, const void *); extern char * elfcore_write_pstatus -Index: gdb-7.1.90.20100711/bfd/elf.c +Index: gdb-7.2.50.20110320/bfd/elf.c =================================================================== ---- gdb-7.1.90.20100711.orig/bfd/elf.c 2010-05-18 05:31:05.000000000 +0200 -+++ gdb-7.1.90.20100711/bfd/elf.c 2010-07-12 22:51:17.000000000 +0200 -@@ -8582,13 +8582,12 @@ elfcore_write_note (bfd *abfd, +--- gdb-7.2.50.20110320.orig/bfd/elf.c 2011-03-20 15:17:42.000000000 +0100 ++++ gdb-7.2.50.20110320/bfd/elf.c 2011-03-20 15:24:02.000000000 +0100 +@@ -8814,13 +8814,12 @@ elfcore_write_note (bfd *abfd, return buf; } @@ -34,7 +34,7 @@ { const char *note_name = "CORE"; const struct elf_backend_data *bed = get_elf_backend_data (abfd); -@@ -8596,48 +8595,55 @@ elfcore_write_prpsinfo (bfd *abfd, +@@ -8828,48 +8827,55 @@ elfcore_write_prpsinfo (bfd *abfd, if (bed->elf_backend_write_core_note != NULL) { char *ret; @@ -109,11 +109,11 @@ #if defined (HAVE_PRSTATUS_T) char * -Index: gdb-7.1.90.20100711/gdb/linux-nat.c +Index: gdb-7.2.50.20110320/gdb/linux-nat.c =================================================================== ---- gdb-7.1.90.20100711.orig/gdb/linux-nat.c 2010-07-12 23:05:22.000000000 +0200 -+++ gdb-7.1.90.20100711/gdb/linux-nat.c 2010-07-12 22:57:34.000000000 +0200 -@@ -4466,6 +4466,131 @@ linux_spu_make_corefile_notes (bfd *obfd +--- gdb-7.2.50.20110320.orig/gdb/linux-nat.c 2011-03-20 15:17:46.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/linux-nat.c 2011-03-20 15:25:36.000000000 +0100 +@@ -4603,6 +4603,131 @@ linux_spu_make_corefile_notes (bfd *obfd return args.note_data; } @@ -245,11 +245,11 @@ /* Fills the "to_make_corefile_note" target vector. Builds the note section for a corefile, and returns it in a malloc buffer. */ -@@ -4484,26 +4609,11 @@ linux_nat_make_corefile_notes (bfd *obfd +@@ -4621,26 +4746,11 @@ linux_nat_make_corefile_notes (bfd *obfd if (get_exec_file (0)) { -- strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname)); +- strncpy (fname, lbasename (get_exec_file (0)), sizeof (fname)); - strncpy (psargs, get_exec_file (0), sizeof (psargs)); - if (get_inferior_args ()) - { @@ -275,11 +275,11 @@ } /* Dump information for threads. */ -Index: gdb-7.1.90.20100711/gdb/procfs.c +Index: gdb-7.2.50.20110320/gdb/procfs.c =================================================================== ---- gdb-7.1.90.20100711.orig/gdb/procfs.c 2010-07-07 18:15:16.000000000 +0200 -+++ gdb-7.1.90.20100711/gdb/procfs.c 2010-07-12 23:05:23.000000000 +0200 -@@ -5770,6 +5770,7 @@ procfs_make_note_section (bfd *obfd, int +--- gdb-7.2.50.20110320.orig/gdb/procfs.c 2011-03-09 13:48:55.000000000 +0100 ++++ gdb-7.2.50.20110320/gdb/procfs.c 2011-03-20 15:24:02.000000000 +0100 +@@ -5752,6 +5752,7 @@ procfs_make_note_section (bfd *obfd, int note_data = (char *) elfcore_write_prpsinfo (obfd, note_data, note_size, ++++++ gdb-6.8-bz442765-threaded-exec-test.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -170,4 +170,4 @@ +gdb_run_cmd ${binfile_nothreads} ${binfile_threads} 0 gdb_test_multiple {} "Program exited" { - -re "\r\nProgram exited normally.\r\n$gdb_prompt $" { + -re "\r\n\[Inferior .* exited normally\]\r\n$gdb_prompt $" { ++++++ gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch ++++++ --- gdb-7.2.50.20110328.orig/gdb/dwarf2read.c 2011-03-30 12:52:20.395450001 +0200 +++ gdb-7.2.50.20110328/gdb/dwarf2read.c 2011-03-30 13:41:55.485450006 +0200 @@ -66,12 +66,14 @@ #ifdef HAVE_ZLIB_H #include <zlib.h> #endif +#ifndef __sparc__ #ifdef HAVE_MMAP #include <sys/mman.h> #ifndef MAP_FAILED #define MAP_FAILED ((void *) -1) #endif #endif +#endif typedef struct symbol *symbolp; DEF_VEC_P (symbolp); @@ -1563,6 +1565,7 @@ } } +#ifndef __sparc__ #ifdef HAVE_MMAP if (pagesize == 0) pagesize = getpagesize (); @@ -1589,6 +1592,7 @@ } } #endif +#endif /* If we get here, we are a normal, not-compressed section. */ info->buffer = buf @@ -15439,6 +15443,7 @@ { if (info->was_mmapped) { +#ifndef __sparc__ #ifdef HAVE_MMAP intptr_t begin = (intptr_t) info->buffer; intptr_t map_begin = begin & ~(pagesize - 1); @@ -15449,6 +15454,7 @@ /* Without HAVE_MMAP, we should never be here to begin with. */ gdb_assert_not_reached ("no mmap support"); #endif +#endif } } ++++++ gdb-7.2.50.20110206.tar.bz2 -> gdb-7.3.tar.bz2 ++++++ gdb/gdb-7.2.50.20110206.tar.bz2 /mounts/work_src_done/STABLE/gdb/gdb-7.3.tar.bz2 differ: char 11, line 1 ++++++ gdb-archer-pie-addons-keep-disabled.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -1,9 +1,9 @@ -Index: gdb-7.2.50.20110206/gdb/breakpoint.c +Index: gdb-7.2.90.20110411/gdb/breakpoint.c =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/breakpoint.c 2011-02-06 20:39:24.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/breakpoint.c 2011-02-06 20:39:44.000000000 +0100 -@@ -10587,6 +10587,50 @@ update_breakpoint_locations (struct brea - update_global_location_list (1); +--- gdb-7.2.90.20110411.orig/gdb/breakpoint.c 2011-04-11 19:11:55.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/breakpoint.c 2011-04-11 19:18:10.000000000 +0200 +@@ -11233,6 +11233,50 @@ re_set_breakpoint (struct breakpoint *b) + do_cleanups (cleanups); } +void @@ -53,25 +53,25 @@ /* Reset a breakpoint given it's struct breakpoint * BINT. The value we return ends up being the return value from catch_errors. Unused in this case. */ -Index: gdb-7.2.50.20110206/gdb/breakpoint.h +Index: gdb-7.2.90.20110411/gdb/breakpoint.h =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/breakpoint.h 2011-02-06 20:39:24.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/breakpoint.h 2011-02-06 20:40:00.000000000 +0100 -@@ -1194,4 +1194,7 @@ extern struct breakpoint *iterate_over_b +--- gdb-7.2.90.20110411.orig/gdb/breakpoint.h 2011-04-11 19:11:55.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/breakpoint.h 2011-04-11 19:17:53.000000000 +0200 +@@ -1245,4 +1245,7 @@ extern int user_breakpoint_p (struct bre - extern int user_breakpoint_p (struct breakpoint *); + extern void modify_semaphore (struct bp_location *location, int set); +extern void breakpoints_relocate (struct objfile *objfile, + struct section_offsets *delta); + #endif /* !defined (BREAKPOINT_H) */ -Index: gdb-7.2.50.20110206/gdb/objfiles.c +Index: gdb-7.2.90.20110411/gdb/objfiles.c =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/objfiles.c 2011-01-10 21:38:49.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/objfiles.c 2011-02-06 20:39:44.000000000 +0100 -@@ -846,6 +846,11 @@ objfile_relocate1 (struct objfile *objfi - obj_section_addr (s)); - } +--- gdb-7.2.90.20110411.orig/gdb/objfiles.c 2011-04-11 19:11:55.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/objfiles.c 2011-04-11 19:17:53.000000000 +0200 +@@ -851,6 +851,11 @@ objfile_relocate1 (struct objfile *objfi + objfile->sf->sym_probe_fns->sym_relocate_probe (objfile, + new_offsets, delta); + /* Final call of breakpoint_re_set can keep breakpoint locations disabled if + their addresses match. */ ++++++ gdb-archer-pie-addons.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -1,8 +1,8 @@ -Index: gdb-7.2.50.20110117/gdb/dwarf2read.c +Index: gdb-7.2.90.20110525/gdb/dwarf2read.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:56:23.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 16:00:14.000000000 +0100 -@@ -7475,7 +7475,12 @@ read_common_block (struct die_info *die, +--- gdb-7.2.90.20110525.orig/gdb/dwarf2read.c 2011-05-25 17:10:46.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/dwarf2read.c 2011-05-25 17:12:35.000000000 +0200 +@@ -7675,7 +7675,12 @@ read_common_block (struct die_info *die, { struct attribute *attr; struct symbol *sym; @@ -16,7 +16,7 @@ attr = dwarf2_attr (die, DW_AT_location, cu); if (attr) -@@ -7484,6 +7489,7 @@ read_common_block (struct die_info *die, +@@ -7684,6 +7689,7 @@ read_common_block (struct die_info *die, if (attr_form_is_block (attr)) { base = decode_locdesc (DW_BLOCK (attr), cu); @@ -24,15 +24,15 @@ } else if (attr_form_is_section_offset (attr)) { -@@ -7545,12 +7551,15 @@ read_common_block (struct die_info *die, - else - dwarf2_complex_location_expr_complaint (); - -- SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset; +@@ -7736,12 +7742,15 @@ read_common_block (struct die_info *die, + if (sym != NULL + && handle_data_member_location (child_die, cu, &offset)) + { +- SYMBOL_VALUE_ADDRESS (sym) = base + offset; + if (!base_p) + dwarf2_invalid_attrib_class_complaint + ("DW_AT_data_member_location", "common block member"); -+ SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset + baseaddr; ++ SYMBOL_VALUE_ADDRESS (sym) = base + offset + baseaddr; add_symbol_to_list (sym, &global_symbols); } @@ -42,7 +42,7 @@ else SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym)); FIELD_TYPE (*field) = SYMBOL_TYPE (sym); -@@ -7564,7 +7573,7 @@ read_common_block (struct die_info *die, +@@ -7755,7 +7764,7 @@ read_common_block (struct die_info *die, sym = new_symbol (die, type, cu); /* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */ @@ -51,11 +51,11 @@ set_die_type (die, type, cu); } -Index: gdb-7.2.50.20110117/gdb/gdbtypes.h +Index: gdb-7.2.90.20110525/gdb/gdbtypes.h =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/gdbtypes.h 2011-01-17 15:51:03.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/gdbtypes.h 2011-01-17 16:00:32.000000000 +0100 -@@ -394,6 +394,7 @@ enum type_instance_flag_value +--- gdb-7.2.90.20110525.orig/gdb/gdbtypes.h 2011-05-25 17:05:21.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/gdbtypes.h 2011-05-25 17:11:10.000000000 +0200 +@@ -396,6 +396,7 @@ enum type_instance_flag_value enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /* bitpos */ @@ -63,7 +63,7 @@ FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSNAME /* physname */ }; -@@ -576,6 +577,7 @@ struct main_type +@@ -580,6 +581,7 @@ struct main_type is the location (in the target) of the static field. Otherwise, physname is the mangled label of the static field. */ @@ -71,7 +71,7 @@ CORE_ADDR physaddr; char *physname; } -@@ -1102,6 +1104,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1106,6 +1108,7 @@ extern void allocate_gnat_aux_type (stru #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) @@ -79,7 +79,7 @@ #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define SET_FIELD_BITPOS(thisfld, bitpos) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ -@@ -1109,6 +1112,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1113,6 +1116,7 @@ extern void allocate_gnat_aux_type (stru #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -87,7 +87,7 @@ #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -@@ -1121,6 +1125,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1125,6 +1129,7 @@ extern void allocate_gnat_aux_type (stru #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) @@ -95,10 +95,10 @@ #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) -Index: gdb-7.2.50.20110117/gdb/jv-lang.c +Index: gdb-7.2.90.20110525/gdb/jv-lang.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/jv-lang.c 2011-01-09 04:08:57.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/jv-lang.c 2011-01-17 16:00:59.000000000 +0100 +--- gdb-7.2.90.20110525.orig/gdb/jv-lang.c 2011-03-02 01:42:53.000000000 +0100 ++++ gdb-7.2.90.20110525/gdb/jv-lang.c 2011-05-25 17:11:10.000000000 +0200 @@ -414,7 +414,8 @@ java_link_class_type (struct gdbarch *gd fields = NULL; @@ -119,11 +119,11 @@ else TYPE_FIELD_BITPOS (type, i) = 8 * boffset; if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */ -Index: gdb-7.2.50.20110117/gdb/value.c +Index: gdb-7.2.90.20110525/gdb/value.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/value.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/value.c 2011-01-17 16:00:14.000000000 +0100 -@@ -1997,7 +1997,8 @@ value_static_field (struct type *type, i +--- gdb-7.2.90.20110525.orig/gdb/value.c 2011-05-25 17:05:21.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/value.c 2011-05-25 17:11:10.000000000 +0200 +@@ -2492,7 +2492,8 @@ value_static_field (struct type *type, i { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), ++++++ gdb-archer.patch ++++++ ++++ 10259 lines (skipped) ++++ between gdb/gdb-archer.patch ++++ and /mounts/work_src_done/STABLE/gdb/gdb-archer.patch ++++++ gdb-bz541866-rwatch-before-run.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -11,6 +11,47 @@ NAT_CDEPS = $(srcdir)/proc-service.list # The dynamically loaded libthread_db needs access to symbols in the +--- gdb-7.2/gdb/config/i386/linux.mh-orig 2010-06-11 14:08:51.000000000 +0200 ++++ gdb-7.2/gdb/config/i386/linux.mh 2011-03-18 12:00:32.000000000 +0100 +@@ -1,6 +1,6 @@ + # Host: Intel 386 running GNU/Linux. + +-NAT_FILE= config/nm-linux.h ++NAT_FILE= nm-linux.h + NATDEPFILES= inf-ptrace.o fork-child.o \ + i386-nat.o i386-linux-nat.o \ + proc-service.o linux-thread-db.o \ +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.1.90.20100711/gdb/config/i386/nm-linux.h 2010-07-13 19:02:28.000000000 +0200 +@@ -0,0 +1,28 @@ ++/* Native support for GNU/Linux i386. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see http://www.gnu.org/licenses/. */ ++ ++#ifndef NM_LINUX_H ++#define NM_LINUX_H ++ ++#include "config/nm-linux.h" ++ ++/* Red Hat backward compatibility with gdb-6.8. */ ++#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 ++ ++#endif /* NM_LINUX64_H */ Index: gdb-7.2.50.20110117/gdb/config/i386/nm-linux64.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++++ gdb-bz562763-pretty-print-2d-vectors.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -12,10 +12,10 @@ * gdb.python/pr10659.exp. New file. * gdb.python/pr10659.py: New file. -Index: gdb-7.2.50.20110206/gdb/valprint.h +Index: gdb-7.2.50.20110218/gdb/valprint.h =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/valprint.h 2011-01-25 18:59:00.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/valprint.h 2011-02-06 20:55:59.000000000 +0100 +--- gdb-7.2.50.20110218.orig/gdb/valprint.h 2011-02-14 12:35:45.000000000 +0100 ++++ gdb-7.2.50.20110218/gdb/valprint.h 2011-02-18 10:44:32.000000000 +0100 @@ -90,6 +90,9 @@ struct value_print_options /* If nonzero, print the value in "summary" form. */ @@ -26,10 +26,10 @@ }; /* The global print options set by the user. In general this should -Index: gdb-7.2.50.20110206/gdb/python/py-prettyprint.c +Index: gdb-7.2.50.20110218/gdb/python/py-prettyprint.c =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/python/py-prettyprint.c 2011-01-26 21:58:48.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/python/py-prettyprint.c 2011-02-06 20:56:30.000000000 +0100 +--- gdb-7.2.50.20110218.orig/gdb/python/py-prettyprint.c 2011-02-14 12:10:53.000000000 +0100 ++++ gdb-7.2.50.20110218/gdb/python/py-prettyprint.c 2011-02-18 10:45:02.000000000 +0100 @@ -501,7 +501,7 @@ print_children (PyObject *printer, const /* Use the prettyprint_arrays option if we are printing an array, @@ -103,15 +103,15 @@ } done: -@@ -690,6 +713,7 @@ apply_val_pretty_printer (struct type *t +@@ -689,6 +712,7 @@ apply_val_pretty_printer (struct type *t + char *hint = NULL; struct cleanup *cleanups; int result = 0; - enum string_repr_result print_result; + struct value_print_options *options_copy; - cleanups = ensure_python_env (gdbarch, language); + enum string_repr_result print_result; - /* Instantiate the printer. */ -@@ -721,9 +745,21 @@ apply_val_pretty_printer (struct type *t + /* No pretty-printer support for unavailable values. */ +@@ -726,9 +750,21 @@ apply_val_pretty_printer (struct type *t /* If we are printing a map, we want some special formatting. */ hint = gdbpy_get_display_hint (printer); @@ -133,10 +133,10 @@ print_result = print_string_repr (printer, hint, stream, recurse, options, language, gdbarch); if (print_result != string_repr_error) -Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.cc +Index: gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.cc =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.cc 2011-02-06 20:55:59.000000000 +0100 ++++ gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.cc 2011-02-18 10:44:32.000000000 +0100 @@ -0,0 +1,43 @@ +#include <list> +#include <vector> // /usr/include/c++/4.4.1/bits/vector.tcc @@ -181,10 +181,10 @@ + + return 0; // break +} -Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.exp +Index: gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.exp 2011-02-06 20:55:59.000000000 +0100 ++++ gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.exp 2011-02-18 10:44:32.000000000 +0100 @@ -0,0 +1,82 @@ +#Copyright 2010 Free Software Foundation, Inc. + @@ -268,10 +268,10 @@ +# + + -Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.py +Index: gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.py 2011-02-06 20:55:59.000000000 +0100 ++++ gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.py 2011-02-18 10:44:32.000000000 +0100 @@ -0,0 +1,109 @@ +# Copyright (C) 2008, 2009 Free Software Foundation, Inc. + @@ -382,10 +382,10 @@ +fake_pretty_printers_dict = {} + +build_libfakecxx_dictionary () -Index: gdb-7.2.50.20110206/gdb/valprint.c +Index: gdb-7.2.50.20110218/gdb/valprint.c =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/valprint.c 2011-02-06 20:55:52.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/valprint.c 2011-02-06 20:55:59.000000000 +0100 +--- gdb-7.2.50.20110218.orig/gdb/valprint.c 2011-02-18 10:44:16.000000000 +0100 ++++ gdb-7.2.50.20110218/gdb/valprint.c 2011-02-18 10:44:32.000000000 +0100 @@ -85,7 +85,8 @@ struct value_print_options user_print_op 1, /* static_field_print */ 1, /* pascal_static_field_print */ ++++++ gdb-bz645773-case-insensitive-1of5.patch ++++++ [patch] Code cleanup: New SYMBOL_HASH_NEXT http://sourceware.org/ml/gdb-patches/2011-04/msg00022.html http://sourceware.org/ml/gdb-cvs/2011-04/msg00043.html ### src/gdb/ChangeLog 2011/04/06 03:24:22 1.12908 ### src/gdb/ChangeLog 2011/04/06 19:50:03 1.12909 ## -1,3 +1,12 @@ +2011-04-06 Jan Kratochvil <jan.kratochvil@redhat.com> + + Code cleanup. + * dictionary.c (dict_hash): Use SYMBOL_HASH_NEXT. + * dwarf2read.c (mapped_index_string_hash): Refer to SYMBOL_HASH_NEXT + in the function comment, a new note on values compatibility. + * minsyms.c (msymbol_hash_iw, msymbol_hash): Use SYMBOL_HASH_NEXT. + * symtab.h (SYMBOL_HASH_NEXT): New. + 2011-04-06 Thiago Jung Bauermann <bauerman@br.ibm.com> * ppc-linux-nat.c (check_condition): Add len output parameter. --- src/gdb/dictionary.c 2011/01/07 19:36:15 1.21 +++ src/gdb/dictionary.c 2011/04/06 19:50:04 1.22 @@ -826,7 +826,7 @@ } /* FALL THROUGH */ default: - hash = hash * 67 + *string - 113; + hash = SYMBOL_HASH_NEXT (hash, *string); string += 1; break; } --- src/gdb/dwarf2read.c 2011/04/04 14:10:12 1.520 +++ src/gdb/dwarf2read.c 2011/04/06 19:50:04 1.521 @@ -1962,11 +1962,11 @@ do_cleanups (cleanup); } -/* The hash function for strings in the mapped index. This is the - same as the hashtab.c hash function, but we keep a separate copy to - maintain control over the implementation. This is necessary - because the hash function is tied to the format of the mapped index - file. */ +/* The hash function for strings in the mapped index. This is the same as + SYMBOL_HASH_NEXT, but we keep a separate copy to maintain control over the + implementation. This is necessary because the hash function is tied to the + format of the mapped index file. The hash values do not have to match with + SYMBOL_HASH_NEXT. */ static hashval_t mapped_index_string_hash (const void *p) --- src/gdb/minsyms.c 2011/03/28 20:29:51 1.81 +++ src/gdb/minsyms.c 2011/04/06 19:50:05 1.82 @@ -91,7 +91,7 @@ ++string; if (*string && *string != '(') { - hash = hash * 67 + *string - 113; + hash = SYMBOL_HASH_NEXT (hash, *string); ++string; } } @@ -106,7 +106,7 @@ unsigned int hash = 0; for (; *string; ++string) - hash = hash * 67 + *string - 113; + hash = SYMBOL_HASH_NEXT (hash, *string); return hash; } --- src/gdb/symtab.h 2011/04/04 15:19:59 1.177 +++ src/gdb/symtab.h 2011/04/06 19:50:05 1.178 @@ -1004,6 +1004,12 @@ extern unsigned int msymbol_hash (const char *); +/* Compute the next hash value from previous HASH and the character C. This + is only a GDB in-memory computed value with no external files compatibility + requirements. */ + +#define SYMBOL_HASH_NEXT(hash, c) ((hash) * 67 + (c) - 113) + extern struct objfile * msymbol_objfile (struct minimal_symbol *sym); extern void ++++++ gdb-bz645773-case-insensitive-2of5.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-04/msg00124.html Subject: [patch 1/3] case insensitive: Reformat code Hi, just some reformatting to make the later patch more clear. There should be no functionality difference by this patch. c1+c2 are a bit ugly but I found any other solution a bit ugly. Thanks, Jan gdb/ 2011-04-08 Jan Kratochvil <jan.kratochvil@redhat.com> Format the code for the next patch. * dwarf2read.c (struct mapped_index): Include delimiting newlines. * utils.c (strcmp_iw_ordered): Reformat the code for the next patch. New variables c1 and c2. --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -150,14 +150,19 @@ struct mapped_index { /* The total length of the buffer. */ off_t total_size; + /* A pointer to the address table data. */ const gdb_byte *address_table; + /* Size of the address table data in bytes. */ offset_type address_table_size; + /* The symbol table, implemented as a hash table. */ const offset_type *symbol_table; + /* Size in slots, each slot is 2 offset_types. */ offset_type symbol_table_slots; + /* A pointer to the constant pool. */ const char *constant_pool; }; --- a/gdb/utils.c +++ b/gdb/utils.c @@ -3023,48 +3023,55 @@ strcmp_iw (const char *string1, const char *string2) int strcmp_iw_ordered (const char *string1, const char *string2) { - while ((*string1 != '\0') && (*string2 != '\0')) + /* Formatting stub. */ + if (1) { - while (isspace (*string1)) - { - string1++; - } - while (isspace (*string2)) - { - string2++; - } - if (*string1 != *string2) + /* C1 and C2 are valid only if *string1 != '\0' && *string2 != '\0'. + Provide stub characters if we are already at the end of one of the + strings. */ + char c1 = 'X', c2 = 'X'; + + while (*string1 != '\0' && *string2 != '\0') { - break; + while (isspace (*string1)) + string1++; + while (isspace (*string2)) + string2++; + + c1 = *string1; + c2 = *string2; + if (c1 != c2) + break; + + if (*string1 != '\0') + { + string1++; + string2++; + } } - if (*string1 != '\0') + + switch (*string1) { - string1++; - string2++; + /* Characters are non-equal unless they're both '\0'; we want to + make sure we get the comparison right according to our + comparison in the cases where one of them is '\0' or '('. */ + case '\0': + if (*string2 == '\0') + return 0; + else + return -1; + case '(': + if (*string2 == '\0') + return 1; + else + return -1; + default: + if (*string2 == '\0' || *string2 == '(') + return 1; + else + return c1 - c2; } } - - switch (*string1) - { - /* Characters are non-equal unless they're both '\0'; we want to - make sure we get the comparison right according to our - comparison in the cases where one of them is '\0' or '('. */ - case '\0': - if (*string2 == '\0') - return 0; - else - return -1; - case '(': - if (*string2 == '\0') - return 1; - else - return -1; - default: - if (*string2 == '(') - return 1; - else - return *string1 - *string2; - } } /* A simple comparison function with opposite semantics to strcmp. */ ++++++ gdb-bz645773-case-insensitive-3of5.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-04/msg00125.html Subject: [patch 2/3] case insensitive: re_comp->regcomp Hi, re_comp cannot be passed REG_ICASE. Therefore change the code. The should have no functionality impact. The new boolean field `preg_p' could be maybe replaced by a conditional `preg.buffer != NULL' which would work with libiberty regcomp implementation but I do not see it guaranteed anywhere. GDB is always using static libiberty implementation which I do not see why in the case it is running on glibc. But if it gets fixed one day and it starts to use externally linked regcomp/regexec I would find the `preg.buffer != NULL' conditional dangerous. Thanks, Jan gdb/ 2011-04-08 Jan Kratochvil <jan.kratochvil@redhat.com> Replace re_comp/re_exec by regcomp/regexec. * symtab.c (struct search_symbols_data): New fields preg, preg_p. (search_symbols_name_matches): Use them, use regexec. (search_symbols): New variable retval_chain, adjust the use of old_chain against it. Replace re_comp by regcomp. Use the new struct search_symbols_data fields, use regexec instead of re_exec. Index: gdb-7.2.90.20110429/gdb/symtab.c =================================================================== --- gdb-7.2.90.20110429.orig/gdb/symtab.c 2011-04-29 09:43:33.000000000 +0200 +++ gdb-7.2.90.20110429/gdb/symtab.c 2011-04-29 09:43:55.000000000 +0200 @@ -2958,7 +2958,10 @@ struct search_symbols_data { int nfiles; char **files; - char *regexp; + + /* It is true if PREG contains valid data, false otherwise. */ + unsigned preg_p : 1; + regex_t preg; }; /* A callback for expand_symtabs_matching. */ @@ -2976,7 +2979,7 @@ search_symbols_name_matches (const char { struct search_symbols_data *data = user_data; - return data->regexp == NULL || re_exec (symname); + return !data->preg_p || regexec (&data->preg, symname, 0, NULL, 0) == 0; } /* Search the symbol table for matches to the regular expression REGEXP, @@ -3023,9 +3026,13 @@ search_symbols (char *regexp, domain_enu struct symbol_search *sr; struct symbol_search *psr; struct symbol_search *tail; - struct cleanup *old_chain = NULL; struct search_symbols_data datum; + /* OLD_CHAIN .. RETVAL_CHAIN is always freed, RETVAL_CHAIN .. current + CLEANUP_CHAIN is freed only in the case of an error. */ + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + struct cleanup *retval_chain; + if (kind < VARIABLES_DOMAIN || kind >= ALL_DOMAIN) error (_("must search on specific domain")); @@ -3036,6 +3043,7 @@ search_symbols (char *regexp, domain_enu sr = *matches = NULL; tail = NULL; + datum.preg_p = 0; if (regexp != NULL) { @@ -3045,6 +3053,7 @@ search_symbols (char *regexp, domain_enu and <TYPENAME> or <OPERATOR>. */ char *opend; char *opname = operator_chars (regexp, &opend); + int errcode; if (*opname) { @@ -3073,8 +3082,16 @@ search_symbols (char *regexp, domain_enu } } - if (0 != (val = re_comp (regexp))) - error (_("Invalid regexp (%s): %s"), val, regexp); + errcode = regcomp (&datum.preg, regexp, REG_NOSUB); + if (errcode != 0) + { + char *err = get_regcomp_error (errcode, &datum.preg); + + make_cleanup (xfree, err); + error (_("Invalid regexp (%s): %s"), err, regexp); + } + datum.preg_p = 1; + make_regfree_cleanup (&datum.preg); } /* Search through the partial symtabs *first* for all symbols @@ -3083,7 +3100,6 @@ search_symbols (char *regexp, domain_enu datum.nfiles = nfiles; datum.files = files; - datum.regexp = regexp; ALL_OBJFILES (objfile) { if (objfile->sf) @@ -3094,6 +3110,8 @@ search_symbols (char *regexp, domain_enu &datum); } + retval_chain = old_chain; + /* Here, we search through the minimal symbol tables for functions and variables that match, and force their symbols to be read. This is in particular necessary for demangled variable names, @@ -3117,8 +3135,9 @@ search_symbols (char *regexp, domain_enu MSYMBOL_TYPE (msymbol) == ourtype3 || MSYMBOL_TYPE (msymbol) == ourtype4) { - if (regexp == NULL - || re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0) + if (!datum.preg_p + || regexec (&datum.preg, SYMBOL_NATURAL_NAME (msymbol), 0, + NULL, 0) == 0) { if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))) { @@ -3156,8 +3175,9 @@ search_symbols (char *regexp, domain_enu QUIT; if (file_matches (real_symtab->filename, files, nfiles) - && ((regexp == NULL - || re_exec (SYMBOL_NATURAL_NAME (sym)) != 0) + && ((!datum.preg_p + || regexec (&datum.preg, SYMBOL_NATURAL_NAME (sym), 0, + NULL, 0) == 0) && ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (sym) != LOC_TYPEDEF && SYMBOL_CLASS (sym) != LOC_UNRESOLVED @@ -3199,7 +3219,7 @@ search_symbols (char *regexp, domain_enu tail = sort_search_symbols (&dummy, nfound); sr = dummy.next; - old_chain = make_cleanup_free_search_symbols (sr); + make_cleanup_free_search_symbols (sr); } else tail = sort_search_symbols (prevtail, nfound); @@ -3221,8 +3241,9 @@ search_symbols (char *regexp, domain_enu MSYMBOL_TYPE (msymbol) == ourtype3 || MSYMBOL_TYPE (msymbol) == ourtype4) { - if (regexp == NULL - || re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0) + if (!datum.preg_p + || regexec (&datum.preg, SYMBOL_NATURAL_NAME (msymbol), 0, + NULL, 0) == 0) { /* Functions: Look up by address. */ if (kind != FUNCTIONS_DOMAIN || @@ -3244,7 +3265,7 @@ search_symbols (char *regexp, domain_enu if (tail == NULL) { sr = psr; - old_chain = make_cleanup_free_search_symbols (sr); + make_cleanup_free_search_symbols (sr); } else tail->next = psr; @@ -3256,9 +3277,9 @@ search_symbols (char *regexp, domain_enu } } + discard_cleanups (retval_chain); + do_cleanups (old_chain); *matches = sr; - if (sr != NULL) - discard_cleanups (old_chain); } /* Helper function for symtab_symbol_info, this function uses ++++++ gdb-bz645773-case-insensitive-4of5.patch ++++++ ++++ 669 lines (skipped) ++++++ gdb-bz701131-readline62-1of3.patch ++++++ ++++ 21252 lines (skipped) ++++++ gdb-bz701131-readline62-2of3.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-05/msg00002.html Subject: [patch] testsuite: Test readline-6.2 "ask" regression Hi, this problem does not affect default FSF GDB build as it is using bundled readline-5.1. But with system readline-6.2 and build using: --with-system-readline use installed readline library GDB will no longer ask about displaying too many symbols and dumps them all immediately. PASS: $ gdb gdb (gdb) p <tab><tab> Display all 21482 possibilities? (y or n)_ FAIL: $ gdb gdb (gdb) p <tab><tab> Display all 22129 possibilities? (y or n) ../../bfd/aout-target.h cs_to_section ../../bfd/aout32.c ctime <screens and screens of dumps without any question> This regression will soon start affecting distros: FSF GDB HEAD - PASS - using bundled readline-5.1 fedora-15 - FAIL - using system readline-6.2 fedora-14 - PASS - using system readline-6.1 debian-6.0 - PASS - using system readline-6.1 kubuntu-10.10 - PASS - using system readline-6.1 I have asked about it on readline ml: Re: [Bug-readline] callback mode pager disable status https://lists.gnu.org/archive/html/bug-readline/2011-04/msg00012.html The suggested workaround (in fact the readline-5.1 code state) going to patch into the proposed FSF GDB bundled readline-6.2. Distros then can stop using --with-system-readline to still feature recent and system matching readline until readline-7.0 gets released. This regression has been so far caught only with system debug infos installed: -PASS: gdb.base/completion.exp: complete (2) 'p no_var_named_this-' -PASS: gdb.base/completion.exp: complete 'p values[0].a' -PASS: gdb.base/completion.exp: complete 'p values[0] . a' -PASS: gdb.base/completion.exp: complete 'p &values[0] -> a' -PASS: gdb.base/completion.exp: copmletion of field in anonymous union +FAIL: gdb.base/completion.exp: (timeout) complete (2) 'p no_var_named_this-' +FAIL: gdb.base/completion.exp: (timeout) complete 'p values[0].a' 2 +FAIL: gdb.base/completion.exp: (timeout) complete 'p values[0] . a' 2 +FAIL: gdb.base/completion.exp: (timeout) complete 'p &values[0] -> a' 2 +FAIL: gdb.base/completion.exp: copmletion of field in anonymous union I will check it in with no comments. Thanks, Jan gdb/testsuite/ 2011-05-01 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/readline-ask.c: New file. * gdb.base/readline-ask.exp: New file. * gdb.base/readline-ask.inputrc: New file. --- /dev/null +++ b/gdb/testsuite/gdb.base/readline-ask.c @@ -0,0 +1,23 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2011 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see http://www.gnu.org/licenses/. */ + +int +symbol_01_length_40_____________________, +symbol_02_length_40_____________________, +symbol_03_length_40_____________________, +symbol_04_length_40_____________________, +symbol_10_length_40_____________________; --- /dev/null +++ b/gdb/testsuite/gdb.base/readline-ask.exp @@ -0,0 +1,118 @@ +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +set testfile readline-ask +set executable ${testfile}.x +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${executable} +set inputrc ${srcdir}/${subdir}/${testfile}.inputrc + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } { + untested ${testfile}.exp + return -1 +} + +# INPUTRC gets reset for the next testfile. +setenv INPUTRC $inputrc +clean_restart ${executable} + +gdb_test_no_output "set width 50" +gdb_test_no_output "set height 3" + +set cmd "p symbol_0" +send_gdb "$cmd\t" +set test "bell for more message" +gdb_test_multiple "" $test { + -re "$cmd\007$" { + pass $test + } +} + +send_gdb "\t" +set test "more message for 01 and 02" +gdb_test_multiple "" $test { + -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" { + pass $test + } + -re "$gdb_prompt " { + fail $test + } +} + +# There get some VT100 characters printed. + +send_gdb "\r" +set test "more message for 03" +gdb_test_multiple "" $test { + -re "\rsymbol_03_length_40_____________________\r\n--More--$" { + pass $test + } +} + +# "$gdb_prompt $" will not match as $cmd gets output: $gdb_prompt p symbol_0 +# And "$gdb_prompt p symbol_0" cannot be matched as the default "$gdb_prompt $" +# string from gdb_test_multiple could match earlier. + +send_gdb "\r" +set test "more finish for 04" +gdb_test_multiple "" $test { + -re "\rsymbol_04_length_40_____________________\r\n$gdb_prompt " { + pass $test + } +} + +gdb_test "foo" {No symbol "symbol_0foo" in current context.} "abort more message" + +set cmd "p symbol_" +send_gdb "$cmd\t" +set test "bell for ask message" +gdb_test_multiple "" $test { + -re "$cmd\007$" { + pass $test + } +} + +send_gdb "\t" +set test "ask message" +gdb_test_multiple "" $test { + -re "^\r\nDisplay all 5 possibilities\? \(y or n\)$" { + pass $test + } + -re "$gdb_prompt " { + fail $test + return 0 + } +} + +send_gdb "y" +set test "ask message for 01 and 02" +gdb_test_multiple "" $test { + -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" { + pass $test + } +} + +# There get some VT100 characters printed. +# See the "$gdb_prompt " match like in "more finish for 04". + +send_gdb "n" +set test "ask message no" +gdb_test_multiple "" $test { + -re "\r$gdb_prompt " { + pass $test + } +} + +gdb_test "foo" {No symbol "symbol_foo" in current context.} "abort ask message" --- /dev/null +++ b/gdb/testsuite/gdb.base/readline-ask.inputrc @@ -0,0 +1,16 @@ +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +set completion-query-items 5 ++++++ gdb-bz701131-readline62-3of3.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-05/msg00010.html Subject: [patch 4/3] readline-6.2: Substitute inc-hist.texinfo Hi, forgot the patchset had a `make doc' regression: make: *** No rule to make target `../../../gdb/doc/../../readline/doc/inc-hist.texinfo', needed by `gdb.info'. Stop. There was a copy hsuser.texi -> inc-hist.texinfo before with this diff: @node Using History Interactively @chapter Using History Interactively -@ifclear BashFeatures -@defcodeindex bt -@end ifclear +@c @ifclear BashFeatures +@c @defcodeindex bt +@c @end ifclear @ifset BashFeatures This chapter describes how to use the @sc{gnu} History Library @end ifset @ifclear BashFeatures This chapter describes how to use the @sc{gnu} History Library interactively, -from a user's standpoint. It should be considered a user's guide. For -information on using the @sc{gnu} History Library in your own programs, -@pxref{Programming with GNU History}. +from a user's standpoint. It should be considered a user's guide. +For information on using the @sc{gnu} History Library in other programs, +see the @sc{gnu} Readline Library Manual. @end ifclear @ifset BashFeatures Used slightly alternative one with IMO better reference and I have also kept hsuser.texi in place as readline/ in src/ is no longer a standalone readline distribution anyway. Sorry, Jan gdb/doc/ 2011-05-02 Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (GDB_DOC_SOURCE_INCLUDES): Rename inc-hist.texinfo to hsuser.texi. * gdb.texinfo <!SYSTEM_READLINE>: Rename inc-hist.texinfo inclusion and comment to hsuser.texi. Change rluser.texi name in the comment. readline/doc/ 2011-05-02 Jan Kratochvil <jan.kratochvil@redhat.com> * hsuser.texi (Using History Interactively): Disable !BashFeatures @defcodeindex. Make the `Programming with GNU History' reference external. Index: gdb-7.2.90.20110525/gdb/doc/Makefile.in =================================================================== --- gdb-7.2.90.20110525.orig/gdb/doc/Makefile.in 2011-01-03 14:01:05.000000000 +0100 +++ gdb-7.2.90.20110525/gdb/doc/Makefile.in 2011-05-25 19:16:35.000000000 +0200 @@ -117,7 +117,7 @@ GDB_DOC_SOURCE_INCLUDES = \ $(srcdir)/gpl.texi \ $(srcdir)/agentexpr.texi \ $(READLINE_DIR)/rluser.texi \ - $(READLINE_DIR)/inc-hist.texinfo + $(READLINE_DIR)/hsuser.texi GDB_DOC_BUILD_INCLUDES = \ gdb-cfg.texi \ GDBvn.texi Index: gdb-7.2.90.20110525/gdb/doc/gdb.texinfo =================================================================== --- gdb-7.2.90.20110525.orig/gdb/doc/gdb.texinfo 2011-05-25 19:14:36.000000000 +0200 +++ gdb-7.2.90.20110525/gdb/doc/gdb.texinfo 2011-05-25 19:17:01.000000000 +0200 @@ -31095,13 +31095,13 @@ things without first using the debugger @c The readline documentation is distributed with the readline code @c and consists of the two following files: -@c rluser.texinfo -@c inc-hist.texinfo +@c rluser.texi +@c hsuser.texi @c Use -I with makeinfo to point to the appropriate directory, @c environment var TEXINPUTS with TeX. @ifclear SYSTEM_READLINE @include rluser.texi -@include inc-hist.texinfo +@include hsuser.texi @end ifclear @node In Memoriam Index: gdb-7.2.90.20110525/readline/doc/hsuser.texi =================================================================== --- gdb-7.2.90.20110525.orig/readline/doc/hsuser.texi 2011-05-25 19:16:17.000000000 +0200 +++ gdb-7.2.90.20110525/readline/doc/hsuser.texi 2011-05-25 19:16:35.000000000 +0200 @@ -26,9 +26,10 @@ into another language, under the above c @node Using History Interactively @chapter Using History Interactively -@ifclear BashFeatures -@defcodeindex bt -@end ifclear +@c GDB bundling modification: +@c @ifclear BashFeatures +@c @defcodeindex bt +@c @end ifclear @ifset BashFeatures This chapter describes how to use the @sc{gnu} History Library @@ -41,7 +42,8 @@ see the @sc{gnu} Readline Library Manual This chapter describes how to use the @sc{gnu} History Library interactively, from a user's standpoint. It should be considered a user's guide. For information on using the @sc{gnu} History Library in your own programs, -@pxref{Programming with GNU History}. +@c GDB bundling modification: +@pxref{Programming with GNU History, , , history, GNU History Library}. @end ifclear @ifset BashFeatures ++++++ gdb-core-thread-internalerr-1of3.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-02/msg00679.html Subject: Re: [patch 1/3] Code cleanup: gdb.threads/gcore-thread.exp On Thu, 24 Feb 2011 08:20:09 +0100, Joel Brobecker wrote:
Just a thought: Do we really need to worry about restoring the timeout at the end of the testcase, given that this is automatically done at the start of each testcase (see gdb.exp: gdb_init)?
I see now: Re: [RFA/testsuite] Reset the timeout duration at the start of each testcase. http://sourceware.org/ml/gdb-patches/2010-02/msg00202.html commit 501c57da40fd27c8036a5fc995f750b0559272ad Patch updated. Thanks, Jan gdb/testsuite/ 2011-02-24 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.threads/gcore-thread.exp ($testfile): Match it the .exp filename. ($srcfile): Preserve the original value. ($testfile): Match it the .exp filename. ($corefile): New variable. Substitute it around. Use clean_restart. ($prev_timeout): Remove. (load_core): Move core loading into this proc. Fix restore of $timeout if load_core fails. --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -21,11 +21,11 @@ if $tracelevel then { strace $tracelevel } - # Single-threaded test case -set testfile "pthreads" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/gcore-${testfile} +set testfile "gcore-thread" +set srcfile pthreads.c +set binfile ${objdir}/${subdir}/${testfile} +set corefile ${objdir}/${subdir}/${testfile}.test if [istarget "*-*-linux"] then { set target_cflags "-D_MIT_POSIX_THREADS" @@ -41,10 +41,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${testfile} # regexp for "horizontal" text (i.e. doesn't include newline or # carriage return) @@ -53,7 +50,6 @@ set horiz "[^\n\r]*" # regexp for newline set nl "[\r\n]+" -set prev_timeout $timeout set timeout 30 gdb_test_multiple "help gcore" "help gcore" { @@ -92,10 +88,9 @@ delete_breakpoints gdb_breakpoint "thread2" gdb_test "continue" "Continuing.*Breakpoint.* thread2 .*" "thread 2 is running" -set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test] +set escapedfilename [string_to_regexp $corefile] # Drop corefile -gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \ - "save a corefile" \ +gdb_test_multiple "gcore $corefile" "save a corefile" \ { -re "Saved corefile ${escapedfilename}[\r\n]+$gdb_prompt $" { pass "save a corefile" @@ -114,31 +109,38 @@ if {!$core_supported} { return -1 } + # Now restart gdb and load the corefile. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - -gdb_test_multiple "core ${objdir}/${subdir}/gcore.test" \ - "re-load generated corefile" { - -re ".* is not a core dump:.*$gdb_prompt $" { - fail "re-load generated corefile (bad file format)" - # No use proceeding from here. - return; - } - -re ".*: No such file or directory.*$gdb_prompt $" { - fail "re-load generated corefile (file not found)" - # No use proceeding from here. - return; - } - -re ".*Couldn't find .* registers in core file.*$gdb_prompt $" { - fail "re-load generated corefile (incomplete note section)" - } - -re "Core was generated by .*$gdb_prompt $" { - pass "re-load generated corefile" +clean_restart ${testfile} + +proc load_core { corefile } { + global gdb_prompt + + gdb_test_multiple "core $corefile" \ + "re-load generated corefile" { + -re " is not a core dump:.*\r\n$gdb_prompt $" { + fail "re-load generated corefile (bad file format)" + # No use proceeding from here. + return 0; + } + -re ": No such file or directory.*\r\n$gdb_prompt $" { + fail "re-load generated corefile (file not found)" + # No use proceeding from here. + return 0; + } + -re "Couldn't find .* registers in core file.*\r\n$gdb_prompt $" { + fail "re-load generated corefile (incomplete note section)" + } + -re "Core was generated by .*\r\n$gdb_prompt $" { + pass "re-load generated corefile" + } } - } + return 1 +} + +if ![load_core $corefile] { + return +} # FIXME: now what can we test about the thread state? # We do not know for certain that there should be at least @@ -158,5 +160,3 @@ gdb_test "info threads" ".* thread2 .*" \ gdb_test "info threads" ".*${nl}\* ${horiz} thread2 .*" \ "thread2 is current thread in corefile" - -set timeout $prev_timeout ++++++ gdb-core-thread-internalerr-2of3.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-02/msg00680.html Subject: [patch 2/3] Fix threading internal error on corrupted memory [rediff] [rediff] gdb/ 2011-02-24 Jan Kratochvil <jan.kratochvil@redhat.com> * linux-thread-db.c (find_new_threads_callback): Exit on zero TI_TID even if !TARGET_HAS_EXECUTION. gdb/testsuite/ 2011-02-24 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.threads/gcore-thread.exp ($core0file): New variable. (clear __stack_user.next, clear stack_used.next) (save a zeroed-threads corefile): New test. Call core_load for $core0file. (zeroed-threads cannot be listed): New test. --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1335,7 +1335,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) return 0; /* A zombie -- ignore. */ - if (ti.ti_tid == 0 && target_has_execution) + if (ti.ti_tid == 0) { /* A thread ID of zero means that this is the main thread, but glibc has not yet initialized thread-local storage and the @@ -1347,10 +1347,13 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) need this glibc bug workaround. */ info->need_stale_parent_threads_check = 0; - err = info->td_thr_event_enable_p (th_p, 1); - if (err != TD_OK) - error (_("Cannot enable thread event reporting for LWP %d: %s"), - (int) ti.ti_lid, thread_db_err_str (err)); + if (target_has_execution) + { + err = info->td_thr_event_enable_p (th_p, 1); + if (err != TD_OK) + error (_("Cannot enable thread event reporting for LWP %d: %s"), + (int) ti.ti_lid, thread_db_err_str (err)); + } return 0; } --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -26,6 +26,7 @@ set testfile "gcore-thread" set srcfile pthreads.c set binfile ${objdir}/${subdir}/${testfile} set corefile ${objdir}/${subdir}/${testfile}.test +set core0file ${objdir}/${subdir}/${testfile}0.test if [istarget "*-*-linux"] then { set target_cflags "-D_MIT_POSIX_THREADS" @@ -110,6 +111,29 @@ if {!$core_supported} { } +# Test the uninitialized thread list. +# Provide the case of glibc td_thr_get_info handling of: +# /* Special case for the main thread before initialization. */ + +foreach symbol {__stack_user stack_used} { + set test "clear ${symbol}.next" + gdb_test_multiple "p *(void **) &${symbol} = 0" $test { + -re " = \(void \*\) 0x0\r\n$gdb_prompt $" { + pass $test + } + -re "No symbol "${symbol}" in current context\.\r\n$gdb_prompt $" { + xfail $test + # Do not do the verification. + set core0file "" + } + } +} + +if {"$core0file" != ""} { + gdb_test "gcore $core0file" "Saved corefile .*" "save a zeroed-threads corefile" +} + + # Now restart gdb and load the corefile. clean_restart ${testfile} @@ -160,3 +184,11 @@ gdb_test "info threads" ".* thread2 .*" \ gdb_test "info threads" ".*${nl}\* ${horiz} thread2 .*" \ "thread2 is current thread in corefile" + + +# Test the uninitialized thread list. + +if {"$core0file" != "" && [load_core $core0file]} { + + gdb_test "info threads" "Cannot find new threads: .*" "zeroed-threads cannot be listed" +} ++++++ gdb-core-thread-internalerr-3of3.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-02/msg00675.html Subject: [patch 3/3] Display core reasons even during thread error [ rediff ] Hi, this is mostly unrelated. But after the patch 2/3 it will still FAIL: Loaded symbols for /lib64/ld-linux-x86-64.so.2 Cannot find new threads: debugger service failed (gdb) FAIL: gdb.threads/gcore-thread.exp: re-load generated corefile as it is a common bug I dislike for years I have fixed it here: Loaded symbols for /lib64/ld-linux-x86-64.so.2 Cannot find new threads: debugger service failed Core was generated by `.../gdb/testsuite/gdb.threads/gcore-thread'. Program terminated with signal 5, Trace/breakpoint trap. #0 thread2 (arg=0xdeadbeef) at ./gdb.threads/pthreads.c:91 91 int k = 0; (gdb) PASS: gdb.threads/gcore-thread.exp: re-load generated corefile No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu. Thanks, Jan gdb/ 2011-02-24 Jan Kratochvil <jan.kratochvil@redhat.com> * corelow.c: Include wrapper.h. (core_open): Call now gdb_target_find_new_threads. * wrapper.c: Include target.h. (gdb_target_find_new_threads): New. * wrapper.h (gdb_target_find_new_threads): New declaration. --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -47,6 +47,7 @@ #include "auxv.h" #include "elf/common.h" #include "gdbcmd.h" +#include "wrapper.h" #ifndef O_LARGEFILE @@ -428,7 +429,7 @@ core_open (char *filename, int from_tty) may be a thread_stratum target loaded on top of target core by now. The layer above should claim threads found in the BFD sections. */ - target_find_new_threads (); + gdb_target_find_new_threads (); p = bfd_core_file_failing_command (core_bfd); if (p) --- a/gdb/wrapper.c +++ b/gdb/wrapper.c @@ -21,6 +21,7 @@ #include "exceptions.h" #include "wrapper.h" #include "ui-out.h" +#include "target.h" int gdb_parse_exp_1 (char **stringptr, struct block *block, int comma, @@ -161,3 +162,24 @@ gdb_value_struct_elt (struct ui_out *uiout, struct value **result, return GDB_RC_FAIL; return GDB_RC_OK; } + +/* Call target_find_new_threads without throwing exception. Exception is + printed if it got thrown. */ + +int +gdb_target_find_new_threads (void) +{ + volatile struct gdb_exception except; + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + target_find_new_threads (); + } + + if (except.reason < 0) + { + exception_print (gdb_stderr, except); + return 0; + } + return 1; +} --- a/gdb/wrapper.h +++ b/gdb/wrapper.h @@ -48,4 +48,6 @@ extern int gdb_value_ind (struct value *val, struct value ** rval); extern int gdb_parse_and_eval_type (char *, int, struct type **); +extern int gdb_target_find_new_threads (void); + #endif /* wrapper.h */ ++++++ gdb-fortran-common.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -1,8 +1,8 @@ -Index: gdb-7.2.50.20110117/gdb/dwarf2read.c +Index: gdb-7.2.90.20110525/gdb/dwarf2read.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:50:41.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 15:56:23.000000000 +0100 -@@ -7465,12 +7465,14 @@ read_set_type (struct die_info *die, str +--- gdb-7.2.90.20110525.orig/gdb/dwarf2read.c 2011-05-25 17:06:19.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/dwarf2read.c 2011-05-25 17:10:46.000000000 +0200 +@@ -7665,12 +7665,14 @@ read_set_type (struct die_info *die, str return set_die_type (die, set_type, cu); } @@ -19,7 +19,7 @@ struct attribute *attr; struct symbol *sym; CORE_ADDR base = (CORE_ADDR) 0; -@@ -7495,10 +7497,40 @@ read_common_block (struct die_info *die, +@@ -7695,20 +7697,67 @@ read_common_block (struct die_info *die, } if (die->child != NULL) { @@ -52,16 +52,17 @@ child_die = die->child; while (child_die && child_die->tag) { + LONGEST offset; + + /* Create the symbol in the DW_TAG_common_block block in the current + symbol scope. */ sym = new_symbol (child_die, NULL, cu); + + /* Undocumented in DWARF3, when it can be present? */ - attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu); - if (sym != NULL && attr != NULL) + if (sym != NULL + && handle_data_member_location (child_die, cu, &offset)) { -@@ -7516,8 +7548,25 @@ read_common_block (struct die_info *die, - SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset; + SYMBOL_VALUE_ADDRESS (sym) = base + offset; add_symbol_to_list (sym, &global_symbols); } + @@ -86,7 +87,7 @@ } } -@@ -11111,6 +11160,13 @@ new_symbol_full (struct die_info *die, s +@@ -11376,6 +11425,13 @@ new_symbol_full (struct die_info *die, s { var_decode_location (attr, sym, cu); attr2 = dwarf2_attr (die, DW_AT_external, cu); @@ -100,7 +101,7 @@ if (SYMBOL_CLASS (sym) == LOC_STATIC && SYMBOL_VALUE_ADDRESS (sym) == 0 && !dwarf2_per_objfile->has_section_at_zero) -@@ -11283,6 +11339,11 @@ new_symbol_full (struct die_info *die, s +@@ -11548,6 +11604,11 @@ new_symbol_full (struct die_info *die, s SYMBOL_CLASS (sym) = LOC_TYPEDEF; list_to_add = &global_symbols; break; @@ -112,10 +113,10 @@ default: /* Not a tag we recognize. Hopefully we aren't processing trash data, but since we must specifically ignore things -Index: gdb-7.2.50.20110117/gdb/f-lang.c +Index: gdb-7.2.90.20110525/gdb/f-lang.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/f-lang.c 2011-01-17 15:56:07.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/f-lang.c 2011-01-17 15:56:48.000000000 +0100 +--- gdb-7.2.90.20110525.orig/gdb/f-lang.c 2011-05-25 17:06:22.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/f-lang.c 2011-05-25 17:07:02.000000000 +0200 @@ -446,27 +446,3 @@ _initialize_f_language (void) add_language (&f_language_defn); @@ -144,10 +145,10 @@ - } - return (NULL); -} -Index: gdb-7.2.50.20110117/gdb/f-lang.h +Index: gdb-7.2.90.20110525/gdb/f-lang.h =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/f-lang.h 2011-01-17 15:54:14.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/f-lang.h 2011-01-17 15:56:23.000000000 +0100 +--- gdb-7.2.90.20110525.orig/gdb/f-lang.h 2011-05-25 17:06:22.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/f-lang.h 2011-05-25 17:07:02.000000000 +0200 @@ -52,36 +52,8 @@ enum f90_range_type NONE_BOUND_DEFAULT /* "(low:high)" */ }; @@ -185,10 +186,10 @@ /* When reasonable array bounds cannot be fetched, such as when you ask to 'mt print symbols' and there is no stack frame and -Index: gdb-7.2.50.20110117/gdb/f-valprint.c +Index: gdb-7.2.90.20110525/gdb/f-valprint.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/f-valprint.c 2011-01-17 15:54:36.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/f-valprint.c 2011-01-17 15:59:38.000000000 +0100 +--- gdb-7.2.90.20110525.orig/gdb/f-valprint.c 2011-05-25 17:06:22.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/f-valprint.c 2011-05-25 17:07:02.000000000 +0200 @@ -34,6 +34,8 @@ #include "gdbcore.h" #include "command.h" @@ -198,7 +199,7 @@ extern void _initialize_f_valprint (void); static void info_common_command (char *, int); -@@ -489,22 +491,54 @@ f_val_print (struct type *type, const gd +@@ -501,22 +503,54 @@ f_val_print (struct type *type, const gd return 0; } @@ -266,7 +267,7 @@ } /* This function is used to print out the values in a given COMMON -@@ -514,11 +548,9 @@ list_all_visible_commons (char *funname) +@@ -526,11 +560,9 @@ list_all_visible_commons (char *funname) static void info_common_command (char *comname, int from_tty) { @@ -280,7 +281,7 @@ /* We have been told to display the contents of F77 COMMON block supposedly visible in this function. Let us -@@ -530,74 +562,31 @@ info_common_command (char *comname, int +@@ -542,74 +574,31 @@ info_common_command (char *comname, int /* The following is generally ripped off from stack.c's routine print_frame_info(). */ @@ -371,11 +372,11 @@ } void -Index: gdb-7.2.50.20110117/gdb/stack.c +Index: gdb-7.2.90.20110525/gdb/stack.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/stack.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/stack.c 2011-01-17 15:56:23.000000000 +0100 -@@ -1498,6 +1498,8 @@ iterate_over_block_locals (struct block +--- gdb-7.2.90.20110525.orig/gdb/stack.c 2011-05-25 17:05:21.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/stack.c 2011-05-25 17:07:02.000000000 +0200 +@@ -1525,6 +1525,8 @@ iterate_over_block_locals (struct block case LOC_COMPUTED: if (SYMBOL_IS_ARGUMENT (sym)) break; @@ -384,26 +385,26 @@ (*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data); break; -Index: gdb-7.2.50.20110117/gdb/symtab.h +Index: gdb-7.2.90.20110525/gdb/symtab.h =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/symtab.h 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/symtab.h 2011-01-17 15:56:23.000000000 +0100 -@@ -408,7 +408,10 @@ typedef enum domain_enum_tag - FUNCTIONS_DOMAIN, - - /* All defined types */ -- TYPES_DOMAIN -+ TYPES_DOMAIN, +--- gdb-7.2.90.20110525.orig/gdb/symtab.h 2011-05-25 17:05:21.000000000 +0200 ++++ gdb-7.2.90.20110525/gdb/symtab.h 2011-05-25 17:07:02.000000000 +0200 +@@ -411,7 +411,10 @@ typedef enum domain_enum_tag + TYPES_DOMAIN, + + /* Any type. */ +- ALL_DOMAIN ++ ALL_DOMAIN, + + /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. */ + COMMON_BLOCK_DOMAIN } domain_enum; -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.exp +Index: gdb-7.2.90.20110525/gdb/testsuite/gdb.fortran/common-block.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.exp 2011-01-17 15:56:23.000000000 +0100 ++++ gdb-7.2.90.20110525/gdb/testsuite/gdb.fortran/common-block.exp 2011-05-25 17:07:02.000000000 +0200 @@ -0,0 +1,101 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -506,10 +507,10 @@ +gdb_test "p ix_x" " = 1 *" "p ix_x in" +gdb_test "p iy_y" " = 2 *" "p iy_y in" +gdb_test "p iz_z2" " = 3 *" "p iz_z2 in" -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.f90 +Index: gdb-7.2.90.20110525/gdb/testsuite/gdb.fortran/common-block.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.f90 2011-01-17 15:56:23.000000000 +0100 ++++ gdb-7.2.90.20110525/gdb/testsuite/gdb.fortran/common-block.f90 2011-05-25 17:07:02.000000000 +0200 @@ -0,0 +1,67 @@ +! Copyright 2008 Free Software Foundation, Inc. +! ++++++ gdb-gcc46-stdarg-prologue.patch ++++++ ++++ 736 lines (skipped) ++++ between gdb/gdb-gcc46-stdarg-prologue.patch ++++ and /mounts/work_src_done/STABLE/gdb/gdb-gcc46-stdarg-prologue.patch ++++++ gdb-gcc46-typedef.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -1,17 +1,218 @@ -internal-error: could not find partial DIE -https://bugzilla.redhat.com/show_bug.cgi?id=672230 +http://sourceware.org/ml/gdb-patches/2011-04/msg00154.html +Subject: [patch] Workaround buggy GCC PR 47510 produced code + +Hi, + +GCC PR debug/47510 is already fixed and GDB has the proper support for it: + RFC: update for GCC PR 47510 + http://sourceware.org/ml/gdb-patches/2011-03/msg00916.html + +Still FSF GDB HEAD will crash on a binary produced by older/buggy GCC: + Reading symbols from .../gcc46.o...dwarf2read.c:9329: internal-error: could not find partial DIE 0x9a in cache [from module .../gcc46.o] + +Which may not give much clue to the user. + +The proposed patch could make false warnings if any code out there has +DW_TAG_typedef with children, it does not check for specific GCC versions. +Still such DWARF is invalid, although in such case complaint() would be more +appropriate than warning(). Does it make sense to differentiate it? + +No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu. + + +Thanks, +Jan + + +gdb/ +2011-04-11 Jan Kratochvil <jan.kratochvil@redhat.com> + + * dwarf2read.c (struct dwarf2_per_objfile): New field + typedef_children_warning_printed. + (load_partial_dies): Read in any children of DW_TAG_typedef with + a warning in such case. + +gdb/testsuite/ +2011-04-11 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gdb.dwarf2/dw2-typedef-children.S: New file. + * gdb.dwarf2/dw2-typedef-children.exp: New file. -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 6a98d57..f33a327 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -8796,8 +8796,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, +@@ -209,6 +209,9 @@ struct dwarf2_per_objfile + or we are faking it for OBJF_READNOW's sake. */ + unsigned char using_index; + ++ /* Print the GCC PR debug/47510 warning only once per objfile. */ ++ unsigned typedef_children_warning_printed : 1; ++ + /* The mapped index, or NULL if .gdb_index is missing or not being used. */ + struct mapped_index *index_table; + +@@ -8951,7 +8954,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, if (parent_die == NULL && part_die->has_specification == 0 && part_die->is_declaration == 0 - && (part_die->tag == DW_TAG_typedef -- || part_die->tag == DW_TAG_base_type -+ && (part_die->tag == DW_TAG_base_type ++ && ((part_die->tag == DW_TAG_typedef && !part_die->has_children) + || part_die->tag == DW_TAG_base_type || part_die->tag == DW_TAG_subrange_type)) { - if (building_psymtab && part_die->name != NULL) +@@ -8964,6 +8967,20 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, + continue; + } + ++ /* The exception for DW_TAG_typedef with has_children above is ++ a workaround of GCC PR debug/47510. GDB crashed on broken GCC output ++ as it skipped children of DW_TAG_typedef by the shortcut above and ++ then it could not find the child DIEs referenced later. */ ++ ++ if (!dwarf2_per_objfile->typedef_children_warning_printed ++ && part_die->tag == DW_TAG_typedef && part_die->has_children) ++ { ++ warning (_("DW_TAG_typedef has childen - GCC PR debug/47510 bug " ++ "- DIE at 0x%x [in module %s]"), ++ part_die->offset, cu->objfile->name); ++ dwarf2_per_objfile->typedef_children_warning_printed = 1; ++ } ++ + /* If we're at the second level, and we're an enumerator, and + our parent has no specification (meaning possibly lives in a + namespace elsewhere), then we can add the partial symbol now +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-typedef-children.S +@@ -0,0 +1,92 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2011 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see http://www.gnu.org/licenses/. */ ++ ++/* Debug information */ ++ ++ .section .debug_info ++.Lcu1_begin: ++ /* CU header */ ++ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ ++.Lcu1_start: ++ .2byte 2 /* DWARF Version */ ++ .4byte .Labbrev1_begin /* Offset into abbrev section */ ++ .byte 4 /* Pointer size */ ++ ++ /* CU die */ ++ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ ++ .ascii "file1.txt\0" /* DW_AT_name */ ++ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ ++ .byte 1 /* DW_AT_language (C) */ ++ ++.Ltype_int: ++ .uleb128 2 /* Abbrev: DW_TAG_base_type */ ++ .ascii "int\0" /* DW_AT_name */ ++ .byte 4 /* DW_AT_byte_size */ ++ .byte 5 /* DW_AT_encoding */ ++ ++ .uleb128 0x3 /* (DIE (0x38) DW_TAG_typedef) */ ++ .ascii "new\0" /* DW_AT_name */ ++ .long .Ltype_int - .Lcu1_begin /* DW_AT_type */ ++ ++ .uleb128 2 /* Abbrev: DW_TAG_base_type */ ++ .ascii "int\0" /* DW_AT_name */ ++ .byte 4 /* DW_AT_byte_size */ ++ .byte 5 /* DW_AT_encoding */ ++ ++ .uleb128 0 /* End of DW_TAG_typedef */ ++ .uleb128 0 /* End of DW_TAG_compile_unit */ ++.Lcu1_end: ++ ++/* Abbrev table */ ++ .section .debug_abbrev ++.Labbrev1_begin: ++ .uleb128 1 /* Abbrev code */ ++ .uleb128 0x11 /* DW_TAG_compile_unit */ ++ .byte 1 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x25 /* DW_AT_producer */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x13 /* DW_AT_language */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 2 /* Abbrev code */ ++ .uleb128 0x24 /* DW_TAG_base_type */ ++ .byte 0 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0xb /* DW_AT_byte_size */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x3e /* DW_AT_encoding */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 0x3 /* (abbrev code) */ ++ .uleb128 0x16 /* (TAG: DW_TAG_typedef) */ ++ .byte 0x1 /* DW_children_yes */ ++ .uleb128 0x3 /* (DW_AT_name) */ ++ .uleb128 0x8 /* (DW_FORM_string) */ ++ .uleb128 0x49 /* (DW_AT_type) */ ++ .uleb128 0x13 /* (DW_FORM_ref4) */ ++ .byte 0x0 ++ .byte 0x0 ++ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-typedef-children.exp +@@ -0,0 +1,37 @@ ++# Copyright 2011 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see http://www.gnu.org/licenses/. ++load_lib dwarf.exp ++ ++# Note: Inspired from dw2-basic.exp. ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++if {![dwarf2_support]} { ++ return 0 ++} ++ ++set testfile "dw2-typedef-children" ++set srcfile ${testfile}.S ++set binfile ${objdir}/${subdir}/${testfile}.x ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {nodebug}] != "" } { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++ ++gdb_test "file $binfile" \ ++ "warning: DW_TAG_typedef has childen - GCC PR debug/47510 bug - DIE at .*" \ ++ "warning message" + ++++++ gdb-prelink-rela.patch ++++++ http://sourceware.org/ml/gdb-patches/2011-02/msg00630.html Subject: [patch] [i386] Fix {,un}prelinked libraries for attach/core-load Hi, please see comments in the patch. The adjusted testcase FAILs on i386. "Prelink", March 4, 2004 - by Jakub Jelinek: http://people.redhat.com/jakub/prelink.pdf primarily section 7 - REL to RELA conversion An example of unprelinked -> prelinked library change: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align - LOAD 0x000000 0x00000000 0x00000000 0x00538 0x00538 R E 0x1000 - LOAD 0x000538 0x00001538 0x00001538 0x00100 0x00110 RW 0x1000 - DYNAMIC 0x000550 0x00001550 0x00001550 0x000c8 0x000c8 RW 0x4 - NOTE 0x0000f4 0x000000f4 0x000000f4 0x00024 0x00024 R 0x4 - GNU_EH_FRAME 0x0004e8 0x000004e8 0x000004e8 0x00014 0x00014 R 0x4 + LOAD 0x000000 0x411b3000 0x411b3000 0x00558 0x00558 R E 0x1000 + LOAD 0x000558 0x411b4558 0x411b4558 0x00100 0x00110 RW 0x1000 + DYNAMIC 0x000570 0x411b4570 0x411b4570 0x000c8 0x000c8 RW 0x4 + NOTE 0x0000f4 0x411b30f4 0x411b30f4 0x00024 0x00024 R 0x4 + GNU_EH_FRAME 0x000508 0x411b3508 0x411b3508 0x00014 0x00014 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4 So far GDB expected all such displacements will be always PAGE_SIZE aligned. This applies for example for re-prelinking of an already prelinked file. But it does not apply for prelinking of an unprelinked file or unprelinking of a prelinked file, there can be arbitrary displacement. It affects i386 (=i686, prelink doc reports also ARM and MIPS) which uses REL. x86_64 always uses RELA, therefore I have not noticed it so far. i386 still has to be supported. This affects both attachment to a PID and core file loads. This applies in real world if you transfer a core file between hosts and try to backtrace them, libraries of both hosts may differ whether they are / are not prelinked. I could implement some (displacement-forgiving and prelink-modifications forgiving) comparison of both DYNAMIC segments found. But I do not think it is useful, if the DYNAMIC address from linkmap vs. bfd do not match it is still a better chance to try a displacement to make them match. Keeping the file relocation cannot work anyway when the DYNAMIC address is verified as wrong. No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu. Mostly do you agree the DYNAMIC content does not have to be verifed? Do you have any comments on the in-code long comments? Thanks, Jan gdb/ 2011-02-22 Jan Kratochvil <jan.kratochvil@redhat.com> Fix libraries displacement if they change whether they were prelinked. * solib-svr4.c (LM_ADDR_CHECK): Set L_ADDR even if the DYNAMIC pointer does not match. Comment why. gdb/testsuite/ 2011-02-22 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/break-interp-lib.c (v, vptr): New variables. * gdb.base/break-interp.exp (test_attach): New comment. --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -237,11 +237,11 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) Even on PPC it must be zero-aligned at least for MINPAGESIZE. */ + l_addr = l_dynaddr - dynaddr; + if ((l_addr & (minpagesize - 1)) == 0 && (l_addr & align) == ((l_dynaddr - dynaddr) & align)) { - l_addr = l_dynaddr - dynaddr; - if (info_verbose) printf_unfiltered (_("Using PIC (Position Independent Code) " "prelink displacement %s for "%s".\n"), @@ -249,9 +249,20 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) so->so_name); } else - warning (_(".dynamic section for "%s" " - "is not at the expected address " - "(wrong library or version mismatch?)"), so->so_name); + { + /* There is no way to verify the library file matches. prelink + can during prelinking of an unprelinked file (or unprelinking + of a prelinked file) shift the DYNAMIC segment by arbitrary + offset without any page size alignment. There is no way to + find out the ELF header and/or Program Headers for a limited + verification if it they match. One could do a verification + of the DYNAMIC segment. Still the found address is the best + one GDB could find. */ + + warning (_(".dynamic section for "%s" " + "is not at the expected address " + "(wrong library or version mismatch?)"), so->so_name); + } } set_addr: --- a/gdb/testsuite/gdb.base/break-interp-lib.c +++ b/gdb/testsuite/gdb.base/break-interp-lib.c @@ -20,6 +20,10 @@ #include <assert.h> #include <stdio.h> +/* Force REL->RELA conversion on i386, see "Prelink", March 4, 2004. */ +volatile int v[2]; +volatile int *vptr = &v[1]; + void libfunc (const char *action) { --- a/gdb/testsuite/gdb.base/break-interp.exp +++ b/gdb/testsuite/gdb.base/break-interp.exp @@ -352,6 +352,14 @@ proc test_attach {file displacement {relink_args ""}} { # test simplicity, we merged this test and the test above by not # restoring $INTERP after $EXEC prelink. $INTERP gets restored # later below. + # + # `(wrong library or version mismatch?)' messages are printed for + # $binfile_lib on platforms converting REL->RELA relocations by + # prelink (such as on i386). There is no reliable way to verify + # the library file matches the running library in such case but + # GDB at least attempts to set the right displacement. We test + # `libfunc' is present in the backtrace and therefore the + # displacement has been guessed right. if [prelink$relink $relink_args [file tail $exec]] { # /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)". ++++++ gdb-stap-double-free.patch ++++++ --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -355,9 +355,7 @@ stap_free_args_info (void *args_info_ptr) int i; for (i = 0; i < a->n_args; i++) - { - xfree (a->arg[i].arg_str); - } + xfree (a->arg[i].arg_str); xfree (a->arg); xfree (a); @@ -401,6 +399,7 @@ stap_parse_probe_arguments (struct stap_probe *probe) return; args_info = xmalloc (sizeof (struct stap_args_info)); + args_info->n_args = 0; back_to = make_cleanup (stap_free_args_info, args_info); args_info->arg = xcalloc (STAP_MAX_ARGS, sizeof (struct stap_probe_arg)); @@ -493,6 +492,7 @@ stap_parse_probe_arguments (struct stap_probe *probe) args_info->arg[current_arg].arg_str = savestring (start, cur - start); + ++args_info->n_args; /* Start it over again. */ cur = skip_spaces ((char *) cur); current_state = NEW_ARG; @@ -513,7 +513,6 @@ stap_parse_probe_arguments (struct stap_probe *probe) } } - args_info->n_args = current_arg + 1; args_info->arg = xrealloc (args_info->arg, args_info->n_args * sizeof (struct stap_probe_arg)); @@ -1526,8 +1525,9 @@ stap_free_parsed_args (struct stap_args_info *parsed_args) return; for (i = 0; i < parsed_args->n_args; i++) - xfree (parsed_args->arg); + xfree (parsed_args->arg[i].arg_str); + xfree (parsed_args->arg); xfree (parsed_args); } @@ -1859,7 +1859,7 @@ parse_stap_probe (char **argptr, struct linespec_result *canonical) if (canonical) { canonical->canonical = xrealloc (canonical->canonical, - result.nelts * sizeof (char **)); + result.nelts * sizeof (char *)); canonical->canonical[result.nelts - 1] = xstrdup (full_arg); } } ++++++ gdb-test-pp-hint-error.patch ++++++ --- /var/tmp/diff_new_pack.61y4Ag/_old 2011-08-11 15:46:30.000000000 +0200 +++ /var/tmp/diff_new_pack.61y4Ag/_new 2011-08-11 15:46:30.000000000 +0200 @@ -27,10 +27,10 @@ * gdb.python/py-prettyprint.py (class pp_hint_error): New. (register_pretty_printers): Register it. -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.c +Index: gdb-7.2.90.20110411/gdb/testsuite/gdb.python/py-prettyprint.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/testsuite/gdb.python/py-prettyprint.c 2011-01-01 16:33:49.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.c 2011-01-17 16:08:16.000000000 +0100 +--- gdb-7.2.90.20110411.orig/gdb/testsuite/gdb.python/py-prettyprint.c 2011-03-31 21:59:26.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/testsuite/gdb.python/py-prettyprint.c 2011-04-11 19:42:10.000000000 +0200 @@ -44,6 +44,10 @@ struct lazystring { const char *lazy_str; }; @@ -43,17 +43,17 @@ struct S : public s { int zs; @@ -215,6 +219,7 @@ main () - nostring_type nstype; + nostring_type nstype, nstype2; struct ns ns, ns2; struct lazystring estring, estring2; + struct hint_error hint_error; nstype.elements = narray; nstype.len = 0; -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.exp +Index: gdb-7.2.90.20110411/gdb/testsuite/gdb.python/py-prettyprint.exp =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/testsuite/gdb.python/py-prettyprint.exp 2011-01-01 16:33:49.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.exp 2011-01-17 16:08:33.000000000 +0100 +--- gdb-7.2.90.20110411.orig/gdb/testsuite/gdb.python/py-prettyprint.exp 2011-03-07 17:03:03.000000000 +0100 ++++ gdb-7.2.90.20110411/gdb/testsuite/gdb.python/py-prettyprint.exp 2011-04-11 19:41:56.000000000 +0200 @@ -97,6 +97,8 @@ proc run_lang_tests {lang} { gdb_test_no_output "python pp_ls_encoding = 'UTF-8'" gdb_test "print estring2" ""embedded ", <incomplete sequence \\302>" @@ -63,11 +63,11 @@ gdb_test "print c" " = container "container" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}" gdb_test "print nstype" " = {$nl *.0. = 7,$nl *.1. = 42$nl}" -Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.py +Index: gdb-7.2.90.20110411/gdb/testsuite/gdb.python/py-prettyprint.py =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/testsuite/gdb.python/py-prettyprint.py 2011-01-01 16:33:49.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.py 2011-01-17 16:08:16.000000000 +0100 -@@ -156,6 +156,18 @@ class pp_ls: +--- gdb-7.2.90.20110411.orig/gdb/testsuite/gdb.python/py-prettyprint.py 2011-03-31 21:59:26.000000000 +0200 ++++ gdb-7.2.90.20110411/gdb/testsuite/gdb.python/py-prettyprint.py 2011-04-11 19:41:56.000000000 +0200 +@@ -161,6 +161,18 @@ class pp_ls: def display_hint (self): return 'string' @@ -86,7 +86,7 @@ class pp_outer: "Print struct outer" -@@ -241,6 +253,9 @@ def register_pretty_printers (): +@@ -246,6 +258,9 @@ def register_pretty_printers (): pretty_printers_dict[re.compile ('^struct outerstruct$')] = pp_outer pretty_printers_dict[re.compile ('^outerstruct$')] = pp_outer ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org