* infcall.c (call_function_by_hand): Remove gdb_assert on sp and old_sp.
New comment.
gdb/testsuite/
* gdb.base/callfuncs.exp: New tests for $spval 0 and -1. Remove return.
+2010-02-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * infcall.c (call_function_by_hand): Remove gdb_assert on sp and old_sp.
+ New comment.
+
2010-02-28 Corinna Vinschen <vinschen@redhat.com>
* Makefile.in (SUBDIR_MI_OBS): Move mi-common.o from here...
/* 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 underflown 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!
+2010-02-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb.base/callfuncs.exp: New tests for $spval 0 and -1. Remove return.
+
2010-02-25 David S. Miller <davem@davemloft.net>
* gdb.base/catch-syscall.exp: Allow to run on sparc*-*-linux and
fail "nested call dummies preserve register contents"
}
-return 0
+# GDB should not crash by internal error on $sp underflow during the inferior
+# call. It is OK it will stop on some: Cannot access memory at address 0x$hex.
+if {![target_info exists gdb,nosignals] && ![istarget "*-*-uclinux*"]} {
+ gdb_test {set $old_sp = $sp}
+
+ gdb_test {set $sp = 0}
+ gdb_test "call doubleit (1)" "" "sp == 0: call doubleit (1)"
+
+ gdb_test {set $sp = -1}
+ gdb_test "call doubleit (1)" "" "sp == -1: call doubleit (1)"
+
+ gdb_test {set $sp = $old_sp}
+}