This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] gdb.trace/*.exp send_gdb vs. gdb_test


On Friday 28 May 2010 00:24:59, Michael Snyder wrote:
> Pedro Alves wrote:
> 
> > ... the test is using an undocumented packet to set
> > artificial limits on the remote tracing engine.  GDBserver doesn't
> > implement that packet.  I had never heard of this packet, and I'm
> > not sure it makes much sense to have this test nowadays.  Can we
> > just get rid of the whole test file?
> 
> 
> OK with me, but probably not my decision...

Okay, since you wrote it, and won't miss it, and nobody spoke in its
defense, I went ahead and removed it.

-- 
Pedro Alves

2010-05-29  Pedro Alves  <pedro@codesourcery.com>

	* limits.c, limits.exp: Delete files.
	* Makefile.in (clean mostlyclean): Adjust.
	* tracecmd.exp: Adjust.

---
 gdb/testsuite/gdb.trace/Makefile.in  |    2 
 gdb/testsuite/gdb.trace/limits.c     |   51 -----
 gdb/testsuite/gdb.trace/limits.exp   |  306 -----------------------------------
 gdb/testsuite/gdb.trace/tracecmd.exp |    3 
 4 files changed, 2 insertions(+), 360 deletions(-)

Index: src/gdb/testsuite/gdb.trace/Makefile.in
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/Makefile.in	2010-05-28 22:57:03.000000000 +0100
+++ src/gdb/testsuite/gdb.trace/Makefile.in	2010-05-28 22:58:51.000000000 +0100
@@ -7,7 +7,7 @@ all info install-info dvi install uninst
 	@echo "Nothing to be done for $@..."
 
 clean mostlyclean:
-	-rm -f actions circ collection limits
+	-rm -f actions circ collection
 	-rm -f *.o *.diff *~ *.bad core sh3 hppa mn10300
 
 distclean maintainer-clean realclean: clean
Index: src/gdb/testsuite/gdb.trace/limits.c
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/limits.c	2010-05-28 22:56:58.000000000 +0100
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,51 +0,0 @@
-/*
- * Test program for tracing internal limits (number of tracepoints etc.)
- */
-
-int n = 6;
-
-int arr[64];
-
-static void foo(int x)
-{
-}
-
-static void bar(int y)
-{
-}
-
-static void baz(int z)
-{
-}
-
-static void begin ()	/* called before anything else */
-{
-}
-
-static void end ()	/* called after everything else */
-{
-}
-
-int
-main (argc, argv, envp)
-     int argc;
-     char *argv[], **envp;
-{
-  int i;
-
-#ifdef usestubs
-  set_debug_traps ();
-  breakpoint ();
-#endif
-
-  begin ();
-  for (i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
-    arr[i] = i + 1;
-
-  foo (1);
-  bar (2);
-  baz (3);
-  end ();
-  return 0;
-}
-
Index: src/gdb/testsuite/gdb.trace/limits.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/limits.exp	2010-05-28 22:56:27.000000000 +0100
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,306 +0,0 @@
-# Copyright 1998, 2007, 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
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-load_lib "trace-support.exp"
-
-if $tracelevel then {
-	strace $tracelevel
-}
-
-
-set testfile "limits"
-set srcfile ${testfile}.c
-set binfile $objdir/$subdir/$testfile
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
-	executable {debug nowarnings}] != "" } {
-    untested limits.exp
-    return -1
-}
-
-# Tests:
-# 1) Meet and exceed artificial limit on number of tracepoints
-# 2) Meet and exceed artificial limit on number of memranges
-# 3) Meet and exceed artificial limit on bytes  of bytecode data
-# [NOTE: number four is moved out into its own separate test module.]
-# 4) Meet and exceed artificial limit on bytes  of trace buffer storage
-#    (circular and non-circular modes).  However note that a more 
-#    thorough test of the circular mode can be made separately.
-
-set cr "\[\r\n\]+"
-
-proc gdb_tracepoint_limit_test { } {
-    global gdb_prompt
-    global cr
-
-    # Make sure we're in a sane starting state.
-    gdb_test "tstop" "" ""
-    gdb_test "tfind none" "" ""
-    gdb_delete_tracepoints
-
-    # Set three tracepoints
-    gdb_test "trace foo" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "tracepoint limit test: set first tracepoint"
-
-    gdb_test "trace bar" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "tracepoint limit test: set second tracepoint"
-
-    gdb_test "trace baz" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "tracepoint limit test: set third tracepoint"
-
-    # Set secret artificial tracepoint limit to four
-    gdb_test "maint packet QTLimit:tp:4" \
-	    "received: .OK." \
-	    "tracepoint limit test: set limit to four"
-
-    # Now sending three tracepoints should succeed.
-    send_gdb "tstart\n"
-    gdb_expect {
-	-re "$cr$gdb_prompt" {
-	    pass "tracepoint limit test: send fewer than limit"
-	}
-	default {
-	    fail "tracepoint limit test: send fewer than limit"
-	}
-    }
-
-    # Set secret artificial tracepoint limit to three
-    gdb_test "maint packet QTLimit:tp:3" \
-	    "received: .OK." \
-	    "tracepoint limit test: set limit to three"
-
-    # Now sending three tracepoints should still succeed.
-    send_gdb "tstart\n"
-    gdb_expect {
-	-re "$cr$gdb_prompt" {
-	    pass "tracepoint limit test: send equal to limit"
-	}
-	default {
-	    fail "tracepoint limit test: send equal to limit"
-	}
-    }
-
-    # Set secret artificial tracepoint limit to two
-    gdb_test "maint packet QTLimit:tp:2" \
-	    "received: .OK." \
-	    "tracepoint limit test: set limit to two"
-
-    # Now sending three tracepoints should fail.
-    gdb_test "tstart" \
-	    ".*\[Ee\]rror.*" \
-	    "tracepoint limit test: send more than limit"
-
-    # Clean up:
-    gdb_test "tstop" "" ""
-    gdb_test "maint packet QTLimit:tp:FFFFFFFF" "" ""
-}
-
-proc gdb_memrange_limit_test { } {
-    global gdb_prompt
-    global cr
-
-    # Make sure we're in a sane starting state.
-    gdb_test "tstop" "" ""
-    gdb_test "tfind none" "" ""
-    gdb_delete_tracepoints
-
-    # Set three tracepoints, and make 'em collect memranges
-    gdb_test "trace foo" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "memrange limit test: set first tracepoint"
-
-    gdb_trace_setactions "memrange limit test: set first actions" \
-	    "" \
-	    "collect \$arg" "^$"
-
-    gdb_test "trace bar" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "memrange limit test: set second tracepoint"
-
-    gdb_trace_setactions "memrange limit test: set second actions" \
-	    "" \
-	    "collect \$arg" "^$"
-
-    gdb_test "trace baz" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "memrange limit test: set third tracepoint"
-
-    gdb_trace_setactions "memrange limit test: set third actions" \
-	    "" \
-	    "collect \$arg" "^$"
-
-    # Set secret artificial memrange limit to four
-    gdb_test "maint packet QTLimit:memrange:4" \
-	    "received: .OK." \
-	    "memrange limit test: set limit to four"
-
-    # Now sending three memranges should still succeed.
-    send_gdb "tstart\n"
-    gdb_expect {
-	-re "$cr$gdb_prompt" {
-	    pass "memrange limit test: send fewer than limit"
-	}
-	default {
-	    fail "memrange limit test: send fewer than limit"
-	}
-    }
-
-    # Set secret artificial memrange limit to three
-    gdb_test "maint packet QTLimit:memrange:3" \
-	    "received: .OK." \
-	    "memrange limit test: set limit to three"
-
-    # Now sending three memranges should still succeed.
-    send_gdb "tstart\n"
-    gdb_expect {
-	-re "$cr$gdb_prompt" {
-	    pass "memrange limit test: send equal to limit"
-	}
-	default {
-	    fail "memrange limit test: send equal to limit"
-	}
-    }
-
-    # Set secret artificial memrange limit to two
-    gdb_test "maint packet QTLimit:memrange:2" \
-	    "received: .OK." \
-	    "memrange limit test: set limit to two"
-
-    # Now sending three memranges should fail.
-    gdb_test "tstart" \
-	    ".*\[Ee\]rror.*" \
-	    "memrange limit test: send more than limit"
-
-    # Clean up:
-    gdb_test "tstop" "" ""
-    gdb_test "maint packet QTLimit:memrange:FFFFFFFF" "" ""
-}
-
-
-proc gdb_bytecode_limit_test { } {
-    global gdb_prompt
-    global cr
-
-    # Make sure we're in a sane starting state.
-    gdb_test "tstop" "" ""
-    gdb_test "tfind none" "" ""
-    gdb_delete_tracepoints
-
-    # Set three tracepoints
-    gdb_test "trace foo" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "bytecode limit test: set first tracepoint"
-
-    gdb_trace_setactions "bytecode limit test: set first actions" \
-	    "" \
-	    "collect x + n" "^$"
-
-    gdb_test "trace bar" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "bytecode limit test: set second tracepoint"
-
-    gdb_trace_setactions "bytecode limit test: set second actions" \
-	    "" \
-	    "collect y + n" "^$"
-
-    gdb_test "trace baz" \
-	    "Tracepoint \[0-9\]+ at .*" \
-	    "bytecode limit test: set third tracepoint"
-
-    gdb_trace_setactions "bytecode limit test: set third actions" \
-	    "" \
-	    "collect z + n" "^$"
-
-    # Set secret artificial bytecode limit to a large number
-    gdb_test "maint packet QTLimit:bytecode:400" \
-	    "received: .OK." \
-	    "bytecode limit test: set limit to large"
-
-    # Now sending three bytecodes should still succeed.
-    send_gdb "tstart\n"
-    gdb_expect {
-	-re "$cr$gdb_prompt" {
-	    pass "bytecode limit test: send fewer than limit"
-	}
-	default {
-	    fail "bytecode limit test: send fewer than limit"
-	}
-    }
-
-    # Set secret artificial bytecode limit to a small number
-    gdb_test "maint packet QTLimit:bytecode:40" \
-	    "received: .OK." \
-	    "bytecode limit test: set limit to small"
-
-    # Now sending three bytecodes should fail.
-    gdb_test "tstart" \
-	    ".*\[Ee\]rror.*" \
-	    "bytecode limit test: send more than limit"
-
-
-    # Clean up:
-    gdb_test "tstop" "" ""
-    gdb_test "maint packet QTLimit:bytecode:FFFFFFFF" "" ""
-}
-
-proc gdb_trace_limits_tests { } {
-    global gdb_prompt
-
-    # We generously give ourselves one "pass" if we successfully 
-    # detect that this test cannot be run on this target!
-
-    if { ![gdb_target_supports_trace] } then {
-	pass "Current target does not support trace"
-	return 1;
-    }
-
-    if [gdb_test "maint packet QTLimit:tp:ffffffff" \
-	    "received: .OK." ""] then { 
-	pass "This test cannot be run on this target"
-	return 1;
-    }
-
-    if [gdb_test "maint packet QTLimit:memrange:ffffffff" \
-	    "received: .OK." ""] then { 
-	pass "This test cannot be run on this target"
-	return 1;
-    }
-
-    if [gdb_test "maint packet QTLimit:bytecode:ffffffff" \
-	    "received: .OK." ""] then { 
-	pass "This test cannot be run on this target"
-	return;
-    }
-
-    gdb_tracepoint_limit_test
-    gdb_memrange_limit_test
-    gdb_bytecode_limit_test
-}
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
- 
-if [target_info exists gdb_stub] {
-    gdb_step_for_stub;
-}
-# Body of test encased in a proc so we can return prematurely.
-gdb_trace_limits_tests
Index: src/gdb/testsuite/gdb.trace/tracecmd.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/tracecmd.exp	2010-05-28 22:57:07.000000000 +0100
+++ src/gdb/testsuite/gdb.trace/tracecmd.exp	2010-05-28 22:59:35.000000000 +0100
@@ -142,8 +142,7 @@ gdb_test "info trace" "$c_test_addr.*in 
 gdb_test "trace" "No default breakpoint address now." \
 	"1.9: trace <no arguments>"
 
-# 1.10 set large number of tracepoints
-# deferred to limits test module
+# 1.10 there's no 1.10.
 
 # 1.11 tracepoint conditions
 gdb_delete_tracepoints


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]