* IN id_int student -- enumerated type
* IN colors shirt -- enumerated type
*****************************************************************/
+#ifdef PROTOTYPES
+void print_student_id_shirt_color (id_int student, colors shirt)
+#else
void print_student_id_shirt_color ( student, shirt )
id_int student;
colors shirt;
+#endif
{
printf("student id : %d\t", student);
* PRINT_CHAR_ARRAY :
* IN char array_c[] -- character array
*****************************************************************/
+#ifdef PROTOTYPES
+void print_char_array (char array_c[])
+#else
void print_char_array ( array_c )
char array_c[];
-
+#endif
{
int index;
* PRINT_DOUBLE_ARRAY :
* IN double array_d[] -- array of doubles
*****************************************************************/
+#ifdef PROTOTYPES
+void print_double_array (double array_d[])
+#else
void print_double_array (array_d)
double array_d[];
-
+#endif
{
int index;
* PRINT_FLOAT_ARRAY:
* IN float array_f[] -- array of floats
*****************************************************************/
+#ifdef PROTOTYPES
+void print_float_array (float array_f[])
+#else
void print_float_array ( array_f )
float array_f[];
-
+#endif
{
int index;
* PRINT_INT_ARRAY:
* IN int array_i[] -- array of integers
*****************************************************************/
+#ifdef PROTOTYPES
+void print_int_array (int array_i[])
+#else
void print_int_array ( array_i )
int array_i[];
-
+#endif
{
int index;
* IN float array_f[] -- array of floats
* IN double array_d[] -- array of doubles
*****************************************************************/
+#ifdef PROTOTYPES
+void print_all_arrays(int array_i[], char array_c[], float array_f[], double array_d[])
+#else
void print_all_arrays( array_i, array_c, array_f, array_d )
int array_i[];
char array_c[];
float array_f[];
double array_d[];
-
+#endif
{
print_int_array(array_i);
print_char_array(array_c);
* A do nothing function. Used to provide a point at which calls can be made.
* IN int seed
*****************************************************************/
+#ifdef PROTOTYPES
+void compute_with_small_structs (int seed)
+#else
void compute_with_small_structs ( seed )
int seed;
+#endif
{
struct small_rep_info_t array[4];
* IN unsigned e -- 0 or 1
* IN unsigned o -- 0 or 1
*****************************************************************/
+#ifdef PROTOTYPES
+void init_bit_flags (struct bit_flags_t *bit_flags, unsigned a, unsigned b, unsigned g, unsigned d, unsigned e, unsigned o)
+#else
void init_bit_flags ( bit_flags, a, b, g, d, e, o )
struct bit_flags_t *bit_flags;
unsigned a;
unsigned d;
unsigned e;
unsigned o;
+#endif
{
bit_flags->alpha = a;
* IN unsigned e -- 0 or 1
* IN unsigned o -- 0 or 1
*****************************************************************/
+#ifdef PROTOTYPES
+void init_bit_flags_combo (struct bit_flags_combo_t *bit_flags_combo, unsigned a, unsigned b, char ch1, unsigned g, unsigned d, char ch2, unsigned e, unsigned o)
+#else
void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
struct bit_flags_combo_t *bit_flags_combo;
unsigned a;
char ch2;
unsigned e;
unsigned o;
+#endif
{
bit_flags_combo->alpha = a;
* OUT struct one_double_t *one_double -- structure to fill
* IN double init_val
*****************************************************************/
+#ifdef PROTOTYPES
+void init_one_double (struct one_double_t *one_double, double init_val)
+#else
void init_one_double ( one_double, init_val )
struct one_double_t *one_double;
double init_val;
+#endif
{
one_double->double1 = init_val;
* IN float init_val1
* IN float init_val2
*****************************************************************/
+#ifdef PROTOTYPES
+void init_two_floats (struct two_floats_t *two_floats, float init_val1, float init_val2)
+#else
void init_two_floats ( two_floats, init_val1, init_val2 )
struct two_floats_t *two_floats;
float init_val1;
float init_val2;
+#endif
{
two_floats->float1 = init_val1;
two_floats->float2 = init_val2;
* IN char init_val1
* IN char init_val2
*****************************************************************/
+#ifdef PROTOTYPES
+void init_two_chars (struct two_char_t *two_char, char init_val1, char init_val2)
+#else
void init_two_chars ( two_char, init_val1, init_val2 )
struct two_char_t *two_char;
char init_val1;
char init_val2;
+#endif
{
two_char->ch1 = init_val1;
* IN char init_val2
* IN char init_val3
*****************************************************************/
+#ifdef PROTOTYPES
+void init_three_chars (struct three_char_t *three_char, char init_val1, char init_val2, char init_val3)
+#else
void init_three_chars ( three_char, init_val1, init_val2, init_val3 )
struct three_char_t *three_char;
char init_val1;
char init_val2;
char init_val3;
+#endif
{
three_char->ch1 = init_val1;
* IN char init_val4
* IN char init_val5
*****************************************************************/
+#ifdef PROTOTYPES
+void init_five_chars (struct five_char_t *five_char, char init_val1, char init_val2, char init_val3, char init_val4, char init_val5)
+#else
void init_five_chars ( five_char, init_val1, init_val2, init_val3,init_val4,init_val5 )
struct five_char_t *five_char;
char init_val1;
char init_val3;
char init_val4;
char init_val5;
+#endif
{
five_char->ch1 = init_val1;
five_char->ch2 = init_val2;
* IN int init_val1
* IN char init_val2
*****************************************************************/
+#ifdef PROTOTYPES
+void init_int_char_combo (struct int_char_combo_t *combo, int init_val1, char init_val2)
+#else
void init_int_char_combo ( combo, init_val1, init_val2 )
struct int_char_combo_t *combo;
int init_val1;
char init_val2;
+#endif
{
combo->int1 = init_val1;
* OUT struct small_rep_into_t *small_struct -- structure to be filled
* IN int seed
*****************************************************************/
+#ifdef PROTOTYPES
+void init_struct_rep(struct small_rep_info_t *small_struct, int seed)
+#else
void init_struct_rep( small_struct, seed )
struct small_rep_info_t *small_struct;
int seed;
-
+#endif
{
small_struct->value = 2 + (seed*2);
* Takes all the small structures as input and calls the appropriate
* initialization routine for each structure
*****************************************************************/
+#ifdef PROTOTYPES
+void init_small_structs (
+ struct small_rep_info_t *struct1,
+ struct small_rep_info_t *struct2,
+ struct small_rep_info_t *struct3,
+ struct small_rep_info_t *struct4,
+ struct bit_flags_t *flags,
+ struct bit_flags_combo_t *flags_combo,
+ struct three_char_t *three_char,
+ struct five_char_t *five_char,
+ struct int_char_combo_t *int_char_combo,
+ struct one_double_t *d1,
+ struct one_double_t *d2,
+ struct one_double_t *d3,
+ struct two_floats_t *f1,
+ struct two_floats_t *f2,
+ struct two_floats_t *f3)
+#else
void init_small_structs (struct1, struct2, struct3,struct4,flags,flags_combo,
three_char, five_char,int_char_combo, d1, d2,d3,f1,f2,f3)
struct small_rep_info_t *struct1;
struct two_floats_t *f1;
struct two_floats_t *f2;
struct two_floats_t *f3;
-
+#endif
{
init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
init_struct_rep(struct3, 5);
init_struct_rep(struct4, 6);
init_one_double ( d1, 10.5);
- init_one_double ( d2, -3.34);
- init_one_double ( d3, 675.09123);
+ init_one_double ( d2, -3.375);
+ init_one_double ( d3, 675.09375);
init_two_floats ( f1, 45.234, 43.6);
init_two_floats ( f2, 78.01, 122.10);
init_two_floats ( f3, -1232.345, -199.21);
* PRINT_TEN_DOUBLES :
* ?????????????????????????????
****************************************************************/
+#ifdef PROTOTYPES
+void print_ten_doubles (
+ double d1,
+ double d2,
+ double d3,
+ double d4,
+ double d5,
+ double d6,
+ double d7,
+ double d8,
+ double d9,
+ double d10)
+#else
void print_ten_doubles ( d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 )
double d1;
double d2;
double d8;
double d9;
double d10;
+#endif
{
printf("Two Doubles : %f\t%f\n", d1, d2);
* PRINT_BIT_FLAGS :
* IN struct bit_flags_t bit_flags
****************************************************************/
+#ifdef PROTOTYPES
+void print_bit_flags (struct bit_flags_t bit_flags)
+#else
void print_bit_flags ( bit_flags )
struct bit_flags_t bit_flags;
+#endif
{
if (bit_flags.alpha) printf("alpha\n");
* PRINT_BIT_FLAGS_COMBO :
* IN struct bit_flags_combo_t bit_flags_combo
****************************************************************/
+#ifdef PROTOTYPES
+void print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
+#else
void print_bit_flags_combo ( bit_flags_combo )
-struct bit_flags_combo_t bit_flags_combo;
+ struct bit_flags_combo_t bit_flags_combo;
+#endif
{
if (bit_flags_combo.alpha) printf("alpha\n");
* PRINT_ONE_DOUBLE :
* IN struct one_double_t one_double
****************************************************************/
+#ifdef PROTOTYPES
+void print_one_double (struct one_double_t one_double)
+#else
void print_one_double ( one_double )
struct one_double_t one_double;
+#endif
{
printf("Contents of one_double_t: \n\n");
* PRINT_TWO_FLOATS :
* IN struct two_floats_t two_floats
****************************************************************/
+#ifdef PROTOTYPES
+void print_two_floats (struct two_floats_t two_floats)
+#else
void print_two_floats ( two_floats )
struct two_floats_t two_floats;
+#endif
{
printf("Contents of two_floats_t: \n\n");
* PRINT_TWO_CHARS :
* IN struct two_char_t two_char
****************************************************************/
+#ifdef PROTOTYPES
+void print_two_chars (struct two_char_t two_char)
+#else
void print_two_chars ( two_char )
struct two_char_t two_char;
+#endif
{
printf("Contents of two_char_t: \n\n");
* PRINT_THREE_CHARS :
* IN struct three_char_t three_char
****************************************************************/
+#ifdef PROTOTYPES
+void print_three_chars (struct three_char_t three_char)
+#else
void print_three_chars ( three_char )
struct three_char_t three_char;
+#endif
{
printf("Contents of three_char_t: \n\n");
* PRINT_FIVE_CHARS :
* IN struct five_char_t five_char
****************************************************************/
+#ifdef PROTOTYPES
+void print_five_chars (struct five_char_t five_char)
+#else
void print_five_chars ( five_char )
struct five_char_t five_char;
+#endif
{
printf("Contents of five_char_t: \n\n");
* PRINT_INT_CHAR_COMBO :
* IN struct int_char_combo_t int_char_combo
****************************************************************/
+#ifdef PROTOTYPES
+void print_int_char_combo (struct int_char_combo_t int_char_combo)
+#else
void print_int_char_combo ( int_char_combo )
struct int_char_combo_t int_char_combo;
+#endif
{
printf("Contents of int_char_combo_t: \n\n");
* IN struct small_rep_info_t struct2
* IN struct small_rep_info_t struct3
****************************************************************/
+#ifdef PROTOTYPES
+void print_struct_rep(
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3)
+#else
void print_struct_rep( struct1, struct2, struct3)
struct small_rep_info_t struct1;
struct small_rep_info_t struct2;
struct small_rep_info_t struct3;
-
+#endif
{
* IN struct small_rep_info_t struct3
* IN struct small_rep_info_t struct4
****************************************************************/
+#ifdef PROTOTYPES
+void sum_struct_print (
+ int seed,
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3,
+ struct small_rep_info_t struct4)
+#else
void sum_struct_print ( seed, struct1, struct2, struct3, struct4)
int seed;
struct small_rep_info_t struct1;
struct small_rep_info_t struct2;
struct small_rep_info_t struct3;
struct small_rep_info_t struct4;
-
+#endif
{
int sum;
* All of the small structures of odd sizes (40 bits, 8bits, etc.)
* are pushed onto the stack.
****************************************************************/
+#ifdef PROTOTYPES
+void print_small_structs (
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3,
+ struct small_rep_info_t struct4,
+ struct bit_flags_t flags,
+ struct bit_flags_combo_t flags_combo,
+ struct three_char_t three_char,
+ struct five_char_t five_char,
+ struct int_char_combo_t int_char_combo,
+ struct one_double_t d1,
+ struct one_double_t d2,
+ struct one_double_t d3,
+ struct two_floats_t f1,
+ struct two_floats_t f2,
+ struct two_floats_t f3)
+#else
void print_small_structs ( struct1, struct2, struct3, struct4, flags,
flags_combo, three_char, five_char, int_char_combo, d1, d2,d3,f1,f2,f3)
struct small_rep_info_t struct1;
struct two_floats_t f1;
struct two_floats_t f2;
struct two_floats_t f3;
+#endif
{
print_bit_flags(flags);
print_bit_flags_combo(flags_combo);
* may force more space to be pushed onto the stack as part of the callers
* frame.
****************************************************************/
+#ifdef PROTOTYPES
+void print_long_arg_list (
+ double a,
+ double b,
+ int c,
+ int d,
+ int e,
+ int f,
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3,
+ struct small_rep_info_t struct4,
+ struct bit_flags_t flags,
+ struct bit_flags_combo_t flags_combo,
+ struct three_char_t three_char,
+ struct five_char_t five_char,
+ struct int_char_combo_t int_char_combo,
+ struct one_double_t d1,
+ struct one_double_t d2,
+ struct one_double_t d3,
+ struct two_floats_t f1,
+ struct two_floats_t f2,
+ struct two_floats_t f3)
+#else
void print_long_arg_list ( a, b, c, d, e, f, struct1, struct2, struct3,
struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1,d2,d3,
f1, f2, f3 )
struct two_floats_t f1;
struct two_floats_t f2;
struct two_floats_t f3;
-
+#endif
{
printf("double : %f\n", a);
printf("double : %f\n", b);
}
+#ifdef PROTOTYPES
+void print_one_large_struct (struct array_rep_info_t linked_list1)
+#else
void print_one_large_struct( linked_list1 )
struct array_rep_info_t linked_list1;
-
+#endif
{
/* printf("Contents of linked list1: \n\n");
* IN struct array_rep_info_t linked_list2
* IN struct array_rep_info_t linked_list3
****************************************************************/
+#ifdef PROTOTYPES
+void print_array_rep(
+ struct array_rep_info_t linked_list1,
+ struct array_rep_info_t linked_list2,
+ struct array_rep_info_t linked_list3)
+#else
void print_array_rep( linked_list1, linked_list2, linked_list3 )
struct array_rep_info_t linked_list1;
struct array_rep_info_t linked_list2;
struct array_rep_info_t linked_list3;
-
+#endif
{
int index;
* IN struct array_rep_info_t linked_list3
* IN struct array_rep_info_t linked_list4
****************************************************************/
+#ifdef PROTOTYPES
+void sum_array_print (
+ int seed,
+ struct array_rep_info_t linked_list1,
+ struct array_rep_info_t linked_list2,
+ struct array_rep_info_t linked_list3,
+ struct array_rep_info_t linked_list4)
+#else
void sum_array_print ( seed, linked_list1, linked_list2, linked_list3,linked_list4)
int seed;
struct array_rep_info_t linked_list1;
struct array_rep_info_t linked_list2;
struct array_rep_info_t linked_list3;
struct array_rep_info_t linked_list4;
-
+#endif
{
int index;
int sum;
* IN struct array_rep_info_t *linked_list
* IN int seed
****************************************************************/
+#ifdef PROTOTYPES
+void init_array_rep(
+ struct array_rep_info_t *linked_list,
+ int seed)
+#else
void init_array_rep( linked_list, seed )
struct array_rep_info_t *linked_list;
int seed;
-
+#endif
{
int index;
for (index = 0; index < 120; index++) {
if ((index%2) == 0) char_array[index] = 'Z';
else char_array[index] = 'a';
- } /* call-ar-st.exp uses line numbers everywhere */ char_array[120] = '\0';
+ }
+ char_array[120] = '\0';
for (index = 0; index < 100; index++) {
double_array[index] = index*23.4567;
/* Print a very long arg list
*/
- a = 22.22;
- b = 33.333;
+ a = 22.25;
+ b = 33.375;
c = 0;
d = -25;
e = 100;
continue
}
-#go -until 1007
-gdb_test "tbreak 1007" \
- "Breakpoint \[0-9\]+.*file.*$srcfile, line 1007.*" \
- "tbreakpoint line 1007"
+#go -until 1209
+gdb_test "tbreak 1209" \
+ "Breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \
+ "tbreakpoint line 1209"
gdb_test continue \
-"Continuing\\..*main \\(\\) at.*$srcfile:1007.*" \
+"Continuing\\..*main \\(\\) at.*$srcfile:1209.*" \
"run until breakpoint set at a line"
#call print_double_array(double_array)
-send_gdb "print print_double_array(double_array)\n"
-gdb_expect {
- -re "array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+.*$gdb_prompt $" {
- pass "print print_double_array(double_array)"
- }
- -re ".*$gdb_prompt $" { fail "print print_double_array(double_array)" }
- timeout { fail "(timeout) print print_double_array(double_array)" }
+if {![target_info exists gdb,skip_float_tests]} {
+ send_gdb "print print_double_array(double_array)\n"
+ gdb_expect_list "print print_double_array(double_array)" ".*$gdb_prompt $" {
+ "\[ \t\r\n\]+array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
+ "\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
+ "\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
+ "\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
+ "\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
+ "\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
+ "\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
+ "\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
+ "\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
+ "\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
+ "\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
+ "\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
}
-
+}
#call print_char_array(char_array)
+
send_gdb "print print_char_array(char_array)\n"
gdb_expect {
-re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+.*\[ \t\r\n\]+.*$gdb_prompt $" {
-#go -until 1014
-gdb_test "tbreak 1014" \
-"Breakpoint.*file.*$srcfile, line 1014.*" \
-"tbreakpoint line 1014"
+#go -until 1216
+gdb_test "tbreak 1216" \
+"Breakpoint.*file.*$srcfile, line 1216.*" \
+"tbreakpoint line 1216"
send_gdb "continue\n"
gdb_expect {
- -re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+\[ \t\r\n\]+main.*at.*$srcfile:1014\[ \t\r\n\]+.*print_double_array\\(double_array\\).*$gdb_prompt $" {
- pass "continue to 1014"
+ -re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+\[ \t\r\n\]+main.*at.*$srcfile:1216\[ \t\r\n\]+.*print_double_array\\(double_array\\).*$gdb_prompt $" {
+ pass "continue to 1216"
}
- -re ".*$gdb_prompt $" { fail "continue to 1014" }
- timeout { fail "(timeout) continue to 1014" }
+ -re ".*$gdb_prompt $" { fail "continue to 1216" }
+ timeout { fail "(timeout) continue to 1216" }
}
# I am disabling this test, because it takes too long. I verified by
# }
#set timeout $oldtimeout
-#go -until 1018
-gdb_test "tbreak 1018" \
- "Breakpoint.* file .*$srcfile, line 1018.*" \
- "tbreakpoint line 1018"
+#go -until 1220
+gdb_test "tbreak 1220" \
+ "Breakpoint.* file .*$srcfile, line 1220.*" \
+ "tbreakpoint line 1220"
-gdb_test continue \
-"Continuing\\..*array_d :.*array_f :.*student id :\[\t \]+.*YELLOW.*array_i :.*main \\(\\) at .*call-ar-st.c:1018\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)." \
-"continuing to breakpoint 1018"
+send_gdb "continue\n"
+gdb_expect_list "continuing to breakpoint 1220" ".*$gdb_prompt $" {
+ "Continuing\\."
+ "\[ \t\r\n\]+array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
+ "\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
+ "\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
+ "\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
+ "\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
+ "\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
+ "\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
+ "\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
+ "\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
+ "\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
+ "\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
+ "\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
+ ".*array_f :"
+ ".*student id :\[\t \]+.*YELLOW"
+ ".*array_i :"
+ ".*main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."
+}
#step
send_gdb "step\n"
gdb_expect {
- -re "print_all_arrays \\(array_i=, array_c=.ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=, array_d=\\) at .*call-ar-st.c:287\[ \t\r\n\]+287.*print_int_array\\(array_i\\);.*$gdb_prompt $" {pass "step inside print_all_arrays"}
+ -re "print_all_arrays \\(array_i=, array_c=.ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=, array_d=\\) at .*call-ar-st.c:306\[ \t\r\n\]+306.*print_int_array\\(array_i\\);.*$gdb_prompt $" {pass "step inside print_all_arrays"}
-re ".*$gdb_prompt $" { fail "step inside print_all_arrays" }
timeout { fail "step inside print_all_arrays (timeout)" }
}
#step -over
send_gdb "next\n"
gdb_expect {
- -re "array_i :.*288.*print_char_array\\(array_c\\);.*$gdb_prompt $" {pass "next over print_int_array in print-all_arrays"}
+ -re "array_i :.*307.*print_char_array\\(array_c\\);.*$gdb_prompt $" {pass "next over print_int_array in print-all_arrays"}
-re ".*$gdb_prompt $" { fail "next over print_int_array in print-all_arrays" }
timeout { fail "next over print_int_array in print-all_arrays (timeout)" }
}
#call print_double_array(array_d)
-send_gdb "print print_double_array(array_d)\n"
-gdb_expect {
- -re "array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+.*$gdb_prompt $" {
- pass "print print_double_array(array_d)"
- }
- -re ".*$gdb_prompt $" { fail "print print_double_array(array_d)" }
- timeout { fail "(timeout) print print_double_array(array_d)" }
+if {![target_info exists gdb,skip_float_tests]} {
+ send_gdb "print print_double_array(array_d)\n"
+ gdb_expect_list "print print_double_array(array_d)" ".*$gdb_prompt $" {
+ "array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
+ "\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
+ "\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
+ "\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
+ "\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
+ "\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
+ "\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
+ "\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
+ "\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
+ "\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
+ "\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
+ "\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
}
+}
+#go -until 1236
+gdb_test "tbreak 1236" \
+"Breakpoint.* file .*$srcfile, line 1236.*" \
+"tbreakpoint line 1236"
-#go -until 1034
-gdb_test "tbreak 1034" \
-"Breakpoint.* file .*$srcfile, line 1034.*" \
-"tbreakpoint line 1034"
-
-gdb_test continue "Continuing\\..*array_c.*array_f.*array_d.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1034.*printf\\(.BYE BYE FOR NOW.n.\\)." "continuing to 1034"
+send_gdb "continue\n"
+gdb_expect_list "continuing to 1236" ".*$gdb_prompt $" {
+ "Continuing\\..*array_c"
+ ".*array_f"
+ "\[ \t\r\n\]+array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
+ "\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
+ "\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
+ "\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
+ "\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
+ "\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
+ "\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
+ "\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
+ "\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
+ "\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
+ "\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
+ "\[ \t\r\n\]+2275.299900 2298.756600 2322.213300.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
+}
#call sum_array_print(10, *list1, *list2, *list3, *list4)
+
send_gdb "print sum_array_print(10, *list1, *list2, *list3, *list4)\n"
gdb_expect {
-re ".*Sum of 4 arrays, by element \\(add in seed as well\\):\[ \t\r\n\]+Seed: 10\[ \t\r\n\]+Element Index . Sum\[ \t\r\n\]+-------------------------\[ \t\r\n\]+.*\[ \t\]+0\[ \t\]+52\[ \t\r\n\]+1\[ \t\]+60\[ \t\r\n\]+2\[ \t\]+68\[ \t\r\n\]+3\[ \t\]+76\[ \t\r\n\]+4\[ \t\]+84\[ \t\r\n\]+5\[ \t\]+92\[ \t\r\n\]+6\[ \t\]+100\[ \t\r\n\]+7\[ \t\]+108\[ \t\r\n\]+8\[ \t\]+116\[ \t\r\n\]+9\[ \t\]+124\[ \t\r\n\]+.*$gdb_prompt $" {
timeout { fail "(timeout) print sum_array_print(10, *list1, *list2, *list3, *list4)" }
}
-
-#step -over
- send_gdb "next\n"
- gdb_expect {
- -re "BYE BYE FOR NOW\[ \t\r\n\]+1035\[ \t\r\n\]+printf\\(.VERY GREEN GRASS.n.\\);\[ \t\r\n\]+.*$gdb_prompt $" { pass "next to 1035"}
- -re ".*$gdb_prompt $" { fail "next to 1035" }
- timeout { fail "next to 1035(timeout)" }
- }
+#step over
+send_gdb "n\n"
+gdb_expect {
+ -re ".*BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*$gdb_prompt $" { pass "next to 1237"}
+ -re ".*$gdb_prompt $" { fail "next to 1237" }
+ timeout { fail "next to 1237(timeout)" }
+}
#call print_array_rep(\*list1, \*list2, \*list3)
send_gdb "print print_array_rep(\*list1, \*list2, \*list3)\n"
gdb_expect {
- -re ".*.*$gdb_prompt $" {
+ -re ".*$gdb_prompt $" {
pass "print print_array_rep(*list1, *list2, *list3)"
}
-re ".*$gdb_prompt $" { fail "print print_array_rep(*list1, *list2, *list3)" }
- timeout { fail "(timeout) print print_array_rep(*list1, *list2, *list3)"# }
+ timeout { fail "(timeout) print print_array_rep(*list1, *list2, *list3)" }
}
-
-
-#go -until 1039
-gdb_test "tbreak 1039" \
- "Breakpoint..* file .*$srcfile, line 1039.*" \
- "tbreakpoint line 1039"
+#go -until 1241
+gdb_test "tbreak 1241" \
+ "Breakpoint..* file .*$srcfile, line 1241.*" \
+ "tbreakpoint line 1241"
send_gdb "continue\n"
gdb_expect {
- -re ".*main \\(\\) at .*call-ar-st.c:1039\r\n1039\t\[ \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" {
- pass "continue to 1039"}
- -re ".*$gdb_prompt $" { fail "continue to 1039"}
- timeout { fail "(timeout) continue to 1039"}
+ -re ".*main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" {
+ pass "continue to 1241"}
+ -re ".*$gdb_prompt $" { fail "continue to 1241"}
+ timeout { fail "(timeout) continue to 1241"}
}
".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \
"set breakpoint in sum_array_print"
gdb_test "continue" \
- ".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:909\[ \t\n\r\]+909.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
+ ".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
"check args of sum_array_print"
#call print_array_rep(linked_list1, linked_list2, linked_list3)
#}
-#go -until 1079
-gdb_test "tbreak 1079" \
- "Breakpoint.* file .*call-ar-st.c, line 1079.*" \
- "tbreakpoint line 1079"
+#go -until 1281
+gdb_test "tbreak 1281" \
+ "Breakpoint.* file .*call-ar-st.c, line 1281.*" \
+ "tbreakpoint line 1281"
send_gdb "continue\n"
gdb_expect {
- -re "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1079.*c = 0.*$gdb_prompt $" {
- pass "continue to 1079"}
- -re ".*$gdb_prompt $" { fail "continue to 1079"}
- timeout { fail "(timeout) continue to 1079"}
+ -re "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1281.*c = 0.*$gdb_prompt $" {
+ pass "continue to 1281"}
+ -re ".*$gdb_prompt $" { fail "continue to 1281"}
+ timeout { fail "(timeout) continue to 1281"}
}
#call print_small_structs(*struct1, *struct2, *struct3, *struct4,*flags, *flags_combo,
#*three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
-send_gdb "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
-gdb_expect {
- -re ".*alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+ch1: y\tch2: n\[\t\r\n \]+Contents of three_char_t:\[\t\r\n \]+a\tb\tc\[\t\r\n \]+Contents of five_char_t:\[\t\r\n \]+l\tm\tn\to\tp\[\t\r\n \]+Contents of int_char_combo_t:\[\t\r\n \]+123.*z\[\t\r\n \]+Sum of the 4 struct values and seed :\[\t\r\n \]+52\[\t\r\n \]+Contents of struct1:\[\t\r\n \]+6.*0\[\t\r\n \]+Contents of struct2:\[\t\r\n \]+10.*0\[\t\r\n \]+Contents of struct3:\[\t\r\n \]+12.*0\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+10.500000\[\t\r\n \]+Contents of one_double_t:.*-3.340000\[\t\r\n \]+Contents of one_double_t:.*675.091230\[\t\r\n \]+Contents of two_floats_t:.*45.234001.*43.599998\[\t\r\n \]+Contents of two_floats_t:.*78.010002.*122.099998\[\t\r\n \]+Contents of two_floats_t:.*-1232.344971.*-199.210007\[\t\r\n \]+.*$gdb_prompt $" {
- pass "print print_small_structs"
- }
+if {![target_info exists gdb,skip_float_tests]} {
+ send_gdb "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
+ gdb_expect {
+ -re ".*alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+ch1: y\tch2: n\[\t\r\n \]+Contents of three_char_t:\[\t\r\n \]+a\tb\tc\[\t\r\n \]+Contents of five_char_t:\[\t\r\n \]+l\tm\tn\to\tp\[\t\r\n \]+Contents of int_char_combo_t:\[\t\r\n \]+123.*z\[\t\r\n \]+Sum of the 4 struct values and seed :\[\t\r\n \]+52\[\t\r\n \]+Contents of struct1:\[\t\r\n \]+6.*0\[\t\r\n \]+Contents of struct2:\[\t\r\n \]+10.*0\[\t\r\n \]+Contents of struct3:\[\t\r\n \]+12.*0\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+10.500000\[\t\r\n \]+Contents of one_double_t:.*-3.375000\[\t\r\n \]+Contents of one_double_t:.*675.093750\[\t\r\n \]+Contents of two_floats_t:.*45.234001.*43.599998\[\t\r\n \]+Contents of two_floats_t:.*78.010002.*122.099998\[\t\r\n \]+Contents of two_floats_t:.*-1232.344971.*-199.210007\[\t\r\n \]+.*$gdb_prompt $" {
+ pass "print print_small_structs"
+ }
-re ".*$gdb_prompt $" { fail "print print_small_structs" }
timeout { fail "(timeout) print_small_structs" }
}
-
+}
#call compute_with_small_structs(20)
send_gdb "print compute_with_small_structs(20)\n"
#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)
-send_gdb "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)\n"
-gdb_expect {
+if {![target_info exists gdb,skip_float_tests]} {
+ send_gdb "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)\n"
+ gdb_expect {
-re ".*Two Doubles : 123.456000.*123.456000\[\t\r\n \]+Two Doubles : -0.120000.*-1.230000\[\t\r\n \]+Two Doubles : 343434.800000.*89.098000\[\t\r\n \]+Two Doubles : 3.140000.*-5678.123450\[\t\r\n \]+Two Doubles : -0.111111.*216.970650\[\t\r\n \]+.*$gdb_prompt $" {
- pass "print print_ten_doubles"
- }
+ pass "print print_ten_doubles"
+ }
-re ".*$gdb_prompt $" { fail "print print_ten_doubles" }
timeout { fail "(timeout) print_ten_doubles" }
}
+}
-#go -until 1084
-gdb_test "tbreak 1084" \
- "Breakpoint .* file .*call-ar-st.c, line 1084.*" \
- "tbreakpoint line 1084"
-
-gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1084\[\t\r\n \]+1084.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1084"
-
-
+#go -until 1286
+gdb_test "tbreak 1286" \
+ "Breakpoint .* file .*call-ar-st.c, line 1286.*" \
+ "tbreakpoint line 1286"
+
+gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286"
+
+if { [istarget "hppa*-*-hpux*"] } {
+ #
+ # NOTE:(FIXME)
+ # the aCC demangler cannot demangle the name of a function with >10 args.
+ # so I added a .* after the name of the function, to match the
+ # incredibly long mangled name
+ # (getting aCC's libdemangle.a bundled w/ the system?)
+ # DTS CLLbs16994 coulter 990114
+ #
+ # FIXME: use step for hppa* testing for now
+ # guo 990621
+ #
send_gdb "step\n"
gdb_expect {
- -re ".*print_long_arg_list \\(a=22.219999999999999, b=33.332999999999998, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.3399999999999999\}, d3=\{double1 = 675.09123\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at ${srcdir}/${subdir}/${srcfile}:813\[\r\n\]+813\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
+ -re ".*print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
-re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
timeout { fail "step into print_long_arg_list (timeout)" }
}
+} else {
+
+ # We can't just assume that a "step" will get us into
+ # print_long_arg_list here,either.
+ gdb_test "tbreak print_long_arg_list" \
+ "Breakpoint .* file .*call-ar-st.c, line .*" \
+ "tbreak in print_long_arg_list after stepping into memcpy"
+ # The short match case below handles cases where a buffer
+ # overflows or something, and expect can't deal with the full
+ # line. Perhaps a more elegant solution exists... -sts 1999-08-17
+ send_gdb "continue\n"
+ if {![target_info exists gdb,skip_float_tests]} {
+ gdb_expect {
+ -re ".*print_long_arg_list \\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" { pass "step into print_long_arg_list" }
+ -re ".*print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}.*\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list (short match)"}
+ -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
+ timeout { fail "step into print_long_arg_list (timeout)" }
+ }
+ } else {
+ # If skipping float tests, don't expect anything in arg list.
+ gdb_expect {
+ -re ".*print_long_arg_list \\(.*\\).*$gdb_prompt $" { pass "step into print_long_arg_list" }
+ -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
+ timeout { fail "step into print_long_arg_list (timeout)" }
+ }
+ }
+}
+set ws "\[\n\r\t \]+"
#call print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)
-send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
-gdb_expect {
- -re ".*alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+ch1: y\tch2: n\[\t\r\n \]+Contents of three_char_t:\[\t\r\n \]+a\tb\tc\[\t\r\n \]+Contents of five_char_t:\[\t\r\n \]+l\tm\tn\to\tp\[\t\r\n \]+Contents of int_char_combo_t:\[\t\r\n \]+123.*z\[\t\r\n \]+Sum of the 4 struct values and seed :\[\t\r\n \]+52\[\t\r\n \]+Contents of struct1:\[\t\r\n \]+6.*0\[\t\r\n \]+Contents of struct2:\[\t\r\n \]+10.*0\[\t\r\n \]+Contents of struct3:\[\t\r\n \]+12.*0\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+10.500000\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+-3.340000\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+675.091230\[\t\r\n \]+Contents of two_floats_t:\[\t\r\n \]+45.234001.*43.599998\[\t\r\n \]+Contents of two_floats_t:\[\t\r\n \]+78.010002.*122.099998\[\t\r\n \]+Contents of two_floats_t:\[\t\r\n \]+-1232.344971.*-199.210007\[\t\r\n \]+.*$gdb_prompt $" {
- pass "print print_small_structs from print_long_arg_list "
- }
- -re ".*$gdb_prompt $" { fail "print print_small_structs from print_long_arg_list" }
- timeout { fail "(timeout) print_small_structs from print_long_arg_list" }
- }
-
-
+if {![target_info exists gdb,skip_float_tests]} {
+ # On Solaris, some of the args are passed by ref, others by value,
+ # and GDB gets confused and says "Invalid cast" because it thinks
+ # it has to cast the structure into a pointer to structure. A real
+ # GDB bug, probably for all Sparc configs, but obscure. -sts 1999-08-17.
+ setup_xfail "sparc*-*-solaris*"
+ send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
+ gdb_expect {
+ -re ".*alpha${ws}gamma${ws}epsilon${ws}alpha${ws}gamma${ws}epsilon${ws}ch1: y\tch2: n${ws}Contents of three_char_t:${ws}a\tb\tc${ws}Contents of five_char_t:${ws}l\tm\tn\to\tp${ws}Contents of int_char_combo_t:${ws}123.*z${ws}Sum of the 4 struct values and seed :${ws}52${ws}Contents of struct1:${ws}6.*0${ws}Contents of struct2:${ws}10.*0${ws}Contents of struct3:${ws}12.*0${ws}Contents of one_double_t:${ws}10.500000${ws}Contents of one_double_t:${ws}-3.375000${ws}Contents of one_double_t:${ws}675.093750${ws}Contents of two_floats_t:${ws}45.234001.*43.599998${ws}Contents of two_floats_t:${ws}78.010002.*122.099998${ws}Contents of two_floats_t:${ws}-1232.344971.*-199.210007${ws}.*$gdb_prompt $" {
+ pass "print print_small_structs from print_long_arg_list"
+ }
+ -re ".*$gdb_prompt $" { fail "print print_small_structs from print_long_arg_list" }
+ timeout { fail "(timeout) print_small_structs from print_long_arg_list" }
+ }
+}
-#go -until 1098
-gdb_test "tbreak 1098" \
- "Breakpoint.* file .*call-ar-st.c, line 1098.*" \
- "tbreakpoint line 1098"
-gdb_test continue "Continuing\\..*Contents of two_floats_t:.*-1232.344971.*-199.210007.*main \\(\\) at.*call-ar-st.c:1098.*1098.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
-"continue to 1098"
+#go -until 1300
+gdb_test "tbreak 1300" \
+ "Breakpoint.* file .*call-ar-st.c, line 1300.*" \
+ "tbreakpoint line 1300"
+gdb_test continue "Continuing\\..*Contents of two_floats_t:.*main \\(\\) at.*call-ar-st.c:1300.*1300.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
+ "continue to 1300"
#step
send_gdb "step\n"
gdb_expect {
-re "
-init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*call-ar-st.c:385\[ \t\n\r\]+385.*bit_flags_combo->alpha = a;.*$gdb_prompt $" {
+init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*call-ar-st.c:416\[ \t\n\r\]+416.*bit_flags_combo->alpha = a;.*$gdb_prompt $" {
pass "step into init_bit_flags_combo"}
-re ".*$gdb_prompt $" { fail "step into init_bit_flags_combo" }
timeout { fail "step into init_bit_flags_combo (timeout)" }
}
-#go -until 1103
-gdb_test "tbreak 1103" \
- "Breakpoint.* file .*call-ar-st.c, line 1103.*" \
- "tbreakpoint line 1103"
+#go -until 1305
+gdb_test "tbreak 1305" \
+ "Breakpoint.* file .*call-ar-st.c, line 1305.*" \
+ "tbreakpoint line 1305"
-gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1103\[\r\n\t \]+1103.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
-"continue to 1103"
+gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+1305.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
+"continue to 1305"
#call print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
-send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
-gdb_expect {
- -re ".*double : 22.220000.*double : 33.333000.*int : 0.*int : -25.*int : 100.*int : 2345.*alpha.*gamma.*epsilon.*ch1: y\tch2: n.*Contents of three_char_t:.*x\ty\tz.*Contents of five_char_t:.*h\te\tl\tl\to.*Contents of int_char_combo_t:.*123\tz.*Sum of the 4 struct values and seed :.*52.*Contents of struct1:.*6\[ \]+0.*Contents of struct2:.*10\[ \]+0.*Contents of struct3:.*12.*0.*Contents of one_double_t:\[ \n\r\t\]+1.111110\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+-345.340000\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+546464.200000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+0.234000\t453.100006\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+78.345001\t23.090000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+-2.345000\t1.000000.*$gdb_prompt $" {
- pass "print print_long_arg_list"
- }
+
+# FIXME:
+# HP aCC demangler currently does not handle hp aCC functions with >10 args
+# DTS CLLbs16994 coulter 990114
+
+if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*" CLLbs16994}
+
+if {![target_info exists gdb,skip_float_tests]} {
+ send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
+ gdb_expect {
+ -re ".*double : 22.250000.*double : 33.375000.*int : 0.*int : -25.*int : 100.*int : 2345.*alpha.*gamma.*epsilon.*ch1: y\tch2: n.*Contents of three_char_t:.*x\ty\tz.*Contents of five_char_t:.*h\te\tl\tl\to.*Contents of int_char_combo_t:.*123\tz.*Sum of the 4 struct values and seed :.*52.*Contents of struct1:.*6\[ \]+0.*Contents of struct2:.*10\[ \]+0.*Contents of struct3:.*12.*0.*Contents of one_double_t:\[ \n\r\t\]+1.111110\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+-345.340000\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+546464.200000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+0.234000\t453.100006\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+78.345001\t23.090000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+-2.345000\t1.000000.*$gdb_prompt $" {
+ pass "print print_long_arg_list"
+ }
-re ".*$gdb_prompt $" { fail "print print_long_arg_list" }
timeout { fail "(timeout) print_long_arg_list" }
}
+}
-#go -until 1109
-gdb_test "tbreak 1109" \
- "Breakpoint.* file .*call-ar-st.c, line 1109.*" \
- "tbreakpoint line 1109"
+#go -until 1311
+gdb_test "tbreak 1311" \
+ "Breakpoint.* file .*call-ar-st.c, line 1311.*" \
+ "tbreakpoint line 1311"
-gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1109\[ \t\n\r\]+1109.*compute_with_small_structs\\(35\\);" \
-"continue to 1109"
+gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1311\[ \t\n\r\]+1311.*compute_with_small_structs\\(35\\);" \
+"continue to 1311"
#call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)