Hello community,
here is the log from the commit of package gdb for openSUSE:Factory
checked in at Fri Apr 16 18:29:47 CEST 2010.
--------
--- gdb/gdb.changes 2010-03-11 15:54:02.000000000 +0100
+++ /mounts/work_src_done/STABLE/gdb/gdb.changes 2010-04-15 15:11:16.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Apr 15 14:22:36 CEST 2010 - rguenther@novell.com
+
+- Merge from gdb-7.1-12.fc13.src.rpm.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
fix-gdb-backtrace.diff
gdb-6.3-gstack-without-path-20060414.patch
gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch
gdb-6.8-bz457187-largefile.patch
gdb-6.8-inlining-addon.patch
gdb-6.8-inlining-by-name.patch
gdb-7.0-upstream.patch
gdb-7.0.1.tar.bz2
gdb-archer-excessive-files.patch
gdb-archer-pie.patch
gdb-bitfield-check_typedef.patch
gdb-bz528668-symfile-cleanup.patch
gdb-bz528668-symfile-multi.patch
gdb-bz528668-symfile-sepcrc.patch
gdb-bz538626-bp_location-accel-bp-cond.patch
gdb-bz539590-gnu-ifunc.patch
gdb-bz559291-fortran-module-toplevel.patch
gdb-bz559414-pie-assert-fix.patch
gdb-bz562517-archer-reread-quick_addrmap.patch
gdb-empty-namespace.patch
gdb-false-warning-gnu.liblist.patch
gdb-ia64-infcall-workaround.patch
gdb-ppc-hw-watchpoint-twice.patch
gdb-python-cplus-crash.patch
gdb-readline-6.0-signal.patch
gdb-readline-6.0.patch
gdb-stabs-read_args.patch
gdb-stale-related_breakpoint.patch
gdb-stale-sectindex.patch
gdb-test-interrupt.exp-timeout.patch
gdb-testsuite-unknown-output.patch
gdb-watchpoint-cond-gone.patch
libstdc++-v3-python-common-prefix.patch
libstdc++-v3-python-r151798.tar.bz2
New:
----
gdb-6.6-buildid-locate-core-as-arg.patch
gdb-6.7-testsuite-stable-results-prelink.patch
gdb-7.1.tar.bz2
gdb-bz562975-std-terminate-double-free.patch
gdb-bz574483-display-sepdebug.patch
gdb-bz578250-avx-01of10.patch
gdb-bz578250-avx-02of10.patch
gdb-bz578250-avx-03of10.patch
gdb-bz578250-avx-04of10.patch
gdb-bz578250-avx-05of10.patch
gdb-bz578250-avx-06of10.patch
gdb-bz578250-avx-07of10.patch
gdb-bz578250-avx-08of10.patch
gdb-bz578250-avx-09of10.patch
gdb-bz578250-avx-10of10-ppc.patch
gdb-bz578250-avx-10of10.patch
gdb-ccache-workaround.patch
gdb-fortran-common-reduce.patch
gdb-fortran-common.patch
gdb-fortran-logical8.patch
gdb-lineno-makeup-test.patch
gdb-pie-1of6-reprelinked-bin.patch
gdb-pie-2of6-reprelinked-ld.patch
gdb-pie-3of6-relocate-once.patch
gdb-pie-rerun.patch
gdb-ppc-power7-test.patch
gdb-solib-memory-error-nonfatal.patch
gdb-unused-revert.patch
gdb-upstream.patch
gdb-using-directive-leak.patch
libstdc++-v3-python-r155978.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gdb.spec ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package gdb (Version 7.0.1)
+# spec file for package gdb (Version 7.1)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -23,14 +23,15 @@
# 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.0.1
+Version: 7.1
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+
+License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL 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/branch/gdb-%{version}.tar.bz2
# ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
Source: ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
@@ -64,7 +65,7 @@
Source3: gdb-gstack.man
# libstdc++ pretty printers from GCC SVN HEAD (4.5 experimental).
-%define libstdcxxpython libstdc++-v3-python-r151798
+%define libstdcxxpython libstdc++-v3-python-r155978
Source4: %{libstdcxxpython}.tar.bz2
# Work around out-of-date dejagnu that does not have KFAIL
@@ -101,7 +102,6 @@
# VSYSCALL and PIE
Patch122: gdb-6.3-test-pie-20050107.patch
-Patch124: gdb-archer-pie.patch
Patch389: gdb-archer-pie-addons.patch
Patch394: gdb-archer-pie-addons-keep-disabled.patch
@@ -163,10 +163,6 @@
# Use bigger numbers than int.
Patch176: gdb-6.3-large-core-20051206.patch
-# Hard-code executable names in gstack, such that it can run with a
-# corrupted or missing PATH.
-Patch177: gdb-6.3-gstack-without-path-20060414.patch
-
# Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
Patch188: gdb-6.5-bz203661-emit-relocs.patch
@@ -204,8 +200,7 @@
# Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711).
Patch214: gdb-6.5-bz216711-clone-is-outermost.patch
-# Try to reduce sideeffects of skipping ppc .so libs trampolines (BZ 218379).
-Patch215: gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch
+# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
@@ -220,8 +215,8 @@
# Testcase for exec() from threaded program (BZ 202689).
Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
-# Backported post gdb-7.0 fixups.
-Patch232: gdb-7.0-upstream.patch
+# Backported fixups post the source tarball.
+Patch232: gdb-upstream.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch
@@ -266,6 +261,7 @@
# New locating of the matching binaries from the pure core file (build-id).
Patch274: gdb-6.6-buildid-locate.patch
Patch353: gdb-6.6-buildid-locate-rpm.patch
+Patch415: gdb-6.6-buildid-locate-core-as-arg.patch
# Fix displaying of numeric char arrays as strings (BZ 224128).
Patch282: gdb-6.7-charsign-test.patch
@@ -302,9 +298,6 @@
# Test a crash on `focus cmd', `focus prev' commands.
Patch311: gdb-6.3-focus-cmd-prev-test.patch
-# Fix error on a sw watchpoint active at function epilogue (hit on s390x).
-Patch314: gdb-watchpoint-cond-gone.patch
-
# Test various forms of threads tracking across exec() (BZ 442765).
Patch315: gdb-6.8-bz442765-threaded-exec-test.patch
@@ -326,13 +319,6 @@
# Create a single binary `gdb' autodetecting --tui by its argv[0].
Patch326: gdb-6.8-tui-singlebinary.patch
-# Support transparent debugging of inlined functions for an optimized code.
-# Disable break-by-name on inlined functions due to a regression on parameters
-# of inlined functions falsely <optimized out> (BZ 556975 Comment 8).
-# Disable addon (finish) due to inline-cmds.exp: up from outer_inline2 assert.
-Patch350: gdb-6.8-inlining-addon.patch
-Patch328: gdb-6.8-inlining-by-name.patch
-
# Fix PRPSINFO in the core files dumped by gcore (BZ 254229).
Patch329: gdb-6.8-bz254229-gcore-prpsinfo.patch
@@ -356,40 +342,18 @@
# The merged branch `archer' of: http://sourceware.org/gdb/wiki/ProjectArcher
Patch349: gdb-archer.patch
-Patch418: gdb-archer-excessive-files.patch
Patch420: gdb-archer-ada.patch
# Fix parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457187).
# - Turn on 64-bit BFD support, globally enable AC_SYS_LARGEFILE.
-Patch352: gdb-6.8-bz457187-largefile.patch
Patch360: gdb-6.8-bz457187-largefile-test.patch
-# Fix compatibility of --with-system-readline and readline-6.0+.
-Patch375: gdb-readline-6.0.patch
-
-# Fix python pretty printers lookup on x86_64.
-Patch376: libstdc++-v3-python-common-prefix.patch
-
# New test for step-resume breakpoint placed in multiple threads at once.
Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch
# Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
Patch382: gdb-core-open-vdso-warning.patch
-# Support multiple directories for `set debug-file-directory' (BZ 528668).
-Patch383: gdb-bz528668-symfile-sepcrc.patch
-Patch384: gdb-bz528668-symfile-cleanup.patch
-Patch385: gdb-bz528668-symfile-multi.patch
-
-# Support GNU IFUNCs - indirect functions (BZ 539590).
-Patch387: gdb-bz539590-gnu-ifunc.patch
-
-# Fix bp conditionals [bp_location-accel] regression (BZ 538626).
-Patch388: gdb-bz538626-bp_location-accel-bp-cond.patch
-
-# Fix callback-mode readline-6.0 regression for CTRL-C.
-Patch390: gdb-readline-6.0-signal.patch
-
# Fix syscall restarts for amd64->i386 biarch.
Patch391: gdb-x86_64-i386-syscall-restart.patch
@@ -403,61 +367,75 @@
# Workaround RHEL-5 kernels for detaching SIGSTOPped processes (BZ 498595).
Patch335: gdb-rhel5-compat.patch
-# Fix backward compatibility with G++ 4.1 namespaces "::".
-Patch395: gdb-empty-namespace.patch
-
-# Fix regression on re-setting the single ppc watchpoint slot.
-Patch396: gdb-ppc-hw-watchpoint-twice.patch
-
# Fix regression by python on ia64 due to stale current frame.
Patch397: gdb-follow-child-stale-parent.patch
-# testsuite: Fix false MI "unknown output after running" regression.
-Patch398: gdb-testsuite-unknown-output.patch
-
-# Fix regression of gdb-7.0.1 not preserving typedef of a field.
-Patch399: gdb-bitfield-check_typedef.patch
+# Workaround ccache making lineno non-zero for command-line definitions.
+Patch403: gdb-ccache-workaround.patch
-# Fix related_breakpoint stale ref crash.
-Patch400: gdb-stale-related_breakpoint.patch
+# Implement `info common' for Fortran.
+Patch404: gdb-fortran-common-reduce.patch
+Patch405: gdb-fortran-common.patch
-# Fix crash reading broken stabs (it377671).
-Patch401: gdb-stabs-read_args.patch
+# Fix Fortran logical-kind=8 (BZ 465310).
+Patch406: gdb-fortran-logical8.patch
-# Fix crash while executing python code.
-Patch402: gdb-python-cplus-crash.patch
+# Testcase for "Do not make up line information" fix by Daniel Jacobowitz.
+Patch407: gdb-lineno-makeup-test.patch
-# Fix failed gdb_assert due to the PIE patchset (BZ 559414).
-Patch414: gdb-bz559414-pie-assert-fix.patch
+# Test power7 ppc disassembly.
+Patch408: gdb-ppc-power7-test.patch
-# Fortran: Fix regression on setting breakpoint at toplevel symbols (BZ 559291).
-Patch416: gdb-bz559291-fortran-module-toplevel.patch
+# Revert: Add -Wunused-function to compile flags.
+Patch412: gdb-unused-revert.patch
# Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
Patch417: gdb-bz541866-rwatch-before-run.patch
-# testsuite: Fix long timeout on arches with failing gdb.base/interrupt.exp.
-Patch419: gdb-test-interrupt.exp-timeout.patch
-
-# Fix crash on stale addrinfo->sectindex (more sensitive due to the PIE patch).
-Patch421: gdb-stale-sectindex.patch
-
# Remove false gdb_assert on $sp underflow.
Patch422: gdb-infcall-sp-underflow.patch
-# Workaround ia64 inferior calls clearing SP.
-Patch423: gdb-ia64-infcall-workaround.patch
+# Fix double-free on std::terminate handler (Tom Tromey, BZ 562975).
+Patch429: gdb-bz562975-std-terminate-double-free.patch
+
+# PIE: Fix back re-reun.
+Patch430: gdb-pie-rerun.patch
-# [delayed-symfile] Backport fix of reread_symbols (Tom Tromey, BZ 562517).
-Patch424: gdb-bz562517-archer-reread-quick_addrmap.patch
+# Do not consider memory error on reading _r_debug->r_map as fatal (BZ 576742).
+Patch432: gdb-solib-memory-error-nonfatal.patch
-# Fix false warning: section .gnu.liblist not found in ...
-Patch425: gdb-false-warning-gnu.liblist.patch
+# testsuite: Fix unstable results of gdb.base/prelink.exp.
+Patch433: gdb-6.7-testsuite-stable-results-prelink.patch
+
+# [patch 1/6] PIE: Attach binary even after re-prelinked underneath
+# [patch 2/6] PIE: Attach binary even after ld.so re-prelinked underneath
+# [patch 3/6] PIE: Fix occasional error attaching i686 binary
+Patch434: gdb-pie-1of6-reprelinked-bin.patch
+Patch435: gdb-pie-2of6-reprelinked-ld.patch
+Patch436: gdb-pie-3of6-relocate-once.patch
+
+# [expr-cumulative] using-directive: Fix memory leak (Sami Wagiaalla).
+Patch437: gdb-using-directive-leak.patch
+
+# Fix dangling displays in separate debuginfo (BZ 574483).
+Patch438: gdb-bz574483-display-sepdebug.patch
+
+# Support AVX registers (BZ 578250).
+Patch439: gdb-bz578250-avx-01of10.patch
+Patch440: gdb-bz578250-avx-02of10.patch
+Patch441: gdb-bz578250-avx-03of10.patch
+Patch442: gdb-bz578250-avx-04of10.patch
+Patch443: gdb-bz578250-avx-05of10.patch
+Patch444: gdb-bz578250-avx-06of10.patch
+Patch445: gdb-bz578250-avx-07of10.patch
+Patch446: gdb-bz578250-avx-08of10.patch
+Patch447: gdb-bz578250-avx-09of10.patch
+Patch448: gdb-bz578250-avx-10of10.patch
+Patch449: gdb-bz578250-avx-10of10-ppc.patch
# Fix readline 5.1 warnings
Patch1000: readline-5.1-random.patch
Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch
-Patch1007: fix-gdb-backtrace.diff
BuildRequires: bison flex gettext glibc-devel ncurses-devel texinfo zlib-devel
%if %{suse_version} < 1020
@@ -479,8 +457,9 @@
# Ensure the devel libraries are installed for both multilib arches.
%define bits_local %{?_isa}
%define bits_other %{?_isa}
+%if 0%{!?el5:1}
%ifarch s390x
-%define bits_other (%{__isa_name}-31)
+%define bits_other (%{__isa_name}-32)
%else #!s390x
%ifarch ppc
%define bits_other (%{__isa_name}-64)
@@ -490,6 +469,7 @@
%endif #sparc64 ppc64 s390x x86_64
%endif #!ppc
%endif #!s390x
+%endif #!el5
BuildRequires: dejagnu sharutils
# gcc-objc++ is not covered by the GDB testsuite.
@@ -518,7 +498,7 @@
and printing their data.
%package -n gdbserver
-License: GPLv3+
+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
@@ -527,7 +507,8 @@
Java, and other languages, by executing them in a controlled fashion
and printing their data.
-This package provides a program that allows you to run GDB on a different machine than the one which is running the program being debugged.
+This package provides a program that allows you to run GDB on a different
+machine than the one which is running the program being debugged.
%prep
@@ -552,13 +533,7 @@
%patch232 -p1
%patch349 -p1
-%patch418 -p1
%patch420 -p1
-%patch383 -p1
-%patch384 -p1
-%patch385 -p1
-%patch388 -p1
-%patch124 -p1
%patch1 -p1
%patch3 -p1
@@ -589,7 +564,6 @@
%patch169 -p1
%patch170 -p1
%patch176 -p1
-%patch177 -p1
%patch188 -p1
%patch190 -p1
%patch194 -p1
@@ -602,7 +576,6 @@
%patch211 -p1
%patch213 -p1
%patch214 -p1
-%patch215 -p1
%patch216 -p1
%patch217 -p1
%patch225 -p1
@@ -637,7 +610,6 @@
%patch304 -p1
%patch309 -p1
%patch311 -p1
-%patch314 -p1
%patch315 -p1
%patch317 -p1
%patch318 -p1
@@ -645,8 +617,6 @@
%patch322 -p1
%patch324 -p1
%patch326 -p1
-###patch350 -p1
-###patch328 -p1
%patch329 -p1
%patch330 -p1
%patch331 -p1
@@ -654,51 +624,46 @@
%patch337 -p1
%patch343 -p1
%patch348 -p1
-%patch352 -p1
%patch360 -p1
-%patch375 -p1
-%patch376 -p1
%patch381 -p1
%patch382 -p1
-# Does not work on ia64
-%ifnarch ia64
-%patch387 -p1
-%endif
-%patch389 -p1
-%patch390 -p1
%patch391 -p1
%patch392 -p1
-%patch394 -p1
-%patch395 -p1
-%patch396 -p1
%patch397 -p1
-%patch398 -p1
-%patch399 -p1
-%patch400 -p1
-%patch401 -p1
-%patch402 -p1
-%patch414 -p1
-%patch416 -p1
+%patch403 -p1
+%patch404 -p1
+%patch405 -p1
+%patch389 -p1
+%patch394 -p1
+%patch406 -p1
+%patch407 -p1
+%patch408 -p1
+%patch412 -p1
%patch417 -p1
-%patch419 -p1
-%patch421 -p1
%patch422 -p1
-%patch423 -p1
-%patch424 -p1
-%patch425 -p1
-%if 0
-# Always verify their applicability.
-%patch393 -p1
-%patch335 -p1
-%if 0%{!?el5:1}
-%patch393 -p1 -R
-%patch335 -p1 -R
-%endif
-%endif
+%patch429 -p1
+%patch430 -p1
+%patch432 -p1
+%patch433 -p1
+%patch434 -p1
+%patch435 -p1
+%patch436 -p1
+%patch437 -p1
+%patch438 -p1
+%patch439 -p1
+%patch440 -p1
+%patch441 -p1
+%patch442 -p1
+%patch443 -p1
+%patch444 -p1
+%patch445 -p1
+%patch446 -p1
+%patch447 -p1
+%patch448 -p1
+%patch449 -p1
%patch1000
%patch1002 -p1
-%patch1007
find -name "*.orig" | xargs rm -f
! find -name "*.rej" # Should not happen.
@@ -975,7 +940,7 @@
%files
%defattr(-,root,root)
-%doc COPYING COPYING.LIB README NEWS
+%doc COPYING3 COPYING COPYING.LIB README NEWS
%{_bindir}/gcore
%{_bindir}/gdb
%{_bindir}/gdbtui
++++++ gdb-6.3-gstack-20050411.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -4,10 +4,9 @@
to install and uninstall.
* gstack.sh, gstack.1: New files.
-Index: gdb-6.8.91.20090917/gdb/Makefile.in
-===================================================================
---- gdb-6.8.91.20090917.orig/gdb/Makefile.in 2009-09-17 12:47:07.000000000 +0200
-+++ gdb-6.8.91.20090917/gdb/Makefile.in 2009-09-17 12:47:38.000000000 +0200
+diff -up -ruNp gdb-7.0.1-empty/gdb/Makefile.in gdb-7.0.1/gdb/Makefile.in
+--- gdb-7.0.1-empty/gdb/Makefile.in 2010-04-07 20:36:04.000000000 +0200
++++ gdb-7.0.1/gdb/Makefile.in 2010-04-07 20:36:42.000000000 +0200
@@ -989,7 +989,7 @@ install: all install-only
# The "install-only" target also installs the syscalls' XML files in
@@ -63,10 +62,9 @@
# The C++ name parser can be built standalone for testing.
test-cp-name-parser.o: cp-name-parser.c
-Index: gdb-6.8.91.20090917/gdb/gstack.sh
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.91.20090917/gdb/gstack.sh 2009-09-17 12:47:14.000000000 +0200
+diff -up -ruNp gdb-7.0.1-empty/gdb/gstack.sh gdb-7.0.1/gdb/gstack.sh
+--- gdb-7.0.1-empty/gdb/gstack.sh 1970-01-01 01:00:00.000000000 +0100
++++ gdb-7.0.1/gdb/gstack.sh 2010-04-07 20:36:47.000000000 +0200
@@ -0,0 +1,48 @@
+#!/bin/sh
+
@@ -87,17 +85,17 @@
+backtrace="bt"
+if test -d /proc/$1/task ; then
+ # Newer kernel; has a task/ directory.
-+ if test `ls /proc/$1/task | wc -l` -gt 1 2>/dev/null ; then
++ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
+ backtrace="thread apply all bt"
+ fi
+elif test -f /proc/$1/maps ; then
+ # Older kernel; go by it loading libpthread.
-+ if grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
++ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
+ backtrace="thread apply all bt"
+ fi
+fi
+
-+GDB=${GDB:-gdb}
++GDB=${GDB:-/usr/bin/gdb}
+
+if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
+ readnever=--readnever
@@ -112,7 +110,127 @@
+set pagination no
+$backtrace
+EOF
-+sed -n \
-+ -e 's/^(gdb) //' \
++/bin/sed -n \
++ -e 's/^\((gdb) \)*//' \
+ -e '/^#/p' \
+ -e '/^Thread/p'
+--- /dev/null 2010-04-07 06:20:52.289994508 +0200
++++ gdb-7.0.1/gdb/testsuite/gdb.base/gstack.exp 2010-04-07 21:53:57.000000000 +0200
+@@ -0,0 +1,71 @@
++# Copyright (C) 2010 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 gstack
++set executable ${testfile}
++set binfile ${objdir}/${subdir}/$executable
++if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
++ return -1
++}
++
++set test "spawn inferior"
++set command "${binfile}"
++set res [remote_spawn host $command];
++if { $res < 0 || $res == "" } {
++ perror "Spawning $command failed."
++ fail $test
++ return
++}
++set pid [exp_pid -i $res]
++gdb_expect {
++ -re "looping\r\n" {
++ pass $test
++ }
++ eof {
++ fail "$test (eof)"
++ return
++ }
++ timeout {
++ fail "$test (timeout)"
++ return
++ }
++}
++gdb_exit
++
++# Testcase uses the most simple notification not to get caught by attach on
++# exiting the function. Still we could retry the gstack command if we fail.
++
++set test "spawn gstack"
++set command "sh -c GDB=$GDB\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
++set res [remote_spawn host $command];
++if { $res < 0 || $res == "" } {
++ perror "Spawning $command failed."
++ fail $test
++}
++set pid [exp_pid -i $res]
++gdb_expect {
++ -re {^#0 +0x[0-9a-f]+ in \.?func \(\)\r\n#1 +0x[0-9a-f]+ in \.?main \(\)\r\nGSTACK-END\r\n$} {
++ pass $test
++ }
++ eof {
++ fail "$test (eof)"
++ }
++ timeout {
++ fail "$test (timeout)"
++ }
++}
++gdb_exit
++
++remote_exec host "kill -9 $pid"
+--- /dev/null 2010-04-07 06:20:52.289994508 +0200
++++ gdb-7.0.1/gdb/testsuite/gdb.base/gstack.c 2010-04-07 21:46:52.000000000 +0200
+@@ -0,0 +1,43 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2005, 2007, 2008, 2009 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/. */
++
++#include
++#include
++#include
++
++void
++func (void)
++{
++ const char msg[] = "looping\n";
++
++ /* Use the most simple notification not to get caught by attach on exiting
++ the function. */
++ write (1, msg, strlen (msg));
++
++ for (;;);
++}
++
++int
++main (void)
++{
++ alarm (60);
++ nice (100);
++
++ func ();
++
++ return 0;
++}
++++++ gdb-6.3-large-core-20051206.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -25,11 +25,11 @@
Port to GDB-6.7.
-Index: gdb-6.8.50.20090909/gdb/symfile-mem.c
+Index: gdb-7.0.50.20100115/gdb/symfile-mem.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/symfile-mem.c 2009-07-02 19:21:06.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/symfile-mem.c 2009-09-09 19:06:57.000000000 +0200
-@@ -56,6 +56,14 @@
+--- gdb-7.0.50.20100115.orig/gdb/symfile-mem.c 2010-01-01 08:31:42.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/symfile-mem.c 2010-01-15 03:22:23.000000000 +0100
+@@ -57,6 +57,14 @@
#include "elf/common.h"
@@ -44,7 +44,7 @@
/* Read inferior memory at ADDR to find the header of a loaded object file
and read its in-core symbols out of inferior memory. TEMPL is a bfd
representing the target's format. NAME is the name to use for this
-@@ -76,7 +84,7 @@ symbol_file_add_from_memory (struct bfd
+@@ -77,7 +85,7 @@ symbol_file_add_from_memory (struct bfd
error (_("add-symbol-file-from-memory not supported for this target"));
nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
@@ -53,10 +53,10 @@
if (nbfd == NULL)
error (_("Failed to read a valid object file image from memory."));
-Index: gdb-6.8.50.20090909/gdb/target.c
+Index: gdb-7.0.50.20100115/gdb/target.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/target.c 2009-09-09 19:05:56.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/target.c 2009-09-09 19:08:11.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/target.c 2010-01-15 03:22:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/target.c 2010-01-15 03:22:23.000000000 +0100
@@ -59,7 +59,7 @@ static int nosymbol (char *, CORE_ADDR *
static void tcomplain (void) ATTR_NORETURN;
@@ -66,7 +66,7 @@
static int return_zero (void);
-@@ -492,7 +492,7 @@ target_terminal_inferior (void)
+@@ -494,7 +494,7 @@ target_terminal_inferior (void)
(*current_target.to_terminal_inferior) ();
}
@@ -75,7 +75,7 @@
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t)
{
-@@ -711,7 +711,7 @@ update_current_target (void)
+@@ -726,7 +726,7 @@ update_current_target (void)
(void (*) (struct regcache *))
noprocess);
de_fault (deprecated_xfer_memory,
@@ -84,7 +84,7 @@
nomemory);
de_fault (to_files_info,
(void (*) (struct target_ops *))
-@@ -1443,7 +1443,7 @@ target_xfer_partial (struct target_ops *
+@@ -1497,7 +1497,7 @@ target_xfer_partial (struct target_ops *
it makes no progress, and then return how much was transferred). */
int
@@ -93,7 +93,7 @@
{
/* Dispatch to the topmost target, not the flattened current_target.
Memory accesses check target->to_has_(all_)memory, and the
-@@ -1459,7 +1459,7 @@ target_read_memory (CORE_ADDR memaddr, g
+@@ -1513,7 +1513,7 @@ target_read_memory (CORE_ADDR memaddr, g
the target's stack. This may trigger different cache behavior. */
int
@@ -102,8 +102,8 @@
{
/* Dispatch to the topmost target, not the flattened current_target.
Memory accesses check target->to_has_(all_)memory, and the
-@@ -1473,7 +1473,7 @@ target_read_stack (CORE_ADDR memaddr, gd
- }
+@@ -1532,7 +1532,7 @@ target_read_stack (CORE_ADDR memaddr, gd
+ Callers that can deal with partial writes should call target_write. */
int
-target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
@@ -111,7 +111,7 @@
{
/* Dispatch to the topmost target, not the flattened current_target.
Memory accesses check target->to_has_(all_)memory, and the
-@@ -2964,8 +2964,8 @@ debug_to_prepare_to_store (struct regcac
+@@ -3098,8 +3098,8 @@ debug_to_prepare_to_store (struct regcac
fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
}
@@ -122,7 +122,7 @@
int write, struct mem_attrib *attrib,
struct target_ops *target)
{
-@@ -2975,8 +2975,8 @@ deprecated_debug_xfer_memory (CORE_ADDR
+@@ -3109,8 +3109,8 @@ deprecated_debug_xfer_memory (CORE_ADDR
attrib, target);
fprintf_unfiltered (gdb_stdlog,
@@ -133,11 +133,11 @@
write ? "write" : "read", retval);
if (retval > 0)
-Index: gdb-6.8.50.20090909/gdb/target.h
+Index: gdb-7.0.50.20100115/gdb/target.h
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/target.h 2009-09-09 19:05:56.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/target.h 2009-09-09 19:07:36.000000000 +0200
-@@ -366,10 +366,10 @@ struct target_ops
+--- gdb-7.0.50.20100115.orig/gdb/target.h 2010-01-15 03:22:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/target.h 2010-01-15 03:22:23.000000000 +0100
+@@ -406,10 +406,10 @@ struct target_ops
NOTE: cagney/2004-10-01: This has been entirely superseeded by
to_xfer_partial and inferior inheritance. */
@@ -152,7 +152,7 @@
void (*to_files_info) (struct target_ops *);
int (*to_insert_breakpoint) (struct gdbarch *, struct bp_target_info *);
-@@ -680,12 +680,12 @@ extern void target_dcache_invalidate (vo
+@@ -786,12 +786,12 @@ extern void target_dcache_invalidate (vo
extern int target_read_string (CORE_ADDR, char **, int, int *);
@@ -168,13 +168,13 @@
/* Fetches the target's memory map. If one is found it is sorted
and returned, after some consistency checking. Otherwise, NULL
-Index: gdb-6.8.50.20090909/gdb/dcache.c
+Index: gdb-7.0.50.20100115/gdb/dcache.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/dcache.c 2009-08-31 22:18:45.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/dcache.c 2009-09-09 19:09:21.000000000 +0200
-@@ -390,10 +390,10 @@ dcache_free (DCACHE *dcache)
-
- The meaning of the result is the same as for target_write. */
+--- gdb-7.0.50.20100115.orig/gdb/dcache.c 2010-01-01 08:31:30.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/dcache.c 2010-01-15 03:22:23.000000000 +0100
+@@ -468,10 +468,10 @@ dcache_free (DCACHE *dcache)
+ NOTE: This is different than the to_xfer_partial interface, in which
+ positive values less than LEN mean further transfers may be possible. */
-int
+LONGEST
@@ -185,10 +185,10 @@
{
int i;
int res;
-Index: gdb-6.8.50.20090909/gdb/dcache.h
+Index: gdb-7.0.50.20100115/gdb/dcache.h
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/dcache.h 2009-08-31 22:18:45.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/dcache.h 2009-09-09 19:08:54.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/dcache.h 2010-01-01 08:31:30.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/dcache.h 2010-01-15 03:22:23.000000000 +0100
@@ -35,8 +35,8 @@ void dcache_free (DCACHE *);
/* Simple to call from <remote>_xfer_memory */
@@ -200,11 +200,11 @@
void dcache_update (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
int len);
-Index: gdb-6.8.50.20090909/gdb/exec.c
+Index: gdb-7.0.50.20100115/gdb/exec.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/exec.c 2009-07-02 19:21:06.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/exec.c 2009-09-09 19:06:57.000000000 +0200
-@@ -560,7 +560,7 @@ map_vmap (bfd *abfd, bfd *arch)
+--- gdb-7.0.50.20100115.orig/gdb/exec.c 2010-01-14 22:01:24.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/exec.c 2010-01-15 03:22:23.000000000 +0100
+@@ -578,7 +578,7 @@ map_vmap (bfd *abfd, bfd *arch)
}
@@ -213,11 +213,11 @@
section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len,
struct target_section *sections,
-Index: gdb-6.8.50.20090909/gdb/linux-nat.c
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/linux-nat.c 2009-09-09 19:06:46.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/linux-nat.c 2009-09-09 19:06:57.000000000 +0200
-@@ -4622,7 +4622,7 @@ linux_xfer_partial (struct target_ops *o
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c 2010-01-15 03:22:14.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.c 2010-01-15 03:22:23.000000000 +0100
+@@ -5117,7 +5117,7 @@ linux_xfer_partial (struct target_ops *o
#endif
if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
{ /* This region contains ia64 rse registers, we have to re-read. */
@@ -226,10 +226,10 @@
/* Re-read register stack area. */
xxfer = super_xfer_partial (ops, object, annex,
-Index: gdb-6.8.50.20090909/gdb/remote.c
+Index: gdb-7.0.50.20100115/gdb/remote.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/remote.c 2009-08-18 18:17:16.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/remote.c 2009-09-09 19:06:57.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/remote.c 2010-01-12 22:40:24.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/remote.c 2010-01-15 03:22:23.000000000 +0100
@@ -25,6 +25,7 @@
#include "gdb_string.h"
#include
@@ -238,7 +238,7 @@
#include "inferior.h"
#include "bfd.h"
#include "symfile.h"
-@@ -5764,12 +5765,19 @@ handle_notification (char *buf, size_t l
+@@ -6175,12 +6176,19 @@ handle_notification (char *buf, size_t l
if SHOULD_WRITE is nonzero. Returns length of data written or
read; 0 for error. TARGET is unused. */
@@ -260,7 +260,7 @@
set_general_thread (inferior_ptid);
-@@ -5778,7 +5786,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
+@@ -6189,7 +6197,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
else
res = remote_read_bytes (mem_addr, buffer, mem_len);
@@ -269,10 +269,10 @@
}
/* Sends a packet with content determined by the printf format string
-Index: gdb-6.8.50.20090909/gdb/remote-sim.c
+Index: gdb-7.0.50.20100115/gdb/remote-sim.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/remote-sim.c 2009-07-02 19:21:06.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/remote-sim.c 2009-09-09 19:06:57.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/remote-sim.c 2010-01-01 08:31:40.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/remote-sim.c 2010-01-15 03:22:23.000000000 +0100
@@ -752,11 +752,14 @@ gdbsim_prepare_to_store (struct regcache
Returns the number of bytes transferred. */
@@ -290,11 +290,11 @@
/* If no program is running yet, then ignore the simulator for
memory. Pass the request down to the next target, hopefully
an exec file. */
-Index: gdb-6.8.50.20090909/gdb/exec.h
+Index: gdb-7.0.50.20100115/gdb/exec.h
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/exec.h 2009-06-12 20:38:36.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/exec.h 2009-09-09 19:06:57.000000000 +0200
-@@ -56,7 +56,7 @@ extern int resize_section_table (struct
+--- gdb-7.0.50.20100115.orig/gdb/exec.h 2010-01-01 08:31:31.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/exec.h 2010-01-15 03:22:23.000000000 +0100
+@@ -60,7 +60,7 @@ extern int resize_section_table (struct
One, and only one, of readbuf or writebuf must be non-NULL. */
++++++ gdb-6.3-readnever-20050907.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -11,11 +11,11 @@
* gdb.texinfo (File Options): Document --readnever.
-Index: gdb-6.8.50.20090811/gdb/doc/gdb.texinfo
+Index: gdb-7.0.90.20100306/gdb/doc/gdb.texinfo
===================================================================
---- gdb-6.8.50.20090811.orig/gdb/doc/gdb.texinfo 2009-08-13 10:14:15.000000000 +0200
-+++ gdb-6.8.50.20090811/gdb/doc/gdb.texinfo 2009-08-13 10:14:18.000000000 +0200
-@@ -991,6 +991,12 @@ Read each symbol file's entire symbol ta
+--- gdb-7.0.90.20100306.orig/gdb/doc/gdb.texinfo 2010-03-06 23:19:13.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/doc/gdb.texinfo 2010-03-06 23:20:35.000000000 +0100
+@@ -995,6 +995,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,10 +28,10 @@
@end table
@node Mode Options
-Index: gdb-6.8.50.20090811/gdb/main.c
+Index: gdb-7.0.90.20100306/gdb/main.c
===================================================================
---- gdb-6.8.50.20090811.orig/gdb/main.c 2009-08-13 10:14:15.000000000 +0200
-+++ gdb-6.8.50.20090811/gdb/main.c 2009-08-13 10:14:18.000000000 +0200
+--- gdb-7.0.90.20100306.orig/gdb/main.c 2010-03-06 23:20:23.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/main.c 2010-03-06 23:20:35.000000000 +0100
@@ -382,6 +382,7 @@ captured_main (void *data)
{"xdb", no_argument, &xdb_commands, 1},
{"dbx", no_argument, &dbx_commands, 1},
@@ -40,7 +40,7 @@
{"r", no_argument, &readnow_symbol_files, 1},
{"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1},
-@@ -1030,6 +1031,7 @@ Options:\n\n\
+@@ -1033,6 +1034,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-6.8.50.20090811/gdb/symfile.c
+Index: gdb-7.0.90.20100306/gdb/symfile.c
===================================================================
---- gdb-6.8.50.20090811.orig/gdb/symfile.c 2009-08-13 10:14:15.000000000 +0200
-+++ gdb-6.8.50.20090811/gdb/symfile.c 2009-08-13 10:14:18.000000000 +0200
+--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:19:13.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:20:35.000000000 +0100
@@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup (
/* Global variables owned by this file */
@@ -60,19 +60,19 @@
/* External variables and functions referenced. */
-Index: gdb-6.8.50.20090811/gdb/dwarf2read.c
+Index: gdb-7.0.90.20100306/gdb/dwarf2read.c
===================================================================
---- gdb-6.8.50.20090811.orig/gdb/dwarf2read.c 2009-08-13 10:14:15.000000000 +0200
-+++ gdb-6.8.50.20090811/gdb/dwarf2read.c 2009-08-13 10:14:29.000000000 +0200
-@@ -53,6 +53,7 @@
+--- gdb-7.0.90.20100306.orig/gdb/dwarf2read.c 2010-03-06 23:19:13.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/dwarf2read.c 2010-03-06 23:20:54.000000000 +0100
+@@ -52,6 +52,7 @@
+ #include "f-lang.h"
+ #include "typeprint.h"
#include "jv-lang.h"
- #include "vec.h"
- #include "block.h"
+#include "top.h"
#include
#include "gdb_string.h"
-@@ -1245,7 +1246,8 @@ dwarf2_has_info (struct objfile *objfile
+@@ -1222,7 +1223,8 @@ dwarf2_has_info (struct objfile *objfile
bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
}
@@ -82,11 +82,11 @@
&& dwarf2_per_objfile->abbrev.asection != NULL);
}
-Index: gdb-6.8.50.20090811/gdb/top.h
+Index: gdb-7.0.90.20100306/gdb/top.h
===================================================================
---- gdb-6.8.50.20090811.orig/gdb/top.h 2009-01-03 06:57:53.000000000 +0100
-+++ gdb-6.8.50.20090811/gdb/top.h 2009-08-13 10:14:18.000000000 +0200
-@@ -59,6 +59,7 @@ extern void set_prompt (char *);
+--- gdb-7.0.90.20100306.orig/gdb/top.h 2010-01-01 08:31:42.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/top.h 2010-03-06 23:20:35.000000000 +0100
+@@ -63,6 +63,7 @@ extern void set_prompt (char *);
/* From random places. */
extern int readnow_symbol_files;
++++++ gdb-6.3-security-errata-20050610.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -19,30 +19,21 @@
(source_command): Update documentation. Check permissions if
FROM_TTY is -1.
-Index: gdb-6.8.50.20090226/gdb/cli/cli-cmds.c
+Index: gdb-7.0.50.20100121/gdb/cli/cli-cmds.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/cli/cli-cmds.c 2009-02-27 00:04:32.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/cli/cli-cmds.c 2009-02-28 07:17:49.000000000 +0100
-@@ -36,6 +36,7 @@
+--- gdb-7.0.50.20100121.orig/gdb/cli/cli-cmds.c 2010-01-18 07:25:22.000000000 +0100
++++ gdb-7.0.50.20100121/gdb/cli/cli-cmds.c 2010-01-21 15:12:28.000000000 +0100
+@@ -38,6 +38,7 @@
#include "objfiles.h"
#include "source.h"
#include "disasm.h"
+#include "gdb_stat.h"
+ extern void disconnect_or_stop_tracing (int from_tty);
#include "ui-out.h"
-
-@@ -466,7 +467,7 @@ source_script (char *file, int from_tty)
-
- if (fd == -1)
- {
-- if (from_tty)
-+ if (from_tty > 0)
- perror_with_name (file);
- else
- {
-@@ -475,6 +476,29 @@ source_script (char *file, int from_tty)
- }
- }
+@@ -488,6 +489,29 @@ find_and_open_script (int from_tty, char
+ file, O_RDONLY, &full_pathname);
+ make_cleanup (xfree, full_pathname);
+#ifdef HAVE_GETUID
+ if (from_tty == -1)
@@ -62,15 +53,24 @@
+ warning (_("not using untrusted file \"%s\""), file);
+ close (fd);
+ do_cleanups (old_cleanups);
-+ return;
++ return 0;
+ }
+ }
+#endif
+
- is_python = source_python;
- if (strlen (file) > 3 && !strcmp (&file[strlen (file) - 3], ".py"))
- is_python = 1;
-@@ -486,6 +510,7 @@ source_script (char *file, int from_tty)
+ /* Use the full path name, if it is found. */
+ if (full_pathname != NULL && fd != -1)
+ {
+@@ -496,7 +520,7 @@ find_and_open_script (int from_tty, char
+
+ if (fd == -1)
+ {
+- if (from_tty)
++ if (from_tty > 0)
+ perror_with_name (file);
+ else
+ {
+@@ -554,6 +578,7 @@ source_script (char *file, int from_tty)
else
script_from_file (stream, file);
@@ -78,10 +78,10 @@
do_cleanups (old_cleanups);
}
-Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.exp
+Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.exp 2009-02-28 07:15:57.000000000 +0100
++++ gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.exp 2010-01-21 15:11:18.000000000 +0100
@@ -0,0 +1,98 @@
+# Copyright 2005
+# Free Software Foundation, Inc.
@@ -181,17 +181,17 @@
+}
+
+remote_exec build "rm .gdbinit"
-Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.sample
+Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.sample
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.sample 2009-02-28 07:15:57.000000000 +0100
++++ gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.sample 2010-01-21 15:11:18.000000000 +0100
@@ -0,0 +1 @@
+echo "\nin gdbinit"
-Index: gdb-6.8.50.20090226/gdb/main.c
+Index: gdb-7.0.50.20100121/gdb/main.c
===================================================================
---- gdb-6.8.50.20090226.orig/gdb/main.c 2009-02-27 00:04:32.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/main.c 2009-02-28 07:15:57.000000000 +0100
-@@ -855,7 +855,7 @@ Excess command line arguments ignored. (
+--- gdb-7.0.50.20100121.orig/gdb/main.c 2010-01-21 15:11:09.000000000 +0100
++++ gdb-7.0.50.20100121/gdb/main.c 2010-01-21 15:11:18.000000000 +0100
+@@ -818,7 +818,7 @@ Excess command line arguments ignored. (
debugging or what directory you are in. */
if (home_gdbinit && !inhibit_gdbinit)
@@ -200,7 +200,7 @@
/* Now perform all the actions indicated by the arguments. */
if (cdarg != NULL)
-@@ -924,7 +924,7 @@ Can't attach to process and specify a co
+@@ -887,7 +887,7 @@ Can't attach to process and specify a co
/* Read the .gdbinit file in the current directory, *if* it isn't
the same as the $HOME/.gdbinit file (it should exist, also). */
if (local_gdbinit && !inhibit_gdbinit)
++++++ gdb-6.3-test-pie-20050107.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,29 +1,29 @@
-Index: gdb-6.8.50.20090909/gdb/testsuite/configure.ac
+Index: gdb-7.0.90.20100306/gdb/testsuite/configure.ac
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/testsuite/configure.ac 2009-07-31 17:38:16.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/testsuite/configure.ac 2009-09-09 19:06:01.000000000 +0200
+--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure.ac 2010-02-19 20:16:36.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/testsuite/configure.ac 2010-03-06 23:19:56.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.mi/Makefile gdb.modula2/Makefile \
+ gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile \
+ gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \
- gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
+ gdb.objc/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])
-Index: gdb-6.8.50.20090909/gdb/testsuite/configure
+Index: gdb-7.0.90.20100306/gdb/testsuite/configure
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/testsuite/configure 2009-08-22 18:56:43.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/testsuite/configure 2009-09-09 19:06:27.000000000 +0200
+--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure 2010-02-19 20:16:36.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/testsuite/configure 2010-03-06 23:20:12.000000000 +0100
@@ -3515,7 +3515,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.objc/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.objc/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.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.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.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/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
-@@ -4231,6 +4231,7 @@ do
+@@ -4232,6 +4232,7 @@ do
"gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;;
"gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
"gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
@@ -31,10 +31,10 @@
"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-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c 2010-03-06 23:19:31.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-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c 2010-03-06 23:19:31.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-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c 2010-03-06 23:19:31.000000000 +0100
@@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -236,10 +236,10 @@
+ }
+ return 0;
+}
-Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c 2010-03-06 23:19:31.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-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c 2010-03-06 23:19:31.000000000 +0100
@@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc.
@@ -432,10 +432,10 @@
+ return 0;
+}
+
-Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp 2010-03-06 23:19:31.000000000 +0100
@@ -0,0 +1,433 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+
@@ -870,10 +870,10 @@
+do_call_attach_tests
+
+return 0
-Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp 2010-03-06 23:19:31.000000000 +0100
@@ -0,0 +1,977 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004
@@ -1852,10 +1852,10 @@
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+}
-Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp 2010-03-06 23:19:31.000000000 +0100
@@ -0,0 +1,243 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
@@ -2097,13 +2097,13 @@
+# test reinit_frame_cache
+
+gdb_load ${binfile}
-+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)"
++gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
+
+gdb_test "core" "No core file now."
-Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in
+Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in 2009-09-09 19:06:01.000000000 +0200
++++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in 2010-03-06 23:19:31.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.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -30,11 +30,11 @@
<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-6.8.50.20090802/gdb/gdbtypes.c
+Index: gdb-7.0.50.20100128/gdb/gdbtypes.c
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/gdbtypes.c 2009-08-03 09:50:57.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/gdbtypes.c 2009-08-03 15:42:51.000000000 +0200
-@@ -3769,6 +3769,9 @@ gdbtypes_post_init (struct gdbarch *gdba
+--- gdb-7.0.50.20100128.orig/gdb/gdbtypes.c 2010-01-28 12:52:17.000000000 +0100
++++ gdb-7.0.50.20100128/gdb/gdbtypes.c 2010-01-28 12:52:48.000000000 +0100
+@@ -3978,6 +3978,9 @@ gdbtypes_post_init (struct gdbarch *gdba
= arch_type (gdbarch, TYPE_CODE_INTERNAL_FUNCTION, 0,
"<internal function>");
@@ -44,11 +44,11 @@
return builtin_type;
}
-Index: gdb-6.8.50.20090802/gdb/gdbtypes.h
+Index: gdb-7.0.50.20100128/gdb/gdbtypes.h
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/gdbtypes.h 2009-08-03 09:50:57.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/gdbtypes.h 2009-08-03 15:40:02.000000000 +0200
-@@ -1128,6 +1128,8 @@ struct builtin_type
+--- gdb-7.0.50.20100128.orig/gdb/gdbtypes.h 2010-01-28 12:52:17.000000000 +0100
++++ gdb-7.0.50.20100128/gdb/gdbtypes.h 2010-01-28 12:52:48.000000000 +0100
+@@ -1245,6 +1245,8 @@ struct builtin_type
/* This type is used to represent a GDB internal function. */
struct type *internal_fn;
@@ -57,11 +57,11 @@
};
/* Return the type table for the specified architecture. */
-Index: gdb-6.8.50.20090802/gdb/parse.c
+Index: gdb-7.0.50.20100128/gdb/parse.c
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/parse.c 2009-08-03 09:50:57.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/parse.c 2009-08-03 15:41:54.000000000 +0200
-@@ -510,7 +510,11 @@ write_exp_msymbol (struct minimal_symbol
+--- gdb-7.0.50.20100128.orig/gdb/parse.c 2010-01-28 12:52:19.000000000 +0100
++++ gdb-7.0.50.20100128/gdb/parse.c 2010-01-28 12:53:20.000000000 +0100
+@@ -509,7 +509,11 @@ write_exp_msymbol (struct minimal_symbol
case mst_text:
case mst_file_text:
case mst_solib_trampoline:
@@ -73,12 +73,12 @@
+ write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol);
break;
- case mst_data:
-Index: gdb-6.8.50.20090802/gdb/target.c
+ case mst_text_gnu_ifunc:
+Index: gdb-7.0.50.20100128/gdb/target.c
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/target.c 2009-08-03 12:38:47.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/target.c 2009-08-03 12:49:33.000000000 +0200
-@@ -933,6 +933,25 @@ pop_all_targets (int quitting)
+--- gdb-7.0.50.20100128.orig/gdb/target.c 2010-01-28 12:52:29.000000000 +0100
++++ gdb-7.0.50.20100128/gdb/target.c 2010-01-28 12:52:48.000000000 +0100
+@@ -1000,6 +1000,25 @@ pop_all_targets (int quitting)
pop_all_targets_above (dummy_stratum, quitting);
}
@@ -104,7 +104,7 @@
/* Using the objfile specified in OBJFILE, find the address for the
current thread's thread-local storage with offset OFFSET. */
CORE_ADDR
-@@ -1023,7 +1042,28 @@ target_translate_tls_address (struct obj
+@@ -1090,7 +1109,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
@@ -134,10 +134,10 @@
return addr;
}
-Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2009-08-03 12:49:33.000000000 +0200
++++ gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2010-01-28 12:52:48.000000000 +0100
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -167,10 +167,10 @@
+
+ return 0; /* breakpoint */
+}
-Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2009-08-03 12:49:33.000000000 +0200
++++ gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2010-01-28 12:52:48.000000000 +0100
@@ -0,0 +1,67 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
++++++ gdb-6.5-bz203661-emit-relocs.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,11 +1,11 @@
-Index: gdb-6.8.50.20090802/gdb/symfile.c
+Index: gdb-7.0.90.20100306/gdb/symfile.c
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/symfile.c 2009-08-03 12:29:58.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/symfile.c 2009-08-03 12:40:58.000000000 +0200
-@@ -4012,6 +4012,12 @@ symfile_dummy_outputs (bfd *abfd, asecti
- bfd_byte *
- symfile_relocate_debug_section (bfd *abfd, asection *sectp, bfd_byte *buf)
+--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:20:35.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:26:25.000000000 +0100
+@@ -3642,6 +3642,12 @@ default_symfile_relocate (struct objfile
{
+ bfd *abfd = objfile->obfd;
+
+ /* Executable files have all the relocations already resolved.
+ * Handle files linked with --emit-relocs.
+ * http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */
++++++ gdb-6.5-gcore-i386-on-amd64.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -23,10 +23,10 @@
Port to GDB-6.8pre.
-Index: gdb-6.8.50.20090802/gdb/amd64-linux-nat.c
+Index: gdb-7.0.50.20100115/gdb/amd64-linux-nat.c
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/amd64-linux-nat.c 2009-06-17 20:44:23.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/amd64-linux-nat.c 2009-08-03 15:49:33.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/amd64-linux-nat.c 2010-01-15 03:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/amd64-linux-nat.c 2010-01-15 03:20:58.000000000 +0100
@@ -51,6 +51,9 @@
#include "i386-linux-tdep.h"
#include "amd64-nat.h"
@@ -170,7 +170,7 @@
/* Transfering the general-purpose registers between GDB, inferiors
and core files. */
-@@ -682,6 +804,11 @@ _initialize_amd64_linux_nat (void)
+@@ -727,6 +849,11 @@ _initialize_amd64_linux_nat (void)
t->to_fetch_registers = amd64_linux_fetch_inferior_registers;
t->to_store_registers = amd64_linux_store_inferior_registers;
@@ -182,11 +182,11 @@
/* Register the target. */
linux_nat_add_target (t);
linux_nat_set_new_thread (t, amd64_linux_new_thread);
-Index: gdb-6.8.50.20090802/gdb/config.in
+Index: gdb-7.0.50.20100115/gdb/config.in
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/config.in 2009-08-03 09:50:57.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/config.in 2009-08-03 15:48:31.000000000 +0200
-@@ -146,6 +146,9 @@
+--- gdb-7.0.50.20100115.orig/gdb/config.in 2010-01-15 03:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/config.in 2010-01-15 03:20:58.000000000 +0100
+@@ -149,6 +149,9 @@
/* Define to 1 if you have the header file. */
#undef HAVE_ELF_HP_H
@@ -196,7 +196,7 @@
/* Define to 1 if your system has the etext variable. */
#undef HAVE_ETEXT
-@@ -487,6 +490,9 @@
+@@ -490,6 +493,9 @@
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_POLL_H
@@ -206,7 +206,7 @@
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_PROCFS_H
-@@ -514,6 +520,9 @@
+@@ -517,6 +523,9 @@
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
@@ -216,11 +216,11 @@
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_USER_H
-Index: gdb-6.8.50.20090802/gdb/configure
+Index: gdb-7.0.50.20100115/gdb/configure
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/configure 2009-08-03 09:50:57.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/configure 2009-08-03 15:48:31.000000000 +0200
-@@ -12545,6 +12545,268 @@ _ACEOF
+--- gdb-7.0.50.20100115.orig/gdb/configure 2010-01-15 03:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/configure 2010-01-15 03:20:58.000000000 +0100
+@@ -10043,6 +10043,268 @@ $as_echo "#define STDC_HEADERS 1" >>conf
fi
@@ -489,11 +489,11 @@
# elf_hp.h is for HP/UX 64-bit shared library support.
# FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
# unconditionally, so what's the point in checking these?
-Index: gdb-6.8.50.20090802/gdb/configure.ac
+Index: gdb-7.0.50.20100115/gdb/configure.ac
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/configure.ac 2009-08-03 09:50:57.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/configure.ac 2009-08-03 15:48:31.000000000 +0200
-@@ -744,6 +744,11 @@ AC_SUBST(PYTHON_CFLAGS)
+--- gdb-7.0.50.20100115.orig/gdb/configure.ac 2010-01-15 03:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/configure.ac 2010-01-15 03:20:58.000000000 +0100
+@@ -758,6 +758,11 @@ AC_SUBST(PYTHON_CFLAGS)
AC_HEADER_DIRENT
AC_HEADER_STAT
AC_HEADER_STDC
@@ -505,11 +505,11 @@
# elf_hp.h is for HP/UX 64-bit shared library support.
# FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
# unconditionally, so what's the point in checking these?
-Index: gdb-6.8.50.20090802/gdb/gcore.c
+Index: gdb-7.0.50.20100115/gdb/gcore.c
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/gcore.c 2009-08-03 12:28:56.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/gcore.c 2009-08-03 15:48:31.000000000 +0200
-@@ -324,6 +324,11 @@ gcore_create_callback (CORE_ADDR vaddr,
+--- gdb-7.0.50.20100115.orig/gdb/gcore.c 2010-01-15 03:17:59.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/gcore.c 2010-01-15 03:20:58.000000000 +0100
+@@ -376,6 +376,11 @@ gcore_create_callback (CORE_ADDR vaddr,
asection *osec;
flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;
@@ -521,10 +521,10 @@
/* If the memory segment has no permissions set, ignore it, otherwise
when we later try to access it for read/write, we'll get an error
or jam the kernel. */
-Index: gdb-6.8.50.20090802/gdb/gdb_procfs32.h
+Index: gdb-7.0.50.20100115/gdb/gdb_procfs32.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090802/gdb/gdb_procfs32.h 2009-08-03 15:48:31.000000000 +0200
++++ gdb-7.0.50.20100115/gdb/gdb_procfs32.h 2010-01-15 03:20:58.000000000 +0100
@@ -0,0 +1,128 @@
+#ifdef HAVE_SYS_PROCFS32_H
+#include
@@ -654,10 +654,10 @@
+#endif /* _SYS_PROCFS32_H */
+
+#endif /* HAVE_SYS_PROCFS32_H */
-Index: gdb-6.8.50.20090802/gdb/gdb_user32.h
+Index: gdb-7.0.50.20100115/gdb/gdb_user32.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090802/gdb/gdb_user32.h 2009-08-03 15:48:31.000000000 +0200
++++ gdb-7.0.50.20100115/gdb/gdb_user32.h 2010-01-15 03:20:58.000000000 +0100
@@ -0,0 +1,108 @@
+#ifdef HAVE_SYS_USER32_H
+#include
@@ -767,11 +767,11 @@
+#endif /* _SYS_USER32_H */
+
+#endif /* HAVE_SYS_USER32_H */
-Index: gdb-6.8.50.20090802/gdb/linux-nat.c
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/linux-nat.c 2009-08-03 12:31:26.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/linux-nat.c 2009-08-03 15:48:31.000000000 +0200
-@@ -219,6 +219,21 @@ static LONGEST (*super_xfer_partial) (st
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c 2010-01-15 03:20:45.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.c 2010-01-15 03:20:58.000000000 +0100
+@@ -225,6 +225,21 @@ static LONGEST (*super_xfer_partial) (st
const gdb_byte *,
ULONGEST, LONGEST);
@@ -793,7 +793,7 @@
static int debug_linux_nat;
static void
show_debug_linux_nat (struct ui_file *file, int from_tty,
-@@ -3586,7 +3601,7 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -4187,7 +4202,7 @@ linux_nat_do_thread_registers (bfd *obfd
else
fill_gregset (regcache, &gregs, -1);
@@ -802,7 +802,7 @@
note_data,
note_size,
lwp,
-@@ -3636,10 +3651,10 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -4237,10 +4252,10 @@ linux_nat_do_thread_registers (bfd *obfd
else
fill_fpregset (regcache, &fpregs, -1);
@@ -815,7 +815,7 @@
}
return note_data;
-@@ -3822,9 +3837,9 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -4423,9 +4438,9 @@ linux_nat_make_corefile_notes (bfd *obfd
psargs_end - string_end);
}
}
@@ -828,14 +828,14 @@
}
/* Dump information for threads. */
-Index: gdb-6.8.50.20090802/gdb/linux-nat.h
+Index: gdb-7.0.50.20100115/gdb/linux-nat.h
===================================================================
---- gdb-6.8.50.20090802.orig/gdb/linux-nat.h 2009-08-03 10:52:00.000000000 +0200
-+++ gdb-6.8.50.20090802/gdb/linux-nat.h 2009-08-03 15:48:31.000000000 +0200
-@@ -144,3 +144,12 @@ void linux_nat_switch_fork (ptid_t new_p
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.h 2010-01-15 03:17:07.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.h 2010-01-15 03:21:26.000000000 +0100
+@@ -169,3 +169,12 @@ struct siginfo *linux_nat_get_siginfo (p
- /* Return the saved siginfo associated with PTID. */
- struct siginfo *linux_nat_get_siginfo (ptid_t ptid);
+ /* Compute and return the processor core of a given thread. */
+ int linux_nat_core_of_thread_1 (ptid_t ptid);
+
+/* These functions make elfcore note sections.
+ They may get overriden by code adjusting data for multi-target builds. */
++++++ gdb-6.6-buildid-locate-core-as-arg.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-01/msg00558.html
Subject: Re: [patch] print a more useful error message for "gdb core"
[ Fixed up since the mail. ]
On Thu, 21 Jan 2010 18:17:15 +0100, Doug Evans wrote:
Not an exhaustive list, but if we go down the path of converting "gdb
corefile" to "gdb -c corefile", then we also need to think about "file
corefile" being converted to "core corefile" [or "target core
corefile", "core" is apparently deprecated in favor of "target core"]
and "target exec corefile" -> "target core corefile". Presumably
"file corefile" (and "target exec corefile") would discard the
currently selected executable. But maybe not. Will that be confusing
for users? I don't know.
While thinking about it overriding some GDB _commands_ was not my intention.
There is a general assumption if I have a shell COMMAND and some FILE I can do
$ COMMAND FILE
and COMMAND will appropriately load the FILE.
FSF GDB currently needs to specify also the executable file for core files
which already inhibits this intuitive expectation. OTOH with the build-id
locating patch which could allow such intuitive start notneeding the
executable file. Still it currently did not work due to the required "-c":
$ COMMAND -c COREFILE
Entering "file", "core-file" or "attach" commands is already explicit enough
so that it IMO should do what the command name says without any
autodetections. The second command line argument
(captured_main->pid_or_core_arg) is also autodetected (for PID or CORE) but
neither "attach" accepts a core file nor "core-file" accepts a PID.
The patch makes sense only with the build-id patchset so this is not submit
for FSF GDB inclusion yet. I am fine with your patch (+/- Hui Zhu's pending
bfd_check_format_matches) as the patch below is its natural extension.
Sorry for the delay,
Jan
2010-01-25 Jan Kratochvil
* exceptions.h (enum errors ): New.
* exec.c: Include exceptions.h.
(exec_file_attach ): Call throw_error (IS_CORE_ERROR, ...).
* main.c (exec_or_core_file_attach): New.
(captured_main ): Set also corearg.
(captured_main ): New variable func.
Call exec_or_core_file_attach if COREARG matches EXECARG. Call
symbol_file_add_main only if CORE_BFD remained NULL.
Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
2010-01-20 Doug Evans
* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
--- ./gdb/exceptions.h 2010-04-11 22:31:30.000000000 +0200
+++ ./gdb/exceptions.h 2010-04-11 22:31:47.000000000 +0200
@@ -78,6 +78,9 @@ enum errors {
/* Feature is not supported in this copy of GDB. */
UNSUPPORTED_ERROR,
+ /* Attempt to load a core file as executable. */
+ IS_CORE_ERROR,
+
/* Add more errors here. */
NR_ERRORS
};
--- ./gdb/exec.c 2010-04-11 22:31:30.000000000 +0200
+++ ./gdb/exec.c 2010-04-11 22:41:26.000000000 +0200
@@ -34,6 +34,7 @@
#include "arch-utils.h"
#include "gdbthread.h"
#include "progspace.h"
+#include "exceptions.h"
#include
#include "readline/readline.h"
@@ -256,12 +257,27 @@ exec_file_attach (char *filename, int fr
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
+ int is_core;
+
+ /* If the user accidentally did "gdb core", print a useful
+ error message. Check it only after bfd_object has been checked as
+ a valid executable may get recognized for example also as
+ "trad-core". */
+ is_core = bfd_check_format (exec_bfd, bfd_core);
+
/* Make sure to close exec_bfd, or else "run" might try to use
it. */
exec_close ();
- error (_("\"%s\": not in executable format: %s"),
- scratch_pathname,
- gdb_bfd_errmsg (bfd_get_error (), matching));
+
+ if (is_core != 0)
+ throw_error (IS_CORE_ERROR,
+ _("\"%s\" is a core file.\n"
+ "Please specify an executable to debug."),
+ scratch_pathname);
+ else
+ error (_("\"%s\": not in executable format: %s"),
+ scratch_pathname,
+ gdb_bfd_errmsg (bfd_get_error (), matching));
}
/* FIXME - This should only be run for RS6000, but the ifdef is a poor
--- ./gdb/main.c 2010-04-11 22:31:30.000000000 +0200
+++ ./gdb/main.c 2010-04-11 22:31:47.000000000 +0200
@@ -241,6 +241,36 @@ captured_command_loop (void *data)
return 1;
}
+/* Call exec_file_attach. If it detected FILENAME is a core file call
+ core_file_command. Print the original exec_file_attach error only if
+ core_file_command failed to find a matching executable. */
+
+static void
+exec_or_core_file_attach (char *filename, int from_tty)
+{
+ volatile struct gdb_exception e;
+
+ gdb_assert (exec_bfd == NULL);
+
+ TRY_CATCH (e, RETURN_MASK_ALL)
+ {
+ exec_file_attach (filename, from_tty);
+ }
+ if (e.reason < 0)
+ {
+ if (e.error == IS_CORE_ERROR)
+ {
+ core_file_command (filename, from_tty);
+
+ /* Iff the core file found its executable suppress the error message
+ from exec_file_attach. */
+ if (exec_bfd != NULL)
+ return;
+ }
+ throw_exception (e);
+ }
+}
+
static int
captured_main (void *data)
{
@@ -703,6 +733,8 @@ extern int gdbtk_test (char *);
{
symarg = argv[optind];
execarg = argv[optind];
+ if (optind + 1 == argc && corearg == NULL)
+ corearg = argv[optind];
optind++;
}
@@ -835,10 +867,25 @@ Excess command line arguments ignored. (
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
+ catch_command_errors_ftype *func;
+
+ /* Call exec_or_core_file_attach only if the file was specified as
+ a command line argument (and not an a command line option). */
+ if (corearg != NULL && strcmp (corearg, execarg) == 0)
+ {
+ func = exec_or_core_file_attach;
+ corearg = NULL;
+ }
+ else
+ func = exec_file_attach;
+
/* The exec file and the symbol-file are the same. If we can't
- open it, better only print one error message.
- catch_command_errors returns non-zero on success! */
- if (catch_command_errors (exec_file_attach, execarg, !batch, RETURN_MASK_ALL))
+ open it, better only print one error message.
+ catch_command_errors returns non-zero on success!
+ Do not load EXECARG as a symbol file if it has been already processed
+ as a core file. */
+ if (catch_command_errors (func, execarg, !batch, RETURN_MASK_ALL)
+ && core_bfd == NULL)
catch_command_errors (symbol_file_add_main, symarg, !batch, RETURN_MASK_ALL);
}
else
++++++ gdb-6.6-buildid-locate-rpm-suse.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,20 +1,28 @@
-Index: gdb-7.0.1/gdb/symfile.c
+Index: gdb-7.1/gdb/elfread.c
===================================================================
---- gdb-7.0.1.orig/gdb/symfile.c 2010-03-11 15:49:51.000000000 +0100
-+++ gdb-7.0.1/gdb/symfile.c 2010-03-11 15:51:47.000000000 +0100
-@@ -2308,9 +2308,12 @@ debug_print_missing (const char *binary,
- fprintf_unfiltered (gdb_stdlog,
- _("Missing separate debuginfo for %s\n"), binary);
- if (debug != NULL)
-- fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
-- "yum --disablerepo='*' --enablerepo='*-debuginfo'"
-- " install", debug);
-+ {
-+ const char *p = strrchr (debug, '/');
-+ fprintf_unfiltered (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"),
-+ "zypper install -C \"debuginfo(build-id)=",
-+ p - 2, p + 1);
-+ }
- }
- }
-
+*** gdb-7.1.orig/gdb/elfread.c 2010-04-15 14:46:14.000000000 +0200
+--- gdb-7.1/gdb/elfread.c 2010-04-15 14:50:17.000000000 +0200
+*************** debug_print_missing (const char *binary,
+*** 1625,1633 ****
+ fprintf_unfiltered (gdb_stdlog,
+ _("Missing separate debuginfo for %s\n"), binary);
+ if (debug != NULL)
+! fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
+! "yum --disablerepo='*' --enablerepo='*-debuginfo'"
+! " install", debug);
+ }
+ }
+
+--- 1625,1636 ----
+ fprintf_unfiltered (gdb_stdlog,
+ _("Missing separate debuginfo for %s\n"), binary);
+ if (debug != NULL)
+! {
+! const char *p = strrchr (debug, '/');
+! fprintf_unfiltered (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"),
+! "zypper install -C \"debuginfo(build-id)=",
+! p - 2, p + 1);
+! }
+ }
+ }
+
++++++ gdb-6.6-buildid-locate-rpm.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,7 +1,7 @@
-Index: gdb-6.8.50.20090909/gdb/event-top.c
+Index: gdb-7.0.50.20100115/gdb/event-top.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/event-top.c 2009-09-09 20:05:48.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/event-top.c 2009-09-09 20:08:04.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/event-top.c 2010-01-01 08:31:31.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/event-top.c 2010-01-15 11:45:20.000000000 +0100
@@ -33,6 +33,7 @@
#include "cli/cli-script.h" /* for reset_command_nest_depth */
#include "main.h"
@@ -28,27 +28,19 @@
/* Each interpreter has its own rules on displaying the command
prompt. */
if (!current_interp_display_prompt_p ())
-Index: gdb-6.8.50.20090909/gdb/symfile.c
+Index: gdb-7.0.50.20100115/gdb/elfread.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/symfile.c 2009-09-09 20:08:04.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/symfile.c 2009-09-09 20:08:04.000000000 +0200
-@@ -57,6 +57,7 @@
- #include "solib.h"
- #include "remote.h"
- #include "libbfd.h"
+--- gdb-7.0.50.20100115.orig/gdb/elfread.c 2010-01-15 11:43:30.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/elfread.c 2010-01-15 11:45:34.000000000 +0100
+@@ -40,6 +40,7 @@
+ #include "gdbcore.h"
+ #include "gdbcmd.h"
+ #include "observer.h"
+#include "elf/external.h"
- #include
- #include
-@@ -65,6 +66,7 @@
- #include
- #include
- #include
-+#include
-
+ extern void _initialize_elfread (void);
- int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
-@@ -1673,8 +1675,353 @@ build_id_to_filename (struct build_id *b
+@@ -1119,8 +1120,353 @@ build_id_to_filename (struct build_id *b
return retval;
}
@@ -403,7 +395,7 @@
avoidance. */
struct missing_filepair
-@@ -1728,11 +2074,17 @@ missing_filepair_change (void)
+@@ -1174,11 +1520,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL;
}
@@ -421,7 +413,7 @@
missing_filepair_change ();
}
-@@ -1799,14 +2151,34 @@ debug_print_missing (const char *binary,
+@@ -1245,14 +1597,34 @@ debug_print_missing (const char *binary,
*slot = missing_filepair;
@@ -463,11 +455,11 @@
}
static char *
-Index: gdb-6.8.50.20090909/gdb/symfile.h
+Index: gdb-7.0.50.20100115/gdb/symfile.h
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/symfile.h 2009-09-09 20:08:04.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/symfile.h 2009-09-09 20:08:04.000000000 +0200
-@@ -387,6 +387,7 @@ extern struct build_id *build_id_addr_ge
+--- gdb-7.0.50.20100115.orig/gdb/symfile.h 2010-01-15 11:12:33.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/symfile.h 2010-01-15 11:45:20.000000000 +0100
+@@ -398,6 +398,7 @@ 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);
@@ -475,10 +467,10 @@
/* From dwarf2read.c */
-Index: gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/lib/gdb.exp
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/gdb.exp 2009-09-09 20:08:04.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp 2009-09-09 20:08:04.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/lib/gdb.exp 2010-01-15 11:12:33.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/lib/gdb.exp 2010-01-15 11:45:20.000000000 +0100
@@ -1248,7 +1248,7 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
@@ -488,10 +480,10 @@
send_gdb "set build-id-verbose 0\n"
gdb_expect 10 {
-re "$gdb_prompt $" {
-Index: gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/lib/mi-support.exp
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/mi-support.exp 2009-09-09 20:08:04.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp 2009-09-09 20:08:04.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/lib/mi-support.exp 2010-01-15 11:12:33.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/lib/mi-support.exp 2010-01-15 11:45:20.000000000 +0100
@@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } {
}
}
@@ -501,10 +493,10 @@
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-6.8.50.20090909/gdb/tui/tui-interp.c
+Index: gdb-7.0.50.20100115/gdb/tui/tui-interp.c
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/tui/tui-interp.c 2009-09-09 20:05:48.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/tui/tui-interp.c 2009-09-09 20:08:04.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/tui/tui-interp.c 2010-01-01 08:32:07.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/tui/tui-interp.c 2010-01-15 11:45:20.000000000 +0100
@@ -30,6 +30,7 @@
#include "tui/tui.h"
#include "tui/tui-io.h"
@@ -522,10 +514,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-6.8.50.20090909/gdb/aclocal.m4
+Index: gdb-7.0.50.20100115/gdb/aclocal.m4
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/aclocal.m4 2009-09-09 20:05:48.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/aclocal.m4 2009-09-09 20:09:32.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/aclocal.m4 2009-11-11 05:42:39.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/aclocal.m4 2010-01-15 11:45:20.000000000 +0100
@@ -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'.])])
@@ -689,10 +681,10 @@
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
-Index: gdb-6.8.50.20090909/gdb/config.in
+Index: gdb-7.0.50.20100115/gdb/config.in
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/config.in 2009-09-09 20:08:04.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/config.in 2009-09-09 20:08:04.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/config.in 2010-01-15 03:22:31.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/config.in 2010-01-15 11:45:20.000000000 +0100
@@ -42,6 +42,9 @@
/* Define to BFD's default target vector. */
#undef DEFAULT_BFD_VEC
@@ -713,10 +705,10 @@
/* Define if libunwind library is being used. */
#undef HAVE_LIBUNWIND
-Index: gdb-6.8.50.20090909/gdb/configure
+Index: gdb-7.0.50.20100115/gdb/configure
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/configure 2009-09-09 20:08:04.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/configure 2009-09-09 20:09:35.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/configure 2010-01-15 03:22:31.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/configure 2010-01-15 11:45:20.000000000 +0100
@@ -676,6 +676,9 @@ REPORT_BUGS_TO
PKGVERSION
TARGET_OBS
@@ -727,7 +719,7 @@
pythondir
GDB_DATADIR_PATH
GDB_DATADIR
-@@ -886,6 +889,7 @@ with_separate_debug_dir
+@@ -888,6 +891,7 @@ with_separate_debug_dir
with_gdb_datadir
with_relocated_sources
with_pythondir
@@ -735,7 +727,7 @@
enable_targets
enable_64_bit_bfd
enable_gdbcli
-@@ -925,6 +929,9 @@ LDFLAGS
+@@ -928,6 +932,9 @@ LDFLAGS
LIBS
CPPFLAGS
CPP
@@ -745,7 +737,7 @@
YACC
YFLAGS
XMKMF'
-@@ -1588,6 +1595,8 @@ Optional Packages:
+@@ -1593,6 +1600,8 @@ Optional Packages:
[DATADIR/gdb]
--with-pythondir install Python data files in this path
[DATADIR/gdb/python]
@@ -754,7 +746,7 @@
--with-libunwind use libunwind frame unwinding support
--with-curses use the curses library instead of the termcap
library
-@@ -1621,6 +1630,9 @@ Some influential environment variables:
+@@ -1627,6 +1636,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
@@ -764,7 +756,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.
-@@ -6675,6 +6687,486 @@ _ACEOF
+@@ -6760,6 +6772,486 @@ else
fi
@@ -933,7 +925,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
-+/* Duplicate here the declarations to verify they match "symfile.c". */
++/* Duplicate here the declarations to verify they match "elfread.c". */
+#include
+#include
+#include
@@ -1187,7 +1179,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
-+/* Duplicate here the declarations to verify they match "symfile.c". */
++/* Duplicate here the declarations to verify they match "elfread.c". */
+#include
+#include
+#include
@@ -1251,7 +1243,7 @@
-@@ -9721,265 +10213,25 @@ $as_echo "#define STDC_HEADERS 1" >>conf
+@@ -10043,265 +10535,25 @@ $as_echo "#define STDC_HEADERS 1" >>conf
fi
@@ -1527,11 +1519,11 @@
fi
-Index: gdb-6.8.50.20090909/gdb/configure.ac
+Index: gdb-7.0.50.20100115/gdb/configure.ac
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/configure.ac 2009-09-09 20:08:04.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/configure.ac 2009-09-09 20:08:04.000000000 +0200
-@@ -151,6 +151,199 @@ else
+--- gdb-7.0.50.20100115.orig/gdb/configure.ac 2010-01-15 03:22:31.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/configure.ac 2010-01-15 11:45:20.000000000 +0100
+@@ -152,6 +152,199 @@ else
fi
AC_SUBST(pythondir)
@@ -1664,7 +1656,7 @@
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
-+/* Duplicate here the declarations to verify they match "symfile.c". */
++/* Duplicate here the declarations to verify they match "elfread.c". */
+#include
+#include
+#include
@@ -1731,17 +1723,17 @@
AC_CONFIG_SUBDIRS(doc testsuite)
-Index: gdb-6.8.50.20090909/gdb/acinclude.m4
+Index: gdb-7.0.50.20100115/gdb/acinclude.m4
===================================================================
---- gdb-6.8.50.20090909.orig/gdb/acinclude.m4 2009-09-09 20:05:48.000000000 +0200
-+++ gdb-6.8.50.20090909/gdb/acinclude.m4 2009-09-09 20:08:04.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/acinclude.m4 2010-01-08 08:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/acinclude.m4 2010-01-15 11:45:20.000000000 +0100
@@ -1,3 +1,5 @@
+# serial 1
+
dnl written by Rob Savoye for Cygnus Support
dnl major rewriting for Tcl 7.5 by Don Libes
-@@ -79,8 +81,6 @@ AC_MSG_RESULT(yes)
+@@ -81,8 +83,6 @@ AC_MSG_RESULT(yes)
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
++++++ gdb-6.6-buildid-locate.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,11 +1,11 @@
-Index: gdb-7.0/gdb/corelow.c
+Index: gdb-7.0.50.20100115/gdb/corelow.c
===================================================================
---- gdb-7.0.orig/gdb/corelow.c 2009-07-31 17:25:21.000000000 +0200
-+++ gdb-7.0/gdb/corelow.c 2009-10-23 00:17:29.000000000 +0200
-@@ -45,6 +45,10 @@
- #include "exceptions.h"
+--- gdb-7.0.50.20100115.orig/gdb/corelow.c 2010-01-04 15:57:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/corelow.c 2010-01-15 11:14:05.000000000 +0100
+@@ -46,6 +46,10 @@
#include "solib.h"
#include "filenames.h"
+ #include "progspace.h"
+#include "auxv.h"
+#include "elf/common.h"
+#include "objfiles.h"
@@ -13,7 +13,7 @@
#ifndef O_LARGEFILE
-@@ -273,6 +277,52 @@ add_to_thread_list (bfd *abfd, asection
+@@ -290,6 +294,52 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = ptid; /* Yes, make it current */
}
@@ -66,7 +66,7 @@
/* This routine opens and sets up the core file bfd. */
static void
-@@ -371,6 +421,12 @@ core_open (char *filename, int from_tty)
+@@ -387,6 +437,12 @@ core_open (char *filename, int from_tty)
push_target (&core_ops);
discard_cleanups (old_chain);
@@ -76,10 +76,10 @@
+ if (build_id_core_loads != 0)
+ build_id_locate_exec (from_tty);
+
- add_inferior_silent (corelow_pid);
-
/* Do this before acknowledging the inferior, so if
-@@ -878,4 +934,11 @@ _initialize_corelow (void)
+ post_create_inferior throws (can happen easilly if you're loading
+ a core file with the wrong exec), we aren't left with threads
+@@ -925,4 +981,11 @@ _initialize_corelow (void)
init_core_ops ();
add_target (&core_ops);
@@ -91,11 +91,11 @@
+ NULL, NULL, NULL,
+ &setlist, &showlist);
}
-Index: gdb-7.0/gdb/doc/gdb.texinfo
+Index: gdb-7.0.50.20100115/gdb/doc/gdb.texinfo
===================================================================
---- gdb-7.0.orig/gdb/doc/gdb.texinfo 2009-10-23 00:12:39.000000000 +0200
-+++ gdb-7.0/gdb/doc/gdb.texinfo 2009-10-23 00:17:29.000000000 +0200
-@@ -13896,6 +13896,27 @@ information files.
+--- gdb-7.0.50.20100115.orig/gdb/doc/gdb.texinfo 2010-01-15 03:23:50.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/doc/gdb.texinfo 2010-01-15 11:12:33.000000000 +0100
+@@ -14258,6 +14258,27 @@ information files.
@end table
@@ -123,11 +123,11 @@
@cindex @code{.gnu_debuglink} sections
@cindex debug link sections
A debug link is a special section of the executable file named
-Index: gdb-7.0/gdb/solib-svr4.c
+Index: gdb-7.0.50.20100115/gdb/solib-svr4.c
===================================================================
---- gdb-7.0.orig/gdb/solib-svr4.c 2009-10-23 00:12:38.000000000 +0200
-+++ gdb-7.0/gdb/solib-svr4.c 2009-10-23 00:17:29.000000000 +0200
-@@ -1101,9 +1101,49 @@ svr4_current_sos (void)
+--- gdb-7.0.50.20100115.orig/gdb/solib-svr4.c 2010-01-15 03:22:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/solib-svr4.c 2010-01-15 11:12:33.000000000 +0100
+@@ -1116,9 +1116,49 @@ svr4_current_sos (void)
safe_strerror (errcode));
else
{
@@ -180,22 +180,25 @@
}
xfree (buffer);
-Index: gdb-7.0/gdb/symfile.c
+Index: gdb-7.0.50.20100115/gdb/elfread.c
===================================================================
---- gdb-7.0.orig/gdb/symfile.c 2009-10-23 00:12:38.000000000 +0200
-+++ gdb-7.0/gdb/symfile.c 2009-10-23 00:43:28.000000000 +0200
-@@ -56,6 +56,7 @@
- #include "elf-bfd.h"
- #include "solib.h"
- #include "remote.h"
+--- gdb-7.0.50.20100115.orig/gdb/elfread.c 2010-01-15 03:22:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/elfread.c 2010-01-15 11:43:30.000000000 +0100
+@@ -36,6 +36,10 @@
+ #include "gdb-stabs.h"
+ #include "complaints.h"
+ #include "demangle.h"
+#include "libbfd.h"
++#include "gdbcore.h"
++#include "gdbcmd.h"
++#include "observer.h"
- #include
- #include
-@@ -1173,16 +1174,65 @@ symbol_file_clear (int from_tty)
- printf_unfiltered (_("No symbol file now.\n"));
- }
+ extern void _initialize_elfread (void);
+@@ -567,6 +571,20 @@ elf_symtab_read (struct objfile *objfile
+ }
+ }
+ }
+/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
+
@@ -210,10 +213,10 @@
+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
+ value);
+}
-+
+
struct build_id
{
- size_t size;
+@@ -574,10 +592,44 @@ struct build_id
gdb_byte data[1];
};
@@ -260,7 +263,7 @@
{
struct build_id *retval;
-@@ -1198,6 +1248,348 @@ build_id_bfd_get (bfd *abfd)
+@@ -593,6 +645,348 @@ build_id_bfd_get (bfd *abfd)
return retval;
}
@@ -609,7 +612,7 @@
/* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */
static int
-@@ -1215,7 +1607,7 @@ build_id_verify (const char *filename, s
+@@ -607,7 +1001,7 @@ build_id_verify (const char *filename, s
if (abfd == NULL)
return 0;
@@ -618,7 +621,7 @@
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"), filename);
-@@ -1234,14 +1626,16 @@ build_id_verify (const char *filename, s
+@@ -626,14 +1020,16 @@ build_id_verify (const char *filename, s
return retval;
}
@@ -639,7 +642,7 @@
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
-@@ -1272,7 +1666,10 @@ build_id_to_debug_filename (struct build
+@@ -664,7 +1060,10 @@ build_id_to_debug_filename (struct build
*s++ = '/';
while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++);
@@ -651,7 +654,7 @@
/* lrealpath() is expensive even for the usually non-existent files. */
if (access (link, F_OK) == 0)
-@@ -1285,15 +1682,185 @@ build_id_to_debug_filename (struct build
+@@ -677,17 +1076,188 @@ build_id_to_debug_filename (struct build
}
if (retval != NULL)
@@ -696,9 +699,9 @@
+ xfree (link);
+ xfree (link_all);
+
-+ return retval;
-+}
-+
+ return retval;
+ }
+
+/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
+ Try to install the hash file ...
+ avoidance. */
@@ -721,9 +724,9 @@
+
+ retval = obstack_alloc (&missing_filepair_obstack, size);
+ memset (retval, 0, size);
- return retval;
- }
-
++ return retval;
++}
++
+static hashval_t
+missing_filepair_hash_func (const struct missing_filepair *elem)
+{
@@ -836,70 +839,88 @@
+}
+
static char *
- get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out)
+-find_separate_debug_file_by_buildid (struct objfile *objfile)
++find_separate_debug_file_by_buildid (struct objfile *objfile,
++ char **build_id_filename_return)
{
-@@ -1384,13 +1951,14 @@ find_separate_debug_file (struct objfile
- unsigned long crc32;
+ asection *sect;
+ char *basename, *name_copy, *debugdir;
+@@ -699,12 +1269,16 @@ find_separate_debug_file_by_buildid (str
int i;
struct build_id *build_id;
-+ char *build_id_filename = NULL;
- build_id = build_id_bfd_get (objfile->obfd);
++ if (build_id_filename_return)
++ *build_id_filename_return = NULL;
++
+ build_id = build_id_bfd_shdr_get (objfile->obfd);
if (build_id != NULL)
{
char *build_id_name;
- build_id_name = build_id_to_debug_filename (build_id);
-+ build_id_name = build_id_to_filename (build_id, &build_id_filename, 1);
++ build_id_name = build_id_to_filename (build_id, build_id_filename_return,
++ 1);
xfree (build_id);
/* Prevent looping on a stripped .debug file. */
if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0)
-@@ -1400,7 +1968,10 @@ find_separate_debug_file (struct objfile
+@@ -714,7 +1288,7 @@ find_separate_debug_file_by_buildid (str
xfree (build_id_name);
}
else if (build_id_name != NULL)
- return build_id_name;
-+ {
-+ xfree (build_id_filename);
-+ return build_id_name;
-+ }
++ return build_id_name;
+ }
+ return NULL;
+ }
+@@ -887,9 +1461,10 @@ elf_symfile_read (struct objfile *objfil
+ `.gnu_debuglink' may no longer be present with `.note.gnu.build-id'. */
+ else
+ {
+- char *debugfile;
++ char *debugfile, *build_id_filename;
+
+- debugfile = find_separate_debug_file_by_buildid (objfile);
++ debugfile = find_separate_debug_file_by_buildid (objfile,
++ &build_id_filename);
+
+ if (debugfile == NULL)
+ debugfile = find_separate_debug_file_by_debuglink (objfile);
+@@ -900,6 +1475,12 @@ elf_symfile_read (struct objfile *objfil
+ symbol_file_add_separate (abfd, symfile_flags, objfile);
+ xfree (debugfile);
+ }
++ /* Check if any separate debug info has been extracted out. */
++ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
++ != NULL)
++ debug_print_missing (objfile->name, build_id_filename);
++
++ xfree (build_id_filename);
}
+ }
- basename = get_debug_link_info (objfile, &crc32);
-@@ -1501,8 +2072,10 @@ find_separate_debug_file (struct objfile
-
- xfree (debugfile);
- debugfile = NULL;
-+ debug_print_missing (objfile->name, build_id_filename);
-
- cleanup_return_debugfile:
-+ xfree (build_id_filename);
- xfree (canon_name);
- xfree (basename);
- xfree (dir);
-@@ -4256,4 +4829,16 @@ each global debug-file-directory compone
- NULL,
- show_debug_file_directory,
- &setlist, &showlist);
-+
-+ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
-+ _("\
-+ Set debugging level of the build-id locator."), _("\
-+ Show debugging level of the build-id locator."), _("\
-+ Level 1 (default) enables printing the missing debug filenames,\n\
-+ level 2 also prints the parsing of binaries to find the identificators."),
-+ NULL,
-+ show_build_id_verbose,
-+ &setlist, &showlist);
+@@ -1072,4 +1653,16 @@ void
+ _initialize_elfread (void)
+ {
+ add_symtab_fns (&elf_sym_fns);
++
++ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
++ _("\
++Set debugging level of the build-id locator."), _("\
++Show debugging level of the build-id locator."), _("\
++Level 1 (default) enables printing the missing debug filenames,\n\
++level 2 also prints the parsing of binaries to find the identificators."),
++ NULL,
++ show_build_id_verbose,
++ &setlist, &showlist);
+
-+ observer_attach_executable_changed (debug_print_executable_changed);
++ observer_attach_executable_changed (debug_print_executable_changed);
}
-Index: gdb-7.0/gdb/symfile.h
+Index: gdb-7.0.50.20100115/gdb/symfile.h
===================================================================
---- gdb-7.0.orig/gdb/symfile.h 2009-10-23 00:12:38.000000000 +0200
-+++ gdb-7.0/gdb/symfile.h 2009-10-23 00:17:29.000000000 +0200
-@@ -381,6 +381,13 @@ extern int symfile_map_offsets_to_segmen
+--- gdb-7.0.50.20100115.orig/gdb/symfile.h 2010-01-15 03:22:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/symfile.h 2010-01-15 11:12:33.000000000 +0100
+@@ -392,6 +392,13 @@ extern int symfile_map_offsets_to_segmen
struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
void free_symfile_segment_data (struct symfile_segment_data *data);
@@ -913,10 +934,10 @@
/* From dwarf2read.c */
extern int dwarf2_has_info (struct objfile *);
-Index: gdb-7.0/gdb/testsuite/lib/gdb.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/lib/gdb.exp
===================================================================
---- gdb-7.0.orig/gdb/testsuite/lib/gdb.exp 2009-10-23 00:12:38.000000000 +0200
-+++ gdb-7.0/gdb/testsuite/lib/gdb.exp 2009-10-23 00:17:29.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/lib/gdb.exp 2010-01-15 03:22:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/lib/gdb.exp 2010-01-15 11:12:33.000000000 +0100
@@ -1248,6 +1248,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
@@ -934,10 +955,10 @@
return 0;
}
-Index: gdb-7.0/gdb/testsuite/lib/mi-support.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/lib/mi-support.exp
===================================================================
---- gdb-7.0.orig/gdb/testsuite/lib/mi-support.exp 2009-09-15 20:51:26.000000000 +0200
-+++ gdb-7.0/gdb/testsuite/lib/mi-support.exp 2009-10-23 00:17:29.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/lib/mi-support.exp 2010-01-12 22:40:25.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/lib/mi-support.exp 2010-01-15 11:12:33.000000000 +0100
@@ -221,6 +221,16 @@ proc default_mi_gdb_start { args } {
}
}
@@ -955,11 +976,11 @@
detect_async
-Index: gdb-7.0/gdb/objfiles.h
+Index: gdb-7.0.50.20100115/gdb/objfiles.h
===================================================================
---- gdb-7.0.orig/gdb/objfiles.h 2009-10-23 00:12:38.000000000 +0200
-+++ gdb-7.0/gdb/objfiles.h 2009-10-23 00:17:29.000000000 +0200
-@@ -428,6 +428,10 @@ struct objfile
+--- gdb-7.0.50.20100115.orig/gdb/objfiles.h 2010-01-15 03:22:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/objfiles.h 2010-01-15 11:14:42.000000000 +0100
+@@ -440,6 +440,10 @@ struct objfile
#define OBJF_MAIN (1 << 7)
@@ -967,6 +988,6 @@
+
+#define OBJF_BUILD_ID_CORE_LOADED (1 << 12)
+
- /* The object file that the main symbol table was loaded from (e.g. the
- argument to the "symbol-file" or "file" command). */
+ /* The object file that contains the runtime common minimal symbols
+ for SunOS4. Note that this objfile has no associated BFD. */
++++++ gdb-6.6-bz235197-fork-detach-info.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -3,23 +3,23 @@
Port to GDB-6.8pre.
Remove the `[' character from the GDB-6.8 default message.
-Index: gdb-6.7.50.20080227/gdb/linux-nat.c
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
===================================================================
---- gdb-6.7.50.20080227.orig/gdb/linux-nat.c 2008-03-01 10:30:48.000000000 +0100
-+++ gdb-6.7.50.20080227/gdb/linux-nat.c 2008-03-01 10:48:25.000000000 +0100
-@@ -415,7 +415,7 @@ linux_child_follow_fork (struct target_o
- /* Detach new forked process? */
- if (detach_fork)
- {
+--- 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
+ remove_breakpoints_pid (GET_PID (inferior_ptid));
+ }
+
- if (info_verbose || debug_linux_nat)
+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
{
target_terminal_ours ();
fprintf_filtered (gdb_stdlog,
-Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.c
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.c 2008-03-01 10:30:49.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.c 2010-01-15 03:22:52.000000000 +0100
@@ -0,0 +1,57 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -78,10 +78,10 @@
+ }
+ return 0;
+}
-Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.exp 2008-03-01 10:49:36.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/fork-detach.exp 2010-01-15 03:22:52.000000000 +0100
@@ -0,0 +1,43 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
++++++ gdb-6.6-gcore32-test.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -3,11 +3,11 @@
UNSUPPORTED results are valid for `-m64' on 32bit targets.
-Index: gdb-6.8/gdb/testsuite/gdb.base/gcore.exp
+Index: gdb-7.0.50.20100203/gdb/testsuite/gdb.base/gcore.exp
===================================================================
---- gdb-6.8.orig/gdb/testsuite/gdb.base/gcore.exp 2008-01-01 23:53:19.000000000 +0100
-+++ gdb-6.8/gdb/testsuite/gdb.base/gcore.exp 2008-07-14 10:28:05.000000000 +0200
-@@ -30,9 +30,14 @@ set testfile "gcore"
+--- gdb-7.0.50.20100203.orig/gdb/testsuite/gdb.base/gcore.exp 2010-02-01 18:15:36.000000000 +0100
++++ gdb-7.0.50.20100203/gdb/testsuite/gdb.base/gcore.exp 2010-02-03 06:39:54.000000000 +0100
+@@ -28,9 +28,14 @@ set testfile "gcore"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
@@ -25,7 +25,7 @@
}
# Start with a fresh gdb.
-@@ -47,23 +52,23 @@ send_gdb "help gcore\n"
+@@ -45,23 +50,23 @@ send_gdb "help gcore\n"
gdb_expect {
-re "Undefined command: .gcore.*$gdb_prompt $" {
# gcore command not supported -- nothing to test here.
@@ -56,16 +56,16 @@
}
proc capture_command_output { command prefix } {
-@@ -77,7 +82,7 @@ proc capture_command_output { command pr
+@@ -69,7 +74,7 @@ proc capture_command_output { command pr
+ global expect_out
+
+ set output_string ""
+- gdb_test_multiple "$command" "capture_command_output for $command" {
++ gdb_test_multiple "$command" "${prefix} capture_command_output for $command" {
+ -re "${command}\[\r\n\]+${prefix}(.*)\[\r\n\]+$gdb_prompt $" {
set output_string $expect_out(1,string)
}
- default {
-- fail "capture_command_output failed on $command."
-+ fail "${prefix} capture_command_output failed on $command."
- }
- }
- return $output_string
-@@ -109,22 +114,22 @@ set escapedfilename [string_to_regexp ${
+@@ -103,22 +108,22 @@ set escapedfilename [string_to_regexp ${
set core_supported 0
gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \
@@ -92,7 +92,7 @@
}
# Now restart gdb and load the corefile.
-@@ -136,31 +141,31 @@ gdb_load ${binfile}
+@@ -130,31 +135,31 @@ gdb_load ${binfile}
send_gdb "core ${objdir}/${subdir}/gcore.test\n"
gdb_expect {
-re ".* is not a core dump:.*$gdb_prompt $" {
@@ -133,7 +133,7 @@
".*\[\r\n\]+#0 .* terminal_func \\(\\) at "
".*\[\r\n\]+#1 .* array_func \\(\\) at "
".*\[\r\n\]+#2 .* factorial_func \\(value=1\\) at "
-@@ -174,61 +179,64 @@ gdb_expect_list "where in corefile" ".*$
+@@ -168,61 +173,64 @@ gdb_expect_list "where in corefile" ".*$
set post_corefile_regs [capture_command_output "info registers" ""]
if ![string compare $pre_corefile_regs $post_corefile_regs] then {
++++++ gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -21,11 +21,11 @@
Port to GDB-6.8pre.
-Index: gdb-6.8.50.20090803/gdb/inferior.h
+Index: gdb-7.0.50.20100115/gdb/inferior.h
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/inferior.h 2009-06-28 02:20:22.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/inferior.h 2009-08-03 17:19:56.000000000 +0200
-@@ -181,7 +181,15 @@ extern void reopen_exec_file (void);
+--- gdb-7.0.50.20100115.orig/gdb/inferior.h 2010-01-15 03:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/inferior.h 2010-01-15 03:17:07.000000000 +0100
+@@ -188,7 +188,15 @@ extern void reopen_exec_file (void);
/* The `resume' routine should only be called in special circumstances.
Normally, use `proceed', which handles a lot of bookkeeping. */
@@ -42,11 +42,11 @@
/* From misc files */
-Index: gdb-6.8.50.20090803/gdb/infrun.c
+Index: gdb-7.0.50.20100115/gdb/infrun.c
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/infrun.c 2009-07-31 01:01:27.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/infrun.c 2009-08-03 21:39:28.000000000 +0200
-@@ -74,7 +74,7 @@ static int follow_fork (void);
+--- gdb-7.0.50.20100115.orig/gdb/infrun.c 2010-01-15 03:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/infrun.c 2010-01-15 03:17:32.000000000 +0100
+@@ -77,7 +77,7 @@ static int follow_fork (void);
static void set_schedlock_func (char *args, int from_tty,
struct cmd_list_element *c);
@@ -55,7 +55,7 @@
static int currently_stepping_or_nexting_callback (struct thread_info *tp,
void *data);
-@@ -1137,7 +1137,7 @@ maybe_software_singlestep (struct gdbarc
+@@ -1363,7 +1363,7 @@ maybe_software_singlestep (struct gdbarc
STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */
void
@@ -64,7 +64,7 @@
{
int should_resume = 1;
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
-@@ -1149,10 +1149,12 @@ resume (int step, enum target_signal sig
+@@ -1376,10 +1376,12 @@ resume (int step, enum target_signal sig
QUIT;
if (debug_infrun)
@@ -81,7 +81,7 @@
/* Some targets (e.g. Solaris x86) have a kernel bug when stepping
over an instruction that causes a page fault without triggering
-@@ -1271,9 +1273,10 @@ a command like `return' or `jump' to con
+@@ -1501,9 +1503,10 @@ a command like `return' or `jump' to con
individually. */
resume_ptid = inferior_ptid;
}
@@ -94,16 +94,16 @@
{
/* User-settable 'scheduler' mode requires solo thread resume. */
resume_ptid = inferior_ptid;
-@@ -1474,7 +1477,7 @@ proceed (CORE_ADDR addr, enum target_sig
- struct gdbarch *gdbarch;
+@@ -1709,7 +1712,7 @@ proceed (CORE_ADDR addr, enum target_sig
struct thread_info *tp;
CORE_ADDR pc;
+ struct address_space *aspace;
- int oneproc = 0;
+ enum resume_step resume_step = RESUME_STEP_CONTINUE;
/* If we're stopped at a fork/vfork, follow the branch set by the
"set follow-fork-mode" command; otherwise, we'll just proceed
-@@ -1508,13 +1511,13 @@ proceed (CORE_ADDR addr, enum target_sig
+@@ -1744,13 +1747,13 @@ proceed (CORE_ADDR addr, enum target_sig
actually be executing the breakpoint insn anyway.
We'll be (un-)executing the previous instruction. */
@@ -119,7 +119,7 @@
}
else
{
-@@ -1545,13 +1548,13 @@ proceed (CORE_ADDR addr, enum target_sig
+@@ -1781,13 +1784,13 @@ proceed (CORE_ADDR addr, enum target_sig
is required it returns TRUE and sets the current thread to
the old thread. */
if (prepare_to_proceed (step))
@@ -135,7 +135,7 @@
{
tp->trap_expected = 1;
/* If displaced stepping is enabled, we can step over the
-@@ -1637,8 +1640,13 @@ proceed (CORE_ADDR addr, enum target_sig
+@@ -1873,8 +1876,13 @@ proceed (CORE_ADDR addr, enum target_sig
/* Reset to normal state. */
init_infwait_state ();
@@ -150,7 +150,7 @@
/* Wait for it to stop (if not standalone)
and in any case decode why it stopped, and act accordingly. */
-@@ -4171,13 +4179,18 @@ infrun: not switching back to stepped th
+@@ -4655,13 +4663,18 @@ infrun: not switching back to stepped th
/* Is thread TP in the middle of single-stepping? */
@@ -174,11 +174,11 @@
}
/* Returns true if any thread *but* the one passed in "data" is in the
-Index: gdb-6.8.50.20090803/gdb/linux-nat.c
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/linux-nat.c 2009-07-31 17:25:21.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/linux-nat.c 2009-08-03 21:39:10.000000000 +0200
-@@ -2351,7 +2351,10 @@ count_events_callback (struct lwp_info *
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c 2010-01-15 03:16:43.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.c 2010-01-15 03:17:07.000000000 +0100
+@@ -2883,7 +2883,10 @@ count_events_callback (struct lwp_info *
static int
select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
{
@@ -190,10 +190,10 @@
return 1;
else
return 0;
-Index: gdb-6.8.50.20090803/gdb/linux-nat.h
+Index: gdb-7.0.50.20100115/gdb/linux-nat.h
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/linux-nat.h 2009-05-18 19:11:25.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/linux-nat.h 2009-08-03 21:39:09.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.h 2010-01-12 22:40:24.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.h 2010-01-15 03:17:07.000000000 +0100
@@ -55,8 +55,8 @@ struct lwp_info
/* If non-zero, a pending wait status. */
int status;
++++++ gdb-6.7-testsuite-stable-results-prelink.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-03/msg01006.html
Subject: [patch or FYI] testsuite: Fix prelink.exp on system w/unprelinked system libs
Hi,
this is a more conservative variant superseded by:
[patch 4/6] testsuite: Unify to lib/prelink-support.exp
http://sourceware.org/ml/gdb-patches/2010-03/msg01002.html
where gdb.base/prelink.exp is reworked on generic lib/prelink-support.exp.
I prefer the [patch 4/6] over this patch but this mail can serve also as an
illustration of the current problem.
------------------------------------------------------------------------------
If your system for some reason currently does not have all the libraries
prelinked gdb.base/prelink.exp will get UNRESOLVED randomly also affecting
testsuite results diff.
Apparently the testcase already tried to avoid any system libraries
dependencies by "-nodefaultlibs". But currently it does has not worked that
way.
"-lm" is contained already even in dejagnu's default_target_compile (not just
in gdb/testsuite/lib/ada.exp). But I do not know why it is there and which
systems would get broken by some global gdb/testsuite/ "-lm" removal.
Thanks,
Jan
2010-03-29 Jan Kratochvil
Fix testcase false UNRESOLVED if system libraries are not prelinked.
* gdb.base/prelink.exp: New variables compile, board, err and mathlib.
Set clear board mathlib for ${libfile} compilation.
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -42,7 +42,25 @@ set testfile "prelink"
set libsrcfile ${testfile}-lib.c
set libfile ${objdir}/${subdir}/${testfile}.so
-if { [gdb_compile "${srcdir}/${subdir}/${libsrcfile}" "${libfile}" executable [list debug "additional_flags=-fpic -shared -nodefaultlibs"]] != ""} {
+
+# default_target_compile would otherwise add "-lm" making the testcase
+# dependent on whether the system libraries are already prelinked.
+# prelink: Could not set /lib64/libm-2.11.1.so owner or mode: Operation not permitted
+set compile {
+ gdb_compile "${srcdir}/${subdir}/${libsrcfile}" "${libfile}" executable [list debug "additional_flags=-fpic -shared -nodefaultlibs"]
+}
+set board [target_info name]
+if [board_info $board exists mathlib] {
+ set mathlib [board_info $dest mathlib]
+ set_board_info mathlib ""
+ set err [eval $compile]
+ set_board_info mathlib $mathlib
+} else {
+ set_board_info mathlib ""
+ set err [eval $compile]
+ unset_board_info mathlib
+}
+if {$err != ""} {
# If creating the shared library fails, maybe we don't have the right tools
return -1
}
++++++ gdb-6.7-testsuite-stable-results.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -102,154 +102,3 @@
set timeout $oldtimeout
return 0
-
-
-
-http://sourceware.org/ml/gdb-patches/2009-12/msg00234.html
-Subject: [patch] testsuite: Fix a race by me - watchthreads-reorder.exp
-
-Hi,
-
-there is a bug explainable by man pthread_cond_signal:
- The [...] pthread_cond_signal() functions shall have no effect if
- there are no threads currently blocked on cond.
-
-meaning a race for the testcase.
- +FAIL: gdb.threads/watchthreads-reorder.exp: reorder1: continue a (timeout)
-
-One can reproduce the race on CVS HEAD by:
-# --- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
-# +++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
-# @@ -89,6 +89,7 @@ thread1_func (void *unused)
-# int i;
-# volatile int rwatch_store;
-#
-# +sleep(1);
-# thread1_tid = gettid ();
-# i = pthread_cond_signal (&thread1_tid_cond);
-# assert (i == 0);
-# @@ -317,6 +318,7 @@ main (int argc, char **argv)
-#
-# if (thread1_tid == 0)
-# {
-# +sleep(2);
-# i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
-# assert (i == 0);
-#
-
-Fixed; gdbstop_mutex got removed as it became redundant there.
-
-Going to check it in as obvious in several days (code is by me + it is just
-a testcase).
-
-
-Sorry,
-Jan
-
-
-gdb/testsuite/
-2009-12-17 Jan Kratochvil
-
- * gdb.threads/watchthreads-reorder.c (gdbstop_mutex): Remove.
- (thread1_func): Protect thread1_tid_cond by thread1_tid_mutex. Remove
- gdbstop_mutex handling.
- (thread2_func): Protect thread2_tid_cond by thread2_tid_mutex. Remove
- gdbstop_mutex handling.
- (main): Move thread1_tid_mutex and thread2_tid_mutex locks before
- pthread_create. Remove gdbstop_mutex handling. New comment. Remove
- pthread_cond_wait conditionalizations.
-
---- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
-+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
-@@ -34,8 +34,6 @@
- otherwise. */
- #define TIMEOUT (gettid () == getpid() ? 10 : 15)
-
--static pthread_mutex_t gdbstop_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
--
- static pid_t thread1_tid;
- static pthread_cond_t thread1_tid_cond = PTHREAD_COND_INITIALIZER;
- static pthread_mutex_t thread1_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
-@@ -90,12 +88,11 @@ thread1_func (void *unused)
- volatile int rwatch_store;
-
- thread1_tid = gettid ();
-+
-+ timed_mutex_lock (&thread1_tid_mutex);
- i = pthread_cond_signal (&thread1_tid_cond);
- assert (i == 0);
--
-- /* Be sure GDB is already stopped before continuing. */
-- timed_mutex_lock (&gdbstop_mutex);
-- i = pthread_mutex_unlock (&gdbstop_mutex);
-+ i = pthread_mutex_unlock (&thread1_tid_mutex);
- assert (i == 0);
-
- rwatch_store = thread1_rwatch;
-@@ -115,12 +112,11 @@ thread2_func (void *unused)
- volatile int rwatch_store;
-
- thread2_tid = gettid ();
-+
-+ timed_mutex_lock (&thread2_tid_mutex);
- i = pthread_cond_signal (&thread2_tid_cond);
- assert (i == 0);
--
-- /* Be sure GDB is already stopped before continuing. */
-- timed_mutex_lock (&gdbstop_mutex);
-- i = pthread_mutex_unlock (&gdbstop_mutex);
-+ i = pthread_mutex_unlock (&thread2_tid_mutex);
- assert (i == 0);
-
- rwatch_store = thread2_rwatch;
-@@ -267,7 +263,8 @@ main (int argc, char **argv)
-
- setbuf (stdout, NULL);
-
-- timed_mutex_lock (&gdbstop_mutex);
-+ timed_mutex_lock (&thread1_tid_mutex);
-+ timed_mutex_lock (&thread2_tid_mutex);
-
- timed_mutex_lock (&terminate_mutex);
-
-@@ -306,30 +303,21 @@ main (int argc, char **argv)
- state_wait (tracer, "T (stopped)");
- }
-
-- timed_mutex_lock (&thread1_tid_mutex);
-- timed_mutex_lock (&thread2_tid_mutex);
--
-- /* Let the threads start. */
-- i = pthread_mutex_unlock (&gdbstop_mutex);
-- assert (i == 0);
-+ /* Threads are now waiting at timed_mutex_lock (thread1_tid_mutex) and so
-+ they could not trigger the watchpoints before GDB gets unstopped later.
-+ Threads get resumed at pthread_cond_wait below. */
-
- printf ("Waiting till the threads initialize their TIDs.\n");
-
-- if (thread1_tid == 0)
-- {
-- i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
-- assert (i == 0);
-+ i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
-+ assert (i == 0);
-
-- assert (thread1_tid > 0);
-- }
-+ assert (thread1_tid > 0);
-
-- if (thread2_tid == 0)
-- {
-- i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
-- assert (i == 0);
-+ i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
-+ assert (i == 0);
-
-- assert (thread2_tid > 0);
-- }
-+ assert (thread2_tid > 0);
-
- printf ("Thread 1 TID = %lu, thread 2 TID = %lu, PID = %lu.\n",
- (unsigned long) thread1_tid, (unsigned long) thread2_tid,
-
++++++ gdb-6.8-attach-signalled-detach-stopped.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20090803/gdb/linux-nat.c
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/linux-nat.c 2009-08-03 17:24:03.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/linux-nat.c 2009-08-03 17:27:23.000000000 +0200
-@@ -202,6 +202,9 @@ blocked. */
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c 2010-01-15 11:53:34.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.c 2010-01-15 12:13:53.000000000 +0100
+@@ -208,6 +208,9 @@ blocked. */
static struct target_ops *linux_ops;
static struct target_ops linux_ops_saved;
@@ -12,8 +12,8 @@
/* The method to call, if any, when a new thread is attached. */
static void (*linux_nat_new_thread) (ptid_t);
-@@ -790,7 +793,14 @@ linux_child_follow_fork (struct target_o
- linux_parent_pid = parent_pid;
+@@ -933,7 +936,14 @@ Attaching after process %d fork to child
+ parent_inf->waiting_for_vfork_done = 0;
}
else if (detach_fork)
- target_detach (NULL, 0);
@@ -26,9 +26,9 @@
+ target_detach (NULL, 0);
+ }
- inferior_ptid = ptid_build (child_pid, child_pid, 0);
- add_thread (inferior_ptid);
-@@ -1231,6 +1241,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
+ /* Note that the detach above makes PARENT_INF dangling. */
+
+@@ -1427,6 +1437,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
"LNPAW: Attaching to a stopped process\n");
@@ -36,8 +36,8 @@
/* The process is definitely stopped. It is in a job control
stop, unless the kernel predates the TASK_STOPPED /
-@@ -1512,6 +1523,9 @@ GPT: lwp %s had signal %s, but it is in
- *status = lp->status;
+@@ -1757,6 +1768,9 @@ GPT: lwp %s had signal %s, but it is in
+ target_signal_to_string (signo));
}
+ if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
@@ -46,7 +46,7 @@
return 0;
}
-@@ -1621,6 +1635,8 @@ linux_nat_detach (struct target_ops *ops
+@@ -1866,6 +1880,8 @@ linux_nat_detach (struct target_ops *ops
}
else
linux_ops->to_detach (ops, args, from_tty);
@@ -55,7 +55,7 @@
}
/* Resume LP. */
-@@ -1774,6 +1790,14 @@ linux_nat_resume (struct target_ops *ops
+@@ -2031,6 +2047,14 @@ linux_nat_resume (struct target_ops *ops
resume_callback. */
lp->stopped = 0;
@@ -70,7 +70,7 @@
if (resume_many)
iterate_over_lwps (ptid, resume_callback, NULL);
-@@ -3322,6 +3346,8 @@ linux_nat_mourn_inferior (struct target_
+@@ -3923,6 +3947,8 @@ linux_nat_mourn_inferior (struct target_
there are other viable forks to debug. Delete the exiting
one and context-switch to the first available. */
linux_fork_mourn_inferior ();
@@ -79,10 +79,10 @@
}
/* Convert a native/host siginfo object, into/from the siginfo in the
-Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attach-stopped.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attach-stopped.exp
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2009-01-03 06:58:07.000000000 +0100
-+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attach-stopped.exp 2009-08-03 17:26:22.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2010-01-01 08:32:06.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attach-stopped.exp 2010-01-15 11:54:57.000000000 +0100
@@ -62,7 +62,65 @@ proc corefunc { threadtype } {
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
@@ -150,10 +150,10 @@
set test "$threadtype: attach2 to stopped, after setting file"
gdb_test_multiple "attach $testpid" "$test" {
-Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attachstop-mt.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attachstop-mt.exp
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp 2009-01-03 06:58:07.000000000 +0100
-+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attachstop-mt.exp 2009-08-03 17:26:22.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp 2010-01-01 08:32:06.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attachstop-mt.exp 2010-01-15 11:54:57.000000000 +0100
@@ -176,12 +176,23 @@ gdb_test "bt" ".*sleep.*(func|main).*" "
# Exit and detach the process.
gdb_exit
++++++ gdb-6.8-bz254229-gcore-prpsinfo.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20090910/bfd/elf-bfd.h
+Index: gdb-7.0.50.20100203/bfd/elf-bfd.h
===================================================================
---- gdb-6.8.50.20090910.orig/bfd/elf-bfd.h 2009-09-09 23:38:57.000000000 +0200
-+++ gdb-6.8.50.20090910/bfd/elf-bfd.h 2009-09-10 23:01:15.000000000 +0200
-@@ -2121,7 +2121,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find
+--- gdb-7.0.50.20100203.orig/bfd/elf-bfd.h 2010-02-02 13:37:39.000000000 +0100
++++ gdb-7.0.50.20100203/bfd/elf-bfd.h 2010-02-03 07:28:20.000000000 +0100
+@@ -2140,7 +2140,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find
extern char *elfcore_write_note
(bfd *, char *, int *, const char *, int, const void *, int);
extern char *elfcore_write_prpsinfo
@@ -11,11 +11,11 @@
extern char *elfcore_write_prstatus
(bfd *, char *, int *, long, int, const void *);
extern char * elfcore_write_pstatus
-Index: gdb-6.8.50.20090910/bfd/elf.c
+Index: gdb-7.0.50.20100203/bfd/elf.c
===================================================================
---- gdb-6.8.50.20090910.orig/bfd/elf.c 2009-09-09 23:38:57.000000000 +0200
-+++ gdb-6.8.50.20090910/bfd/elf.c 2009-09-10 23:04:17.000000000 +0200
-@@ -8398,6 +8398,7 @@ char *
+--- gdb-7.0.50.20100203.orig/bfd/elf.c 2010-02-02 13:37:39.000000000 +0100
++++ gdb-7.0.50.20100203/bfd/elf.c 2010-02-03 07:28:20.000000000 +0100
+@@ -8459,6 +8459,7 @@ char *
elfcore_write_prpsinfo (bfd *abfd,
char *buf,
int *bufsiz,
@@ -23,7 +23,7 @@
const char *fname,
const char *psargs)
{
-@@ -8424,9 +8425,15 @@ elfcore_write_prpsinfo (bfd *abfd,
+@@ -8485,9 +8486,15 @@ elfcore_write_prpsinfo (bfd *abfd,
int note_type = NT_PRPSINFO;
#endif
@@ -42,7 +42,7 @@
return elfcore_write_note (abfd, buf, bufsiz,
note_name, note_type, &data, sizeof (data));
}
-@@ -8441,9 +8448,15 @@ elfcore_write_prpsinfo (bfd *abfd,
+@@ -8502,9 +8509,15 @@ elfcore_write_prpsinfo (bfd *abfd,
int note_type = NT_PRPSINFO;
#endif
@@ -61,10 +61,10 @@
return elfcore_write_note (abfd, buf, bufsiz,
note_name, note_type, &data, sizeof (data));
}
-Index: gdb-6.8.50.20090910/gdb/amd64-linux-nat.c
+Index: gdb-7.0.50.20100203/gdb/amd64-linux-nat.c
===================================================================
---- gdb-6.8.50.20090910.orig/gdb/amd64-linux-nat.c 2009-09-10 23:01:07.000000000 +0200
-+++ gdb-6.8.50.20090910/gdb/amd64-linux-nat.c 2009-09-10 23:01:15.000000000 +0200
+--- gdb-7.0.50.20100203.orig/gdb/amd64-linux-nat.c 2010-02-03 07:28:20.000000000 +0100
++++ gdb-7.0.50.20100203/gdb/amd64-linux-nat.c 2010-02-03 07:28:20.000000000 +0100
@@ -140,6 +140,7 @@ static int amd64_linux_gregset32_reg_off
static char *
@@ -98,10 +98,10 @@
}
static void
-Index: gdb-6.8.50.20090910/gdb/fbsd-nat.c
+Index: gdb-7.0.50.20100203/gdb/fbsd-nat.c
===================================================================
---- gdb-6.8.50.20090910.orig/gdb/fbsd-nat.c 2009-07-02 19:21:06.000000000 +0200
-+++ gdb-6.8.50.20090910/gdb/fbsd-nat.c 2009-09-10 23:01:15.000000000 +0200
+--- gdb-7.0.50.20100203.orig/gdb/fbsd-nat.c 2010-01-01 08:31:31.000000000 +0100
++++ gdb-7.0.50.20100203/gdb/fbsd-nat.c 2010-02-03 07:28:20.000000000 +0100
@@ -211,6 +211,7 @@ fbsd_make_corefile_notes (bfd *obfd, int
psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL);
@@ -110,19 +110,19 @@
fname, psargs);
}
-Index: gdb-6.8.50.20090910/gdb/linux-nat.c
+Index: gdb-7.0.50.20100203/gdb/linux-nat.c
===================================================================
---- gdb-6.8.50.20090910.orig/gdb/linux-nat.c 2009-09-10 23:01:06.000000000 +0200
-+++ gdb-6.8.50.20090910/gdb/linux-nat.c 2009-09-10 23:01:15.000000000 +0200
-@@ -55,6 +55,7 @@
- #include "xml-support.h"
+--- gdb-7.0.50.20100203.orig/gdb/linux-nat.c 2010-02-03 07:28:20.000000000 +0100
++++ gdb-7.0.50.20100203/gdb/linux-nat.c 2010-02-03 07:28:20.000000000 +0100
+@@ -56,6 +56,7 @@
#include "terminal.h"
#include
+ #include "solib.h"
+#include "gdb_procfs32.h" /* for struct elf_prpsinfo32 */
#ifndef SPUFS_MAGIC
#define SPUFS_MAGIC 0x23c9b64e
-@@ -222,7 +223,7 @@ static LONGEST (*super_xfer_partial) (st
+@@ -228,7 +229,7 @@ static LONGEST (*super_xfer_partial) (st
/* This functions make elfcore note sections.
They may get overriden by code adjusting data for multi-target builds. */
char *(*linux_elfcore_write_prpsinfo)
@@ -131,7 +131,7 @@
char *(*linux_elfcore_write_prstatus)
(bfd *, char *, int *, long, int, const void *) = elfcore_write_prstatus;
static char *
-@@ -3946,6 +3947,159 @@ linux_spu_make_corefile_notes (bfd *obfd
+@@ -4422,6 +4423,159 @@ linux_spu_make_corefile_notes (bfd *obfd
return args.note_data;
}
@@ -291,7 +291,7 @@
/* Fills the "to_make_corefile_note" target vector. Builds the note
section for a corefile, and returns it in a malloc buffer. */
-@@ -3966,8 +4120,14 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -4442,8 +4596,14 @@ linux_nat_make_corefile_notes (bfd *obfd
if (get_exec_file (0))
{
@@ -306,7 +306,7 @@
if (get_inferior_args ())
{
char *string_end;
-@@ -3983,9 +4143,15 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -4459,9 +4619,15 @@ linux_nat_make_corefile_notes (bfd *obfd
psargs_end - string_end);
}
}
@@ -324,11 +324,11 @@
}
/* Dump information for threads. */
-Index: gdb-6.8.50.20090910/gdb/linux-nat.h
+Index: gdb-7.0.50.20100203/gdb/linux-nat.h
===================================================================
---- gdb-6.8.50.20090910.orig/gdb/linux-nat.h 2009-09-10 23:01:06.000000000 +0200
-+++ gdb-6.8.50.20090910/gdb/linux-nat.h 2009-09-10 23:01:15.000000000 +0200
-@@ -154,7 +154,7 @@ struct siginfo *linux_nat_get_siginfo (p
+--- gdb-7.0.50.20100203.orig/gdb/linux-nat.h 2010-02-03 07:28:19.000000000 +0100
++++ gdb-7.0.50.20100203/gdb/linux-nat.h 2010-02-03 07:28:20.000000000 +0100
+@@ -173,7 +173,7 @@ int linux_nat_core_of_thread_1 (ptid_t p
/* These functions make elfcore note sections.
They may get overriden by code adjusting data for multi-target builds. */
extern char *(*linux_elfcore_write_prpsinfo)
@@ -337,11 +337,11 @@
extern char *(*linux_elfcore_write_prstatus)
(bfd *, char *, int *, long, int, const void *);
extern char *(*linux_elfcore_write_prfpreg)
-Index: gdb-6.8.50.20090910/gdb/procfs.c
+Index: gdb-7.0.50.20100203/gdb/procfs.c
===================================================================
---- gdb-6.8.50.20090910.orig/gdb/procfs.c 2009-08-01 02:02:04.000000000 +0200
-+++ gdb-6.8.50.20090910/gdb/procfs.c 2009-09-10 23:01:15.000000000 +0200
-@@ -6147,6 +6147,7 @@ procfs_make_note_section (bfd *obfd, int
+--- gdb-7.0.50.20100203.orig/gdb/procfs.c 2010-01-28 09:19:29.000000000 +0100
++++ gdb-7.0.50.20100203/gdb/procfs.c 2010-02-03 07:28:20.000000000 +0100
+@@ -6186,6 +6186,7 @@ procfs_make_note_section (bfd *obfd, int
note_data = (char *) elfcore_write_prpsinfo (obfd,
note_data,
note_size,
++++++ gdb-6.8-bz457187-largefile-test.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -61,7 +61,7 @@
+# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*"
+gdb_test "core-file ${corefile}"
+
-+gdb_test "x/i $address" "\r\n$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
++gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S 2009-04-19 14:52:28.000000000 +0200
@@ -0,0 +1,22 @@
++++++ gdb-6.8-constant-watchpoints.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -18,11 +18,11 @@
gdb.base/watchpoint.c (global_ptr_ptr): New variable.
(func4): New testing code for GLOBAL_PTR_PTR.
-Index: gdb-6.8.50.20090803/gdb/breakpoint.c
+Index: gdb-7.0.50.20100115/gdb/breakpoint.c
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/breakpoint.c 2009-08-04 06:29:47.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/breakpoint.c 2009-08-04 06:32:50.000000000 +0200
-@@ -823,7 +823,15 @@ is_hardware_watchpoint (struct breakpoin
+--- gdb-7.0.50.20100115.orig/gdb/breakpoint.c 2010-01-15 11:46:29.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/breakpoint.c 2010-01-15 11:49:49.000000000 +0100
+@@ -947,7 +947,15 @@ is_hardware_watchpoint (struct breakpoin
If VAL_CHAIN is non-NULL, *VAL_CHAIN will be released from the
value chain. The caller must free the values individually. If
VAL_CHAIN is NULL, all generated values will be left on the value
@@ -39,8 +39,8 @@
static void
fetch_watchpoint_value (struct expression *exp, struct value **valp,
-@@ -6301,7 +6309,7 @@ watch_command_1 (char *arg, int accessfl
- struct symtab_and_line sal;
+@@ -7264,7 +7272,7 @@ watch_command_1 (char *arg, int accessfl
+ struct breakpoint *b, *scope_breakpoint = NULL;
struct expression *exp;
struct block *exp_valid_block;
- struct value *val, *mark;
@@ -48,7 +48,7 @@
struct frame_info *frame;
char *exp_start = NULL;
char *exp_end = NULL;
-@@ -6392,6 +6400,27 @@ watch_command_1 (char *arg, int accessfl
+@@ -7352,6 +7360,27 @@ watch_command_1 (char *arg, int accessfl
exp_valid_block = innermost_block;
mark = value_mark ();
fetch_watchpoint_value (exp, &val, NULL, NULL);
@@ -76,11 +76,11 @@
if (val != NULL)
release_value (val);
-Index: gdb-6.8.50.20090803/gdb/gdbtypes.h
+Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/gdbtypes.h 2009-08-04 06:31:58.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/gdbtypes.h 2009-08-04 06:32:50.000000000 +0200
-@@ -71,7 +71,22 @@ enum type_code
+--- gdb-7.0.50.20100115.orig/gdb/gdbtypes.h 2010-01-15 03:22:31.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/gdbtypes.h 2010-01-15 11:49:26.000000000 +0100
+@@ -72,7 +72,22 @@ enum type_code
TYPE_CODE_UNION, /* C union or Pascal variant part */
TYPE_CODE_ENUM, /* Enumeration type */
TYPE_CODE_FLAGS, /* Bit flags type */
@@ -104,11 +104,11 @@
TYPE_CODE_INT, /* Integer type */
/* Floating type. This is *NOT* a complex type. Beware, there are parts
-Index: gdb-6.8.50.20090803/gdb/doc/gdb.texinfo
+Index: gdb-7.0.50.20100115/gdb/doc/gdb.texinfo
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/doc/gdb.texinfo 2009-08-04 06:32:39.000000000 +0200
-+++ gdb-6.8.50.20090803/gdb/doc/gdb.texinfo 2009-08-04 06:32:50.000000000 +0200
-@@ -3517,6 +3517,18 @@ This command prints a list of watchpoint
+--- gdb-7.0.50.20100115.orig/gdb/doc/gdb.texinfo 2010-01-15 11:12:33.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/doc/gdb.texinfo 2010-01-15 11:49:26.000000000 +0100
+@@ -3723,6 +3723,18 @@ This command prints a list of watchpoint
it is the same as @code{info break} (@pxref{Set Breaks}).
@end table
@@ -127,10 +127,10 @@
@value{GDBN} sets a @dfn{hardware watchpoint} if possible. Hardware
watchpoints execute very quickly, and the debugger reports a change in
value at the exact instruction where the change occurs. If @value{GDBN}
-Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.c
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/watchpoint.c
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.base/watchpoint.c 2008-03-03 14:24:12.000000000 +0100
-+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.c 2009-08-04 06:32:50.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.base/watchpoint.c 2009-12-30 18:33:35.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/watchpoint.c 2010-01-15 11:49:26.000000000 +0100
@@ -40,6 +40,7 @@ struct foo struct1, struct2, *ptr1, *ptr
int doread = 0;
@@ -139,7 +139,7 @@
void marker1 ()
{
-@@ -118,6 +119,10 @@ func4 ()
+@@ -119,6 +120,10 @@ func4 ()
buf[0] = 3;
global_ptr = buf;
buf[0] = 7;
@@ -150,10 +150,10 @@
}
int main ()
-Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.exp
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/watchpoint.exp
===================================================================
---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.base/watchpoint.exp 2009-01-03 06:58:03.000000000 +0100
-+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.exp 2009-08-04 06:32:50.000000000 +0200
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.base/watchpoint.exp 2010-01-01 08:32:01.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/watchpoint.exp 2010-01-15 11:50:21.000000000 +0100
@@ -641,7 +641,21 @@ proc test_watchpoint_and_breakpoint {} {
}
}
@@ -216,10 +216,10 @@
}
}
-@@ -842,6 +879,17 @@ if [initialize] then {
- }
-
+@@ -851,6 +888,17 @@ if [initialize] then {
test_watchpoint_and_breakpoint
+
+ test_watchpoint_in_big_blob
+
+ # See above.
+ if [istarget "mips-idt-*"] then {
++++++ gdb-6.8-fortran-tag-constant.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20090811/gdb/dwarf2read.c
+Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
===================================================================
---- gdb-6.8.50.20090811.orig/gdb/dwarf2read.c 2009-08-13 10:14:45.000000000 +0200
-+++ gdb-6.8.50.20090811/gdb/dwarf2read.c 2009-08-13 10:22:36.000000000 +0200
-@@ -2480,6 +2480,7 @@ scan_partial_symbols (struct partial_die
+--- gdb-7.0.50.20100115.orig/gdb/dwarf2read.c 2010-01-15 11:52:59.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/dwarf2read.c 2010-01-15 11:53:57.000000000 +0100
+@@ -2529,6 +2529,7 @@ scan_partial_symbols (struct partial_die
add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu);
break;
case DW_TAG_variable:
@@ -10,7 +10,7 @@
case DW_TAG_typedef:
case DW_TAG_union_type:
if (!pdi->is_declaration)
-@@ -2675,6 +2676,7 @@ add_partial_symbol (struct partial_die_i
+@@ -2719,6 +2720,7 @@ add_partial_symbol (struct partial_die_i
}
break;
case DW_TAG_variable:
@@ -18,15 +18,7 @@
if (pdi->is_external)
{
/* Global Variable.
-@@ -2805,6 +2807,7 @@ die_needs_namespace (struct die_info *di
- return 1;
-
- case DW_TAG_variable:
-+ case DW_TAG_constant:
- {
- struct attribute *attr;
- attr = dwarf2_attr (die, DW_AT_specification, cu);
-@@ -4741,7 +4744,8 @@ dwarf2_add_field (struct field_info *fip
+@@ -4770,7 +4772,8 @@ dwarf2_add_field (struct field_info *fip
fip->non_public_fields = 1;
}
}
@@ -36,7 +28,7 @@
{
/* C++ static member. */
-@@ -5233,7 +5237,8 @@ read_structure_type (struct die_info *di
+@@ -5339,7 +5342,8 @@ read_structure_type (struct die_info *di
while (child_die && child_die->tag)
{
if (child_die->tag == DW_TAG_member
@@ -46,7 +38,7 @@
{
/* NOTE: carlton/2002-11-05: A C++ static data member
should be a DW_TAG_member that is a declaration, but
-@@ -5352,6 +5357,7 @@ process_structure_scope (struct die_info
+@@ -5459,6 +5463,7 @@ process_structure_scope (struct die_info
{
if (child_die->tag == DW_TAG_member
|| child_die->tag == DW_TAG_variable
@@ -54,7 +46,7 @@
|| child_die->tag == DW_TAG_inheritance)
{
/* Do nothing. */
-@@ -6980,6 +6986,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
+@@ -7134,6 +7139,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
&& abbrev->tag != DW_TAG_subprogram
&& abbrev->tag != DW_TAG_lexical_block
&& abbrev->tag != DW_TAG_variable
@@ -62,7 +54,7 @@
&& abbrev->tag != DW_TAG_namespace
&& abbrev->tag != DW_TAG_module
&& abbrev->tag != DW_TAG_member)
-@@ -7088,6 +7095,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
+@@ -7242,6 +7248,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
if (load_all
|| abbrev->tag == DW_TAG_subprogram
|| abbrev->tag == DW_TAG_variable
@@ -70,7 +62,7 @@
|| abbrev->tag == DW_TAG_namespace
|| part_die->is_declaration)
{
-@@ -8901,6 +8909,11 @@ new_symbol (struct die_info *die, struct
+@@ -9016,6 +9023,11 @@ new_symbol (struct die_info *die, struct
/* Do not add the symbol to any lists. It will be found via
BLOCK_FUNCTION from the blockvector. */
break;
++++++ gdb-7.0.1.tar.bz2 -> gdb-7.1.tar.bz2 ++++++
gdb/gdb-7.0.1.tar.bz2 /mounts/work_src_done/STABLE/gdb/gdb-7.1.tar.bz2 differ: char 11, line 1
++++++ gdb-archer-ada.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:51.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:51.000000000 +0200
@@ -1,19 +1,10 @@
From: Keith Seitz
Message-ID: <4B7F207A.7020102@redhat.com>
+[ read_partial_die part dropped in the port to Rawhide ]
+
--- gdb-7.0.1-orig/gdb/dwarf2read.c 2010-02-20 01:06:44.000000000 +0100
+++ gdb-7.0.1/gdb/dwarf2read.c 2010-02-20 01:08:28.000000000 +0100
-@@ -7362,6 +7362,10 @@ read_partial_die (struct partial_die_inf
- break;
- }
- break;
-+ case DW_AT_MIPS_linkage_name:
-+ if (cu->language == language_ada)
-+ part_die->name = DW_STRING (&attr);
-+ break;
- case DW_AT_comp_dir:
- if (part_die->dirname == NULL)
- part_die->dirname = DW_STRING (&attr);
@@ -9924,9 +9928,13 @@ dwarf2_canonicalize_name (char *name, st
static char *
dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
++++++ gdb-archer-pie-addons-keep-disabled.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:52.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:52.000000000 +0200
@@ -1,6 +1,8 @@
---- ./gdb/breakpoint.c 2009-12-18 00:13:49.000000000 +0100
-+++ ./gdb/breakpoint.c 2009-12-18 00:13:16.000000000 +0100
-@@ -8563,6 +8563,49 @@ update_breakpoint_locations (struct brea
+Index: gdb-7.0.50.20100115/gdb/breakpoint.c
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/breakpoint.c 2010-01-15 21:35:16.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/breakpoint.c 2010-01-15 21:51:20.000000000 +0100
+@@ -9167,6 +9167,49 @@ update_breakpoint_locations (struct brea
update_global_location_list (1);
}
@@ -45,14 +47,16 @@
+
+ if (changed)
+ qsort (bp_location, bp_location_count, sizeof (*bp_location),
-+ bp_location_compare_for_qsort);
++ bp_location_compare);
+}
/* Reset a breakpoint given it's struct breakpoint * BINT.
The value we return ends up being the return value from catch_errors.
---- ./gdb/breakpoint.h 2009-12-18 00:13:48.000000000 +0100
-+++ ./gdb/breakpoint.h 2009-12-17 22:11:10.000000000 +0100
-@@ -970,4 +970,7 @@ extern struct breakpoint *get_tracepoint
+Index: gdb-7.0.50.20100115/gdb/breakpoint.h
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/breakpoint.h 2010-01-15 21:35:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/breakpoint.h 2010-01-15 21:50:12.000000000 +0100
+@@ -1015,4 +1015,7 @@ extern struct breakpoint *get_tracepoint
is newly allocated; the caller should free when done with it. */
extern VEC(breakpoint_p) *all_tracepoints (void);
@@ -60,63 +64,19 @@
+ struct section_offsets *delta);
+
#endif /* !defined (BREAKPOINT_H) */
---- ./gdb/objfiles.c 2009-12-18 00:13:48.000000000 +0100
-+++ ./gdb/objfiles.c 2009-12-17 23:19:22.000000000 +0100
-@@ -546,7 +546,7 @@ free_all_objfiles (void)
- /* Relocate OBJFILE to NEW_OFFSETS. There should be OBJFILE->NUM_SECTIONS
- entries in new_offsets. SEPARATE_DEBUG_OBJFILE is not touched here. */
-
--static void
-+static int
- objfile_relocate1 (struct objfile *objfile, struct section_offsets *new_offsets)
- {
- struct obj_section *s;
-@@ -565,7 +565,7 @@ objfile_relocate1 (struct objfile *objfi
- something_changed = 1;
- }
- if (!something_changed)
-- return;
-+ return 0;
- }
-
- /* OK, get all the symtabs. */
-@@ -706,6 +706,13 @@ objfile_relocate1 (struct objfile *objfi
- exec_set_section_address (bfd_get_filename (objfile->obfd), idx,
+Index: gdb-7.0.50.20100115/gdb/objfiles.c
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/objfiles.c 2010-01-15 21:35:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/objfiles.c 2010-01-15 21:50:45.000000000 +0100
+@@ -856,6 +856,11 @@ objfile_relocate1 (struct objfile *objfi
obj_section_addr (s));
}
-+
+
+ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
+ their addresses match. */
+ if (objfile->separate_debug_objfile_backlink == NULL)
+ breakpoints_relocate (objfile, delta);
+
-+ return 1;
- }
-
- /* Relocate OBJFILE to NEW_OFFSETS. There should be OBJFILE->NUM_SECTIONS
-@@ -720,7 +727,9 @@ objfile_relocate1 (struct objfile *objfi
- void
- objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
- {
-- objfile_relocate1 (objfile, new_offsets);
-+ int changed = 0;
-+
-+ changed |= objfile_relocate1 (objfile, new_offsets);
-
- if (objfile->separate_debug_objfile != NULL)
- {
-@@ -747,11 +756,12 @@ objfile_relocate (struct objfile *objfil
- objfile_addrs);
- do_cleanups (my_cleanups);
-
-- objfile_relocate1 (debug_objfile, new_debug_offsets);
-+ changed |= objfile_relocate1 (debug_objfile, new_debug_offsets);
- }
-
- /* Relocate breakpoints as necessary, after things are relocated. */
-- breakpoint_re_set ();
-+ if (changed)
-+ breakpoint_re_set ();
+ /* Data changed. */
+ return 1;
}
-
- /* Return non-zero if OBJFILE has partial symbols. */
++++++ gdb-archer-pie-addons.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:52.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:52.000000000 +0200
@@ -1,6 +1,8 @@
---- a/gdb/dwarf2read.c
-+++ b/gdb/dwarf2read.c
-@@ -5754,7 +5754,12 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+Index: gdb-7.0.90.20100306/gdb/dwarf2read.c
+===================================================================
+--- gdb-7.0.90.20100306.orig/gdb/dwarf2read.c 2010-03-06 23:27:30.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/dwarf2read.c 2010-03-06 23:28:43.000000000 +0100
+@@ -5910,7 +5910,12 @@ read_common_block (struct die_info *die,
{
struct attribute *attr;
struct symbol *sym;
@@ -14,15 +16,15 @@
attr = dwarf2_attr (die, DW_AT_location, cu);
if (attr)
-@@ -5763,6 +5768,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5919,6 +5924,7 @@ read_common_block (struct die_info *die,
if (attr_form_is_block (attr))
- {
- base = decode_locdesc (DW_BLOCK (attr), cu);
+ {
+ base = decode_locdesc (DW_BLOCK (attr), cu);
+ base_p = 1;
- }
+ }
else if (attr_form_is_section_offset (attr))
- {
-@@ -5824,12 +5830,15 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+ {
+@@ -5980,12 +5986,15 @@ read_common_block (struct die_info *die,
else
dwarf2_complex_location_expr_complaint ();
@@ -40,7 +42,7 @@
else
SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym));
FIELD_TYPE (*field) = SYMBOL_TYPE (sym);
-@@ -5843,7 +5852,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5999,7 +6008,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. */
@@ -49,64 +51,35 @@
set_die_type (die, type, cu);
}
---- a/gdb/exec.c
-+++ b/gdb/exec.c
-@@ -32,6 +32,7 @@
- #include "exec.h"
- #include "observer.h"
- #include "arch-utils.h"
-+#include "solib.h"
-
- #include
- #include "readline/readline.h"
-@@ -220,6 +221,10 @@ exec_file_attach (char *filename, int from_tty)
- char *scratch_pathname;
- int scratch_chan;
- struct target_section *sections = NULL, *sections_end = NULL;
-+ struct target_section *p;
-+ int addr_bit;
-+ CORE_ADDR mask = CORE_ADDR_MAX;
-+ CORE_ADDR displacement;
-
- scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename,
- write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY,
-@@ -288,12 +293,23 @@ exec_file_attach (char *filename, int from_tty)
- scratch_pathname, bfd_errmsg (bfd_get_error ()));
- }
-
-+ set_gdbarch_from_file (exec_bfd);
-+
-+ addr_bit = gdbarch_addr_bit (target_gdbarch);
-+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
-+ mask = ((CORE_ADDR) 1 << addr_bit) - 1;
-+
-+ displacement = solib_exec_displacement ();
-+ for (p = sections; p < sections_end; p++)
-+ {
-+ p->addr = (p->addr + displacement) & mask;
-+ p->endaddr = (p->endaddr + displacement) & mask;
-+ }
-+
- exec_bfd_mtime = bfd_get_mtime (exec_bfd);
-
- validate_files ();
-
-- set_gdbarch_from_file (exec_bfd);
--
- /* Add the executable's sections to the current address spaces'
- list of sections. */
- add_target_sections (sections, sections_end);
---- a/gdb/gdbtypes.h
-+++ b/gdb/gdbtypes.h
-@@ -966,6 +966,7 @@ extern void allocate_cplus_struct_type (struct type *);
+Index: gdb-7.0.90.20100306/gdb/gdbtypes.h
+===================================================================
+--- gdb-7.0.90.20100306.orig/gdb/gdbtypes.h 2010-03-06 23:26:34.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/gdbtypes.h 2010-03-06 23:28:43.000000000 +0100
+@@ -412,6 +412,7 @@ enum type_instance_flag_value
+ enum field_loc_kind
+ {
+ FIELD_LOC_KIND_BITPOS, /* bitpos */
++ /* This address is unrelocated by the objfile's ANOFFSET. */
+ FIELD_LOC_KIND_PHYSADDR, /* physaddr */
+ FIELD_LOC_KIND_PHYSNAME /* physname */
+ };
+@@ -591,6 +592,7 @@ struct main_type
+ is the location (in the target) of the static field.
+ Otherwise, physname is the mangled label of the static field. */
+
++ /* This address is unrelocated by the objfile's ANOFFSET. */
+ CORE_ADDR physaddr;
+ char *physname;
+ }
+@@ -1091,6 +1093,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)
+/* This address is unrelocated by the objfile's ANOFFSET. */
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
- #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
#define SET_FIELD_BITPOS(thisfld, bitpos) \
-@@ -974,6 +975,7 @@ extern void allocate_cplus_struct_type (struct type *);
+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \
+@@ -1098,6 +1101,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))
@@ -114,17 +87,19 @@
#define SET_FIELD_PHYSADDR(thisfld, addr) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
-@@ -989,6 +991,7 @@ extern void allocate_cplus_struct_type (struct type *);
+@@ -1110,6 +1114,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))
+/* This address is unrelocated by the objfile's ANOFFSET. */
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
- #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
---- a/gdb/jv-lang.c
-+++ b/gdb/jv-lang.c
-@@ -416,7 +416,8 @@ java_link_class_type (struct gdbarch *gdbarch,
+ #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
+Index: gdb-7.0.90.20100306/gdb/jv-lang.c
+===================================================================
+--- gdb-7.0.90.20100306.orig/gdb/jv-lang.c 2010-03-06 23:19:13.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/jv-lang.c 2010-03-06 23:28:43.000000000 +0100
+@@ -416,7 +416,8 @@ java_link_class_type (struct gdbarch *gd
fields = NULL;
nfields--; /* First set up dummy "class" field. */
@@ -134,7 +109,7 @@
TYPE_FIELD_NAME (type, nfields) = "class";
TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
SET_TYPE_FIELD_PRIVATE (type, nfields);
-@@ -462,7 +463,8 @@ java_link_class_type (struct gdbarch *gdbarch,
+@@ -462,7 +463,8 @@ java_link_class_type (struct gdbarch *gd
SET_TYPE_FIELD_PROTECTED (type, i);
}
if (accflags & 0x0008) /* ACC_STATIC */
@@ -144,142 +119,11 @@
else
TYPE_FIELD_BITPOS (type, i) = 8 * boffset;
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
---- a/gdb/solib-svr4.c
-+++ b/gdb/solib-svr4.c
-@@ -1672,15 +1672,20 @@ static CORE_ADDR
- svr4_exec_displacement (void)
- {
- int found;
-+ /* ENTRY_POINT is a possible function descriptor - before
-+ a call to gdbarch_convert_from_func_ptr_addr. */
- CORE_ADDR entry_point;
-
- if (exec_bfd == NULL)
- return 0;
-
- if (target_auxv_search (¤t_target, AT_ENTRY, &entry_point) == 1)
-- return entry_point - exec_entry_point (exec_bfd, ¤t_target);
-+ return entry_point - bfd_get_start_address (exec_bfd);
-
-- return svr4_static_exec_displacement ();
-+ if (!ptid_equal (inferior_ptid, null_ptid))
-+ return svr4_static_exec_displacement ();
-+
-+ return 0;
- }
-
- /* Relocate the main executable. This function should be called upon
-@@ -1632,7 +1635,7 @@ svr4_exec_displacement (void)
- static void
- svr4_relocate_main_executable (void)
- {
-- CORE_ADDR displacement = svr4_exec_displacement ();
-+ CORE_ADDR displacement = solib_exec_displacement ();
-
- /* Even if DISPLACEMENT is 0 still try to relocate it as this is a new
- difference of in-memory vs. in-file addresses and we could already
-@@ -1975,6 +1978,7 @@ _initialize_svr4_solib (void)
- svr4_so_ops.free_so = svr4_free_so;
- svr4_so_ops.clear_solib = svr4_clear_solib;
- svr4_so_ops.solib_create_inferior_hook = svr4_solib_create_inferior_hook;
-+ svr4_so_ops.exec_displacement = svr4_exec_displacement;
- svr4_so_ops.special_symbol_handling = svr4_special_symbol_handling;
- svr4_so_ops.current_sos = svr4_current_sos;
- svr4_so_ops.open_symbol_file_object = open_symbol_file_object;
---- a/gdb/solib.c
-+++ b/gdb/solib.c
-@@ -1014,6 +1014,19 @@ solib_create_inferior_hook (int from_tty)
- ops->solib_create_inferior_hook (from_tty);
- }
-
-+/* Query the difference of in-memory VMA addresses vs. exec_bfd VMAs. */
-+
-+CORE_ADDR
-+solib_exec_displacement (void)
-+{
-+ struct target_so_ops *ops = solib_ops (target_gdbarch);
-+
-+ if (ops->exec_displacement != NULL)
-+ return (*ops->exec_displacement) ();
-+ else
-+ return 0;
-+}
-+
- /* GLOBAL FUNCTION
-
- in_solib_dynsym_resolve_code -- check to see if an address is in
---- a/gdb/solib.h
-+++ b/gdb/solib.h
-@@ -43,6 +43,8 @@ extern int solib_read_symbols (struct so_list *, int);
-
- extern void solib_create_inferior_hook (int from_tty);
-
-+extern CORE_ADDR solib_exec_displacement (void);
-+
- /* If ADDR lies in a shared library, return its name. */
-
- extern char *solib_name_from_address (CORE_ADDR);
---- a/gdb/solist.h
-+++ b/gdb/solist.h
-@@ -89,6 +89,9 @@ struct target_so_ops
- /* Target dependent code to run after child process fork. */
- void (*solib_create_inferior_hook) (int from_tty);
-
-+ /* Query the difference of in-memory VMA addresses vs. exec_bfd VMAs. */
-+ CORE_ADDR (*exec_displacement) (void);
-+
- /* Do additional symbol handling, lookup, etc. after symbols
- for a shared object have been loaded. */
- void (*special_symbol_handling) (void);
---- a/gdb/symfile.c
-+++ b/gdb/symfile.c
-@@ -873,15 +873,36 @@ syms_from_objfile (struct objfile *objfile,
- if an error occurs during symbol reading. */
- old_chain = make_cleanup_free_objfile (objfile);
-
-- /* If ADDRS and OFFSETS are both NULL, put together a dummy address
-- list. We now establish the convention that an addr of zero means
-- no load address was specified. */
-+ /* If ADDRS and OFFSETS are both NULL, put together a dummy offset list. */
-+
- if (! addrs && ! offsets)
- {
-- local_addr
-- = alloc_section_addr_info (bfd_count_sections (objfile->obfd));
-- make_cleanup (xfree, local_addr);
-- addrs = local_addr;
-+ /* Relocateble files have an exception in default_symfile_offsets which
-+ applies only for ADDRS. But calling solib_exec_displacement is more
-+ suitable for OFFSETS. Fortunately we never need the both
-+ functionalities simultaneously and in other cases zeroed ADDRS and
-+ zeroed OFFSETS are equivalent. */
-+
-+ if ((bfd_get_file_flags (objfile->obfd) & (EXEC_P | DYNAMIC)) == 0)
-+ {
-+ local_addr
-+ = alloc_section_addr_info (bfd_count_sections (objfile->obfd));
-+ make_cleanup (xfree, local_addr);
-+ addrs = local_addr;
-+ }
-+ else
-+ {
-+ CORE_ADDR displacement = 0;
-+ int i;
-+
-+ if (mainline)
-+ displacement = solib_exec_displacement ();
-+
-+ num_offsets = bfd_count_sections (objfile->obfd);
-+ offsets = alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets));
-+ for (i = 0; i < num_offsets; i++)
-+ offsets->offsets[i] = displacement;
-+ }
- }
-
- /* Now either addrs or offsets is non-zero. */
---- a/gdb/value.c
-+++ b/gdb/value.c
-@@ -1890,7 +1890,8 @@ value_static_field (struct type *type, int fieldno)
+Index: gdb-7.0.90.20100306/gdb/value.c
+===================================================================
+--- gdb-7.0.90.20100306.orig/gdb/value.c 2010-03-06 23:19:13.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/value.c 2010-03-06 23:28:43.000000000 +0100
+@@ -1897,7 +1897,8 @@ value_static_field (struct type *type, i
if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR)
{
retval = value_at (TYPE_FIELD_TYPE (type, fieldno),
@@ -289,7 +133,7 @@
}
else
{
-@@ -1920,7 +1921,8 @@ value_static_field (struct type *type, int fieldno)
+@@ -1927,7 +1928,8 @@ value_static_field (struct type *type, i
}
if (retval && VALUE_LVAL (retval) == lval_memory)
SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno),
@@ -299,14 +143,3 @@
}
return retval;
}
---- gdb-7.0/gdb/testsuite/gdb.base/valgrind-db-attach.exp-orig 2009-12-21 16:50:42.000000000 +0100
-+++ gdb-7.0/gdb/testsuite/gdb.base/valgrind-db-attach.exp 2009-12-21 16:51:24.000000000 +0100
-@@ -67,6 +67,8 @@ gdb_test_multiple "" $test {
- }
- }
-
-+gdb_test "" "" "eat first prompt"
-+
- # Initialization from default_gdb_start.
- gdb_test "set height 0"
- gdb_test "set width 0"
++++++ gdb-archer.patch ++++++
++++ 28213 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.11pjVW/_old 2010-04-16 18:24:52.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:52.000000000 +0200
@@ -1,17 +1,9 @@
-[ Rediffed against gdb-7.0.1. ]
-
-watchpoint-hw-hit-once.c is a part of:
-http://sourceware.org/ml/gdb-patches/2009-11/msg00444.html
-http://sourceware.org/ml/gdb-cvs/2009-11/msg00178.html
-ec27fce19a16df73e763281ce3a6d0cdb718174e
-
-
--- a/gdb/config/i386/linux64.mh
+++ b/gdb/config/i386/linux64.mh
@@ -2,7 +2,7 @@
NATDEPFILES= inf-ptrace.o fork-child.o \
i386-nat.o amd64-nat.o amd64-linux-nat.o linux-nat.o \
- proc-service.o linux-thread-db.o gcore.o linux-fork.o
+ proc-service.o linux-thread-db.o linux-fork.o
-NAT_FILE= config/nm-linux.h
+NAT_FILE= nm-linux64.h
@@ -58,47 +50,6 @@
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
---- gdb-7.0.1-orig/gdb/config/ia64/linux.mh 2007-04-26 00:17:48.000000000 +0200
-+++ gdb-7.0.1/gdb/config/ia64/linux.mh 2010-02-24 01:40:21.000000000 +0100
-@@ -1,6 +1,6 @@
- # Host: Intel IA-64 running GNU/Linux
-
--NAT_FILE= config/nm-linux.h
-+NAT_FILE= nm-linux.h
- NATDEPFILES= inf-ptrace.o fork-child.o corelow.o gcore.o \
- core-regset.o ia64-linux-nat.o \
- proc-service.o linux-thread-db.o linux-nat.o linux-fork.o
---- /dev/null
-+++ b/gdb/config/ia64/nm-linux.h
-@@ -0,0 +1,28 @@
-+/* Native support for GNU/Linux ia64.
-+
-+ 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_LINUX_H */
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1257,8 +1257,10 @@ extern char *normal_pid_to_str (ptid_t ptid);
@@ -155,40 +106,3 @@
+gdb_test "" "main .* at .*" "start"
+
+gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
---- /dev/null
-+++ b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.c
-@@ -0,0 +1,34 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 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/. */
-+
-+static int watchee;
-+
-+int
-+main (void)
-+{
-+ volatile int dummy;
-+
-+ /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC
-+ already stays on the line PC while entering "step"/"continue". */
-+
-+ dummy = 0; /* Stub to catch WATCHEE access after runto_main. */
-+ dummy = watchee;
-+ dummy = 1; /* Stub to catch break-at-exit after WATCHEE has been hit. */
-+ dummy = 2; /* break-at-exit */
-+
-+ return 0;
-+}
++++++ gdb-bz562975-std-terminate-double-free.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-02/msg00625.html
Subject: RFC: fix bug with std::terminate handler
I would appreciate comments on this patch.
This comes from an automatically-reported bug in the Red Hat bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=562975
call_function_by_hand installs a momentary breakpoint on std::terminate,
and then deletes it later. However, this can cause a double deletion of
the breakpoint. In the bug, the called function is dlopen, which causes
gdb to enter solib_add, which calls breakpoint_re_set, deleting the
momentary breakpoint.
This fix works by creating the momentary breakpoint with an internal
breakpoint number, and then trying to delete the breakpoint by number.
This bug does not always manifest in a crash. In fact, I couldn't make
it crash here, but I could observe the problem under valgrind.
Built and regtested on x86-64 (compile farm). I also manually verified
it using valgrind.
I think this patch is mildly ugly, due to the introduction of
set_momentary_breakpoint_at_pc_with_number. However, in the absence of
comments, I plan to check it in after a reasonable waiting period.
Tom
2010-02-25 Tom Tromey
* infcall.c (do_delete_breakpoint_by_number): New function.
(call_function_by_hand): Refer to momentary breakpoint by number.
* breakpoint.h (set_momentary_breakpoint_at_pc_with_number):
Declare.
* breakpoint.c (set_momentary_breakpoint_at_pc_with_number): New
function.
Index: gdb-7.0.90.20100312/gdb/breakpoint.c
===================================================================
--- gdb-7.0.90.20100312.orig/gdb/breakpoint.c 2010-03-12 14:54:26.000000000 +0100
+++ gdb-7.0.90.20100312/gdb/breakpoint.c 2010-03-12 14:54:53.000000000 +0100
@@ -6115,6 +6115,20 @@ set_momentary_breakpoint_at_pc (struct g
return set_momentary_breakpoint (gdbarch, sal, null_frame_id, type);
}
+
+/* Like set_momentary_breakpoint_at_pc, but ensure that the new
+ breakpoint has a number. */
+
+struct breakpoint *
+set_momentary_breakpoint_at_pc_with_number (struct gdbarch *gdbarch,
+ CORE_ADDR pc,
+ enum bptype type)
+{
+ struct breakpoint *result = set_momentary_breakpoint_at_pc (gdbarch, pc,
+ type);
+ result->number = internal_breakpoint_number--;
+ return result;
+}
/* Tell the user we have just set a breakpoint B. */
Index: gdb-7.0.90.20100312/gdb/breakpoint.h
===================================================================
--- gdb-7.0.90.20100312.orig/gdb/breakpoint.h 2010-03-12 14:54:26.000000000 +0100
+++ gdb-7.0.90.20100312/gdb/breakpoint.h 2010-03-12 14:54:53.000000000 +0100
@@ -774,6 +774,9 @@ extern struct breakpoint *set_momentary_
extern struct breakpoint *set_momentary_breakpoint_at_pc
(struct gdbarch *, CORE_ADDR pc, enum bptype type);
+extern struct breakpoint *set_momentary_breakpoint_at_pc_with_number
+ (struct gdbarch *, CORE_ADDR pc, enum bptype type);
+
extern struct breakpoint *clone_momentary_breakpoint (struct breakpoint *bpkt);
extern void set_ignore_count (int, int, int);
Index: gdb-7.0.90.20100312/gdb/infcall.c
===================================================================
--- gdb-7.0.90.20100312.orig/gdb/infcall.c 2010-03-12 14:54:26.000000000 +0100
+++ gdb-7.0.90.20100312/gdb/infcall.c 2010-03-12 14:55:19.000000000 +0100
@@ -410,6 +410,18 @@ run_inferior_call (struct thread_info *c
return e;
}
+/* A cleanup function that deletes a breakpoint, if it still exists,
+ given the breakpoint's number. */
+
+static void
+do_delete_breakpoint_by_number (void *arg)
+{
+ int *num = arg;
+ struct breakpoint *bp = get_breakpoint (*num);
+ if (bp)
+ delete_breakpoint (bp);
+}
+
/* All this stuff with a dummy frame may seem unnecessarily complicated
(why not just save registers in GDB?). The purpose of pushing a dummy
frame which looks just like a real frame is so that if you call a
@@ -447,7 +459,8 @@ call_function_by_hand (struct value *fun
struct cleanup *args_cleanup;
struct frame_info *frame;
struct gdbarch *gdbarch;
- struct breakpoint *terminate_bp = NULL;
+ int terminate_bp_num = 0;
+ CORE_ADDR terminate_bp_addr = 0;
struct minimal_symbol *tm;
struct cleanup *terminate_bp_cleanup = NULL;
ptid_t call_thread_ptid;
@@ -765,8 +778,13 @@ call_function_by_hand (struct value *fun
struct minimal_symbol *tm = lookup_minimal_symbol ("std::terminate()",
NULL, NULL);
if (tm != NULL)
- terminate_bp = set_momentary_breakpoint_at_pc
+ {
+ struct breakpoint *bp;
+ bp = set_momentary_breakpoint_at_pc_with_number
(gdbarch, SYMBOL_VALUE_ADDRESS (tm), bp_breakpoint);
+ terminate_bp_num = bp->number;
+ terminate_bp_addr = bp->loc->address;
+ }
}
/* Everything's ready, push all the info needed to restore the
@@ -780,8 +798,9 @@ call_function_by_hand (struct value *fun
discard_cleanups (inf_status_cleanup);
/* Register a clean-up for unwind_on_terminating_exception_breakpoint. */
- if (terminate_bp)
- terminate_bp_cleanup = make_cleanup_delete_breakpoint (terminate_bp);
+ if (terminate_bp_num != 0)
+ terminate_bp_cleanup = make_cleanup (do_delete_breakpoint_by_number,
+ &terminate_bp_num);
/* - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP -
If you're looking to implement asynchronous dummy-frames, then
@@ -947,9 +966,9 @@ When the function is done executing, GDB
in an inferior function call. Rewind, and warn the
user. */
- if (terminate_bp != NULL
+ if (terminate_bp_num != 0
&& (inferior_thread ()->stop_bpstat->breakpoint_at->address
- == terminate_bp->loc->address))
+ == terminate_bp_addr))
{
/* We must get back to the frame we were before the
dummy call. */
@@ -998,7 +1017,7 @@ When the function is done executing, GDB
/* If we get here and the std::terminate() breakpoint has been set,
it has to be cleaned manually. */
- if (terminate_bp)
+ if (terminate_bp_num != 0)
do_cleanups (terminate_bp_cleanup);
/* If we get here the called FUNCTION ran to completion,
++++++ gdb-bz574483-display-sepdebug.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-04/msg00055.html
Subject: [patch] Fix dangling displays in separate debug
[ Backported. ]
Hi,
gdb.base/solib-display.exp using _separate_ debug info:
3: c_global = gdbtypes.c:1369: internal-error: check_typedef: Assertion `type' failed.
A problem internal to GDB has been detected,
This problem was fixed before by:
[patch 1/8] Types GC [unloading observer]
http://sourceware.org/ml/gdb-patches/2009-05/msg00544.html
Re: [patch 3/8] Types GC [display_uses_solib_p to exp_iterate]
http://sourceware.org/ml/gdb-patches/2009-07/msg00054.html
but as that patchset is still not in providing this temporary fixup instead.
One may only address that gdb.base/solib-display.exp was testing symbol
in-objfile while now it tests only symbol in-sepdebug-objfile and no longer
the in-objfile case. I find the in-sepdebug-objfile as a superset of
in-objfile test but I can rework it if anyones addresses this test change.
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
Thanks,
Jan
gdb/
2010-04-03 Jan Kratochvil
* printcmd.c (display_uses_solib_p): Check also
SEPARATE_DEBUG_OBJFILE.
gdb/testsuite/
2010-04-03 Jan Kratochvil
* gdb.base/solib-display.exp (split solib): New.
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1845,7 +1845,10 @@ clear_dangling_display_expressions (stru
for (d = display_chain; d != NULL; d = d->next)
if (block_objfile (d->block) == objfile
- || (d->exp && exp_uses_objfile (d->exp, objfile)))
+ || (d->exp && exp_uses_objfile (d->exp, objfile))
+ || (objfile->separate_debug_objfile
+ && (block_objfile (d->block) == objfile->separate_debug_objfile
+ || (d->exp && exp_uses_objfile (d->exp, objfile->separate_debug_objfile)))))
{
xfree (d->exp);
d->exp = NULL;
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -53,6 +53,13 @@ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
return -1
}
+set test "split solib"
+if {[gdb_gnu_strip_debug $binfile_lib] != 0} {
+ fail $test
+} else {
+ pass $test
+}
+
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
++++++ gdb-bz578250-avx-01of10.patch ++++++
++++ 1733 lines (skipped)
++++++ gdb-bz578250-avx-02of10.patch ++++++
++++ 751 lines (skipped)
++++++ gdb-bz578250-avx-03of10.patch ++++++
[ Backported. ]
commit 0257d639d42f896a359993ae8adb5792e280f65f
Author: H.J. Lu
Date: Mon Mar 1 17:26:02 2010 +0000
Remove TDESC_TYPE_I386_EFLAGS and TDESC_TYPE_I386_MXCSR.
2010-03-01 H.J. Lu
* target-descriptions.c (tdesc_type): Remove
TDESC_TYPE_I386_EFLAGS and TDESC_TYPE_I386_MXCSR.
(tdesc_predefined_types): Likewise.
(tdesc_gdb_type): Likewise. Pass NULL to append_flags_type_flag
if flag name is empty.
(maint_print_c_tdesc_cmd): Handle TDESC_TYPE_FLAGS.
* features/i386/32bit-core.xml: Define i386_eflags.
* features/i386/64bit-core.xml: Likewise.
* features/i386/32bit-sse.xml: Define i386_mxcsr.
* features/i386/64bit-sse.xml: Likewise.
* features/i386/amd64-linux.c: Regenerated.
* features/i386/amd64.c: Likewise.
* features/i386/i386-linux.c: Likewise.
* features/i386/i386.c: Likewise.
--- gdb-7.1-p1/gdb/features/i386/32bit-core.xml 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/32bit-core.xml 2010-04-03 21:06:12.000000000 +0200
@@ -7,6 +7,26 @@
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.i386.core">
+ <flags id="i386_eflags" size="4">
+ <field name="CF" start="0" end="0"/>
+ <field name="" start="1" end="1"/>
+ <field name="PF" start="2" end="2"/>
+ <field name="AF" start="4" end="4"/>
+ <field name="ZF" start="6" end="6"/>
+ <field name="SF" start="7" end="7"/>
+ <field name="TF" start="8" end="8"/>
+ <field name="IF" start="9" end="9"/>
+ <field name="DF" start="10" end="10"/>
+ <field name="OF" start="11" end="11"/>
+ <field name="NT" start="14" end="14"/>
+ <field name="RF" start="16" end="16"/>
+ <field name="VM" start="17" end="17"/>
+ <field name="AC" start="18" end="18"/>
+ <field name="VIF" start="19" end="19"/>
+ <field name="VIP" start="20" end="20"/>
+ <field name="ID" start="21" end="21"/>
+ </flags>
+
<reg name="eax" bitsize="32" type="int32"/>
<reg name="ecx" bitsize="32" type="int32"/>
<reg name="edx" bitsize="32" type="int32"/>
--- gdb-7.1-p1/gdb/features/i386/32bit-sse.xml 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/32bit-sse.xml 2010-04-03 21:06:12.000000000 +0200
@@ -22,6 +22,22 @@
<field name="v2_int64" type="v2i64"/>
<field name="uint128" type="uint128"/>
</union>
+ <flags id="i386_mxcsr" size="4">
+ <field name="IE" start="0" end="0"/>
+ <field name="DE" start="1" end="1"/>
+ <field name="ZE" start="2" end="2"/>
+ <field name="OE" start="3" end="3"/>
+ <field name="UE" start="4" end="4"/>
+ <field name="PE" start="5" end="5"/>
+ <field name="DAZ" start="6" end="6"/>
+ <field name="IM" start="7" end="7"/>
+ <field name="DM" start="8" end="8"/>
+ <field name="ZM" start="9" end="9"/>
+ <field name="OM" start="10" end="10"/>
+ <field name="UM" start="11" end="11"/>
+ <field name="PM" start="12" end="12"/>
+ <field name="FZ" start="15" end="15"/>
+ </flags>
<reg name="xmm0" bitsize="128" type="vec128" regnum="32"/>
<reg name="xmm1" bitsize="128" type="vec128"/>
--- gdb-7.1-p1/gdb/features/i386/64bit-core.xml 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/64bit-core.xml 2010-04-03 21:06:12.000000000 +0200
@@ -7,6 +7,26 @@
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.i386.core">
+ <flags id="i386_eflags" size="4">
+ <field name="CF" start="0" end="0"/>
+ <field name="" start="1" end="1"/>
+ <field name="PF" start="2" end="2"/>
+ <field name="AF" start="4" end="4"/>
+ <field name="ZF" start="6" end="6"/>
+ <field name="SF" start="7" end="7"/>
+ <field name="TF" start="8" end="8"/>
+ <field name="IF" start="9" end="9"/>
+ <field name="DF" start="10" end="10"/>
+ <field name="OF" start="11" end="11"/>
+ <field name="NT" start="14" end="14"/>
+ <field name="RF" start="16" end="16"/>
+ <field name="VM" start="17" end="17"/>
+ <field name="AC" start="18" end="18"/>
+ <field name="VIF" start="19" end="19"/>
+ <field name="VIP" start="20" end="20"/>
+ <field name="ID" start="21" end="21"/>
+ </flags>
+
<reg name="rax" bitsize="64" type="int64"/>
<reg name="rbx" bitsize="64" type="int64"/>
<reg name="rcx" bitsize="64" type="int64"/>
--- gdb-7.1-p1/gdb/features/i386/64bit-sse.xml 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/64bit-sse.xml 2010-04-03 21:06:12.000000000 +0200
@@ -22,6 +22,22 @@
<field name="v2_int64" type="v2i64"/>
<field name="uint128" type="uint128"/>
</union>
+ <flags id="i386_mxcsr" size="4">
+ <field name="IE" start="0" end="0"/>
+ <field name="DE" start="1" end="1"/>
+ <field name="ZE" start="2" end="2"/>
+ <field name="OE" start="3" end="3"/>
+ <field name="UE" start="4" end="4"/>
+ <field name="PE" start="5" end="5"/>
+ <field name="DAZ" start="6" end="6"/>
+ <field name="IM" start="7" end="7"/>
+ <field name="DM" start="8" end="8"/>
+ <field name="ZM" start="9" end="9"/>
+ <field name="OM" start="10" end="10"/>
+ <field name="UM" start="11" end="11"/>
+ <field name="PM" start="12" end="12"/>
+ <field name="FZ" start="15" end="15"/>
+ </flags>
<reg name="xmm0" bitsize="128" type="vec128" regnum="40"/>
<reg name="xmm1" bitsize="128" type="vec128"/>
--- gdb-7.1-p1/gdb/features/i386/amd64-linux.c 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/amd64-linux.c 2010-04-03 21:06:12.000000000 +0200
@@ -17,6 +17,25 @@ initialize_tdesc_amd64_linux (void)
set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
+ tdesc_add_flag (field_type, 0, "CF");
+ tdesc_add_flag (field_type, 1, "");
+ tdesc_add_flag (field_type, 2, "PF");
+ tdesc_add_flag (field_type, 4, "AF");
+ tdesc_add_flag (field_type, 6, "ZF");
+ tdesc_add_flag (field_type, 7, "SF");
+ tdesc_add_flag (field_type, 8, "TF");
+ tdesc_add_flag (field_type, 9, "IF");
+ tdesc_add_flag (field_type, 10, "DF");
+ tdesc_add_flag (field_type, 11, "OF");
+ tdesc_add_flag (field_type, 14, "NT");
+ tdesc_add_flag (field_type, 16, "RF");
+ tdesc_add_flag (field_type, 17, "VM");
+ tdesc_add_flag (field_type, 18, "AC");
+ tdesc_add_flag (field_type, 19, "VIF");
+ tdesc_add_flag (field_type, 20, "VIP");
+ tdesc_add_flag (field_type, 21, "ID");
+
tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
@@ -93,6 +112,22 @@ initialize_tdesc_amd64_linux (void)
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type, "uint128", field_type);
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
+ tdesc_add_flag (field_type, 0, "IE");
+ tdesc_add_flag (field_type, 1, "DE");
+ tdesc_add_flag (field_type, 2, "ZE");
+ tdesc_add_flag (field_type, 3, "OE");
+ tdesc_add_flag (field_type, 4, "UE");
+ tdesc_add_flag (field_type, 5, "PE");
+ tdesc_add_flag (field_type, 6, "DAZ");
+ tdesc_add_flag (field_type, 7, "IM");
+ tdesc_add_flag (field_type, 8, "DM");
+ tdesc_add_flag (field_type, 9, "ZM");
+ tdesc_add_flag (field_type, 10, "OM");
+ tdesc_add_flag (field_type, 11, "UM");
+ tdesc_add_flag (field_type, 12, "PM");
+ tdesc_add_flag (field_type, 15, "FZ");
+
tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
--- gdb-7.1-p1/gdb/features/i386/amd64.c 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/amd64.c 2010-04-03 21:06:12.000000000 +0200
@@ -15,6 +15,25 @@ initialize_tdesc_amd64 (void)
set_tdesc_architecture (result, bfd_scan_arch ("i386:x86-64"));
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
+ tdesc_add_flag (field_type, 0, "CF");
+ tdesc_add_flag (field_type, 1, "");
+ tdesc_add_flag (field_type, 2, "PF");
+ tdesc_add_flag (field_type, 4, "AF");
+ tdesc_add_flag (field_type, 6, "ZF");
+ tdesc_add_flag (field_type, 7, "SF");
+ tdesc_add_flag (field_type, 8, "TF");
+ tdesc_add_flag (field_type, 9, "IF");
+ tdesc_add_flag (field_type, 10, "DF");
+ tdesc_add_flag (field_type, 11, "OF");
+ tdesc_add_flag (field_type, 14, "NT");
+ tdesc_add_flag (field_type, 16, "RF");
+ tdesc_add_flag (field_type, 17, "VM");
+ tdesc_add_flag (field_type, 18, "AC");
+ tdesc_add_flag (field_type, 19, "VIF");
+ tdesc_add_flag (field_type, 20, "VIP");
+ tdesc_add_flag (field_type, 21, "ID");
+
tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
@@ -91,6 +110,22 @@ initialize_tdesc_amd64 (void)
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type, "uint128", field_type);
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
+ tdesc_add_flag (field_type, 0, "IE");
+ tdesc_add_flag (field_type, 1, "DE");
+ tdesc_add_flag (field_type, 2, "ZE");
+ tdesc_add_flag (field_type, 3, "OE");
+ tdesc_add_flag (field_type, 4, "UE");
+ tdesc_add_flag (field_type, 5, "PE");
+ tdesc_add_flag (field_type, 6, "DAZ");
+ tdesc_add_flag (field_type, 7, "IM");
+ tdesc_add_flag (field_type, 8, "DM");
+ tdesc_add_flag (field_type, 9, "ZM");
+ tdesc_add_flag (field_type, 10, "OM");
+ tdesc_add_flag (field_type, 11, "UM");
+ tdesc_add_flag (field_type, 12, "PM");
+ tdesc_add_flag (field_type, 15, "FZ");
+
tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
--- gdb-7.1-p1/gdb/features/i386/i386-linux.c 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/i386-linux.c 2010-04-03 21:06:12.000000000 +0200
@@ -17,6 +17,25 @@ initialize_tdesc_i386_linux (void)
set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
+ tdesc_add_flag (field_type, 0, "CF");
+ tdesc_add_flag (field_type, 1, "");
+ tdesc_add_flag (field_type, 2, "PF");
+ tdesc_add_flag (field_type, 4, "AF");
+ tdesc_add_flag (field_type, 6, "ZF");
+ tdesc_add_flag (field_type, 7, "SF");
+ tdesc_add_flag (field_type, 8, "TF");
+ tdesc_add_flag (field_type, 9, "IF");
+ tdesc_add_flag (field_type, 10, "DF");
+ tdesc_add_flag (field_type, 11, "OF");
+ tdesc_add_flag (field_type, 14, "NT");
+ tdesc_add_flag (field_type, 16, "RF");
+ tdesc_add_flag (field_type, 17, "VM");
+ tdesc_add_flag (field_type, 18, "AC");
+ tdesc_add_flag (field_type, 19, "VIF");
+ tdesc_add_flag (field_type, 20, "VIP");
+ tdesc_add_flag (field_type, 21, "ID");
+
tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
@@ -88,6 +107,22 @@ initialize_tdesc_i386_linux (void)
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type, "uint128", field_type);
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
+ tdesc_add_flag (field_type, 0, "IE");
+ tdesc_add_flag (field_type, 1, "DE");
+ tdesc_add_flag (field_type, 2, "ZE");
+ tdesc_add_flag (field_type, 3, "OE");
+ tdesc_add_flag (field_type, 4, "UE");
+ tdesc_add_flag (field_type, 5, "PE");
+ tdesc_add_flag (field_type, 6, "DAZ");
+ tdesc_add_flag (field_type, 7, "IM");
+ tdesc_add_flag (field_type, 8, "DM");
+ tdesc_add_flag (field_type, 9, "ZM");
+ tdesc_add_flag (field_type, 10, "OM");
+ tdesc_add_flag (field_type, 11, "UM");
+ tdesc_add_flag (field_type, 12, "PM");
+ tdesc_add_flag (field_type, 15, "FZ");
+
tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128");
--- gdb-7.1-p1/gdb/features/i386/i386.c 2010-02-08 06:08:46.000000000 +0100
+++ gdb-7.1/gdb/features/i386/i386.c 2010-04-03 21:06:12.000000000 +0200
@@ -15,6 +15,25 @@ initialize_tdesc_i386 (void)
set_tdesc_architecture (result, bfd_scan_arch ("i386"));
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
+ tdesc_add_flag (field_type, 0, "CF");
+ tdesc_add_flag (field_type, 1, "");
+ tdesc_add_flag (field_type, 2, "PF");
+ tdesc_add_flag (field_type, 4, "AF");
+ tdesc_add_flag (field_type, 6, "ZF");
+ tdesc_add_flag (field_type, 7, "SF");
+ tdesc_add_flag (field_type, 8, "TF");
+ tdesc_add_flag (field_type, 9, "IF");
+ tdesc_add_flag (field_type, 10, "DF");
+ tdesc_add_flag (field_type, 11, "OF");
+ tdesc_add_flag (field_type, 14, "NT");
+ tdesc_add_flag (field_type, 16, "RF");
+ tdesc_add_flag (field_type, 17, "VM");
+ tdesc_add_flag (field_type, 18, "AC");
+ tdesc_add_flag (field_type, 19, "VIF");
+ tdesc_add_flag (field_type, 20, "VIP");
+ tdesc_add_flag (field_type, 21, "ID");
+
tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
@@ -83,6 +102,22 @@ initialize_tdesc_i386 (void)
field_type = tdesc_named_type (feature, "uint128");
tdesc_add_field (type, "uint128", field_type);
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
+ tdesc_add_flag (field_type, 0, "IE");
+ tdesc_add_flag (field_type, 1, "DE");
+ tdesc_add_flag (field_type, 2, "ZE");
+ tdesc_add_flag (field_type, 3, "OE");
+ tdesc_add_flag (field_type, 4, "UE");
+ tdesc_add_flag (field_type, 5, "PE");
+ tdesc_add_flag (field_type, 6, "DAZ");
+ tdesc_add_flag (field_type, 7, "IM");
+ tdesc_add_flag (field_type, 8, "DM");
+ tdesc_add_flag (field_type, 9, "ZM");
+ tdesc_add_flag (field_type, 10, "OM");
+ tdesc_add_flag (field_type, 11, "UM");
+ tdesc_add_flag (field_type, 12, "PM");
+ tdesc_add_flag (field_type, 15, "FZ");
+
tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128");
tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128");
--- gdb-7.1-p1/gdb/target-descriptions.c 2010-04-03 21:04:13.000000000 +0200
+++ gdb-7.1/gdb/target-descriptions.c 2010-04-03 21:06:12.000000000 +0200
@@ -126,8 +126,6 @@ typedef struct tdesc_type
TDESC_TYPE_IEEE_DOUBLE,
TDESC_TYPE_ARM_FPA_EXT,
TDESC_TYPE_I387_EXT,
- TDESC_TYPE_I386_EFLAGS,
- TDESC_TYPE_I386_MXCSR,
/* Types defined by a target feature. */
TDESC_TYPE_VECTOR,
@@ -483,9 +481,7 @@ static struct tdesc_type tdesc_predefine
{ "ieee_single", TDESC_TYPE_IEEE_SINGLE },
{ "ieee_double", TDESC_TYPE_IEEE_DOUBLE },
{ "arm_fpa_ext", TDESC_TYPE_ARM_FPA_EXT },
- { "i387_ext", TDESC_TYPE_I387_EXT },
- { "i386_eflags", TDESC_TYPE_I386_EFLAGS },
- { "i386_mxcsr", TDESC_TYPE_I386_MXCSR }
+ { "i387_ext", TDESC_TYPE_I387_EXT }
};
/* Return the type associated with ID in the context of FEATURE, or
@@ -607,57 +603,6 @@ tdesc_gdb_type (struct gdbarch *gdbarch,
return arch_float_type (gdbarch, -1, "builtin_type_i387_ext",
floatformats_i387_ext);
- case TDESC_TYPE_I386_EFLAGS:
- {
- struct type *type;
-
- type = arch_flags_type (gdbarch, "builtin_type_i386_eflags", 4);
- append_flags_type_flag (type, 0, "CF");
- append_flags_type_flag (type, 1, NULL);
- append_flags_type_flag (type, 2, "PF");
- append_flags_type_flag (type, 4, "AF");
- append_flags_type_flag (type, 6, "ZF");
- append_flags_type_flag (type, 7, "SF");
- append_flags_type_flag (type, 8, "TF");
- append_flags_type_flag (type, 9, "IF");
- append_flags_type_flag (type, 10, "DF");
- append_flags_type_flag (type, 11, "OF");
- append_flags_type_flag (type, 14, "NT");
- append_flags_type_flag (type, 16, "RF");
- append_flags_type_flag (type, 17, "VM");
- append_flags_type_flag (type, 18, "AC");
- append_flags_type_flag (type, 19, "VIF");
- append_flags_type_flag (type, 20, "VIP");
- append_flags_type_flag (type, 21, "ID");
-
- return type;
- }
- break;
-
- case TDESC_TYPE_I386_MXCSR:
- {
- struct type *type;
-
- type = arch_flags_type (gdbarch, "builtin_type_i386_mxcsr", 4);
- append_flags_type_flag (type, 0, "IE");
- append_flags_type_flag (type, 1, "DE");
- append_flags_type_flag (type, 2, "ZE");
- append_flags_type_flag (type, 3, "OE");
- append_flags_type_flag (type, 4, "UE");
- append_flags_type_flag (type, 5, "PE");
- append_flags_type_flag (type, 6, "DAZ");
- append_flags_type_flag (type, 7, "IM");
- append_flags_type_flag (type, 8, "DM");
- append_flags_type_flag (type, 9, "ZM");
- append_flags_type_flag (type, 10, "OM");
- append_flags_type_flag (type, 11, "UM");
- append_flags_type_flag (type, 12, "PM");
- append_flags_type_flag (type, 15, "FZ");
-
- return type;
- }
- break;
-
/* Types defined by a target feature. */
case TDESC_TYPE_VECTOR:
{
@@ -769,7 +714,8 @@ tdesc_gdb_type (struct gdbarch *gdbarch,
/* Note that contrary to the function name, this call will
just set the properties of an already-allocated
field. */
- append_flags_type_flag (type, f->start, f->name);
+ append_flags_type_flag (type, f->start,
+ *f->name ? f->name : NULL);
return type;
}
@@ -1602,6 +1548,7 @@ maint_print_c_tdesc_cmd (char *args, int
struct tdesc_reg *reg;
struct tdesc_type *type;
struct tdesc_type_field *f;
+ struct tdesc_type_flag *flag;
int ix, ix2, ix3;
/* Use the global target-supplied description, not the current
@@ -1715,6 +1662,18 @@ maint_print_c_tdesc_cmd (char *args, int
f->name);
}
break;
+ case TDESC_TYPE_FLAGS:
+ printf_unfiltered
+ (" field_type = tdesc_create_flags (feature, \"%s\", %d);\n",
+ type->name, (int) type->u.f.size);
+ for (ix3 = 0;
+ VEC_iterate (tdesc_type_flag, type->u.f.flags, ix3,
+ flag);
+ ix3++)
+ printf_unfiltered
+ (" tdesc_add_flag (field_type, %d, \"%s\");\n",
+ flag->start, flag->name);
+ break;
default:
error (_("C output is not supported type \"%s\"."), type->name);
}
++++++ gdb-bz578250-avx-04of10.patch ++++++
++++ 1366 lines (skipped)
++++++ gdb-bz578250-avx-05of10.patch ++++++
[ Backported. ]
commit 6448aace637843e8e7c021d7f8c5d5d5fdd71974
Author: H.J. Lu
Date: Wed Mar 3 20:19:48 2010 +0000
Mention improvement for X86 general purpose registers.
2010-03-03 H.J. Lu
Eli Zaretskii
* NEWS: Add X86 general purpose registers section.
--- gdb-7.1-p3/gdb/NEWS 2010-03-18 22:01:55.000000000 +0100
+++ gdb-7.1/gdb/NEWS 2010-04-03 21:07:46.000000000 +0200
@@ -438,6 +438,14 @@ GDB will now correctly handle all of:
now support hardware watchpoints, and will use them automatically
as appropriate.
+* X86 general purpose registers
+
+ GDB now supports reading/writing byte, word and double-word x86
+ general purpose registers directly. This means you can use, say,
+ $ah or $ax to refer, respectively, to the byte register AH and
+ 16-bit word register AX that are actually portions of the 32-bit
+ register EAX or 64-bit register RAX.
+
* Python scripting
GDB now has support for scripting using Python. Whether this is
++++++ gdb-bz578250-avx-06of10.patch ++++++
[ Backported. ]
commit 49f8d1c24c639d891f58a3b9feda425833b702fb
Author: H.J. Lu
Date: Fri Mar 12 15:12:34 2010 +0000
Restore sp for x86.
2010-03-12 H.J. Lu
* amd64-tdep.c (amd64_word_names): Replace "sp" with "".
* i386-tdep.c (i386_word_names): Likewise.
--- gdb-7.1-p4/gdb/amd64-tdep.c 2010-04-03 21:06:52.000000000 +0200
+++ gdb-7.1/gdb/amd64-tdep.c 2010-04-03 21:08:21.000000000 +0200
@@ -222,7 +222,7 @@ static const char *amd64_byte_names[] =
static const char *amd64_word_names[] =
{
- "ax", "bx", "cx", "dx", "si", "di", "bp", "sp",
+ "ax", "bx", "cx", "dx", "si", "di", "bp", "",
"r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
};
--- gdb-7.1-p4/gdb/i386-tdep.c 2010-04-03 21:06:52.000000000 +0200
+++ gdb-7.1/gdb/i386-tdep.c 2010-04-03 21:08:21.000000000 +0200
@@ -94,7 +94,7 @@ static const char *i386_byte_names[] =
static const char *i386_word_names[] =
{
"ax", "cx", "dx", "bx",
- "sp", "bp", "si", "di"
+ "", "bp", "si", "di"
};
/* MMX register? */
++++++ gdb-bz578250-avx-07of10.patch ++++++
[ Backported. ]
commit d5ea7042210f5ad319ad19910bce13fd5717c6d6
Author: H.J. Lu
Date: Tue Mar 30 15:45:08 2010 +0000
Add xmlRegisters= to qSupported packet.
gdb/
2010-03-30 H.J. Lu
* NEWS: Mention xmlRegisters= in qSupported packet.
* i386-tdep.c: Include "remote.h".
(_initialize_i386_tdep): Call register_remote_support_xml.
* remote.c (remote_support_xml): New.
(register_remote_support_xml): Likewise.
(remote_query_supported_append): Likewise.
(remote_query_supported): Support remote_support_xml.
* remote.h (register_remote_support_xml): New.
gdb/doc/
2010-03-30 H.J. Lu
* gdb.texinfo (General Query Packets): Add xmlRegisters.
--- gdb-7.1-p5/gdb/NEWS 2010-04-03 21:07:46.000000000 +0200
+++ gdb-7.1/gdb/NEWS 2010-04-03 21:10:06.000000000 +0200
@@ -1,6 +1,11 @@
What has changed in GDB?
(Organized release by release)
+*** Changes since GDB 7.1
+
+* GDB now sends xmlRegisters= in qSupported packet to indicate that
+ it understands register description.
+
*** Changes in GDB 7.1
* C++ Improvements
--- gdb-7.1-p5/gdb/doc/gdb.texinfo 2010-04-03 21:04:13.000000000 +0200
+++ gdb-7.1/gdb/doc/gdb.texinfo 2010-04-03 21:09:29.000000000 +0200
@@ -30292,6 +30292,12 @@ extensions to the remote protocol. @val
extensions unless the stub also reports that it supports them by
including @samp{multiprocess+} in its @samp{qSupported} reply.
@xref{multiprocess extensions}, for details.
+
+@item xmlRegisters
+This feature indicates that @value{GDBN} supports the XML target
+description. If the stub sees @samp{xmlRegisters=} with target
+specific strings separated by a comma, it will report register
+description.
@end table
Stubs should ignore any unknown values for
--- gdb-7.1-p5/gdb/i386-tdep.c 2010-04-03 21:08:21.000000000 +0200
+++ gdb-7.1/gdb/i386-tdep.c 2010-04-03 21:09:29.000000000 +0200
@@ -44,6 +44,7 @@
#include "value.h"
#include "dis-asm.h"
#include "disasm.h"
+#include "remote.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -6000,4 +6001,7 @@ is \"default\"."),
/* Initialize the standard target descriptions. */
initialize_tdesc_i386 ();
+
+ /* Tell remote stub that we support XML target description. */
+ register_remote_support_xml ("i386");
}
--- gdb-7.1-p5/gdb/remote.c 2010-04-03 20:24:51.000000000 +0200
+++ gdb-7.1/gdb/remote.c 2010-04-03 21:09:29.000000000 +0200
@@ -3467,6 +3467,53 @@ static struct protocol_feature remote_pr
PACKET_bs },
};
+static char *remote_support_xml;
+
+/* Register string appended to "xmlRegisters=" in qSupported query. */
+
+void
+register_remote_support_xml (const char *xml ATTRIBUTE_UNUSED)
+{
+#if defined(HAVE_LIBEXPAT)
+ if (remote_support_xml == NULL)
+ remote_support_xml = concat ("xmlRegisters=", xml, NULL);
+ else
+ {
+ char *copy = xstrdup (remote_support_xml + 13);
+ char *p = strtok (copy, ",");
+
+ do
+ {
+ if (strcmp (p, xml) == 0)
+ {
+ /* already there */
+ xfree (copy);
+ return;
+ }
+ }
+ while ((p = strtok (NULL, ",")) != NULL);
+ xfree (copy);
+
+ p = concat (remote_support_xml, ",", xml, NULL);
+ xfree (remote_support_xml);
+ remote_support_xml = p;
+ }
+#endif
+}
+
+static char *
+remote_query_supported_append (char *msg, const char *append)
+{
+ if (msg)
+ {
+ char *p = concat (msg, ";", append, NULL);
+ xfree (msg);
+ return p;
+ }
+ else
+ return xstrdup (append);
+}
+
static void
remote_query_supported (void)
{
@@ -3485,24 +3532,27 @@ remote_query_supported (void)
rs->buf[0] = 0;
if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE)
{
+ char *q = NULL;
const char *qsupported = gdbarch_qsupported (target_gdbarch);
+
+ if (rs->extended)
+ q = remote_query_supported_append (q, "multiprocess+");
+
if (qsupported)
+ q = remote_query_supported_append (q, qsupported);
+
+ if (remote_support_xml)
+ q = remote_query_supported_append (q, remote_support_xml);
+
+ if (q)
{
- char *q;
- if (rs->extended)
- q = concat ("qSupported:multiprocess+;", qsupported, NULL);
- else
- q = concat ("qSupported:", qsupported, NULL);
- putpkt (q);
+ char *p = concat ("qSupported:", q, NULL);
xfree (q);
+ putpkt (p);
+ xfree (p);
}
else
- {
- if (rs->extended)
- putpkt ("qSupported:multiprocess+");
- else
- putpkt ("qSupported");
- }
+ putpkt ("qSupported");
getpkt (&rs->buf, &rs->buf_size, 0);
--- gdb-7.1-p5/gdb/remote.h 2010-01-01 08:31:41.000000000 +0100
+++ gdb-7.1/gdb/remote.h 2010-04-03 21:09:29.000000000 +0200
@@ -66,6 +66,7 @@ extern void (*deprecated_target_wait_loo
void register_remote_g_packet_guess (struct gdbarch *gdbarch, int bytes,
const struct target_desc *tdesc);
+void register_remote_support_xml (const char *);
void remote_file_put (const char *local_file, const char *remote_file,
int from_tty);
++++++ gdb-bz578250-avx-08of10.patch ++++++
[ Backported. ]
commit 684341392f3ca6703dc28dac548d3051811bff47
Author: H.J. Lu
Date: Tue Mar 30 18:37:03 2010 +0000
Add org.gnu.gdb.i386.avx.
2010-03-30 H.J. Lu
* gdb.texinfo (i386 Features): Add org.gnu.gdb.i386.avx.
--- gdb-7.1-p6/gdb/doc/gdb.texinfo 2010-04-03 21:09:29.000000000 +0200
+++ gdb-7.1/gdb/doc/gdb.texinfo 2010-04-03 21:10:57.000000000 +0200
@@ -33380,6 +33380,17 @@ describe registers:
@samp{mxcsr}
@end itemize
+The @samp{org.gnu.gdb.i386.avx} feature is optional. It should
+describe the upper 128 bits of @sc{ymm} registers:
+
+@itemize @minus
+@item
+@samp{ymm0h} through @samp{ymm7h} for i386
+@item
+@samp{ymm0h} through @samp{ymm15h} for amd64
+@item
+@end itemize
+
The @samp{org.gnu.gdb.i386.linux} feature is optional. It should
describe a single register, @samp{orig_eax}.
++++++ gdb-bz578250-avx-09of10.patch ++++++
[ Backported. ]
commit 5362e5e1dc4cfac24fbd58773aaa7a82c615b662
Author: H.J. Lu
Date: Thu Apr 1 20:02:07 2010 +0000
Support "ah", "bh", "ch", "dh" on amd64.
gdb/
2010-04-01 H.J. Lu
* amd64-tdep.c (amd64_byte_names): Add "ah", "bh", "ch", "dh".
(AMD64_NUM_LOWER_BYTE_REGS): New.
(amd64_pseudo_register_read): Handle "ah", "bh", "ch", "dh".
(amd64_pseudo_register_write): Likewise.
(amd64_init_abi): Set num_byte_regs to 20.
gdb/testsuite/
2010-04-01 H.J. Lu
* gdb.arch/amd64-byte.exp: Check "ah", "bh", "ch", "dh".
--- gdb-7.1-p7/gdb/amd64-tdep.c 2010-04-03 21:08:21.000000000 +0200
+++ gdb-7.1/gdb/amd64-tdep.c 2010-04-03 21:11:41.000000000 +0200
@@ -215,9 +215,13 @@ amd64_arch_reg_to_regnum (int reg)
static const char *amd64_byte_names[] =
{
"al", "bl", "cl", "dl", "sil", "dil", "bpl", "spl",
- "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l"
+ "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l",
+ "ah", "bh", "ch", "dh"
};
+/* Number of lower byte registers. */
+#define AMD64_NUM_LOWER_BYTE_REGS 16
+
/* Register names for word pseudo-registers. */
static const char *amd64_word_names[] =
@@ -263,8 +267,18 @@ amd64_pseudo_register_read (struct gdbar
int gpnum = regnum - tdep->al_regnum;
/* Extract (always little endian). */
- regcache_raw_read (regcache, gpnum, raw_buf);
- memcpy (buf, raw_buf, 1);
+ if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
+ {
+ /* Special handling for AH, BH, CH, DH. */
+ regcache_raw_read (regcache,
+ gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
+ memcpy (buf, raw_buf + 1, 1);
+ }
+ else
+ {
+ regcache_raw_read (regcache, gpnum, raw_buf);
+ memcpy (buf, raw_buf, 1);
+ }
}
else if (i386_dword_regnum_p (gdbarch, regnum))
{
@@ -289,12 +303,26 @@ amd64_pseudo_register_write (struct gdba
{
int gpnum = regnum - tdep->al_regnum;
- /* Read ... */
- regcache_raw_read (regcache, gpnum, raw_buf);
- /* ... Modify ... (always little endian). */
- memcpy (raw_buf, buf, 1);
- /* ... Write. */
- regcache_raw_write (regcache, gpnum, raw_buf);
+ if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
+ {
+ /* Read ... AH, BH, CH, DH. */
+ regcache_raw_read (regcache,
+ gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
+ /* ... Modify ... (always little endian). */
+ memcpy (raw_buf + 1, buf, 1);
+ /* ... Write. */
+ regcache_raw_write (regcache,
+ gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
+ }
+ else
+ {
+ /* Read ... */
+ regcache_raw_read (regcache, gpnum, raw_buf);
+ /* ... Modify ... (always little endian). */
+ memcpy (raw_buf, buf, 1);
+ /* ... Write. */
+ regcache_raw_write (regcache, gpnum, raw_buf);
+ }
}
else if (i386_dword_regnum_p (gdbarch, regnum))
{
@@ -2233,7 +2261,7 @@ amd64_init_abi (struct gdbarch_info info
tdep->num_core_regs = AMD64_NUM_GREGS + I387_NUM_REGS;
tdep->register_names = amd64_register_names;
- tdep->num_byte_regs = 16;
+ tdep->num_byte_regs = 20;
tdep->num_word_regs = 16;
tdep->num_dword_regs = 16;
/* Avoid wiring in the MMX registers for now. */
--- gdb-7.1-p7/gdb/testsuite/gdb.arch/amd64-byte.exp 2010-04-03 21:06:52.000000000 +0200
+++ gdb-7.1/gdb/testsuite/gdb.arch/amd64-byte.exp 2010-04-03 21:11:41.000000000 +0200
@@ -52,7 +52,6 @@ if ![runto_main] then {
gdb_suppress_tests
}
-set nr_regs 14
set byte_regs(1) al
set byte_regs(2) bl
set byte_regs(3) cl
@@ -67,6 +66,10 @@ set byte_regs(11) r12l
set byte_regs(12) r13l
set byte_regs(13) r14l
set byte_regs(14) r15l
+set byte_regs(15) ah
+set byte_regs(16) bh
+set byte_regs(17) ch
+set byte_regs(18) dh
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
@@ -79,12 +82,19 @@ for { set r 1 } { $r <= 6 } { incr r }
"check contents of %$byte_regs($r)"
}
+for { set r 1 } { $r <= 4 } { incr r } {
+ set h [expr $r + 14]
+ gdb_test "print/x \$$byte_regs($h)" \
+ ".. = 0x[format %x $r]2" \
+ "check contents of %$byte_regs($h)"
+}
+
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set second breakpoint in main"
gdb_continue_to_breakpoint "continue to second breakpoint in main"
-for { set r 7 } { $r <= $nr_regs } { incr r } {
+for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "print/x \$$byte_regs($r)" \
".. = 0x[format %x $r]1" \
"check contents of %$byte_regs($r)"
@@ -94,6 +104,11 @@ for { set r 1 } { $r <= 6 } { incr r }
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
}
+for { set r 1 } { $r <= 4 } { incr r } {
+ set h [expr $r + 14]
+ gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
+}
+
gdb_test "break [gdb_get_line_number "third breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set third breakpoint in main"
@@ -105,7 +120,14 @@ for { set r 1 } { $r <= 6 } { incr r }
"check contents of %$byte_regs($r)"
}
-for { set r 7 } { $r <= $nr_regs } { incr r } {
+for { set r 1 } { $r <= 4 } { incr r } {
+ set h [expr $r + 14]
+ gdb_test "print \$$byte_regs($h)" \
+ ".. = $h" \
+ "check contents of %$byte_regs($h)"
+}
+
+for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
}
@@ -114,7 +136,7 @@ gdb_test "break [gdb_get_line_number "fo
"set forth breakpoint in main"
gdb_continue_to_breakpoint "continue to forth breakpoint in main"
-for { set r 7 } { $r <= $nr_regs } { incr r } {
+for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "print \$$byte_regs($r)" \
".. = $r" \
"check contents of %$byte_regs($r)"
++++++ gdb-bz578250-avx-10of10-ppc.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-04/msg00056.html
linux-ppc-low.c:599: error: incompatible types when initializing type ‘enum regset_type’ using type ‘void (*)(struct regcache *, void *)’
linux-ppc-low.c:599: warning: initialization from incompatible pointer type
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -594,7 +594,7 @@ struct regset_info target_regsets[] = {
PPC_PTRACE_GETREGS. */
{ PTRACE_GETVSXREGS, PTRACE_SETVSXREGS, 0, SIZEOF_VSXREGS, EXTENDED_REGS,
ppc_fill_vsxregset, ppc_store_vsxregset },
- { PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, EXTENDED_REGS,
+ { PTRACE_GETVRREGS, PTRACE_SETVRREGS, 0, SIZEOF_VRREGS, EXTENDED_REGS,
ppc_fill_vrregset, ppc_store_vrregset },
{ PTRACE_GETEVRREGS, PTRACE_SETEVRREGS, 0, 32 * 4 + 8 + 4, EXTENDED_REGS,
ppc_fill_evrregset, ppc_store_evrregset },
++++++ gdb-bz578250-avx-10of10.patch ++++++
++++ 8271 lines (skipped)
++++++ gdb-ccache-workaround.patch ++++++
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -33,6 +33,14 @@ if [test_compiler_info gcc*] {
lappend options additional_flags=-g3
}
+# Workaround ccache making lineno non-zero for command-line definitions.
+if {[find_gcc] == "gcc" && [file executable "/usr/bin/gcc"]} {
+ set result [catch "exec which gcc" output]
+ if {$result == 0 && [string first "/ccache/" $output] >= -1} {
+ lappend options "compiler=/usr/bin/gcc"
+ }
+}
+
# Generate the intermediate object file. This is required by Darwin to
# have access to the .debug_macinfo section.
if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \
++++++ gdb-fortran-common-reduce.patch ++++++
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -55,20 +55,6 @@ typedef struct saved_bf_symnum SAVED_BF, *SAVED_BF_PTR;
/* Local functions */
extern void _initialize_f_language (void);
-#if 0
-static void clear_function_list (void);
-static long get_bf_for_fcn (long);
-static void clear_bf_list (void);
-static void patch_all_commons_by_name (char *, CORE_ADDR, int);
-static SAVED_F77_COMMON_PTR find_first_common_named (char *);
-static void add_common_entry (struct symbol *);
-static void add_common_block (char *, CORE_ADDR, int, char *);
-static SAVED_FUNCTION *allocate_saved_function_node (void);
-static SAVED_BF_PTR allocate_saved_bf_node (void);
-static COMMON_ENTRY_PTR allocate_common_entry_node (void);
-static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node (void);
-static void patch_common_entries (SAVED_F77_COMMON_PTR, CORE_ADDR, int);
-#endif
static void f_printchar (int c, struct type *type, struct ui_file * stream);
static void f_emit_char (int c, struct type *type,
@@ -419,185 +405,7 @@ _initialize_f_language (void)
add_language (&f_language_defn);
}
-#if 0
-static SAVED_BF_PTR
-allocate_saved_bf_node (void)
-{
- SAVED_BF_PTR new;
-
- new = (SAVED_BF_PTR) xmalloc (sizeof (SAVED_BF));
- return (new);
-}
-
-static SAVED_FUNCTION *
-allocate_saved_function_node (void)
-{
- SAVED_FUNCTION *new;
-
- new = (SAVED_FUNCTION *) xmalloc (sizeof (SAVED_FUNCTION));
- return (new);
-}
-
-static SAVED_F77_COMMON_PTR
-allocate_saved_f77_common_node (void)
-{
- SAVED_F77_COMMON_PTR new;
-
- new = (SAVED_F77_COMMON_PTR) xmalloc (sizeof (SAVED_F77_COMMON));
- return (new);
-}
-
-static COMMON_ENTRY_PTR
-allocate_common_entry_node (void)
-{
- COMMON_ENTRY_PTR new;
-
- new = (COMMON_ENTRY_PTR) xmalloc (sizeof (COMMON_ENTRY));
- return (new);
-}
-#endif
-
SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON */
-SAVED_F77_COMMON_PTR tail_common_list = NULL; /* Ptr to last saved COMMON */
-SAVED_F77_COMMON_PTR current_common = NULL; /* Ptr to current COMMON */
-
-#if 0
-static SAVED_BF_PTR saved_bf_list = NULL; /* Ptr to (.bf,function)
- list */
-static SAVED_BF_PTR saved_bf_list_end = NULL; /* Ptr to above list's end */
-static SAVED_BF_PTR current_head_bf_list = NULL; /* Current head of above list
- */
-
-static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use
- in macros */
-
-/* The following function simply enters a given common block onto
- the global common block chain */
-
-static void
-add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
-{
- SAVED_F77_COMMON_PTR tmp;
- char *c, *local_copy_func_stab;
-
- /* If the COMMON block we are trying to add has a blank
- name (i.e. "#BLNK_COM") then we set it to __BLANK
- because the darn "#" character makes GDB's input
- parser have fits. */
-
-
- if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0
- || strcmp (name, BLANK_COMMON_NAME_MF77) == 0)
- {
-
- xfree (name);
- name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
- strcpy (name, BLANK_COMMON_NAME_LOCAL);
- }
-
- tmp = allocate_saved_f77_common_node ();
-
- local_copy_func_stab = xmalloc (strlen (func_stab) + 1);
- strcpy (local_copy_func_stab, func_stab);
-
- tmp->name = xmalloc (strlen (name) + 1);
-
- /* local_copy_func_stab is a stabstring, let us first extract the
- function name from the stab by NULLing out the ':' character. */
-
-
- c = NULL;
- c = strchr (local_copy_func_stab, ':');
-
- if (c)
- *c = '\0';
- else
- error (_("Malformed function STAB found in add_common_block()"));
-
-
- tmp->owning_function = xmalloc (strlen (local_copy_func_stab) + 1);
-
- strcpy (tmp->owning_function, local_copy_func_stab);
-
- strcpy (tmp->name, name);
- tmp->offset = offset;
- tmp->next = NULL;
- tmp->entries = NULL;
- tmp->secnum = secnum;
-
- current_common = tmp;
-
- if (head_common_list == NULL)
- {
- head_common_list = tail_common_list = tmp;
- }
- else
- {
- tail_common_list->next = tmp;
- tail_common_list = tmp;
- }
-}
-#endif
-
-/* The following function simply enters a given common entry onto
- the "current_common" block that has been saved away. */
-
-#if 0
-static void
-add_common_entry (struct symbol *entry_sym_ptr)
-{
- COMMON_ENTRY_PTR tmp;
-
-
-
- /* The order of this list is important, since
- we expect the entries to appear in decl.
- order when we later issue "info common" calls */
-
- tmp = allocate_common_entry_node ();
-
- tmp->next = NULL;
- tmp->symbol = entry_sym_ptr;
-
- if (current_common == NULL)
- error (_("Attempt to add COMMON entry with no block open!"));
- else
- {
- if (current_common->entries == NULL)
- {
- current_common->entries = tmp;
- current_common->end_of_entries = tmp;
- }
- else
- {
- current_common->end_of_entries->next = tmp;
- current_common->end_of_entries = tmp;
- }
- }
-}
-#endif
-
-/* This routine finds the first encountred COMMON block named "name" */
-
-#if 0
-static SAVED_F77_COMMON_PTR
-find_first_common_named (char *name)
-{
-
- SAVED_F77_COMMON_PTR tmp;
-
- tmp = head_common_list;
-
- while (tmp != NULL)
- {
- if (strcmp (tmp->name, name) == 0)
- return (tmp);
- else
- tmp = tmp->next;
- }
- return (NULL);
-}
-#endif
/* This routine finds the first encountred COMMON block named "name"
that belongs to function funcname */
@@ -620,193 +428,3 @@ find_common_for_function (char *name, char *funcname)
}
return (NULL);
}
-
-
-#if 0
-
-/* The following function is called to patch up the offsets
- for the statics contained in the COMMON block named
- "name." */
-
-static void
-patch_common_entries (SAVED_F77_COMMON_PTR blk, CORE_ADDR offset, int secnum)
-{
- COMMON_ENTRY_PTR entry;
-
- blk->offset = offset; /* Keep this around for future use. */
-
- entry = blk->entries;
-
- while (entry != NULL)
- {
- SYMBOL_VALUE (entry->symbol) += offset;
- SYMBOL_SECTION (entry->symbol) = secnum;
-
- entry = entry->next;
- }
- blk->secnum = secnum;
-}
-
-/* Patch all commons named "name" that need patching.Since COMMON
- blocks occur with relative infrequency, we simply do a linear scan on
- the name. Eventually, the best way to do this will be a
- hashed-lookup. Secnum is the section number for the .bss section
- (which is where common data lives). */
-
-static void
-patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum)
-{
-
- SAVED_F77_COMMON_PTR tmp;
-
- /* For blank common blocks, change the canonical reprsentation
- of a blank name */
-
- if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0
- || strcmp (name, BLANK_COMMON_NAME_MF77) == 0)
- {
- xfree (name);
- name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
- strcpy (name, BLANK_COMMON_NAME_LOCAL);
- }
-
- tmp = head_common_list;
-
- while (tmp != NULL)
- {
- if (COMMON_NEEDS_PATCHING (tmp))
- if (strcmp (tmp->name, name) == 0)
- patch_common_entries (tmp, offset, secnum);
-
- tmp = tmp->next;
- }
-}
-#endif
-
-/* This macro adds the symbol-number for the start of the function
- (the symbol number of the .bf) referenced by symnum_fcn to a
- list. This list, in reality should be a FIFO queue but since
- #line pragmas sometimes cause line ranges to get messed up
- we simply create a linear list. This list can then be searched
- first by a queueing algorithm and upon failure fall back to
- a linear scan. */
-
-#if 0
-#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
- \
- if (saved_bf_list == NULL) \
-{ \
- tmp_bf_ptr = allocate_saved_bf_node(); \
- \
- tmp_bf_ptr->symnum_bf = (bf_sym); \
- tmp_bf_ptr->symnum_fcn = (fcn_sym); \
- tmp_bf_ptr->next = NULL; \
- \
- current_head_bf_list = saved_bf_list = tmp_bf_ptr; \
- saved_bf_list_end = tmp_bf_ptr; \
- } \
-else \
-{ \
- tmp_bf_ptr = allocate_saved_bf_node(); \
- \
- tmp_bf_ptr->symnum_bf = (bf_sym); \
- tmp_bf_ptr->symnum_fcn = (fcn_sym); \
- tmp_bf_ptr->next = NULL; \
- \
- saved_bf_list_end->next = tmp_bf_ptr; \
- saved_bf_list_end = tmp_bf_ptr; \
- }
-#endif
-
-/* This function frees the entire (.bf,function) list */
-
-#if 0
-static void
-clear_bf_list (void)
-{
-
- SAVED_BF_PTR tmp = saved_bf_list;
- SAVED_BF_PTR next = NULL;
-
- while (tmp != NULL)
- {
- next = tmp->next;
- xfree (tmp);
- tmp = next;
- }
- saved_bf_list = NULL;
-}
-#endif
-
-int global_remote_debug;
-
-#if 0
-
-static long
-get_bf_for_fcn (long the_function)
-{
- SAVED_BF_PTR tmp;
- int nprobes = 0;
-
- /* First use a simple queuing algorithm (i.e. look and see if the
- item at the head of the queue is the one you want) */
-
- if (saved_bf_list == NULL)
- internal_error (__FILE__, __LINE__,
- _("cannot get .bf node off empty list"));
-
- if (current_head_bf_list != NULL)
- if (current_head_bf_list->symnum_fcn == the_function)
- {
- if (global_remote_debug)
- fprintf_unfiltered (gdb_stderr, "*");
-
- tmp = current_head_bf_list;
- current_head_bf_list = current_head_bf_list->next;
- return (tmp->symnum_bf);
- }
-
- /* If the above did not work (probably because #line directives were
- used in the sourcefile and they messed up our internal tables) we now do
- the ugly linear scan */
-
- if (global_remote_debug)
- fprintf_unfiltered (gdb_stderr, "\ndefaulting to linear scan\n");
-
- nprobes = 0;
- tmp = saved_bf_list;
- while (tmp != NULL)
- {
- nprobes++;
- if (tmp->symnum_fcn == the_function)
- {
- if (global_remote_debug)
- fprintf_unfiltered (gdb_stderr, "Found in %d probes\n", nprobes);
- current_head_bf_list = tmp->next;
- return (tmp->symnum_bf);
- }
- tmp = tmp->next;
- }
-
- return (-1);
-}
-
-static SAVED_FUNCTION_PTR saved_function_list = NULL;
-static SAVED_FUNCTION_PTR saved_function_list_end = NULL;
-
-static void
-clear_function_list (void)
-{
- SAVED_FUNCTION_PTR tmp = saved_function_list;
- SAVED_FUNCTION_PTR next = NULL;
-
- while (tmp != NULL)
- {
- next = tmp->next;
- xfree (tmp);
- tmp = next;
- }
-
- saved_function_list = NULL;
-}
-#endif
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -71,14 +71,9 @@ typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR;
typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */
-extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */
-extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */
extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
-#define UNINITIALIZED_SECNUM -1
-#define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM)
-
#define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */
#define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */
#define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -35,10 +35,6 @@
#include "command.h"
#include "block.h"
-#if 0
-static int there_is_a_visible_common_named (char *);
-#endif
-
extern void _initialize_f_valprint (void);
static void info_common_command (char *, int);
static void list_all_visible_commons (char *);
@@ -578,67 +574,6 @@ info_common_command (char *comname, int from_tty)
comname, funname);
}
-/* This function is used to determine whether there is a
- F77 common block visible at the current scope called 'comname'. */
-
-#if 0
-static int
-there_is_a_visible_common_named (char *comname)
-{
- SAVED_F77_COMMON_PTR the_common;
- struct frame_info *fi;
- char *funname = 0;
- struct symbol *func;
-
- if (comname == NULL)
- error (_("Cannot deal with NULL common name!"));
-
- fi = get_selected_frame (_("No frame selected"));
-
- /* The following is generally ripped off from stack.c's routine
- print_frame_info() */
-
- func = find_pc_function (fi->pc);
- if (func)
- {
- /* In certain pathological cases, the symtabs give the wrong
- function (when we are in the first function in a file which
- is compiled without debugging symbols, the previous function
- is compiled with debugging symbols, and the "foo.o" symbol
- that is supposed to tell us where the file with debugging symbols
- ends has been truncated by ar because it is longer than 15
- characters).
-
- So look in the minimal symbol tables as well, and if it comes
- up with a larger address for the function use that instead.
- I don't think this can ever cause any problems; there shouldn't
- be any minimal symbols in the middle of a function.
- FIXME: (Not necessarily true. What about text labels) */
-
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
-
- if (msymbol != NULL
- && (SYMBOL_VALUE_ADDRESS (msymbol)
- > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
- funname = SYMBOL_LINKAGE_NAME (msymbol);
- else
- funname = SYMBOL_LINKAGE_NAME (func);
- }
- else
- {
- struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (fi->pc);
-
- if (msymbol != NULL)
- funname = SYMBOL_LINKAGE_NAME (msymbol);
- }
-
- the_common = find_common_for_function (comname, funname);
-
- return (the_common ? 1 : 0);
-}
-#endif
-
void
_initialize_f_valprint (void)
{
++++++ gdb-fortran-common.patch ++++++
Index: gdb-7.0.50.20100128/gdb/dwarf2read.c
===================================================================
--- gdb-7.0.50.20100128.orig/gdb/dwarf2read.c 2010-01-28 12:53:37.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/dwarf2read.c 2010-01-28 12:54:34.000000000 +0100
@@ -5818,12 +5818,14 @@ read_set_type (struct die_info *die, str
return set_die_type (die, set_type, cu);
}
-/* First cut: install each common block member as a global variable. */
+/* Create appropriate locally-scoped variables for all the DW_TAG_common_block
+ entries. Create also TYPE_CODE_STRUCT listing all such variables to be
+ available for `info common'. COMMON_BLOCK_DOMAIN is used to sepate the
+ common blocks name namespace from regular variable names. */
static void
read_common_block (struct die_info *die, struct dwarf2_cu *cu)
{
- struct die_info *child_die;
struct attribute *attr;
struct symbol *sym;
CORE_ADDR base = (CORE_ADDR) 0;
@@ -5848,10 +5850,40 @@ read_common_block (struct die_info *die,
}
if (die->child != NULL)
{
+ struct objfile *objfile = cu->objfile;
+ struct die_info *child_die;
+ struct type *type;
+ struct field *field;
+ char *name;
+ struct symbol *sym;
+
+ type = alloc_type (objfile);
+ TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ /* Artificial type to be used only by `info common'. */
+ TYPE_NAME (type) = "<common>";
+
+ child_die = die->child;
+ while (child_die && child_die->tag)
+ {
+ TYPE_NFIELDS (type)++;
+ child_die = sibling_die (child_die);
+ }
+
+ TYPE_FIELDS (type) = obstack_alloc (&objfile->objfile_obstack,
+ sizeof (*TYPE_FIELDS (type))
+ * TYPE_NFIELDS (type));
+ memset (TYPE_FIELDS (type), 0, sizeof (*TYPE_FIELDS (type))
+ * TYPE_NFIELDS (type));
+
+ field = TYPE_FIELDS (type);
child_die = die->child;
while (child_die && child_die->tag)
{
+ /* 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 (attr)
{
@@ -5869,8 +5901,25 @@ read_common_block (struct die_info *die,
SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset;
add_symbol_to_list (sym, &global_symbols);
}
+
+ if (SYMBOL_CLASS (sym) == LOC_STATIC)
+ SET_FIELD_PHYSADDR (*field, SYMBOL_VALUE_ADDRESS (sym));
+ else
+ SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym));
+ FIELD_TYPE (*field) = SYMBOL_TYPE (sym);
+ FIELD_NAME (*field) = SYMBOL_NATURAL_NAME (sym);
+ field++;
child_die = sibling_die (child_die);
}
+
+ /* TYPE_LENGTH (type) is left 0 - it is only a virtual structure even
+ with no consecutive address space. */
+
+ sym = new_symbol (die, type, cu);
+ /* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */
+ SYMBOL_VALUE_ADDRESS (sym) = base;
+
+ set_die_type (die, type, cu);
}
}
@@ -9061,6 +9110,13 @@ new_symbol (struct die_info *die, struct
{
var_decode_location (attr, sym, cu);
attr2 = dwarf2_attr (die, DW_AT_external, cu);
+
+ /* Fortran explicitly imports any global symbols to the local
+ scope by DW_TAG_common_block. */
+ if (cu->language == language_fortran && die->parent
+ && die->parent->tag == DW_TAG_common_block)
+ attr2 = NULL;
+
if (attr2 && (DW_UNSND (attr2) != 0))
{
struct pending **list_to_add;
@@ -9245,6 +9301,11 @@ new_symbol (struct die_info *die, struct
SYMBOL_DOMAIN (sym) = MODULE_DOMAIN;
add_symbol_to_list (sym, &global_symbols);
break;
+ case DW_TAG_common_block:
+ SYMBOL_CLASS (sym) = LOC_STATIC;
+ SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
+ add_symbol_to_list (sym, cu->list_in_scope);
+ break;
default:
/* Not a tag we recognize. Hopefully we aren't processing
trash data, but since we must specifically ignore things
Index: gdb-7.0.50.20100128/gdb/f-lang.c
===================================================================
--- gdb-7.0.50.20100128.orig/gdb/f-lang.c 2010-01-28 12:53:38.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/f-lang.c 2010-01-28 12:53:46.000000000 +0100
@@ -446,27 +446,3 @@ _initialize_f_language (void)
add_language (&f_language_defn);
}
-
-SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON */
-
-/* This routine finds the first encountred COMMON block named "name"
- that belongs to function funcname */
-
-SAVED_F77_COMMON_PTR
-find_common_for_function (char *name, char *funcname)
-{
-
- SAVED_F77_COMMON_PTR tmp;
-
- tmp = head_common_list;
-
- while (tmp != NULL)
- {
- if (strcmp (tmp->name, name) == 0
- && strcmp (tmp->owning_function, funcname) == 0)
- return (tmp);
- else
- tmp = tmp->next;
- }
- return (NULL);
-}
Index: gdb-7.0.50.20100128/gdb/f-lang.h
===================================================================
--- gdb-7.0.50.20100128.orig/gdb/f-lang.h 2010-01-28 12:53:38.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/f-lang.h 2010-01-28 12:53:46.000000000 +0100
@@ -51,36 +51,8 @@ enum f90_range_type
NONE_BOUND_DEFAULT /* "(low:high)" */
};
-struct common_entry
- {
- struct symbol *symbol; /* The symbol node corresponding
- to this component */
- struct common_entry *next; /* The next component */
- };
-
-struct saved_f77_common
- {
- char *name; /* Name of COMMON */
- char *owning_function; /* Name of parent function */
- int secnum; /* Section # of .bss */
- CORE_ADDR offset; /* Offset from .bss for
- this block */
- struct common_entry *entries; /* List of block's components */
- struct common_entry *end_of_entries; /* ptr. to end of components */
- struct saved_f77_common *next; /* Next saved COMMON block */
- };
-
-typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR;
-
-typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
-
-extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */
-
-extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
-
#define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */
#define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */
-#define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */
/* 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.0.50.20100128/gdb/f-valprint.c
===================================================================
--- gdb-7.0.50.20100128.orig/gdb/f-valprint.c 2010-01-28 12:53:38.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/f-valprint.c 2010-01-28 12:53:46.000000000 +0100
@@ -34,6 +34,8 @@
#include "gdbcore.h"
#include "command.h"
#include "block.h"
+#include "dictionary.h"
+#include "gdb_assert.h"
extern void _initialize_f_valprint (void);
static void info_common_command (char *, int);
@@ -476,22 +478,54 @@ f_val_print (struct type *type, const gd
return 0;
}
-static void
-list_all_visible_commons (char *funname)
+static int
+info_common_command_for_block (struct block *block, struct frame_info *frame,
+ const char *comname)
{
- SAVED_F77_COMMON_PTR tmp;
-
- tmp = head_common_list;
+ struct dict_iterator iter;
+ struct symbol *sym;
+ int values_printed = 0;
+ const char *name;
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
+
+ ALL_BLOCK_SYMBOLS (block, iter, sym)
+ if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
+ {
+ struct type *type = SYMBOL_TYPE (sym);
+ int index;
+
+ gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC);
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT);
+
+ if (comname && (!SYMBOL_LINKAGE_NAME (sym)
+ || strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0))
+ continue;
+
+ values_printed = 1;
+ if (SYMBOL_PRINT_NAME (sym))
+ printf_filtered (_("Contents of F77 COMMON block '%s':\n"),
+ SYMBOL_PRINT_NAME (sym));
+ else
+ printf_filtered (_("Contents of blank COMMON block:\n"));
+
+ for (index = 0; index < TYPE_NFIELDS (type); index++)
+ {
+ struct value *val;
+
+ gdb_assert (field_is_static (&TYPE_FIELD (type, index)));
+ val = value_static_field (type, index);
+
+ printf_filtered ("%s = ", TYPE_FIELD_NAME (type, index));
+ value_print (val, gdb_stdout, &opts);
+ putchar_filtered ('\n');
+ }
- printf_filtered (_("All COMMON blocks visible at this level:\n\n"));
+ putchar_filtered ('\n');
+ }
- while (tmp != NULL)
- {
- if (strcmp (tmp->owning_function, funname) == 0)
- printf_filtered ("%s\n", tmp->name);
-
- tmp = tmp->next;
- }
+ return values_printed;
}
/* This function is used to print out the values in a given COMMON
@@ -501,11 +535,9 @@ list_all_visible_commons (char *funname)
static void
info_common_command (char *comname, int from_tty)
{
- SAVED_F77_COMMON_PTR the_common;
- COMMON_ENTRY_PTR entry;
struct frame_info *fi;
- char *funname = 0;
- struct symbol *func;
+ struct block *block;
+ int values_printed = 0;
/* We have been told to display the contents of F77 COMMON
block supposedly visible in this function. Let us
@@ -517,74 +549,31 @@ info_common_command (char *comname, int
/* The following is generally ripped off from stack.c's routine
print_frame_info() */
- func = find_pc_function (get_frame_pc (fi));
- if (func)
+ block = get_frame_block (fi, 0);
+ if (block == NULL)
{
- /* In certain pathological cases, the symtabs give the wrong
- function (when we are in the first function in a file which
- is compiled without debugging symbols, the previous function
- is compiled with debugging symbols, and the "foo.o" symbol
- that is supposed to tell us where the file with debugging symbols
- ends has been truncated by ar because it is longer than 15
- characters).
-
- So look in the minimal symbol tables as well, and if it comes
- up with a larger address for the function use that instead.
- I don't think this can ever cause any problems; there shouldn't
- be any minimal symbols in the middle of a function.
- FIXME: (Not necessarily true. What about text labels) */
-
- struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (get_frame_pc (fi));
-
- if (msymbol != NULL
- && (SYMBOL_VALUE_ADDRESS (msymbol)
- > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
- funname = SYMBOL_LINKAGE_NAME (msymbol);
- else
- funname = SYMBOL_LINKAGE_NAME (func);
- }
- else
- {
- struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (get_frame_pc (fi));
-
- if (msymbol != NULL)
- funname = SYMBOL_LINKAGE_NAME (msymbol);
- else /* Got no 'funname', code below will fail. */
- error (_("No function found for frame."));
+ printf_filtered (_("No symbol table info available.\n"));
+ return;
}
- /* If comname is NULL, we assume the user wishes to see the
- which COMMON blocks are visible here and then return */
-
- if (comname == 0)
+ while (block)
{
- list_all_visible_commons (funname);
- return;
+ if (info_common_command_for_block (block, fi, comname))
+ values_printed = 1;
+ /* After handling the function's top-level block, stop. Don't
+ continue to its superblock, the block of per-file symbols. */
+ if (BLOCK_FUNCTION (block))
+ break;
+ block = BLOCK_SUPERBLOCK (block);
}
- the_common = find_common_for_function (comname, funname);
-
- if (the_common)
+ if (!values_printed)
{
- if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0)
- printf_filtered (_("Contents of blank COMMON block:\n"));
+ if (comname)
+ printf_filtered (_("No common block '%s'.\n"), comname);
else
- printf_filtered (_("Contents of F77 COMMON block '%s':\n"), comname);
-
- printf_filtered ("\n");
- entry = the_common->entries;
-
- while (entry != NULL)
- {
- print_variable_and_value (NULL, entry->symbol, fi, gdb_stdout, 0);
- entry = entry->next;
- }
+ printf_filtered (_("No common blocks.\n"));
}
- else
- printf_filtered (_("Cannot locate the common block %s in function '%s'\n"),
- comname, funname);
}
void
Index: gdb-7.0.50.20100128/gdb/stack.c
===================================================================
--- gdb-7.0.50.20100128.orig/gdb/stack.c 2010-01-28 12:52:19.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/stack.c 2010-01-28 12:53:46.000000000 +0100
@@ -1474,6 +1474,8 @@ print_block_frame_locals (struct block *
case LOC_COMPUTED:
if (SYMBOL_IS_ARGUMENT (sym))
break;
+ if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
+ break;
values_printed = 1;
print_variable_and_value (NULL, sym, frame, stream, 4 * num_tabs);
break;
Index: gdb-7.0.50.20100128/gdb/symtab.h
===================================================================
--- gdb-7.0.50.20100128.orig/gdb/symtab.h 2010-01-28 12:52:20.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/symtab.h 2010-01-28 12:53:46.000000000 +0100
@@ -401,7 +401,10 @@ typedef enum domain_enum_tag
TYPES_DOMAIN,
/* Fortran module. Their naming must be separate. */
- MODULE_DOMAIN
+ MODULE_DOMAIN,
+
+ /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. */
+ COMMON_BLOCK_DOMAIN
}
domain_enum;
Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.fortran/common-block.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100128/gdb/testsuite/gdb.fortran/common-block.exp 2010-01-28 12:53:46.000000000 +0100
@@ -0,0 +1,101 @@
+# Copyright 2008 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil .
+
+set testfile "common-block"
+set srcfile ${testfile}.f90
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto MAIN__] then {
+ perror "couldn't run to breakpoint MAIN__"
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "stop-here-out"]
+gdb_continue_to_breakpoint "stop-here-out"
+
+# Common block naming with source name /foo/:
+# .symtab DW_TAG_common_block's DW_AT_name
+# Intel Fortran foo_ foo_
+# GNU Fortran foo_ foo
+#set suffix "_"
+set suffix ""
+
+set int4 {(integer\(kind=4\)|INTEGER\(4\))}
+set real4 {(real\(kind=4\)|REAL\(4\))}
+set real8 {(real\(kind=8\)|REAL\(8\))}
+
+gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context."
+gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context."
+gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context."
+gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
+gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
+gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
+
+gdb_test "info locals" "ix_x = 11\r\niy_y = 22\r\niz_z = 33\r\nix = 1\r\niy = 2\r\niz = 3" "info locals out"
+gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix = 1\r\niy = 2\r\niz = 3" "info common out"
+
+gdb_test "ptype ix" "type = $int4" "ptype ix out"
+gdb_test "ptype iy" "type = $real4" "ptype iy out"
+gdb_test "ptype iz" "type = $real8" "ptype iz out"
+gdb_test "ptype ix_x" "type = $int4" "ptype ix_x out"
+gdb_test "ptype iy_y" "type = $real4" "ptype iy_y out"
+gdb_test "ptype iz_z" "type = $real8" "ptype iz_z out"
+
+gdb_test "p ix" " = 1 *" "p ix out"
+gdb_test "p iy" " = 2 *" "p iy out"
+gdb_test "p iz" " = 3 *" "p iz out"
+gdb_test "p ix_x" " = 11 *" "p ix_x out"
+gdb_test "p iy_y" " = 22 *" "p iy_y out"
+gdb_test "p iz_z" " = 33 *" "p iz_z out"
+
+gdb_breakpoint [gdb_get_line_number "stop-here-in"]
+gdb_continue_to_breakpoint "stop-here-in"
+
+gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context." "whatis foo$suffix in"
+gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context." "ptype foo$suffix in"
+gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context." "p foo$suffix in"
+gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "whatis fo_o$suffix in"
+gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "ptype fo_o$suffix in"
+gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "p fo_o$suffix in"
+
+gdb_test "info locals" "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niy = 5\r\niz_z = 55" "info locals in"
+gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix = 11\r\niy2 = 22\r\niz = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3" "info common in"
+
+gdb_test "ptype ix" "type = $int4" "ptype ix in"
+gdb_test "ptype iy2" "type = $real4" "ptype iy2 in"
+gdb_test "ptype iz" "type = $real8" "ptype iz in"
+gdb_test "ptype ix_x" "type = $int4" "ptype ix_x in"
+gdb_test "ptype iy_y" "type = $real4" "ptype iy_y in"
+gdb_test "ptype iz_z2" "type = $real8" "ptype iz_z2 in"
+
+gdb_test "p ix" " = 11 *" "p ix in"
+gdb_test "p iy2" " = 22 *" "p iy2 in"
+gdb_test "p iz" " = 33 *" "p iz in"
+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.0.50.20100128/gdb/testsuite/gdb.fortran/common-block.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100128/gdb/testsuite/gdb.fortran/common-block.f90 2010-01-28 12:53:46.000000000 +0100
@@ -0,0 +1,67 @@
+! Copyright 2008 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 2 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, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek .
+! Modified for the GDB testcase by Jan Kratochvil .
+
+subroutine in
+
+ INTEGER*4 ix
+ REAL*4 iy2
+ REAL*8 iz
+
+ INTEGER*4 ix_x
+ REAL*4 iy_y
+ REAL*8 iz_z2
+
+ common /fo_o/ix,iy2,iz
+ common /foo/ix_x,iy_y,iz_z2
+
+ iy = 5
+ iz_z = 55
+
+ if (ix .ne. 11 .or. iy2 .ne. 22.0 .or. iz .ne. 33.0) call abort
+ if (ix_x .ne. 1 .or. iy_y .ne. 2.0 .or. iz_z2 .ne. 3.0) call abort
+
+ ix = 0 ! stop-here-in
+
+end subroutine in
+
+program common_test
+
+ INTEGER*4 ix
+ REAL*4 iy
+ REAL*8 iz
+
+ INTEGER*4 ix_x
+ REAL*4 iy_y
+ REAL*8 iz_z
+
+ common /foo/ix,iy,iz
+ common /fo_o/ix_x,iy_y,iz_z
+
+ ix = 1
+ iy = 2.0
+ iz = 3.0
+
+ ix_x = 11
+ iy_y = 22.0
+ iz_z = 33.0
+
+ call in ! stop-here-out
+
+end program common_test
++++++ gdb-fortran-logical8.patch ++++++
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -196,6 +196,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
/* Special type cases, put in to allow the parser to distinguish different
legal basetypes. */
%token INT_KEYWORD INT_S2_KEYWORD LOGICAL_S1_KEYWORD LOGICAL_S2_KEYWORD
+%token LOGICAL_S8_KEYWORD
%token LOGICAL_KEYWORD REAL_KEYWORD REAL_S8_KEYWORD REAL_S16_KEYWORD
%token COMPLEX_S8_KEYWORD COMPLEX_S16_KEYWORD COMPLEX_S32_KEYWORD
%token BOOL_AND BOOL_OR BOOL_NOT
@@ -606,6 +607,8 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
{ $$ = parse_f_type->builtin_integer_s2; }
| CHARACTER
{ $$ = parse_f_type->builtin_character; }
+ | LOGICAL_S8_KEYWORD
+ { $$ = parse_f_type->builtin_logical_s8;}
| LOGICAL_KEYWORD
{ $$ = parse_f_type->builtin_logical; }
| LOGICAL_S2_KEYWORD
@@ -858,6 +861,7 @@ static const struct token f77_keywords[] =
{ "integer_2", INT_S2_KEYWORD, BINOP_END },
{ "logical_1", LOGICAL_S1_KEYWORD, BINOP_END },
{ "logical_2", LOGICAL_S2_KEYWORD, BINOP_END },
+ { "logical_8", LOGICAL_S8_KEYWORD, BINOP_END },
{ "complex_8", COMPLEX_S8_KEYWORD, BINOP_END },
{ "integer", INT_KEYWORD, BINOP_END },
{ "logical", LOGICAL_KEYWORD, BINOP_END },
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -259,6 +245,7 @@ enum f_primitive_types {
f_primitive_type_logical,
f_primitive_type_logical_s1,
f_primitive_type_logical_s2,
+ f_primitive_type_logical_s8,
f_primitive_type_integer,
f_primitive_type_integer_s2,
f_primitive_type_real,
@@ -289,6 +276,8 @@ f_language_arch_info (struct gdbarch *gdbarch,
= builtin->builtin_logical_s1;
lai->primitive_type_vector [f_primitive_type_logical_s2]
= builtin->builtin_logical_s2;
+ lai->primitive_type_vector [f_primitive_type_logical_s8]
+ = builtin->builtin_logical_s8;
lai->primitive_type_vector [f_primitive_type_real]
= builtin->builtin_real;
lai->primitive_type_vector [f_primitive_type_real_s8]
@@ -372,6 +361,10 @@ build_fortran_types (struct gdbarch *gdbarch)
= arch_boolean_type (gdbarch, gdbarch_short_bit (gdbarch), 1,
"logical*2");
+ builtin_f_type->builtin_logical_s8
+ = arch_boolean_type (gdbarch, gdbarch_long_long_bit (gdbarch), 1,
+ "logical*8");
+
builtin_f_type->builtin_integer
= arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0,
"integer");
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -113,6 +80,7 @@ struct builtin_f_type
struct type *builtin_logical;
struct type *builtin_logical_s1;
struct type *builtin_logical_s2;
+ struct type *builtin_logical_s8;
struct type *builtin_real;
struct type *builtin_real_s8;
struct type *builtin_real_s16;
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.exp
@@ -0,0 +1,44 @@
+# Copyright 2007 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil .
+
+set testfile "logical"
+set srcfile ${testfile}.f90
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto MAIN__] then {
+ perror "couldn't run to breakpoint MAIN__"
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "stop-here"]
+gdb_continue_to_breakpoint "stop-here"
+gdb_test "p l" " = \\.TRUE\\."
+gdb_test "p l1" " = \\.TRUE\\."
+gdb_test "p l2" " = \\.TRUE\\."
+gdb_test "p l4" " = \\.TRUE\\."
+gdb_test "p l8" " = \\.TRUE\\."
diff --git a/gdb/testsuite/gdb.fortran/logical.f90 b/gdb/testsuite/gdb.fortran/logical.f90
new file mode 100644
index 0000000..4229304
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.f90
@@ -0,0 +1,33 @@
+! Copyright 2008 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 2 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, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek .
+! Modified for the GDB testcase by Jan Kratochvil .
+
+program test
+ logical :: l
+ logical (kind=1) :: l1
+ logical (kind=2) :: l2
+ logical (kind=4) :: l4
+ logical (kind=8) :: l8
+ l = .TRUE.
+ l1 = .TRUE.
+ l2 = .TRUE.
+ l4 = .TRUE.
+ l8 = .TRUE.
+ l = .FALSE. ! stop-here
+end
++++++ gdb-lineno-makeup-test.patch ++++++
New testcase for:
https://bugzilla.redhat.com/show_bug.cgi?id=466222
(for the first / customer recommended fix)
and the upstream fix:
http://sourceware.org/ml/gdb-patches/2006-11/msg00253.html
[rfc] Do not make up line information
http://sourceware.org/ml/gdb-cvs/2006-11/msg00127.html
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineno-makeup-func.c
@@ -0,0 +1,21 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 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/. */
+
+void
+func (void)
+{
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineno-makeup.c
@@ -0,0 +1,35 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 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/. */
+
+/* DW_AT_low_pc-DW_AT_high_pc should cover the function without line number
+ information (.debug_line) so we cannot use an external object file.
+
+ It must not be just a label as it would alias on the next function even for
+ correct GDB. Therefore some stub data must be placed there.
+
+ We need to provide a real stub function body as at least s390
+ (s390_analyze_prologue) would skip the whole body till reaching `main'. */
+
+extern void func (void);
+asm ("func: .incbin \"gdb.base/lineno-makeup-func.bin\"");
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineno-makeup.exp
@@ -0,0 +1,78 @@
+# Copyright 2009 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 "lineno-makeup"
+set srcfuncfile ${testfile}-func.c
+set srcfile ${testfile}.c
+set objfuncfile ${objdir}/${subdir}/${testfile}-func.o
+set binfuncfile ${objdir}/${subdir}/${testfile}-func.bin
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" "${objfuncfile}" object {}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+set objcopy [catch "exec objcopy -O binary --only-section .text ${objfuncfile} ${binfuncfile}" output]
+verbose -log "objcopy=$objcopy: $output"
+if { $objcopy != 0 } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+set binfuncfilesize [file size $binfuncfile]
+verbose -log "file size $binfuncfile = $binfuncfilesize"
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set b_addr ""
+set test "break func"
+gdb_test_multiple $test $test {
+ -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {
+ set b_addr $expect_out(1,string)
+ pass $test
+ }
+ -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+): .*\r\n$gdb_prompt $" {
+ set b_addr $expect_out(1,string)
+ fail $test
+ }
+}
+verbose -log "b_addr=<$b_addr>"
+
+set p_addr ""
+set test "print func"
+gdb_test_multiple $test $test {
+ -re "\\$\[0-9\]+ = {} (0x\[0-9a-f\]+) <func>\r\n$gdb_prompt $" {
+ set p_addr $expect_out(1,string)
+ pass $test
+ }
+}
+verbose -log "p_addr=<$p_addr>"
+
+set test "break address belongs to func"
+if {$b_addr == $p_addr} {
+ pass "$test (exact match)"
+} else {
+ set skip [expr $b_addr - $p_addr]
+ if {$skip > 0 && $skip < $binfuncfilesize} {
+ pass "$test (prologue skip by $skip bytes)"
+ } else {
+ fail $test
+ }
+}
++++++ gdb-orphanripper.c ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:52.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:52.000000000 +0200
@@ -41,6 +41,7 @@
#include
#include
#include
+#include
#define LENGTH(x) (sizeof (x) / sizeof (*(x)))
@@ -87,6 +88,8 @@
/* Weird but at least after POLLHUP we get EIO instead of just EOF. */
if (buf_got == -1 && errno == EIO)
return 0;
+ if (buf_got == -1 && errno == EAGAIN)
+ return 0;
if (buf_got < 0)
{
perror ("read (amaster)");
++++++ gdb-pie-1of6-reprelinked-bin.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-03/msg01008.html
Subject: [patch 1/6]: PIE: Attach binary even after re-prelinked underneath
Hi,
there is a regression (against previous unreleased commits) by:
Re: RFC: Verify AT_ENTRY before using it
http://sourceware.org/ml/gdb-patches/2010-03/msg00395.html
for loading PIE executables which have changed on the disk since started.
There are in fact 3 different addresses one has to properly deal with.
This patch uses explicit "file" so it is not dependent on pending:
[patch] Attach to running but deleted executable
http://sourceware.org/ml/gdb-patches/2010-03/msg00950.html
The two copy-pasted blocks for elf32 and elf64 are "not nice" but this is the
current style in GDB.
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu for the whole
patch series together.
Thanks,
Jan
gdb/
2010-03-29 Jan Kratochvil
Fix attaching to PIEs prelinked on the disk since their start.
* solib-svr4.c (svr4_exec_displacement): New variable arch_size.
Verify it against bfd_get_arch_size. Try to match arbitrary
displacement for the phdrs comparison.
gdb/testsuite/
2010-03-29 Jan Kratochvil
* gdb.base/break-interp.exp: Run $binpie with new value "ATTACH", new
code for it. New variable relink_args.
(prelinkYES): Call prelinkNO.
(test_attach): Accept new parameter relink_args. Re-prelink the binary
in such case. Move the core code to ...
(test_attach_gdb): ... a new function. Send GDB command "file".
Extend expected "Attaching to " string.
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1750,13 +1750,183 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
really do not match. */
int phdrs_size, phdrs2_size, ok = 1;
gdb_byte *buf, *buf2;
+ int arch_size;
- buf = read_program_header (-1, &phdrs_size, NULL);
+ buf = read_program_header (-1, &phdrs_size, &arch_size);
buf2 = read_program_headers_from_bfd (exec_bfd, &phdrs2_size);
- if (buf != NULL && buf2 != NULL
- && (phdrs_size != phdrs2_size
- || memcmp (buf, buf2, phdrs_size) != 0))
- ok = 0;
+ if (buf != NULL && buf2 != NULL)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+
+ /* We are dealing with three different addresses. EXEC_BFD
+ represents current address in on-disk file. target memory content
+ may be different from EXEC_BFD as the file may have been prelinked
+ to a different address since the executable has been loaded.
+ Moreover the address of placement in target memory can be
+ different from what say the target memory program headers - this
+ is the goal of PIE.
+
+ Detected DISPLACEMENT covers both the offsets of PIE placement and
+ possible new prelink since start of the program. Here relocate
+ BUF and BUF2 just by the EXEC_BFD vs. target memory content offset
+ for the verification purpose. */
+
+ if (phdrs_size != phdrs2_size
+ || bfd_get_arch_size (exec_bfd) != arch_size)
+ ok = 0;
+ else if (arch_size == 32 && phdrs_size >= sizeof (Elf32_External_Phdr)
+ && phdrs_size % sizeof (Elf32_External_Phdr) == 0)
+ {
+ Elf_Internal_Ehdr *ehdr2 = elf_tdata (exec_bfd)->elf_header;
+ Elf_Internal_Phdr *phdr2 = elf_tdata (exec_bfd)->phdr;
+ CORE_ADDR displacement = 0;
+ int i;
+
+ /* DISPLACEMENT could be found easier by the difference of
+ ehdr2->e_entry but already read BUF does not contain ehdr. */
+
+ for (i = 0; i < ehdr2->e_phnum; i++)
+ if (phdr2[i].p_type == PT_LOAD)
+ {
+ Elf32_External_Phdr *phdrp;
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
+ CORE_ADDR vaddr, paddr;
+ CORE_ADDR displacement_vaddr = 0;
+ CORE_ADDR displacement_paddr = 0;
+
+ phdrp = &((Elf32_External_Phdr *) buf)[i];
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
+
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 4,
+ byte_order);
+ displacement_vaddr = vaddr - phdr2[i].p_vaddr;
+
+ paddr = extract_unsigned_integer (buf_paddr_p, 4,
+ byte_order);
+ displacement_paddr = paddr - phdr2[i].p_paddr;
+
+ if (displacement_vaddr == displacement_paddr)
+ displacement = displacement_vaddr;
+
+ break;
+ }
+
+ /* Now compare BUF and BUF2 with optional DISPLACEMENT. */
+
+ for (i = 0; i < phdrs_size / sizeof (Elf32_External_Phdr); i++)
+ {
+ Elf32_External_Phdr *phdrp;
+ Elf32_External_Phdr *phdr2p;
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
+ CORE_ADDR vaddr, paddr;
+
+ phdrp = &((Elf32_External_Phdr *) buf)[i];
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
+ phdr2p = &((Elf32_External_Phdr *) buf2)[i];
+
+ /* PT_GNU_STACK addresses are left as zero not being
+ relocated by prelink, their displacing would create false
+ verification failure. Feel free to test the unrelocated
+ comparison for any segment type. */
+
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
+ continue;
+
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 4, byte_order);
+ vaddr -= displacement;
+ store_unsigned_integer (buf_vaddr_p, 4, byte_order, vaddr);
+
+ paddr = extract_unsigned_integer (buf_paddr_p, 4, byte_order);
+ paddr -= displacement;
+ store_unsigned_integer (buf_paddr_p, 4, byte_order, paddr);
+
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
+ continue;
+
+ ok = 0;
+ break;
+ }
+ }
+ else if (arch_size == 64 && phdrs_size >= sizeof (Elf64_External_Phdr)
+ && phdrs_size % sizeof (Elf64_External_Phdr) == 0)
+ {
+ Elf_Internal_Ehdr *ehdr2 = elf_tdata (exec_bfd)->elf_header;
+ Elf_Internal_Phdr *phdr2 = elf_tdata (exec_bfd)->phdr;
+ CORE_ADDR displacement = 0;
+ int i;
+
+ /* DISPLACEMENT could be found easier by the difference of
+ ehdr2->e_entry but already read BUF does not contain ehdr. */
+
+ for (i = 0; i < ehdr2->e_phnum; i++)
+ if (phdr2[i].p_type == PT_LOAD)
+ {
+ Elf64_External_Phdr *phdrp;
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
+ CORE_ADDR vaddr, paddr;
+ CORE_ADDR displacement_vaddr = 0;
+ CORE_ADDR displacement_paddr = 0;
+
+ phdrp = &((Elf64_External_Phdr *) buf)[i];
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
+
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 8,
+ byte_order);
+ displacement_vaddr = vaddr - phdr2[i].p_vaddr;
+
+ paddr = extract_unsigned_integer (buf_paddr_p, 8,
+ byte_order);
+ displacement_paddr = paddr - phdr2[i].p_paddr;
+
+ if (displacement_vaddr == displacement_paddr)
+ displacement = displacement_vaddr;
+
+ break;
+ }
+
+ /* Now compare BUF and BUF2 with optional DISPLACEMENT. */
+
+ for (i = 0; i < phdrs_size / sizeof (Elf64_External_Phdr); i++)
+ {
+ Elf64_External_Phdr *phdrp;
+ Elf64_External_Phdr *phdr2p;
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
+ CORE_ADDR vaddr, paddr;
+
+ phdrp = &((Elf64_External_Phdr *) buf)[i];
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
+ phdr2p = &((Elf64_External_Phdr *) buf2)[i];
+
+ /* PT_GNU_STACK addresses are left as zero not being
+ relocated by prelink, their displacing would create false
+ verification failure. Feel free to test the unrelocated
+ comparison for any segment type. */
+
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
+ continue;
+
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 8, byte_order);
+ vaddr -= displacement;
+ store_unsigned_integer (buf_vaddr_p, 8, byte_order, vaddr);
+
+ paddr = extract_unsigned_integer (buf_paddr_p, 8, byte_order);
+ paddr -= displacement;
+ store_unsigned_integer (buf_paddr_p, 8, byte_order, paddr);
+
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
+ continue;
+
+ ok = 0;
+ break;
+ }
+ }
+ else
+ ok = 0;
+ }
xfree (buf);
xfree (buf2);
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -154,6 +154,12 @@ proc prelinkYES {arg {name ""}} {
if {$name == ""} {
set name [file tail $arg]
}
+
+ # Try to unprelink it first so that if it has been already prelinked before
+ # we get different address now and the result is not affected by the
+ # previous $arg state..
+ prelinkNO $arg "$name pre-unprelink"
+
set test "prelink $name"
set command "exec /usr/sbin/prelink -qNR --no-exec-shield $arg"
verbose -log "command is $command"
@@ -319,38 +325,12 @@ proc test_core {file displacement} {
set pf_prefix $old_ldprefix
}
-proc test_attach {file displacement} {
- global board_info gdb_prompt expect_out
-
- gdb_exit
-
- set test "sleep function started"
-
- set command "${file} sleep"
- set res [remote_spawn host $command];
- if { $res < 0 || $res == "" } {
- perror "Spawning $command failed."
- fail $test
- return
- }
- set pid [exp_pid -i $res]
- gdb_expect {
- -re "sleeping\r\n" {
- pass $test
- }
- eof {
- fail "$test (eof)"
- return
- }
- timeout {
- fail "$test (timeout)"
- return
- }
- }
+proc test_attach_gdb {file pid displacement prefix} {
+ global gdb_prompt expect_out
global pf_prefix
set old_ldprefix $pf_prefix
- lappend pf_prefix "attach:"
+ lappend pf_prefix "$prefix:"
gdb_exit
gdb_start
@@ -358,9 +338,13 @@ proc test_attach {file displacement} {
# Print the "PIE (Position Independent Executable) displacement" message.
gdb_test "set verbose on"
+ if {$file != ""} {
+ gdb_test "file $file" "Reading symbols from .*done\\." "file"
+ }
+
set test "attach"
gdb_test_multiple "attach $pid" $test {
- -re "Attaching to process $pid\r\n" {
+ -re "Attaching to (program: .*, )?process $pid\r\n" {
# Missing "$gdb_prompt $" is intentional.
pass $test
}
@@ -396,11 +380,56 @@ proc test_attach {file displacement} {
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
gdb_exit
- remote_exec host "kill -9 $pid"
-
set pf_prefix $old_ldprefix
}
+proc test_attach {file displacement {relink_args ""}} {
+ global board_info
+
+ gdb_exit
+
+ set test "sleep function started"
+
+ set command "${file} sleep"
+ set res [remote_spawn host $command];
+ if { $res < 0 || $res == "" } {
+ perror "Spawning $command failed."
+ fail $test
+ return
+ }
+ set pid [exp_pid -i $res]
+ gdb_expect {
+ -re "sleeping\r\n" {
+ pass $test
+ }
+ eof {
+ fail "$test (eof)"
+ return
+ }
+ timeout {
+ fail "$test (timeout)"
+ return
+ }
+ }
+
+ if {$relink_args == ""} {
+ test_attach_gdb "" $pid $displacement "attach"
+ } else {
+ # These could be rather passed as arguments.
+ global exec interp_saved interp
+
+ foreach relink {YES NO} {
+ if {[prelink$relink $relink_args [file tail $exec]]
+ && [copy $interp_saved $interp]} {
+ # /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".
+ test_attach_gdb $exec $pid $displacement "attach-relink$relink"
+ }
+ }
+ }
+
+ remote_exec host "kill -9 $pid"
+}
+
proc test_ld {file ifmain trynosym displacement} {
global srcdir subdir gdb_prompt expect_out
@@ -609,7 +638,10 @@ foreach ldprelink {NO YES} {
set old_binprefix $pf_prefix
foreach binprelink {NO YES} {
foreach binsepdebug {NO IN SEP} {
- foreach binpie {NO YES} {
+ # "ATTACH" is like "YES" but it is modified during run.
+ # It cannot be used for problem reproducibility after the
+ # testcase ends.
+ foreach binpie {NO YES ATTACH} {
# This combination is not possible, non-PIE (fixed address)
# binary cannot be prelinked to any (other) address.
if {$binprelink == "YES" && $binpie == "NO"} {
@@ -628,7 +660,7 @@ foreach ldprelink {NO YES} {
if {$binsepdebug != "NO"} {
lappend opts {debug}
}
- if {$binpie == "YES"} {
+ if {$binpie != "NO"} {
lappend opts {additional_flags=-fPIE -pie}
}
if {[build_executable ${test}.exp [file tail $exec] $srcfile $opts] == -1} {
@@ -680,16 +712,45 @@ foreach ldprelink {NO YES} {
lappend dests $dest
}
- if {[prelink$binprelink "--dynamic-linker=$interp --ld-library-path=$dir $exec $interp [concat $dests]" [file tail $exec]]
+ if {$binpie == "NO"} {
+ set displacement "NONE"
+ } elseif {$binprelink == "NO"} {
+ set displacement "NONZERO"
+ } else {
+ set displacement "ZERO"
+ }
+
+ set relink_args "--dynamic-linker=$interp --ld-library-path=$dir $exec $interp [concat $dests]"
+ if {[prelink$binprelink $relink_args [file tail $exec]]
&& [copy $interp_saved $interp]} {
- if {$binpie == "NO"} {
- set displacement "NONE"
- } elseif {$binprelink == "NO"} {
- set displacement "NONZERO"
+ if {$binpie != "ATTACH"} {
+ test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
} else {
- set displacement "ZERO"
+ # If the file has been randomly prelinked it must
+ # be "NONZERO". We could see "ZERO" only if it was
+ # unprelinked na it is now running at the same
+ # address - which is 0 but executable can never run
+ # at address 0.
+
+ set displacement "NONZERO"
+ test_attach $exec $displacement $relink_args
+
+ # ATTACH executables + libraries get modified since
+ # they have been run. They cannot be used for
+ # problem reproducibility after the testcase ends.
+ set exec_debug [system_debug_get $exec]
+ if {$exec_debug != ""} {
+ # `file delete [glob "${exec_debug}*"]' does not work.
+ foreach f [glob "${exec_debug}*"] {
+ file delete $f
+ }
+ }
+ file delete -force $dir
+ # `file delete [glob "${exec}*"]' does not work.
+ foreach f [glob "${exec}*"] {
+ file delete $f
+ }
}
- test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
}
}
}
++++++ gdb-pie-2of6-reprelinked-ld.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-03/msg01000.html
Subject: [patch 2/6] PIE: Attach binary even after ld.so re-prelinked underneath
Hi,
when I have seen the PIE-binary-changed-sice-start tested also
ld.so-changed-since-start and it did not work.
There is questionable when to print and when to not to print non-fatal memory
read errors. Similar change I requested in
Re: [RFC/ia64] memory error when reading wrong core file
http://sourceware.org/ml/gdb-patches/2010-02/msg00001.html
so that GDB prints at least as a warning
Cannot access memory at address ...
when some unexpected error happens.
Contrary to it there is not such warning present in the code below as in the
case of non-valgrind PIE with re-prelinked ld.so the memory read error happens
there. Some GDB code rework could probably avoid it.
Just for example all the memory read errors in read_program_header or even
- primarily - scan_dyntag are currently IMO-incorrectly silent and others.
Therefore posted the patch this way, making all these warnings printed and
possibly fixing code attempting incorrect reads along the way could be done by
a different patch.
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu for the whole
patch series together.
Thanks,
Jan
gdb/
2010-03-29 Jan Kratochvil
* auxv.c (ld_so_xfer_auxv): Do not error on failed read of data_address.
gdb/testsuite/
2010-03-29 Jan Kratochvil
* gdb.base/break-interp.exp (test_attach): Keep $interp changed. Move
its restore after the <$relink_args != ""> loop. new comment.
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -96,7 +96,16 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
pointer_address = SYMBOL_VALUE_ADDRESS (msym);
- data_address = read_memory_typed_address (pointer_address, ptr_type);
+ /* While it is an error I am not aware how to solve attaching to PIE under
+ valgrind --db-attach=yes different way when ld.so on-disk file has prelink
+ change in the meantime. Currently GDB will drop back to procfs_xfer_auxv
+ (so that at least non-valgrind PIE attachments with prelink change of
+ ld.so work). To make it working even with valgrind is PR 11440 requiring
+ a valgrind extension. */
+ if (target_read_memory (pointer_address, ptr_buf, ptr_size) != 0)
+ return -1;
+
+ data_address = extract_typed_address (ptr_buf, ptr_type);
/* Possibly still not initialized such as during an inferior startup. */
if (data_address == 0)
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -419,12 +419,16 @@ proc test_attach {file displacement {relink_args ""}} {
global exec interp_saved interp
foreach relink {YES NO} {
- if {[prelink$relink $relink_args [file tail $exec]]
- && [copy $interp_saved $interp]} {
+ # It would be more correct to also [copy $interp_saved $interp]
+ # here to really test just different prelink of $exec.
+ # But we would need a separate test for different prelink of ld.so
+ # where a bug occured. It is now all merged into this single test.
+ if [prelink$relink $relink_args [file tail $exec]] {
# /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".
test_attach_gdb $exec $pid $displacement "attach-relink$relink"
}
}
+ copy $interp_saved $interp
}
remote_exec host "kill -9 $pid"
++++++ gdb-pie-3of6-relocate-once.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-03/msg01001.html
Subject: [patch 3/6] PIE: Fix occasional error attaching i686 binary
[ Testcase diff backported. ]
Hi,
this is the real bugreport which started this patch series.
gdb "Cannot access memory" on a running process
https://bugzilla.redhat.com/show_bug.cgi?id=576742
Offsets on i686 cause that while attaching to an unprelinked running PIE
scan_dyntag will incorrectly get a successful read in scan_dyntag from DT_DEBUG
it expects is from the mani executable but in fact it is from some ld.so or
libc.so (located low for --exec-shield). Another issue is that scan_dyntag
could verify more that the target memory matches the .dynamic section it is
reading from exec_bfd. It could also complain when the read failed (as always
failed so for for PIE attaches first, succeeded later so nobody has noticed
anything).
The successful read reads a bogus DT_DEBUG value and GDB errors on it later.
This is again a non-fatal error after the patch by Joel Brobecker above but it
was not so before and it is incorrect anyway.
The svr4_relocate_main_executable call in svr4_special_symbol_handling was
there before delayed that way for svr4_static_exec_displacement.
But svr4_static_exec_displacement has been removed in the meantime by:
Re: RFC: Verify AT_ENTRY before using it
http://sourceware.org/ml/gdb-patches/2010-03/msg00030.html
So it can be simplified + corrected now. Moreover GDB will now finally print
exactly "Using PIE (Position Independent Executable) displacement" exactly
once.
The reproducer depends on various offsets which may be distro dependent but it
was made so that it is hopefully reproducible everywhere. Reproduced + fixed
on Fedora 12 x86_64 and i686.
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu for the whole
patch series together.
Thanks,
Jan
gdb/
2010-03-29 Jan Kratochvil
* auxv.c (memory_xfer_auxv): Update attach comment.
* solib-svr4.c (svr4_special_symbol_handling): Remove the call to
svr4_relocate_main_executable.
(svr4_solib_create_inferior_hook): Make the call to
svr4_relocate_main_executable unconditional.
gdb/testsuite/
2010-03-29 Jan Kratochvil
* gdb.base/attach-pie-misread.exp, gdb.base/attach-pie-misread.c: New.
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -198,7 +198,8 @@ memory_xfer_auxv (struct target_ops *ops,
/* ld_so_xfer_auxv is the only function safe for virtual executables being
executed by valgrind's memcheck. As using ld_so_xfer_auxv is problematic
- during inferior startup GDB does call it only for attached processes. */
+ during inferior startup as ld.so symbol tables are not yet relocated GDB
+ calls ld_so_xfer_auxv only for attached processes. */
if (current_inferior ()->attach_flag != 0)
{
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1628,7 +1628,6 @@ enable_break (struct svr4_info *info, int from_tty)
static void
svr4_special_symbol_handling (void)
{
- svr4_relocate_main_executable ();
}
/* Read the ELF program headers from ABFD. Return the contents and
@@ -2065,8 +2064,7 @@ svr4_solib_create_inferior_hook (int from_tty)
info = get_svr4_info ();
/* Relocate the main executable if necessary. */
- if (current_inferior ()->attach_flag == 0)
- svr4_relocate_main_executable ();
+ svr4_relocate_main_executable ();
if (!svr4_have_link_map_offsets ())
return;
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.c
@@ -0,0 +1,47 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 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/. */
+
+#include
+#include
+
+const char stub[] = {
+#ifdef GEN
+# include GEN
+#endif
+};
+
+int
+main (int argc, char **argv)
+{
+ /* Generator of GEN written in Python takes about 15s for x86_64's 4MB. */
+ if (argc == 2)
+ {
+ long count = strtol (argv[1], NULL, 0);
+
+ while (count-- > 0)
+ puts ("0x55,");
+
+ return 0;
+ }
+ if (argc != 1)
+ return 1;
+
+ puts ("sleeping");
+ fflush (stdout);
+
+ return sleep (60);
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -0,0 +1,209 @@
+# Copyright 2010 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/.
+
+# This test only works on GNU/Linux.
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
+ continue
+}
+
+set test "attach-pie-misread"
+set srcfile ${test}.c
+set genfile ${objdir}/${subdir}/${test}-gen.h
+set executable ${test}
+set binfile ${objdir}/${subdir}/${executable}
+
+if {[build_executable ${test}.exp $executable $srcfile [list "additional_flags=-fPIE -pie"]] == -1} {
+ return -1
+}
+
+# Program Headers:
+# Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
+# LOAD 0x000000 0x0000000000400000 0x0000000000400000 0x134f5ec 0x134f5ec R E 0x200000
+# LOAD 0x134f5f0 0x000000000194f5f0 0x000000000194f5f0 0x1dbc60 0x214088 RW 0x200000
+# DYNAMIC 0x134f618 0x000000000194f618 0x000000000194f618 0x000200 0x000200 RW 0x8
+#
+proc read_phdr {binfile test} {
+ set readelf_program [transform readelf]
+ set command "exec $readelf_program -Wl $binfile"
+ verbose -log "command is $command"
+ set result [catch $command output]
+ verbose -log "result is $result"
+ verbose -log "output is $output"
+ if {$result != 0} {
+ fail $test
+ return
+ }
+ if ![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr] {
+ fail "$test (no Program Headers)"
+ return
+ }
+ if ![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr] {
+ fail "$test (no DYNAMIC found)"
+ return
+ }
+ verbose -log "dynamic_vaddr is $dynamic_vaddr"
+ set align_max -1
+ foreach {trash align} [regexp -line -all -inline {^ *LOAD .* (0x[0-9]+)$} $phdr] {
+ if {$align_max < $align} {
+ set align_max $align
+ }
+ }
+ verbose -log "align_max is $align_max"
+ if {$align_max == -1} {
+ fail "$test (no LOAD found)"
+ return
+ }
+ pass $test
+ return [list $dynamic_vaddr $align_max]
+}
+
+set phdr [read_phdr $binfile "readelf initial scan"]
+set dynamic_vaddr [lindex $phdr 0]
+set align_max [lindex $phdr 1]
+
+set stub_size [format 0x%x [expr "2 * $align_max - ($dynamic_vaddr & ($align_max - 1))"]]
+verbose -log "stub_size is $stub_size"
+
+# On x86_64 it is commonly about 4MB.
+if {$stub_size > 25000000} {
+ xfail "stub size $stub_size is too large"
+ return
+}
+
+set test "generate stub"
+set command "exec $binfile $stub_size >$genfile"
+verbose -log "command is $command"
+set result [catch $command output]
+verbose -log "result is $result"
+verbose -log "output is $output"
+if {$result == 0} {
+ pass $test
+} else {
+ fail $test
+}
+
+if {[build_executable ${test}.exp $executable $srcfile [list "additional_flags=-fPIE -pie -DGEN=\"$genfile\""]] == -1} {
+ return -1
+}
+
+# x86_64 file has 25MB, no need to keep it.
+file delete -- $genfile
+
+set phdr [read_phdr $binfile "readelf rebuilt with stub_size"]
+set dynamic_vaddr_prelinkno [lindex $phdr 0]
+
+set command "exec /usr/sbin/prelink -q -N --no-exec-shield -R $binfile"
+verbose -log "command is $command"
+set result [catch $command output]
+verbose -log "result is $result"
+verbose -log "output is $output"
+
+set test "prelink -R"
+if {$result == 0 && $output == ""} {
+ pass $test
+} elseif {$result == 1 && [regexp {^(couldn't execute "/usr/sbin/prelink[^\r\n]*": no such file or directory\n?)*$} $output]} {
+ untested attach-pie-misread.exp
+ return -1
+} else {
+ fail $test
+}
+
+set phdr [read_phdr $binfile "readelf with prelink -R"]
+set dynamic_vaddr_prelinkyes [lindex $phdr 0]
+
+set first_offset [format 0x%x [expr $dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno]]
+verbose -log "first_offset is $first_offset"
+
+set test "first offset is non-zero"
+if {$first_offset == 0} {
+ fail "$test (-fPIE -pie in effect?)"
+} else {
+ pass $test
+}
+
+set test "start inferior"
+gdb_exit
+
+set res [remote_spawn host $binfile];
+if { $res < 0 || $res == "" } {
+ perror "Spawning $binfile failed."
+ fail $test
+ return
+}
+set pid [exp_pid -i $res]
+gdb_expect {
+ -re "sleeping\r\n" {
+ pass $test
+ }
+ eof {
+ fail "$test (eof)"
+ remote_exec host "kill -9 $pid"
+ return
+ }
+ timeout {
+ fail "$test (timeout)"
+ remote_exec host "kill -9 $pid"
+ return
+ }
+}
+
+# Due to alignments it was reproducible with 1 on x86_64 but 2 on i686.
+foreach align_mult {1 2} {
+ set old_ldprefix $pf_prefix
+ lappend pf_prefix "shift-by-$align_mult:"
+
+ # FIXME: We believe there is enough room under FIRST_OFFSET.
+ set shifted_offset [format 0x%x [expr "$first_offset - $align_mult * $align_max"]]
+ verbose -log "shifted_offset is $shifted_offset"
+
+ set command "exec /usr/sbin/prelink -q -N --no-exec-shield -r $shifted_offset $binfile"
+ verbose -log "command is $command"
+ set result [catch $command output]
+ verbose -log "result is $result"
+ verbose -log "output is $output"
+
+ set test "prelink -r"
+ if {$result == 0 && $output == ""} {
+ pass $test
+ } else {
+ fail $test
+ }
+
+ clean_restart $executable
+
+ set test "attach"
+ gdb_test_multiple "attach $pid" $test {
+ -re "Attaching to program: .*, process $pid\r\n" {
+ # Missing "$gdb_prompt $" is intentional.
+ pass $test
+ }
+ }
+
+ set test "error on Cannot access memory at address"
+ gdb_test_multiple "" $test {
+ -re "\r\nCannot access memory at address .*$gdb_prompt $" {
+ fail $test
+ }
+ -re "$gdb_prompt $" {
+ pass $test
+ }
+ }
+
+ gdb_test "detach" "Detaching from program: .*"
+
+ set pf_prefix $old_ldprefix
+}
+
+remote_exec host "kill -9 $pid"
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -248,9 +248,8 @@ proc reach {func command displacement} {
}
if {$displacement == $case} {
pass $test_displacement
- # Permit multiple such messages.
set displacement "FOUND-$displacement"
- } elseif {$displacement != "FOUND-$case"} {
+ } else {
fail $test_displacement
}
exp_continue
@@ -304,9 +303,8 @@ proc test_core {file displacement} {
}
if {$displacement == $case} {
pass $test_displacement
- # Permit multiple such messages.
set displacement "FOUND-$displacement"
- } elseif {$displacement != "FOUND-$case"} {
+ } else {
fail $test_displacement
}
exp_continue
@@ -362,9 +360,8 @@ proc test_attach_gdb {file pid displacement prefix} {
}
if {$displacement == $case} {
pass $test_displacement
- # Permit multiple such messages.
set displacement "FOUND-$displacement"
- } elseif {$displacement != "FOUND-$case"} {
+ } else {
fail $test_displacement
}
exp_continue
@@ -451,9 +448,7 @@
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
if $ifmain {
- # Displacement message will be printed the second time on initializing
- # the linker from svr4_special_symbol_handling.
- reach "main" continue $displacement
+ reach "main" continue "NONE"
reach "libfunc" continue "NONE"
@@ -528,9 +517,8 @@ proc test_ld {file ifmain trynosym displacement} {
}
if {$displacement == $case} {
pass $test_displacement
- # Permit multiple such messages.
set displacement "FOUND-$displacement"
- } elseif {$displacement != "FOUND-$case"} {
+ } else {
fail $test_displacement
}
exp_continue
++++++ gdb-pie-rerun.patch ++++++
http://sourceware.org/ml/gdb-patches/2010-03/msg00868.html
Subject: [patch] PIE: Fix back re-run [Re: [patch] svr4_exec_displacement success indicator]
Hi,
currently:
$ echo 'main(){}'|gcc -o 1 -fPIE -pie -x c -; ./gdb -nx -ex 'set disable-randomization off' -ex 'b main' -ex r -ex c -ex r ./1
Breakpoint 1 at 0x6b0
Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/1
Breakpoint 1, 0x00007fbf73e8c6b0 in main ()
Continuing.
Program exited with code 0140.
Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/1
Error in re-setting breakpoint 1: Cannot access memory at address 0x7fbf73e8c6ac
It is since:
[patch] svr4_exec_displacement success indicator [Re: PIE question]
http://sourceware.org/ml/gdb-patches/2010-03/msg00336.html
On Mon, 08 Mar 2010 22:53:58 +0100, Jan Kratochvil wrote:
Attached these changes:
* svr4_exec_displacement calling convention should have success indicator.
* Preserving now section_offsets if they are already set, inspired by
init_objfile_sect_indices.
I believe either of parts would be sufficient for this problem.
The first part has caused the regression for PIE on native x86* GNU/Linux host.
As I believe for Daniel J.'s seen regression of `qOffsets' the second already
checked-in part is sufficient - I would like to remove the first part.
OK to check it in?
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
(I do not think one needs to think about 7.1-branch as it is not a regression
against any FSF GDB release.)
Thanks,
Jan
gdb/
2010-03-25 Jan Kratochvil
Fix re-run of PIE executable.
* solib-svr4.c (svr4_relocate_main_executable) : Remove
the part of pre-set SYMFILE_OBJFILE->SECTION_OFFSETS.
gdb/testsuite/
2010-03-25 Jan Kratochvil
Fix re-run of PIE executable.
* gdb.base/break-interp.exp (test_ld): Turn off "disable-randomization".
Remove $displacement_main to match the solib-svr4.c change. New "kill"
and re-"run" of the inferior.
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1791,17 +1791,10 @@ svr4_relocate_main_executable (void)
{
CORE_ADDR displacement;
- if (symfile_objfile)
- {
- int i;
-
- /* Remote target may have already set specific offsets by `qOffsets'
- which should be preferred. */
-
- for (i = 0; i < symfile_objfile->num_sections; i++)
- if (ANOFFSET (symfile_objfile->section_offsets, i) != 0)
- return;
- }
+ /* SYMFILE_OBJFILE->SECTION_OFFSETS may now contain displacement from the
+ previous run of the inferior. Re-set it according to the current value,
+ if we can find it out. But otherwise keep it as for remote target it may
+ have been pre-set by the `qOffsets' packet. */
if (! svr4_exec_displacement (&displacement))
return;
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -416,25 +416,28 @@ proc test_ld {file ifmain trynosym displacement} {
# Print the "PIE (Position Independent Executable) displacement" message.
gdb_test "set verbose on"
+ # A bit better test coverage.
+ gdb_test "set disable-randomization off"
+
reach "dl_main" "run segv" $displacement
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
if $ifmain {
# Displacement message will be printed the second time on initializing
- # the linker from svr4_special_symbol_handling. If any ANOFFSET has
- # been already set as non-zero the detection will no longer be run.
- if {$displacement == "NONZERO"} {
- set displacement_main "NONE"
- } else {
- set displacement_main $displacement
- }
- reach "main" continue $displacement_main
+ # the linker from svr4_special_symbol_handling.
+ reach "main" continue $displacement
reach "libfunc" continue "NONE"
gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
+ }
+ # Try re-run if the new PIE displacement takes effect.
+ gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
+ reach "dl_main" "run segv" $displacement
+
+ if $ifmain {
test_core $file $displacement
test_attach $file $displacement
++++++ gdb-ppc-power7-test.patch ++++++
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-power7.exp
@@ -0,0 +1,182 @@
+# Copyright 2009 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test PowerPC Power7 instructions disassembly.
+
+if {![istarget "powerpc*-*-*"]} then {
+ verbose "Skipping PowerPC Power7 instructions disassembly."
+ return
+}
+
+set testfile "powerpc-power7"
+set srcfile ${testfile}.s
+set objfile ${objdir}/${subdir}/${testfile}.o
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
+ untested "PowerPC Power7 instructions disassembly"
+ return -1
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${objfile}
+
+
+# Disassemble the function.
+
+set test "disass func"
+gdb_test_multiple $test $test {
+ -re "\r\nDump of assembler code for function func:(\r\n.*\r\n)End of assembler dump.\r\n$gdb_prompt $" {
+ set func $expect_out(1,string)
+ pass $test
+ }
+}
+
+proc instr_to_patt {offset instr} {
+ # 0x0000000000000018 : stxvd2x vs43,r4,r5
+ return ".*\r\n\[ \t\]*[string map {0x 0x0*} $offset] <(func)?\\+?\[0-9\]*>:\[ \t\]*[string map [list { } "\[ \t\]+" . {\.}] $instr]\[ \t\]*\r\n.*"
+}
+
+# KFAIL strings would not exist if -Many would print the same as -Mpower7.
+# That means the power7 form should be the preferred one.
+# http://sourceware.org/ml/gdb-patches/2009-03/threads.html#00020
+
+proc func_check {offset instr {kfail ""}} {
+ global func
+
+ set test "Found $offset: $instr"
+ if [regexp -nocase -line [instr_to_patt $offset $instr] $func] {
+ pass $test
+ } elseif {$kfail != "" && [regexp -nocase -line [instr_to_patt $offset $kfail] $func]} {
+ kfail gdb/NNNN $test
+ } else {
+ fail $test
+ }
+}
+
+func_check 0x0 "lxvd2x vs3,r4,r5"
+# [PATCH] Remove support for POWER7 VSX load/store with update instructions
+# http://sourceware.org/ml/binutils/2009-09/msg00680.html
+# http://sourceware.org/ml/binutils-cvs/2009-09/msg00331.html
+# lxvd2ux vs3,r4,r5
+func_check 0x4 ".long 0x7c642ed8"
+func_check 0x8 "lxvd2x vs43,r4,r5"
+# lxvd2ux vs43,r4,r5
+func_check 0xc ".long 0x7d642ed9"
+func_check 0x10 "stxvd2x vs3,r4,r5"
+# stxvd2ux vs3,r4,r5
+func_check 0x14 ".long 0x7c642fd8"
+func_check 0x18 "stxvd2x vs43,r4,r5"
+# stxvd2ux vs43,r4,r5
+func_check 0x1c ".long 0x7d642fd9"
+func_check 0x20 "xxmrghd vs3,vs4,vs5"
+func_check 0x24 "xxmrghd vs43,vs44,vs45"
+func_check 0x28 "xxmrgld vs3,vs4,vs5"
+func_check 0x2c "xxmrgld vs43,vs44,vs45"
+func_check 0x30 "xxmrghd vs3,vs4,vs5"
+func_check 0x34 "xxmrghd vs43,vs44,vs45"
+func_check 0x38 "xxmrgld vs3,vs4,vs5"
+func_check 0x3c "xxmrgld vs43,vs44,vs45"
+func_check 0x40 "xxpermdi vs3,vs4,vs5,1"
+func_check 0x44 "xxpermdi vs43,vs44,vs45,1"
+func_check 0x48 "xxpermdi vs3,vs4,vs5,2"
+func_check 0x4c "xxpermdi vs43,vs44,vs45,2"
+func_check 0x50 "xvmovdp vs3,vs4"
+func_check 0x54 "xvmovdp vs43,vs44"
+func_check 0x58 "xvmovdp vs3,vs4"
+func_check 0x5c "xvmovdp vs43,vs44"
+func_check 0x60 "xvcpsgndp vs3,vs4,vs5"
+func_check 0x64 "xvcpsgndp vs43,vs44,vs45"
+func_check 0x68 "wait"
+func_check 0x6c "wait"
+func_check 0x70 "waitrsv"
+func_check 0x74 "waitrsv"
+func_check 0x78 "waitimpl"
+func_check 0x7c "waitimpl"
+func_check 0x80 "doze"
+func_check 0x84 "nap"
+func_check 0x88 "sleep"
+func_check 0x8c "rvwinkle"
+func_check 0x90 "prtyw r3,r4"
+func_check 0x94 "prtyd r13,r14"
+func_check 0x98 "mfcfar r10" "mfspr r10,28"
+func_check 0x9c "mtcfar r11" "mtspr 28,r11"
+func_check 0xa0 "cmpb r3,r4,r5"
+func_check 0xa4 "lwzcix r10,r11,r12"
+func_check 0xa8 "dadd f16,f17,f18"
+func_check 0xac "daddq f20,f22,f24"
+func_check 0xb0 "dss 3"
+func_check 0xb4 "dssall"
+func_check 0xb8 "dst r5,r4,1"
+func_check 0xbc "dstt r8,r7,0"
+func_check 0xc0 "dstst r5,r6,3"
+func_check 0xc4 "dststt r4,r5,2"
+func_check 0xc8 "divwe r10,r11,r12"
+func_check 0xcc "divwe. r11,r12,r13"
+func_check 0xd0 "divweo r12,r13,r14"
+func_check 0xd4 "divweo. r13,r14,r15"
+func_check 0xd8 "divweu r10,r11,r12"
+func_check 0xdc "divweu. r11,r12,r13"
+func_check 0xe0 "divweuo r12,r13,r14"
+func_check 0xe4 "divweuo. r13,r14,r15"
+func_check 0xe8 "bpermd r7,r17,r27"
+func_check 0xec "popcntw r10,r20"
+func_check 0xf0 "popcntd r10,r20"
+func_check 0xf4 "ldbrx r20,r21,r22"
+func_check 0xf8 "stdbrx r20,r21,r22"
+func_check 0xfc "lfiwzx f10,0,r10"
+func_check 0x100 "lfiwzx f10,r9,r10"
+func_check 0x104 "fcfids f4,f5"
+func_check 0x108 "fcfids. f4,f5"
+func_check 0x10c "fcfidus f4,f5"
+func_check 0x110 "fcfidus. f4,f5"
+func_check 0x114 "fctiwu f4,f5"
+func_check 0x118 "fctiwu. f4,f5"
+func_check 0x11c "fctiwuz f4,f5"
+func_check 0x120 "fctiwuz. f4,f5"
+func_check 0x124 "fctidu f4,f5"
+func_check 0x128 "fctidu. f4,f5"
+func_check 0x12c "fctiduz f4,f5"
+func_check 0x130 "fctiduz. f4,f5"
+func_check 0x134 "fcfidu f4,f5"
+func_check 0x138 "fcfidu. f4,f5"
+func_check 0x13c "ftdiv cr0,f10,f11"
+func_check 0x140 "ftdiv cr7,f10,f11"
+func_check 0x144 "ftsqrt cr0,f10"
+func_check 0x148 "ftsqrt cr7,f10"
+func_check 0x14c "dcbtt r8,r9" "dcbt 16,r8,r9"
+func_check 0x150 "dcbtstt r8,r9" "dcbtst 16,r8,r9"
+func_check 0x154 "dcffix f10,f12"
+func_check 0x158 "dcffix. f20,f22"
+func_check 0x15c "lbarx r10,r11,r12"
+func_check 0x160 "lbarx r10,r11,r12"
+func_check 0x164 "lbarx r10,r11,r12,1"
+func_check 0x168 "lharx r20,r21,r22"
+func_check 0x16c "lharx r20,r21,r22"
+func_check 0x170 "lharx r20,r21,r22,1"
+func_check 0x174 "stbcx. r10,r11,r12"
+func_check 0x178 "sthcx. r10,r11,r12"
+func_check 0x17c "fre f14,f15"
+func_check 0x180 "fre. f14,f15"
+func_check 0x184 "fres f14,f15"
+func_check 0x188 "fres. f14,f15"
+func_check 0x18c "frsqrte f14,f15"
+func_check 0x190 "frsqrte. f14,f15"
+func_check 0x194 "frsqrtes f14,f15"
+func_check 0x198 "frsqrtes. f14,f15"
+func_check 0x19c "isel r2,r3,r4,28"
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-power7.s
@@ -0,0 +1,107 @@
+ .text
+ .globl func
+func:
+ .long 0x7c642e98 /* 0: lxvd2x vs3,r4,r5 */
+ .long 0x7c642ed8 /* 4: lxvd2ux vs3,r4,r5 */
+ .long 0x7d642e99 /* 8: lxvd2x vs43,r4,r5 */
+ .long 0x7d642ed9 /* c: lxvd2ux vs43,r4,r5 */
+ .long 0x7c642f98 /* 10: stxvd2x vs3,r4,r5 */
+ .long 0x7c642fd8 /* 14: stxvd2ux vs3,r4,r5 */
+ .long 0x7d642f99 /* 18: stxvd2x vs43,r4,r5 */
+ .long 0x7d642fd9 /* 1c: stxvd2ux vs43,r4,r5 */
+ .long 0xf0642850 /* 20: xxmrghd vs3,vs4,vs5 */
+ .long 0xf16c6857 /* 24: xxmrghd vs43,vs44,vs45 */
+ .long 0xf0642b50 /* 28: xxmrgld vs3,vs4,vs5 */
+ .long 0xf16c6b57 /* 2c: xxmrgld vs43,vs44,vs45 */
+ .long 0xf0642850 /* 30: xxmrghd vs3,vs4,vs5 */
+ .long 0xf16c6857 /* 34: xxmrghd vs43,vs44,vs45 */
+ .long 0xf0642b50 /* 38: xxmrgld vs3,vs4,vs5 */
+ .long 0xf16c6b57 /* 3c: xxmrgld vs43,vs44,vs45 */
+ .long 0xf0642950 /* 40: xxpermdi vs3,vs4,vs5,1 */
+ .long 0xf16c6957 /* 44: xxpermdi vs43,vs44,vs45,1 */
+ .long 0xf0642a50 /* 48: xxpermdi vs3,vs4,vs5,2 */
+ .long 0xf16c6a57 /* 4c: xxpermdi vs43,vs44,vs45,2 */
+ .long 0xf0642780 /* 50: xvmovdp vs3,vs4 */
+ .long 0xf16c6787 /* 54: xvmovdp vs43,vs44 */
+ .long 0xf0642780 /* 58: xvmovdp vs3,vs4 */
+ .long 0xf16c6787 /* 5c: xvmovdp vs43,vs44 */
+ .long 0xf0642f80 /* 60: xvcpsgndp vs3,vs4,vs5 */
+ .long 0xf16c6f87 /* 64: xvcpsgndp vs43,vs44,vs45 */
+ .long 0x7c00007c /* 68: wait */
+ .long 0x7c00007c /* 6c: wait */
+ .long 0x7c20007c /* 70: waitrsv */
+ .long 0x7c20007c /* 74: waitrsv */
+ .long 0x7c40007c /* 78: waitimpl */
+ .long 0x7c40007c /* 7c: waitimpl */
+ .long 0x4c000324 /* 80: doze */
+ .long 0x4c000364 /* 84: nap */
+ .long 0x4c0003a4 /* 88: sleep */
+ .long 0x4c0003e4 /* 8c: rvwinkle */
+ .long 0x7c830134 /* 90: prtyw r3,r4 */
+ .long 0x7dcd0174 /* 94: prtyd r13,r14 */
+ .long 0x7d5c02a6 /* 98: mfcfar r10 */
+ .long 0x7d7c03a6 /* 9c: mtcfar r11 */
+ .long 0x7c832bf8 /* a0: cmpb r3,r4,r5 */
+ .long 0x7d4b662a /* a4: lwzcix r10,r11,r12 */
+ .long 0xee119004 /* a8: dadd f16,f17,f18 */
+ .long 0xfe96c004 /* ac: daddq f20,f22,f24 */
+ .long 0x7c60066c /* b0: dss 3 */
+ .long 0x7e00066c /* b4: dssall */
+ .long 0x7c2522ac /* b8: dst r5,r4,1 */
+ .long 0x7e083aac /* bc: dstt r8,r7,0 */
+ .long 0x7c6532ec /* c0: dstst r5,r6,3 */
+ .long 0x7e442aec /* c4: dststt r4,r5,2 */
+ .long 0x7d4b6356 /* c8: divwe r10,r11,r12 */
+ .long 0x7d6c6b57 /* cc: divwe. r11,r12,r13 */
+ .long 0x7d8d7756 /* d0: divweo r12,r13,r14 */
+ .long 0x7dae7f57 /* d4: divweo. r13,r14,r15 */
+ .long 0x7d4b6316 /* d8: divweu r10,r11,r12 */
+ .long 0x7d6c6b17 /* dc: divweu. r11,r12,r13 */
+ .long 0x7d8d7716 /* e0: divweuo r12,r13,r14 */
+ .long 0x7dae7f17 /* e4: divweuo. r13,r14,r15 */
+ .long 0x7e27d9f8 /* e8: bpermd r7,r17,r27 */
+ .long 0x7e8a02f4 /* ec: popcntw r10,r20 */
+ .long 0x7e8a03f4 /* f0: popcntd r10,r20 */
+ .long 0x7e95b428 /* f4: ldbrx r20,r21,r22 */
+ .long 0x7e95b528 /* f8: stdbrx r20,r21,r22 */
+ .long 0x7d4056ee /* fc: lfiwzx f10,0,r10 */
+ .long 0x7d4956ee /* 100: lfiwzx f10,r9,r10 */
+ .long 0xec802e9c /* 104: fcfids f4,f5 */
+ .long 0xec802e9d /* 108: fcfids. f4,f5 */
+ .long 0xec802f9c /* 10c: fcfidus f4,f5 */
+ .long 0xec802f9d /* 110: fcfidus. f4,f5 */
+ .long 0xfc80291c /* 114: fctiwu f4,f5 */
+ .long 0xfc80291d /* 118: fctiwu. f4,f5 */
+ .long 0xfc80291e /* 11c: fctiwuz f4,f5 */
+ .long 0xfc80291f /* 120: fctiwuz. f4,f5 */
+ .long 0xfc802f5c /* 124: fctidu f4,f5 */
+ .long 0xfc802f5d /* 128: fctidu. f4,f5 */
+ .long 0xfc802f5e /* 12c: fctiduz f4,f5 */
+ .long 0xfc802f5f /* 130: fctiduz. f4,f5 */
+ .long 0xfc802f9c /* 134: fcfidu f4,f5 */
+ .long 0xfc802f9d /* 138: fcfidu. f4,f5 */
+ .long 0xfc0a5900 /* 13c: ftdiv cr0,f10,f11 */
+ .long 0xff8a5900 /* 140: ftdiv cr7,f10,f11 */
+ .long 0xfc005140 /* 144: ftsqrt cr0,f10 */
+ .long 0xff805140 /* 148: ftsqrt cr7,f10 */
+ .long 0x7e084a2c /* 14c: dcbtt r8,r9 */
+ .long 0x7e0849ec /* 150: dcbtstt r8,r9 */
+ .long 0xed406644 /* 154: dcffix f10,f12 */
+ .long 0xee80b645 /* 158: dcffix. f20,f22 */
+ .long 0x7d4b6068 /* 15c: lbarx r10,r11,r12 */
+ .long 0x7d4b6068 /* 160: lbarx r10,r11,r12 */
+ .long 0x7d4b6069 /* 164: lbarx r10,r11,r12,1 */
+ .long 0x7e95b0e8 /* 168: lharx r20,r21,r22 */
+ .long 0x7e95b0e8 /* 16c: lharx r20,r21,r22 */
+ .long 0x7e95b0e9 /* 170: lharx r20,r21,r22,1 */
+ .long 0x7d4b656d /* 174: stbcx. r10,r11,r12 */
+ .long 0x7d4b65ad /* 178: sthcx. r10,r11,r12 */
+ .long 0xfdc07830 /* 17c: fre f14,f15 */
+ .long 0xfdc07831 /* 180: fre. f14,f15 */
+ .long 0xedc07830 /* 184: fres f14,f15 */
+ .long 0xedc07831 /* 188: fres. f14,f15 */
+ .long 0xfdc07834 /* 18c: frsqrte f14,f15 */
+ .long 0xfdc07835 /* 190: frsqrte. f14,f15 */
+ .long 0xedc07834 /* 194: frsqrtes f14,f15 */
+ .long 0xedc07835 /* 198: frsqrtes. f14,f15 */
+ .long 0x7c43271e /* 19c: isel r2,r3,r4,28 */
++++++ gdb-rhel5-compat.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:52.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:52.000000000 +0200
@@ -1,9 +1,20 @@
gdb/linux-nat.c:
- Workaround RHEL-5 kernels for detaching SIGSTOPped processes (BZ 498595).
---- gdb-6.8/gdb-orig/symfile.c 2008-08-21 00:06:50.000000000 +0200
-+++ gdb-6.8/gdb/symfile.c 2008-08-21 22:31:00.000000000 +0200
-@@ -1456,8 +1456,10 @@ find_separate_debug_file (struct objfile
+Index: gdb-7.0.50.20100115/gdb/elfread.c
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/elfread.c 2010-01-15 22:19:28.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/elfread.c 2010-01-15 22:19:34.000000000 +0100
+@@ -582,7 +582,7 @@ elf_symtab_read (struct objfile *objfile
+ #define BUILD_ID_VERBOSE_NONE 0
+ #define BUILD_ID_VERBOSE_FILENAMES 1
+ #define BUILD_ID_VERBOSE_BINARY_PARSE 2
+-static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
++static int build_id_verbose = BUILD_ID_VERBOSE_NONE;
+ static void
+ show_build_id_verbose (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+@@ -1659,8 +1659,10 @@ find_separate_debug_file_by_buildid (str
/* Prevent looping on a stripped .debug file. */
if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0)
{
@@ -14,9 +25,11 @@
xfree (build_id_name);
}
else if (build_id_name != NULL)
---- ./gdb/corelow.c 2010-01-01 16:04:34.000000000 +0100
-+++ ./gdb/corelow.c 2010-01-01 16:06:26.000000000 +0100
-@@ -277,7 +277,7 @@ add_to_thread_list (bfd *abfd, asection
+Index: gdb-7.0.50.20100115/gdb/corelow.c
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/corelow.c 2010-01-15 22:19:27.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/corelow.c 2010-01-15 22:19:34.000000000 +0100
+@@ -294,7 +294,7 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = ptid; /* Yes, make it current */
}
@@ -25,21 +38,12 @@
static void
build_id_locate_exec (int from_tty)
---- ./gdb/symfile.c 2010-01-01 16:04:35.000000000 +0100
-+++ ./gdb/symfile.c 2010-01-01 16:06:12.000000000 +0100
-@@ -1249,7 +1249,7 @@ symbol_file_clear (int from_tty)
- #define BUILD_ID_VERBOSE_NONE 0
- #define BUILD_ID_VERBOSE_FILENAMES 1
- #define BUILD_ID_VERBOSE_BINARY_PARSE 2
--static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
-+static int build_id_verbose = BUILD_ID_VERBOSE_NONE;
- static void
- show_build_id_verbose (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
---- gdb-7.0-orig/gdb/linux-nat.c 2009-12-19 20:53:46.000000000 +0100
-+++ gdb-7.0/gdb/linux-nat.c 2009-12-19 20:55:02.000000000 +0100
-@@ -1604,8 +1604,22 @@ GPT: lwp %s had signal %s, but it is in
- *status = lp->status;
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c 2010-01-15 22:19:27.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.c 2010-01-15 22:19:55.000000000 +0100
+@@ -1768,8 +1768,22 @@ GPT: lwp %s had signal %s, but it is in
+ target_signal_to_string (signo));
}
- if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
++++++ gdb-rhel5-gcc44.patch ++++++
--- /var/tmp/diff_new_pack.11pjVW/_old 2010-04-16 18:24:52.000000000 +0200
+++ /var/tmp/diff_new_pack.11pjVW/_new 2010-04-16 18:24:52.000000000 +0200
@@ -1,8 +1,10 @@
Some functionality is available on RHEL-5.4+ only with gcc44 and gfortran44 as
the default gcc and gfortran binaries are from gcc-4.1.
---- gdb-7.0/gdb/testsuite/gdb.base/vla.exp-orig 2009-12-20 00:38:13.000000000 +0100
-+++ gdb-7.0/gdb/testsuite/gdb.base/vla.exp 2009-12-20 00:54:19.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/vla.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.base/vla.exp 2010-01-15 22:14:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/vla.exp 2010-01-15 22:14:51.000000000 +0100
@@ -16,7 +16,25 @@
set testfile vla
set srcfile ${testfile}.c
@@ -30,8 +32,10 @@
untested "Couldn't compile test program"
return -1
}
---- gdb-7.0/gdb/testsuite/gdb.base/break-interp.exp-orig 2009-12-20 00:38:13.000000000 +0100
-+++ gdb-7.0/gdb/testsuite/gdb.base/break-interp.exp 2009-12-20 01:11:47.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/break-interp.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.base/break-interp.exp 2010-01-14 22:12:00.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/break-interp.exp 2010-01-15 22:14:51.000000000 +0100
@@ -31,10 +31,30 @@ if [get_compiler_info ${binfile_lib}] {
return -1
}
@@ -64,8 +68,8 @@
return -1
}
-@@ -483,9 +503,33 @@ foreach ldprelink {NO YES} {
- if {$binpie == "YES"} {
+@@ -480,9 +500,33 @@ foreach ldprelink {NO YES} {
+ if {$binpie != "NO"} {
lappend opts {additional_flags=-fPIE -pie}
}
- if {[build_executable ${test}.exp [file tail $exec] $srcfile $opts] == -1} {
@@ -100,8 +104,10 @@
if {$binsepdebug == "SEP"} {
gdb_gnu_strip_debug $exec
# Just a sanity check. As gdb_gnu_strip_debug uses the
---- ./gdb/testsuite/gdb.fortran/common-block.exp 2009-12-15 05:13:56.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/common-block.exp 2009-12-15 05:21:00.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/common-block.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/common-block.exp 2010-01-15 22:14:17.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/common-block.exp 2010-01-15 22:14:51.000000000 +0100
@@ -20,7 +20,25 @@ set testfile "common-block"
set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile}
@@ -129,8 +135,10 @@
untested "Couldn't compile ${srcfile}"
return -1
}
---- ./gdb/testsuite/gdb.fortran/dwarf-stride.exp 2009-12-15 05:13:56.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/dwarf-stride.exp 2009-12-15 05:20:07.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/dwarf-stride.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2010-01-15 22:14:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2010-01-15 22:14:51.000000000 +0100
@@ -27,7 +27,25 @@
set testfile dwarf-stride
set srcfile ${testfile}.f90
@@ -158,8 +166,10 @@
return -1
}
---- ./gdb/testsuite/gdb.fortran/dynamic.exp 2009-12-15 05:13:56.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/dynamic.exp 2009-12-15 05:17:21.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/dynamic.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/dynamic.exp 2010-01-15 22:14:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/dynamic.exp 2010-01-15 22:14:51.000000000 +0100
@@ -25,7 +25,25 @@ set testfile "dynamic"
set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile}
@@ -187,8 +197,10 @@
untested "Couldn't compile ${srcfile}"
return -1
}
---- ./gdb/testsuite/gdb.fortran/library-module.exp 2009-12-15 05:13:56.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/library-module.exp 2009-12-15 05:22:37.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/library-module.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/library-module.exp 2010-01-15 22:14:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/library-module.exp 2010-01-15 22:14:51.000000000 +0100
@@ -25,16 +25,34 @@ if [get_compiler_info not-used] {
return -1
}
@@ -228,8 +240,10 @@
untested "Couldn't compile ${srcfile}"
return -1
}
---- ./gdb/testsuite/gdb.fortran/module.exp 2009-12-15 05:13:56.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/module.exp 2009-12-15 05:28:49.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/module.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/module.exp 2010-01-15 22:14:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/module.exp 2010-01-15 22:14:51.000000000 +0100
@@ -16,7 +16,25 @@
set testfile "module"
set srcfile ${testfile}.f90
@@ -257,8 +271,10 @@
return -1
}
---- ./gdb/testsuite/gdb.fortran/string.exp 2009-12-15 05:13:56.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/string.exp 2009-12-15 05:18:13.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/string.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/string.exp 2010-01-15 22:14:13.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/string.exp 2010-01-15 22:14:51.000000000 +0100
@@ -23,7 +23,25 @@ set testfile "string"
set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile}
@@ -286,8 +302,10 @@
untested "Couldn't compile ${srcfile}"
return -1
}
---- gdb-7.0/gdb/testsuite/gdb.fortran/omp-step.exp-orig 2009-12-20 09:47:04.000000000 +0100
-+++ gdb-7.0/gdb/testsuite/gdb.fortran/omp-step.exp 2009-12-20 09:50:06.000000000 +0100
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/omp-step.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/omp-step.exp 2010-01-15 22:14:16.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/omp-step.exp 2010-01-15 22:14:51.000000000 +0100
@@ -15,7 +15,26 @@
set testfile "omp-step"
@@ -316,13 +334,16 @@
return -1
}
---- ./gdb/testsuite/gdb.fortran/derived-type.exp 2009-01-07 13:39:13.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/derived-type.exp 2009-12-20 12:37:12.000000000 +0100
-@@ -26,7 +26,25 @@ set testfile "derived-type"
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/derived-type.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/derived-type.exp 2010-01-01 08:32:02.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/derived-type.exp 2010-01-15 22:16:20.000000000 +0100
+@@ -28,8 +28,26 @@ set testfile "derived-type"
set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile}
--if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
+-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+- executable {debug f77}] != ""} {
+# Temporarily provide f77compiler=gfortran44 saving the original value around.
+
+set board [target_info name]
@@ -334,7 +355,8 @@
+}
+set_board_info f77compiler gfortran44
+
-+set err [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}]
++set err [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
++ executable {debug f77}]
+
+unset_board_info f77compiler
+if [info exists old_f77compiler] {
@@ -342,16 +364,19 @@
+}
+
+if { $err != "" } {
- untested "Couldn't compile ${srcfile}"
return -1
}
---- ./gdb/testsuite/gdb.fortran/subarray.exp 2009-01-07 13:39:13.000000000 +0100
-+++ ./gdb/testsuite/gdb.fortran/subarray.exp 2009-12-20 12:38:00.000000000 +0100
-@@ -26,7 +26,25 @@ set testfile "subarray"
+
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/subarray.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.fortran/subarray.exp 2010-01-01 08:32:02.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.fortran/subarray.exp 2010-01-15 22:17:18.000000000 +0100
+@@ -28,8 +28,26 @@ set testfile "subarray"
set srcfile ${testfile}.f
set binfile ${objdir}/${subdir}/${testfile}
--if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
+-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+- executable {debug f77}] != ""} {
+# Temporarily provide f77compiler=gfortran44 saving the original value around.
+
+set board [target_info name]
@@ -363,7 +388,8 @@
+}
+set_board_info f77compiler gfortran44
+
-+set err [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}]
++set err [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
++ executable {debug f77}]
+
+unset_board_info f77compiler
+if [info exists old_f77compiler] {
@@ -371,11 +397,13 @@
+}
+
+if { $err != "" } {
- untested "Couldn't compile ${srcfile}"
return -1
}
---- ./gdb/testsuite/gdb.threads/tls-sepdebug.exp 2009-12-20 12:22:18.000000000 +0100
-+++ ./gdb/testsuite/gdb.threads/tls-sepdebug.exp 2009-12-20 12:39:53.000000000 +0100
+
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/tls-sepdebug.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2010-01-15 22:14:15.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2010-01-15 22:14:51.000000000 +0100
@@ -32,7 +32,25 @@ set binshareddebugfile ${objdir}/${subdi
# FIXME: gcc dependency (-Wl,-soname).
++++++ gdb-solib-memory-error-nonfatal.patch ++++++
[RFC/ia64] memory error when reading wrong core file
http://sourceware.org/ml/gdb-patches/2010-01/msg00645.html
http://sourceware.org/ml/gdb-patches/2010-02/msg00001.html
http://sourceware.org/ml/gdb-patches/2010-03/msg00298.html
http://sourceware.org/ml/gdb-cvs/2010-03/msg00065.html
c961a8da422283662e09ee498c0598d48fc9d70f
--- src/gdb/solib-svr4.c 2010/02/24 00:29:02 1.125
+++ src/gdb/solib-svr4.c 2010/03/08 07:45:49 1.126
@@ -868,9 +868,16 @@
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
+ CORE_ADDR addr = 0;
+ volatile struct gdb_exception ex;
- return read_memory_typed_address (info->debug_base + lmo->r_map_offset,
- ptr_type);
+ TRY_CATCH (ex, RETURN_MASK_ERROR)
+ {
+ addr = read_memory_typed_address (info->debug_base + lmo->r_map_offset,
+ ptr_type);
+ }
+ exception_print (gdb_stderr, ex);
+ return addr;
}
/* Find r_brk from the inferior's debug base. */
### src/gdb/ChangeLog 2010/03/08 01:49:30 1.11441
### src/gdb/ChangeLog 2010/03/08 07:45:49 1.11442
## -1,3 +1,10 @@
+2010-03-08 Joel Brobecker
+
+ Memory error when reading wrong core file.
+ * solib-svr4.c (solib_svr4_r_map): catch and print all exception
+ errors while reading the inferior memory, and return zero if
+ an exception was raised.
+
2010-03-07 Michael Snyder
* record.c (record_restore): Rename tmpu8 to rectype.
++++++ gdb-unused-revert.patch ++++++
[RFA/commit 5/5] Add -Wunused-function to compile flags.
http://sourceware.org/ml/gdb-patches/2010-01/msg00371.html
http://sourceware.org/ml/gdb-cvs/2010-01/msg00163.html
REVERTED
--- src/gdb/configure.ac 2010/01/15 00:34:37 1.112
+++ src/gdb/configure.ac 2010/01/19 09:52:31 1.113
@@ -1544,8 +1544,7 @@
# gdb/doc/gdbint.texinfo.
build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wformat-nonliteral -Wno-pointer-sign \
--Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts"
+-Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
--- src/gdb/configure 2010/01/15 00:34:37 1.297
+++ src/gdb/configure 2010/01/19 09:52:32 1.298
@@ -13435,8 +13435,7 @@
# gdb/doc/gdbint.texinfo.
build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wformat-nonliteral -Wno-pointer-sign \
--Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts"
+-Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
### src/gdb/ChangeLog 2010/01/19 09:50:48 1.11271
### src/gdb/ChangeLog 2010/01/19 09:52:33 1.11272
## -1,11 +1,5 @@
2010-01-19 Joel Brobecker
- Add -Wunused-function to compile flags.
- * configure.ac: Add -Wunused-function to build_warnings.
- * configure: Regenerate.
-
-2010-01-19 Joel Brobecker
-
"delete" ada-lex.c:input function, not used.
* ada-lex.l: #define YY_NO_INPUT.
++++++ gdb-upstream.patch ++++++
++++ 803 lines (skipped)
++++++ gdb-using-directive-leak.patch ++++++
FSF GDB variant is at:
http://sourceware.org/ml/gdb-patches/2010-03/msg00789.html
commit 56b45f494f647360f9d6ff84f12f59c08cbe05af
Author: Sami Wagiaalla
Date: Mon Mar 29 16:08:58 2010 -0400
Fix using_directive memory leak.
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index ff2c9b1..35e4663 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -387,6 +387,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
}
block_set_using (block, using_directives, &objfile->objfile_obstack);
+ using_directives = NULL;
record_pending_block (objfile, block, opblock);
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 6325ead..c6df91f 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -120,7 +120,8 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
anonymous namespace. So add symbols in it to the
namespace given by the previous component if there is
one, or to the global namespace if there isn't. */
- cp_add_using_directive (dest, src, NULL, "", 0);
+ cp_add_using_directive (dest, src, NULL, "", 0,
+ &SYMBOL_SYMTAB (symbol)->objfile->objfile_obstack);
}
/* The "+ 2" is for the "::". */
previous_component = next_component + 2;
@@ -132,11 +133,17 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
}
/* Add a using directive to using_list. If the using directive in question
- has already been added, don't add it twice. */
+ has already been added, don't add it twice.
+ Create a new struct using_direct which imports the namespace SRC into the
+ scope DEST. ALIAS is the name of the imported namespace in the current
+ scope. If ALIAS is NULL then the namespace is known by its original name.
+ The arguments are copied into newly allocated memory so they can be
+ temporaries. */
void
cp_add_using_directive (const char *dest, const char *src, const char *alias,
- const char *declaration, const int line_number)
+ const char *declaration, const int line_number,
+ struct obstack *obstack)
{
struct using_direct *current;
struct using_direct *new;
@@ -146,12 +153,26 @@ cp_add_using_directive (const char *dest, const char *src, const char *alias,
for (current = using_directives; current != NULL; current = current->next)
{
if (strcmp (current->import_src, src) == 0
- && strcmp (current->import_dest, dest) == 0)
+ && strcmp (current->import_dest, dest) == 0
+ && ((alias == NULL && current->alias == NULL)
+ || (alias != NULL && current->alias != NULL
+ && strcmp (alias, current->alias) == 0)))
return;
}
- using_directives = cp_add_using (dest, src, alias, declaration,
- line_number, using_directives);
+ new = OBSTACK_ZALLOC (obstack, struct using_direct);
+
+ new->import_src = obsavestring (src, strlen (src), obstack);
+ new->import_dest = obsavestring (dest, strlen (dest), obstack);
+
+ if (alias != NULL)
+ new->alias = obsavestring (alias, strlen (alias), obstack);
+
+ new->declaration = obsavestring (declaration, strlen (declaration), obstack);
+ new->line_number = line_number;
+
+ new->next = using_directives;
+ using_directives = new;
}
@@ -203,42 +224,6 @@ cp_is_anonymous (const char *namespace)
!= NULL);
}
-/* Create a new struct using direct which imports the namespace SRC
- into the scope DEST. ALIAS is the name of the imported namespace
- in the current scope. If ALIAS is NULL then the
- namespace is known by its original name.
-
- Set its next member in the linked list to NEXT; allocate all memory
- using xmalloc. It copies the strings, so NAME can be a temporary
- string. */
-
-struct using_direct *
-cp_add_using (const char *dest,
- const char *src,
- const char *alias,
- const char *declaration,
- const int line_number,
- struct using_direct *next)
-{
- struct using_direct *retval;
-
- retval = xmalloc (sizeof (struct using_direct));
- retval->import_src = savestring (src, strlen (src));
- retval->import_dest = savestring (dest, strlen (dest));
-
- if (alias != NULL)
- retval->alias = savestring (alias, strlen (alias));
- else
- retval->alias = NULL;
-
- retval->declaration = savestring (declaration, strlen (declaration));
- retval->line_number = line_number;
- retval->next = next;
- retval->searched = 0;
-
- return retval;
-}
-
/* The C++-specific version of name lookup for static and global
names. This makes sure that names get looked for in all namespaces
that are in scope. NAME is the natural name of the symbol that
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 57aa5e5..41f17fe 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -101,14 +101,8 @@ extern void cp_add_using_directive (const char *dest,
const char *src,
const char *alias,
const char *declaration,
- const int line_number);
-
-extern struct using_direct *cp_add_using (const char *dest,
- const char *src,
- const char *alias,
- const char *declaration,
- const int line_number,
- struct using_direct *next);
+ const int line_number,
+ struct obstack *obstack);
extern void cp_initialize_namespace (void);
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index e3a780e..b73f444 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3563,12 +3563,12 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
}
}
- using_directives = cp_add_using (import_prefix,
- canonical_name,
- import_alias,
- imported_declaration,
- line_number,
- using_directives);
+ cp_add_using_directive (import_prefix,
+ canonical_name,
+ import_alias,
+ imported_declaration,
+ line_number,
+ &cu->objfile->objfile_obstack);
}
static void
@@ -5703,7 +5703,12 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
if (is_anonymous)
{
const char *previous_prefix = determine_prefix (die, cu);
- cp_add_using_directive (previous_prefix, TYPE_NAME (type), NULL, "", dwarf2_read_decl_line(die, cu));
+ cp_add_using_directive (previous_prefix,
+ TYPE_NAME (type),
+ NULL,
+ "",
+ dwarf2_read_decl_line(die, cu),
+ &objfile->objfile_obstack);
}
}
diff --git a/gdb/testsuite/gdb.cp/gdb2384-base.cc b/gdb/testsuite/gdb.cp/gdb2384-base.cc
index 09ed04e..b58f30d 100644
--- a/gdb/testsuite/gdb.cp/gdb2384-base.cc
+++ b/gdb/testsuite/gdb.cp/gdb2384-base.cc
@@ -23,6 +23,8 @@ base::base (int _x)
{
}
+using namespace B;
+
int
base::meth ()
{
diff --git a/gdb/testsuite/gdb.cp/gdb2384-base.h b/gdb/testsuite/gdb.cp/gdb2384-base.h
index b09701e..981943c 100644
--- a/gdb/testsuite/gdb.cp/gdb2384-base.h
+++ b/gdb/testsuite/gdb.cp/gdb2384-base.h
@@ -16,6 +16,10 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
+namespace B{
+ int x;
+}
+
class base
{
public:
++++++ libstdc++-v3-python-r151798.tar.bz2 -> libstdc++-v3-python-r155978.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstdc++-v3-python-r151798/Makefile.in new/libstdc++-v3-python-r155978/Makefile.in
--- old/libstdc++-v3-python-r151798/Makefile.in 2009-08-23 14:16:41.000000000 +0200
+++ new/libstdc++-v3-python-r155978/Makefile.in 2009-12-06 11:45:16.000000000 +0100
@@ -243,7 +243,6 @@
libtool_VERSION = @libtool_VERSION@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
multi_basedir = @multi_basedir@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstdc++-v3-python-r151798/hook.in new/libstdc++-v3-python-r155978/hook.in
--- old/libstdc++-v3-python-r151798/hook.in 2009-06-18 21:12:37.000000000 +0200
+++ new/libstdc++-v3-python-r155978/hook.in 2009-09-20 12:47:22.000000000 +0200
@@ -40,7 +40,7 @@
# In some bizarre configuration we might have found a match in the
# middle of a directory name.
if prefix[-1] != '/':
- prefix = os.path.dirname (prefix)
+ prefix = os.path.dirname (prefix) + '/'
# Strip off the prefix.
pythondir = pythondir[len (prefix):]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstdc++-v3-python-r151798/libstdcxx/v6/printers.py new/libstdc++-v3-python-r155978/libstdcxx/v6/printers.py
--- old/libstdc++-v3-python-r151798/libstdcxx/v6/printers.py 2009-07-17 06:35:36.000000000 +0200
+++ new/libstdc++-v3-python-r155978/libstdcxx/v6/printers.py 2010-01-16 08:45:51.000000000 +0100
@@ -1,6 +1,6 @@
# Pretty-printers for libstc++.
-# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009, 2010 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
@@ -64,28 +64,44 @@
self.count = self.count + 1
return ('[%d]' % count, elt['_M_data'])
- def __init__(self, val):
+ def __init__(self, typename, val):
+ self.typename = typename
self.val = val
def children(self):
itype = self.val.type.template_argument(0)
- nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
+ # If the inferior program is compiled with -D_GLIBCXX_DEBUG
+ # some of the internal implementation details change.
+ if self.typename == "std::list":
+ nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
+ elif self.typename == "std::__debug::list":
+ nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
+ else:
+ raise "Cannot cast list node for list printer."
return self._iterator(nodetype, self.val['_M_impl']['_M_node'])
def to_string(self):
if self.val['_M_impl']['_M_node'].address == self.val['_M_impl']['_M_node']['_M_next']:
- return 'empty std::list'
- return 'std::list'
+ return 'empty %s' % (self.typename)
+ return '%s' % (self.typename)
class StdListIteratorPrinter:
"Print std::list::iterator"
- def __init__(self, val):
+ def __init__(self, typename, val):
self.val = val
+ self.typename = typename
def to_string(self):
itype = self.val.type.template_argument(0)
- nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
+ # If the inferior program is compiled with -D_GLIBCXX_DEBUG
+ # some of the internal implementation details change.
+ if self.typename == "std::_List_iterator" or self.typename == "std::_List_const_iterator":
+ nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
+ elif self.typename == "std::__norm::_List_iterator" or self.typename == "std::__norm::_List_const_iterator":
+ nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
+ else:
+ raise "Cannot cast list node for list iterator printer."
return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
class StdSlistPrinter:
@@ -154,7 +170,8 @@
self.item = self.item + 1
return ('[%d]' % count, elt)
- def __init__(self, val):
+ def __init__(self, typename, val):
+ self.typename = typename
self.val = val
def children(self):
@@ -165,8 +182,8 @@
start = self.val['_M_impl']['_M_start']
finish = self.val['_M_impl']['_M_finish']
end = self.val['_M_impl']['_M_end_of_storage']
- return ('std::vector of length %d, capacity %d'
- % (int (finish - start), int (end - start)))
+ return ('%s of length %d, capacity %d'
+ % (self.typename, int (finish - start), int (end - start)))
def display_hint(self):
return 'array'
@@ -180,6 +197,64 @@
def to_string(self):
return self.val['_M_current'].dereference()
+class StdTuplePrinter:
+ "Print a std::tuple"
+
+ class _iterator:
+ def __init__ (self, head):
+ self.head = head
+
+ # Set the base class as the initial head of the
+ # tuple.
+ nodes = self.head.type.fields ()
+ if len (nodes) != 1:
+ raise "Top of tuple tree does not consist of a single node."
+
+ # Set the actual head to the first pair.
+ self.head = self.head.cast (nodes[0].type)
+ self.count = 0
+
+ def __iter__ (self):
+ return self
+
+ def next (self):
+ nodes = self.head.type.fields ()
+ # Check for further recursions in the inheritance tree.
+ if len (nodes) == 0:
+ raise StopIteration
+ # Check that this iteration has an expected structure.
+ if len (nodes) != 2:
+ raise "Cannot parse more than 2 nodes in a tuple tree."
+
+ # - Left node is the next recursion parent.
+ # - Right node is the actual class contained in the tuple.
+
+ # Process right node.
+ impl = self.head.cast (nodes[1].type)
+
+ # Process left node and set it as head.
+ self.head = self.head.cast (nodes[0].type)
+ self.count = self.count + 1
+
+ # Finally, check the implementation. If it is
+ # wrapped in _M_head_impl return that, otherwise return
+ # the value "as is".
+ fields = impl.type.fields ()
+ if len (fields) < 1 or fields[0].name != "_M_head_impl":
+ return ('[%d]' % self.count, impl)
+ else:
+ return ('[%d]' % self.count, impl['_M_head_impl'])
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.val = val;
+
+ def children (self):
+ return self._iterator (self.val)
+
+ def to_string (self):
+ return '%s containing' % (self.typename)
+
class StdStackOrQueuePrinter:
"Print a std::stack or std::queue"
@@ -248,6 +323,17 @@
nodetype = nodetype.pointer()
return self.val.cast(nodetype).dereference()['_M_value_field']
+class StdDebugIteratorPrinter:
+ "Print a debug enabled version of an iterator"
+
+ def __init__ (self, val):
+ self.val = val
+
+ # Just strip away the encapsulating __gnu_debug::_Safe_iterator
+ # and return the wrapped iterator value.
+ def to_string (self):
+ itype = self.val.type.template_argument(0)
+ return self.val['_M_current'].cast(itype)
class StdMapPrinter:
"Print a std::map or std::multimap"
@@ -330,13 +416,14 @@
class StdBitsetPrinter:
"Print a std::bitset"
- def __init__(self, val):
+ def __init__(self, typename, val):
+ self.typename = typename
self.val = val
def to_string (self):
# If template_argument handled values, we could print the
# size. Or we could use a regexp on the type.
- return 'std::bitset'
+ return '%s' % (self.typename)
def children (self):
words = self.val['_M_w']
@@ -399,7 +486,8 @@
return result
- def __init__(self, val):
+ def __init__(self, typename, val):
+ self.typename = typename
self.val = val
self.elttype = val.type.template_argument(0)
size = self.elttype.sizeof
@@ -418,7 +506,7 @@
size = self.buffer_size * delta_n + delta_s + delta_e
- return 'std::deque with %d elements' % long (size)
+ return '%s with %d elements' % (self.typename, long (size))
def children(self):
start = self.val['_M_impl']['_M_start']
@@ -441,18 +529,10 @@
class StdStringPrinter:
"Print a std::basic_string of some kind"
- def __init__(self, encoding, val):
- self.encoding = encoding
+ def __init__(self, val):
self.val = val
def to_string(self):
- # Look up the target encoding as late as possible.
- encoding = self.encoding
- if encoding == 0:
- encoding = gdb.parameter('target-charset')
- elif encoding == 1:
- encoding = gdb.parameter('target-wide-charset')
-
# Make sure &string works, too.
type = self.val.type
if type.code == gdb.TYPE_CODE_REF:
@@ -466,7 +546,7 @@
reptype = gdb.lookup_type (str (realtype) + '::_Rep').pointer ()
header = ptr.cast(reptype) - 1
len = header.dereference ()['_M_length']
- return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
+ return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
def display_hint (self):
return 'string'
@@ -599,24 +679,36 @@
# libstdc++ objects requiring pretty-printing.
# In order from:
# http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01847.html
- pretty_printers_dict[re.compile('^std::basic_string$')] = lambda val: StdStringPrinter(0, val)
- pretty_printers_dict[re.compile('^std::basic_string$')] = lambda val: StdStringPrinter(1, val)
- pretty_printers_dict[re.compile('^std::basic_string$')] = lambda val: StdStringPrinter('UTF-16', val)
- pretty_printers_dict[re.compile('^std::basic_string$')] = lambda val: StdStringPrinter('UTF-32', val)
- pretty_printers_dict[re.compile('^std::bitset<.*>$')] = StdBitsetPrinter
- pretty_printers_dict[re.compile('^std::deque<.*>$')] = StdDequePrinter
- pretty_printers_dict[re.compile('^std::list<.*>$')] = StdListPrinter
+ pretty_printers_dict[re.compile('^std::basic_string<.*>$')] = lambda val: StdStringPrinter(val)
+ pretty_printers_dict[re.compile('^std::bitset<.*>$')] = lambda val: StdBitsetPrinter("std::bitset", val)
+ pretty_printers_dict[re.compile('^std::deque<.*>$')] = lambda val: StdDequePrinter("std::deque", val)
+ pretty_printers_dict[re.compile('^std::list<.*>$')] = lambda val: StdListPrinter("std::list", val)
pretty_printers_dict[re.compile('^std::map<.*>$')] = lambda val: StdMapPrinter("std::map", val)
pretty_printers_dict[re.compile('^std::multimap<.*>$')] = lambda val: StdMapPrinter("std::multimap", val)
pretty_printers_dict[re.compile('^std::multiset<.*>$')] = lambda val: StdSetPrinter("std::multiset", val)
pretty_printers_dict[re.compile('^std::priority_queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::priority_queue", val)
pretty_printers_dict[re.compile('^std::queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::queue", val)
+ pretty_printers_dict[re.compile('^std::tuple<.*>$')] = lambda val: StdTuplePrinter("std::tuple", val)
pretty_printers_dict[re.compile('^std::set<.*>$')] = lambda val: StdSetPrinter("std::set", val)
pretty_printers_dict[re.compile('^std::stack<.*>$')] = lambda val: StdStackOrQueuePrinter("std::stack", val)
pretty_printers_dict[re.compile('^std::unique_ptr<.*>$')] = UniquePointerPrinter
- pretty_printers_dict[re.compile('^std::vector<.*>$')] = StdVectorPrinter
+ pretty_printers_dict[re.compile('^std::vector<.*>$')] = lambda val: StdVectorPrinter("std::vector", val)
# vector<bool>
+ # Printer registrations for classes compiled with -D_GLIBCXX_DEBUG.
+ pretty_printers_dict[re.compile('^std::__debug::bitset<.*>$')] = lambda val: StdBitsetPrinter("std::__debug::bitset", val)
+ pretty_printers_dict[re.compile('^std::__debug::deque<.*>$')] = lambda val: StdDequePrinter("std::__debug::deque", val)
+ pretty_printers_dict[re.compile('^std::__debug::list<.*>$')] = lambda val: StdListPrinter("std::__debug::list", val)
+ pretty_printers_dict[re.compile('^std::__debug::map<.*>$')] = lambda val: StdMapPrinter("std::__debug::map", val)
+ pretty_printers_dict[re.compile('^std::__debug::multimap<.*>$')] = lambda val: StdMapPrinter("std::__debug::multimap", val)
+ pretty_printers_dict[re.compile('^std::__debug::multiset<.*>$')] = lambda val: StdSetPrinter("std::__debug::multiset", val)
+ pretty_printers_dict[re.compile('^std::__debug::priority_queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::__debug::priority_queue", val)
+ pretty_printers_dict[re.compile('^std::__debug::queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::__debug::queue", val)
+ pretty_printers_dict[re.compile('^std::__debug::set<.*>$')] = lambda val: StdSetPrinter("std::__debug::set", val)
+ pretty_printers_dict[re.compile('^std::__debug::stack<.*>$')] = lambda val: StdStackOrQueuePrinter("std::__debug::stack", val)
+ pretty_printers_dict[re.compile('^std::__debug::unique_ptr<.*>$')] = UniquePointerPrinter
+ pretty_printers_dict[re.compile('^std::__debug::vector<.*>$')] = lambda val: StdVectorPrinter("std::__debug::vector", val)
+
# These are the TR1 and C++0x printers.
# For array - the default GDB pretty-printer seems reasonable.
pretty_printers_dict[re.compile('^std::shared_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::shared_ptr', val)
@@ -633,6 +725,14 @@
pretty_printers_dict[re.compile('^std::tr1::unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::tr1::unordered_multimap', val)
pretty_printers_dict[re.compile('^std::tr1::unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::tr1::unordered_multiset', val)
+ # These are the C++0x printer registrations for -D_GLIBCXX_DEBUG cases.
+ # The tr1 namespace printers do not seem to have any debug
+ # equivalents, so do no register them.
+ pretty_printers_dict[re.compile('^std::__debug::unordered_map<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::__debug::unordered_map', val)
+ pretty_printers_dict[re.compile('^std::__debug::unordered_set<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::__debug::unordered_set', val)
+ pretty_printers_dict[re.compile('^std::__debug::unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::__debug::unordered_multimap', val)
+ pretty_printers_dict[re.compile('^std::__debug::unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::__debug:unordered_multiset', val)
+
# Extensions.
pretty_printers_dict[re.compile('^__gnu_cxx::slist<.*>$')] = StdSlistPrinter
@@ -640,8 +740,8 @@
if True:
# These shouldn't be necessary, if GDB "print *i" worked.
# But it often doesn't, so here they are.
- pretty_printers_dict[re.compile('^std::_List_iterator<.*>$')] = lambda val: StdListIteratorPrinter(val)
- pretty_printers_dict[re.compile('^std::_List_const_iterator<.*>$')] = lambda val: StdListIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::_List_iterator<.*>$')] = lambda val: StdListIteratorPrinter("std::_List_iterator",val)
+ pretty_printers_dict[re.compile('^std::_List_const_iterator<.*>$')] = lambda val: StdListIteratorPrinter("std::_List_const_iterator",val)
pretty_printers_dict[re.compile('^std::_Rb_tree_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
pretty_printers_dict[re.compile('^std::_Rb_tree_const_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
pretty_printers_dict[re.compile('^std::_Deque_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
@@ -649,6 +749,15 @@
pretty_printers_dict[re.compile('^__gnu_cxx::__normal_iterator<.*>$')] = lambda val: StdVectorIteratorPrinter(val)
pretty_printers_dict[re.compile('^__gnu_cxx::_Slist_iterator<.*>$')] = lambda val: StdSlistIteratorPrinter(val)
+ # Debug (compiled with -D_GLIBCXX_DEBUG) printer registrations.
+ # The Rb_tree debug iterator when unwrapped from the encapsulating __gnu_debug::_Safe_iterator
+ # does not have the __norm namespace. Just use the existing printer registration for that.
+ pretty_printers_dict[re.compile('^__gnu_debug::_Safe_iterator<.*>$')] = lambda val: StdDebugIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::__norm::_List_iterator<.*>$')] = lambda val: StdListIteratorPrinter ("std::__norm::_List_iterator",val)
+ pretty_printers_dict[re.compile('^std::__norm::_List_const_iterator<.*>$')] = lambda val: StdListIteratorPrinter ("std::__norm::_List_const_iterator",val)
+ pretty_printers_dict[re.compile('^std::__norm::_Deque_const_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::__norm::_Deque_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
+
pretty_printers_dict = {}
build_libstdcxx_dictionary ()
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org