This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix bigcore.exp sanity checks
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Mon, 13 Jun 2005 14:11:25 -0400
- Subject: [commit] Fix bigcore.exp sanity checks
After waiting for a while for kernel.org kernels to incorporate whatever
patches were necessary for bigcore.exp, I wrote some sanity checks for it
which were supposed to fail gracefully if the kernel was too buggy to test
GDB. At the time, they generated a single xfail.
When Andrew rewrote the dump-core part of the test in September, he broke
the sanity checks; he also changed it to a fail+untested. I'm presuming
that the fail was an accident, since changing xfail->untested here seems
reasonable. Here's the original patch:
http://sourceware.org/ml/gdb-patches/2004-09/msg00312.html
The breakage was that the sanity check read from the inferior, but he moved
it after sending SIGABRT to the inferior - so by the time the core file
exists, the inferior's gone. We have to read early, and save for later.
This patch changes the test from 11 PASS, 2 FAIL on my system to 11 PASS, 1
UNTESTED.
I am going to fix the blasted kernel bug, next, since none of the
distributions shipping (presumably) fixed kernels seem to have contributed
an adequate patch to kernel.org yet...
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-06-13 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.base/bigcore.exp: Correct checks for systems which can
not dump a large core file.
Index: gdb.base/bigcore.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/bigcore.exp,v
retrieving revision 1.10
diff -u -p -r1.10 bigcore.exp
--- gdb.base/bigcore.exp 24 Sep 2004 18:44:56 -0000 1.10
+++ gdb.base/bigcore.exp 13 Jun 2005 18:09:59 -0000
@@ -1,4 +1,4 @@
-# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2004
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2005
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -118,6 +118,10 @@ proc extract_heap { dir } {
set next_heap [extract_heap next]
set prev_heap [extract_heap prev]
+# Save the total allocated size within GDB so that we can check
+# the core size later.
+gdb_test "set \$bytes_allocated = bytes_allocated" "" "save heap size"
+
# Now create a core dump
# Rename the core file to "TESTFILE.corefile" rather than just "core",
@@ -171,11 +175,15 @@ if { $file == "" } {
if {[catch {file size $corefile} core_size] == 0} {
set core_ok 0
- gdb_test_multiple "print bytes_allocated < $core_size" "check core size" {
+ gdb_test_multiple "print \$bytes_allocated < $core_size" "check core size" {
-re " = 1\r\n$gdb_prompt $" {
pass "check core size"
set core_ok 1
}
+ -re " = 0\r\n$gdb_prompt $" {
+ pass "check core size"
+ set core_ok 0
+ }
}
} {
# Probably failed due to the TCL build having problems with very