diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-17 21:47:19 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-17 21:47:19 +0000 |
commit | de58f10fe4e62d1beeffed6136eeada972b08719 (patch) | |
tree | dde2fe9a02ac582f214f140af3d1e534164221ab /gdb/testsuite/gdb.base/remote.exp | |
parent | 0963fc96726f9fff7b5854ccfd4ba3acc95d18df (diff) | |
download | gdb-de58f10fe4e62d1beeffed6136eeada972b08719.zip gdb-de58f10fe4e62d1beeffed6136eeada972b08719.tar.gz gdb-de58f10fe4e62d1beeffed6136eeada972b08719.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/testsuite/gdb.base/remote.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/remote.exp | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp index 7ea35e1..e2967c6 100644 --- a/gdb/testsuite/gdb.base/remote.exp +++ b/gdb/testsuite/gdb.base/remote.exp @@ -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) |