aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-exit-code.exp
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2020-10-11 21:58:31 +0100
committerPedro Alves <pedro@palves.net>2020-10-12 01:45:51 +0100
commitbdfbda93f2fa10e94dec6f06a08459d825213a8d (patch)
tree6430384bd8b3549c748336da21aca93f3373d6c7 /gdb/testsuite/gdb.mi/mi-exit-code.exp
parentdf47e3e9fe15a647db52361a10f726421ddd034e (diff)
downloadgdb-users/palves/runto_main.zip
gdb-users/palves/runto_main.tar.gz
gdb-users/palves/runto_main.tar.bz2
Eliminate mi_run_to_main, introduce mi_clean_restartusers/palves/runto_main
Since we now have mi_runto_main which is like runto_main, eliminate mi_run_to_main, in favor of a new MI clean_restart counterpart -- mi_clean_restart -- and mi_runto_main. This makes MI testcases look a bit more like CLI testcases. gdb/testsuite/ChangeLog: * lib/mi-support.exp (mi_clean_restart): New. (mi_run_to_main): Delete. All callers adjust to use mi_clean_restart / mi_runto_main. Change-Id: I34920bab4fea1f23fb752928c2969c1f6ad714b6
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-exit-code.exp')
-rw-r--r--gdb/testsuite/gdb.mi/mi-exit-code.exp14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-exit-code.exp b/gdb/testsuite/gdb.mi/mi-exit-code.exp
index f10b49c..b8a133a 100644
--- a/gdb/testsuite/gdb.mi/mi-exit-code.exp
+++ b/gdb/testsuite/gdb.mi/mi-exit-code.exp
@@ -16,11 +16,6 @@
load_lib mi-support.exp
set MIFLAGS "-i=mi"
-gdb_exit
-if [mi_gdb_start] {
- continue
-}
-
standard_testfile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
@@ -31,6 +26,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
proc test_list_thread_groups { } {
global hex
global decimal
+ global binfile
+
+ mi_clean_restart
# Before any run, exit-code should not be present.
mi_gdb_test \
@@ -38,8 +36,10 @@ proc test_list_thread_groups { } {
"122\\^done,groups=\\\[\{id=\"i1\",type=\"process\"\}\]" \
"-list-thread-groups before run shows no exit-code"
+ mi_clean_restart $binfile
+
with_test_prefix "first run" {
- mi_run_to_main
+ mi_runto_main
# During the run, exit-code should not be present.
mi_gdb_test \
@@ -59,7 +59,7 @@ proc test_list_thread_groups { } {
}
with_test_prefix "second run" {
- mi_run_to_main
+ mi_runto_main
# Write the exit code we want in the global var
mi_gdb_test "set var exit_code = 8" ".*\\^done" "write exit code"