- Fix ia64 part of the bt-clone-stop.exp fix.

- Fix gdb.ada/* regressions (Keith Seitz).
- Remove false gdb_assert on $sp underflow.
This commit is contained in:
Jan Kratochvil 2010-02-26 08:56:34 +00:00
parent c448a64ed8
commit 7d64017236
4 changed files with 120 additions and 4 deletions

View File

@ -164,7 +164,7 @@ Index: gdb-6.8.50.20090802/gdb/amd64-tdep.c
/* Floating-point registers. */
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -2122,6 +2122,137 @@ static const struct frame_unwind ia64_frame_unwind =
@@ -2122,6 +2122,138 @@ static const struct frame_unwind ia64_frame_unwind =
default_frame_sniffer
};
@ -228,12 +228,13 @@ Index: gdb-6.8.50.20090802/gdb/amd64-tdep.c
+ if (minsym == NULL)
+ return 0;
+
+ instr = slotN_contents (&buf[LINUX_CLONE_PRE_SLOTS * 16], 2);
+ instr = slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], 2);
+ instr &= ~(((1L << 20) - 1) << 13);
+ /* Address is relative to the jump instruction slot, not the next one. */
+ instr |= (((SYMBOL_VALUE_ADDRESS (minsym) - (pc & ~0xfL)) >> 4)
+ & ((1L << 20) - 1)) << 13;
+ replace_slotN_contents (&buf[LINUX_CLONE_PRE_SLOTS * 16], instr, 2);
+ replace_slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], instr,
+ 2);
+
+ if (memcmp (&buf[LINUX_CLONE_PRE_SLOTS * 16],
+ &linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16],

23
gdb-archer-ada.patch Normal file
View File

@ -0,0 +1,23 @@
From: Keith Seitz <keiths@redhat.com>
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
@@ -9924,9 +9928,13 @@ dwarf2_canonicalize_name (char *name, st
static char *
dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
{
- struct attribute *attr;
+ struct attribute *attr = NULL;
+
+ if (cu->language == language_ada)
+ attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu);
- attr = dwarf2_attr (die, DW_AT_name, cu);
+ if (!attr)
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (!attr || !DW_STRING (attr))
return NULL;

View File

@ -0,0 +1,81 @@
http://sourceware.org/ml/gdb-patches/2010-02/msg00515.html
Subject: [patch] infcall: Remove gdb_assert ($sp overflow)
Hi,
set $sp=0
call something()
->
../../gdb/infcall.c:521: internal-error: call_function_by_hand: Assertion
`(gdbarch_inner_than (gdbarch, 1, 2) && sp <= old_sp) || (gdbarch_inner_than
(gdbarch, 2, 1) && sp >= old_sp)' failed.
as $sp - frame == 0xffffsmth which is not lower than $sp.
It must not be gdb_assert(). It can be an error() but I left it just to do:
(gdb) set $sp=0
(gdb) call doubleit (1)
Cannot access memory at address 0xffffffffffffff78
(gdb) set $sp=-1
(gdb) call doubleit (1)
Cannot access memory at address 0xffffffffffffff68
Unaware how inconvenient is an intentional crash of the testcase on some
embedded/non-MMU systems.
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
Thanks,
Jan
gdb/
2010-02-19 Jan Kratochvil <jan.kratochvil@redhat.com>
* infcall.c (call_function_by_hand): Remove gdb_assert on sp and old_sp.
New comment.
gdb/testsuite/
2010-02-19 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/callfuncs.exp: New tests for $spval 0 and -1. Remove return.
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -518,10 +518,9 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
/* Stack grows up. */
sp = gdbarch_frame_align (gdbarch, old_sp + 1);
}
- gdb_assert ((gdbarch_inner_than (gdbarch, 1, 2)
- && sp <= old_sp)
- || (gdbarch_inner_than (gdbarch, 2, 1)
- && sp >= old_sp));
+ /* SP may have overflown address zero here from OLD_SP. Memory access
+ functions will probably fail in such case but that is a target's
+ problem. */
}
else
/* FIXME: cagney/2002-09-18: Hey, you loose!
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -469,5 +469,18 @@ if {$old_reg_content == $new_reg_content} then {
fail "nested call dummies preserve register contents"
}
-return 0
+# GDB should not crash by internal error on $sp overflow during the inferior
+# call. It is OK it will stop on some: Cannot access memory at address 0x$hex.
+foreach spval {0 -1} {
+ set old_ldprefix $pf_prefix
+ lappend pf_prefix "sp=$spval:"
+
+ gdb_test {set $old_sp = $sp}
+ gdb_test "set \$sp = $spval"
+
+ gdb_test "call doubleit (1)"
+
+ gdb_test {set $sp = $old_sp}
+ set pf_prefix $old_ldprefix
+}

View File

@ -36,7 +36,7 @@ Version: 7.0.50.20100203
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 15%{?_with_upstream:.upstream}%{dist}
Release: 16%{?_with_upstream:.upstream}%{dist}
License: GPLv3+
Group: Development/Debuggers
@ -374,6 +374,7 @@ Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch
# The merged branch `archer' of: http://sourceware.org/gdb/wiki/ProjectArcher
Patch349: gdb-archer.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.
@ -429,6 +430,9 @@ 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
# Remove false gdb_assert on $sp underflow.
Patch422: gdb-infcall-sp-underflow.patch
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
Requires: readline%{?_isa}
BuildRequires: readline-devel%{?_isa}
@ -565,6 +569,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
#patch232 -p1
%patch349 -p1
%patch420 -p1
%patch124 -p1
%patch1 -p1
%patch3 -p1
@ -678,6 +683,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch408 -p1
%patch412 -p1
%patch417 -p1
%patch422 -p1
%patch415 -p1
%patch393 -p1
@ -1010,6 +1016,11 @@ fi
%endif
%changelog
* Fri Feb 26 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100203-16.fc13
- Fix ia64 part of the bt-clone-stop.exp fix.
- Fix gdb.ada/* regressions (Keith Seitz).
- Remove false gdb_assert on $sp underflow.
* Mon Feb 8 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100203-15.fc13
- Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).