[RFA/RFC] Tweak for a gdb.mi test.

Michael Snyder
2002-05-08T01:22:16Z

I'm gonna ask for a second pair of eyes, since I don't know MI
very well.

What this is -- the test is examining the stack, but it is
assuming that main is the last frame. My change allows for
one extra frame below main (eg. for '_start').

OK to check in?

Michael

2002-05-07 Michael Snyder <msnyder@redhat.com>

* gdb.mi/mi-stack.exp (test_stack_args_listing): Allow for
an optional frame for the caller of main (eg. '_start').
(test_stack_info_depth): Ditto.
* gdb.mi/mi0-stack.exp (test_stack_args_listing): Allow for
an optional frame for the caller of main (eg. '_start').
(test_stack_info_depth): Ditto.

Index: mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.8
diff -p -r1.8 mi-stack.exp
*** mi-stack.exp 19 Aug 2001 01:23:43 -0000 1.8
--- mi-stack.exp 8 May 2002 01:13:42 -0000
*************** proc test_stack_args_listing {} {
*** 101,108 ****
# -stack-list-arguments 1 1 3
# -stack-list-arguments

mi_gdb_test "231-stack-list-arguments 0" \
! "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}\\\]" \
"stack args listing 0"

mi_gdb_test "232-stack-list-arguments 0 1 1" \
--- 101,109 ----
# -stack-list-arguments 1 1 3
# -stack-list-arguments

+ # Allow for an optional fifth frame ("_start" or whatever...)
mi_gdb_test "231-stack-list-arguments 0" \
! "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}(,frame=\{level=\"5\",args=\\\[\\\]\}|)\\\]" \
"stack args listing 0"

mi_gdb_test "232-stack-list-arguments 0 1 1" \
*************** proc test_stack_args_listing {} {
*** 113,120 ****
"233\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\}\\\]" \
"stack args listing 0 1 3"

mi_gdb_test "231-stack-list-arguments 1" \
! "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}\\\]" \
"stack args listing 1"

mi_gdb_test "232-stack-list-arguments 1 1 1" \
--- 114,122 ----
"233\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\}\\\]" \
"stack args listing 0 1 3"

+ # Allow for an optional fifth frame ("_start" or whatever...)
mi_gdb_test "231-stack-list-arguments 1" \
! "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}(,frame=\{level=\"5\",args=\\\[\\\]\}|)\\\]" \
"stack args listing 1"

mi_gdb_test "232-stack-list-arguments 1 1 1" \
*************** proc test_stack_info_depth {} {
*** 140,155 ****
# -stack-info-depth 3
# -stack-info-depth 99

mi_gdb_test "231-stack-info-depth" \
! "231\\^done,depth=\"5\"" \
"stack info-depth"

mi_gdb_test "231-stack-info-depth 3" \
"231\\^done,depth=\"3\"" \
"stack info-depth 3"

mi_gdb_test "231-stack-info-depth 99" \
! "231\\^done,depth=\"5\"" \
"stack info-depth 99"

mi_gdb_test "231-stack-info-depth 99 99" \
--- 142,159 ----
# -stack-info-depth 3
# -stack-info-depth 99

+ # Allow for an optional fifth frame ("_start" or whatever...)
mi_gdb_test "231-stack-info-depth" \
! "231\\^done,depth=\"(5|6)\"" \
"stack info-depth"

mi_gdb_test "231-stack-info-depth 3" \
"231\\^done,depth=\"3\"" \
"stack info-depth 3"

+ # Allow for an optional fifth frame ("_start" or whatever...)
mi_gdb_test "231-stack-info-depth 99" \
! "231\\^done,depth=\"(5|6)\"" \
"stack info-depth 99"

mi_gdb_test "231-stack-info-depth 99 99" \
Index: mi0-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-stack.exp,v
retrieving revision 1.4
diff -p -r1.4 mi0-stack.exp
*** mi0-stack.exp 19 Aug 2001 01:23:43 -0000 1.4
--- mi0-stack.exp 8 May 2002 01:13:42 -0000
*************** proc test_stack_args_listing {} {
*** 101,108 ****
# -stack-list-arguments 1 1 3
# -stack-list-arguments

mi_gdb_test "231-stack-list-arguments 0" \
! "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{name=\"strarg\"\}\},frame=\{level=\"2\",args=\{name=\"intarg\",name=\"strarg\"\}\},frame=\{level=\"3\",args=\{name=\"intarg\",name=\"strarg\",name=\"fltarg\"\}\},frame=\{level=\"4\",args=\{\}\}\}" \
"stack args listing 0"

mi_gdb_test "232-stack-list-arguments 0 1 1" \
--- 101,109 ----
# -stack-list-arguments 1 1 3
# -stack-list-arguments

+ # Allow for an optional fifth frame ("_start" or whatever...)
mi_gdb_test "231-stack-list-arguments 0" \
! "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{name=\"strarg\"\}\},frame=\{level=\"2\",args=\{name=\"intarg\",name=\"strarg\"\}\},frame=\{level=\"3\",args=\{name=\"intarg\",name=\"strarg\",name=\"fltarg\"\}\},frame=\{level=\"4\",args=\{\}\}(,frame=\{level=\"5\",args=\{\}\}|)\}" \
"stack args listing 0"

mi_gdb_test "232-stack-list-arguments 0 1 1" \
*************** proc test_stack_args_listing {} {
*** 113,120 ****
"233\\^done,stack-args=\{frame=\{level=\"1\",args=\{name=\"strarg\"\}\},frame=\{level=\"2\",args=\{name=\"intarg\",name=\"strarg\"\}\},frame=\{level=\"3\",args=\{name=\"intarg\",name=\"strarg\",name=\"fltarg\"\}\}\}" \
"stack args listing 0 1 3"

mi_gdb_test "231-stack-list-arguments 1" \
! "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\},frame=\{level=\"4\",args=\{\}\}\}" \
"stack args listing 1"

mi_gdb_test "232-stack-list-arguments 1 1 1" \
--- 114,122 ----
"233\\^done,stack-args=\{frame=\{level=\"1\",args=\{name=\"strarg\"\}\},frame=\{level=\"2\",args=\{name=\"intarg\",name=\"strarg\"\}\},frame=\{level=\"3\",args=\{name=\"intarg\",name=\"strarg\",name=\"fltarg\"\}\}\}" \
"stack args listing 0 1 3"

+ # Allow for an optional fifth frame ("_start" or whatever...)
mi_gdb_test "231-stack-list-arguments 1" \
! "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\},frame=\{level=\"4\",args=\{\}\}(,frame=\{level=\"5\",args=\{\}\}|)\}" \
"stack args listing 1"

mi_gdb_test "232-stack-list-arguments 1 1 1" \
*************** proc test_stack_info_depth {} {
*** 141,147 ****
# -stack-info-depth 99

mi_gdb_test "231-stack-info-depth" \
! "231\\^done,depth=\"5\"" \
"stack info-depth"

mi_gdb_test "231-stack-info-depth 3" \
--- 143,149 ----
# -stack-info-depth 99

mi_gdb_test "231-stack-info-depth" \
! "231\\^done,depth=\"(5|6)\"" \
"stack info-depth"

mi_gdb_test "231-stack-info-depth 3" \
*************** proc test_stack_info_depth {} {
*** 149,155 ****
"stack info-depth 3"

mi_gdb_test "231-stack-info-depth 99" \
! "231\\^done,depth=\"5\"" \
"stack info-depth 99"

mi_gdb_test "231-stack-info-depth 99 99" \
--- 151,157 ----
"stack info-depth 3"

mi_gdb_test "231-stack-info-depth 99" \
! "231\\^done,depth=\"(5|6)\"" \
"stack info-depth 99"

mi_gdb_test "231-stack-info-depth 99 99" \