]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdb.base/remote.c (RANDOM_DATA_SIZE): New define, defaults to 48K
authorStephane Carrez <stcarrez@nerim.fr>
Tue, 17 Jul 2001 21:47:19 +0000 (21:47 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Tue, 17 Jul 2001 21:47:19 +0000 (21:47 +0000)
and defined to 1K for m68hc11.
(random_data): Reduce table to 1K for embedded platforms (68hc11).
* gdb.base/remote.exp (get_sizeof): New function from sizeof.exp.
(sizeof_random_data): New variable to tell the size of the data table;
don't test past this size; always run to main.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/remote.c
gdb/testsuite/gdb.base/remote.exp

index d46acc71efb384d3712eccb890d1313d95bdcbb9..ad4b80687d2e40d66d6090ecc99ff5b736e6e384 100644 (file)
@@ -1,3 +1,12 @@
+2001-07-17  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
+
+       * gdb.base/remote.c (RANDOM_DATA_SIZE): New define, defaults to 48K 
+       and defined to 1K for m68hc11.
+       (random_data): Reduce table to 1K for embedded platforms (68hc11).
+       * gdb.base/remote.exp (get_sizeof): New function from sizeof.exp.
+       (sizeof_random_data): New variable to tell the size of the data table;
+       don't test past this size; always run to main.
+
 2001-07-16  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * gdb.base/return2.exp: return of long long and double fails for
index 34c47f313846b797a315f0937bad471cc82c1c8a..e71c598ed6a49d3f325a262076564ec37ed1dc6b 100644 (file)
@@ -23,12 +23,21 @@ BEGIN {
 
 */
 
+#ifdef mc68hc11
+# define RANDOM_DATA_SIZE (1024)
+#endif
+
 /* Use a character buffer to avoid byte order problems. 48k is
    chosen so that the buffer required at least 3 16k packets but
    targets often have no more than 64k of data. */
 /* If you change this data, you will also have to change the checks
    for the data in remote.c */
-unsigned char random_data[3 * 2048 * 8] = {
+#ifndef RANDOM_DATA_SIZE
+# define RANDOM_DATA_SIZE (3 * 2048 * 8)
+# define BIG_RANDOM_DATA
+#endif
+
+unsigned char random_data[RANDOM_DATA_SIZE] = {
   60,  74, 216,  38, 149,  49, 207,  44,
  124,  38,  93, 125, 232,  67, 228,  56,
  161, 146,  85,  26, 128, 145, 218,  10,
@@ -157,6 +166,7 @@ unsigned char random_data[3 * 2048 * 8] = {
  196,  13, 161, 122, 145, 141, 102, 233,
  227, 112, 121,  67, 111, 148, 160,  32,
  199, 117, 223, 105, 184, 131, 119, 182,
+#ifdef BIG_RANDOM_DATA
   60,  26, 169, 194, 173, 164, 249, 135,
  178,  57,  50,  44,  12, 159, 167, 240,
  249, 188,  86, 192,  73,  47,  74,  77,
@@ -6173,6 +6183,7 @@ unsigned char random_data[3 * 2048 * 8] = {
   97, 106, 152,  12, 243, 240,  41, 251,
   35, 249, 105, 228,  53,  94,  43, 119,
   61, 162, 192,  78,  58,  46,  84, 110,
+#endif
 };
 
 int
index 7ea35e1c56909b2a659bca6db7186a7e63478b4e..e2967c60b58c54f1dc8118d3d5f7d148741b89cd 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright 1999 Free Software Foundation, Inc.
+#   Copyright 1999, 2001 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
@@ -30,7 +30,6 @@ if {! [is_remote target]} {
     return
 }
 
-
 set testfile "remote"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
@@ -138,10 +137,37 @@ gdb_load_timed $binfile 0 "fixed" 16385
 # fall back to the default
 gdb_load_timed $binfile 0 "limit" 0
 
+# Get size of data uploaded
+
+#
+# Query GDB for the size of various types
+#
+
+proc get_sizeof { type default } {
+    global gdb_prompt
+    send_gdb "print/d sizeof (${type})\n"
+    gdb_expect {
+       -re "\\$\[0-9\]* = (\[0-9\]*).*$gdb_prompt $" {
+           set size $expect_out(1,string)
+           pass "get sizeof ${type} ($size)"
+       }
+       timeout {
+           set size ${default}
+           fail "get sizeof ${type} (timeout)"
+       }
+    }
+    return ${size}
+}
+
+# Get the size of random_data table (defaults to 48K).
+set sizeof_random_data [get_sizeof "random_data" 48*1024]
 
 #
 # Part THREE: Check the upload behavour
 #
+if ![runto_main] then {
+    fail "Cannot run to main"
+}
 
 # Carefully check memory around each of the most common packet edge
 # conditions
@@ -152,9 +178,10 @@ gdb_test "x/8ub random_data" \
 gdb_test "x/8ub random_data + 400 - 4" \
        "<random_data\\+396>:\[ \t\]+185\[ \t\]+255\[ \t\]+50\[ \t\]+140\[ \t\]+237\[ \t\]+172\[ \t\]+143\[ \t\]+93"
 
-gdb_test "x/8ub random_data + 16384 - 4" \
+if {$sizeof_random_data > 16380 } then {
+    gdb_test "x/8ub random_data + 16384 - 4" \
        "<random_data\\+16380>:\[ \t\]+178\[ \t\]+180\[ \t\]+135\[ \t\]+93\[ \t\]+70\[ \t\]+62\[ \t\]+205\[ \t\]+76"
-
+}
 
 # Read a chunk just larger than the packet size (reduce the packet
 # size to make life easier)