Preserve selected thread in all-stop w/ background execution
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / fork-running-state.exp
index c3bd0b01b29063eadb24bebbd5b1ef20571d11e7..f28f18c8854375b5b37036b36da6fc3ccd6c8022 100644 (file)
@@ -98,30 +98,19 @@ proc do_test { detach_on_fork follow_fork non_stop schedule_multiple } {
 
     set not_nl "\[^\r\n\]*"
 
-    if {$detach_on_fork == "on" && $non_stop == "on" && $follow_fork == "child"} {
+    if {$detach_on_fork == "on" && $follow_fork == "child"} {
        gdb_test "info threads" \
            "  2.1 ${not_nl}\\\(running\\\).*No selected thread.*"
-    } elseif {$detach_on_fork == "on" && $follow_fork == "child"} {
-       gdb_test "info threads" \
-           "\\\* 2.1 ${not_nl}\\\(running\\\)"
     } elseif {$detach_on_fork == "on"} {
        gdb_test "info threads" \
            "\\\* 1 ${not_nl}\\\(running\\\)"
-    } elseif {$non_stop == "on"
-             || ($schedule_multiple == "on" && $follow_fork == "parent")} {
+    } elseif {$non_stop == "on" || $schedule_multiple == "on"} {
        # Both parent and child should be marked running, and the
        # parent should be selected.
        gdb_test "info threads" \
            [multi_line \
                 "\\\* 1.1 ${not_nl} \\\(running\\\)${not_nl}" \
                 "  2.1 ${not_nl} \\\(running\\\)"]
-    } elseif {$schedule_multiple == "on" && $follow_fork == "child"} {
-       # Both parent and child should be marked running, and the
-       # child should be selected.
-       gdb_test "info threads" \
-           [multi_line \
-                "  1.1 ${not_nl} \\\(running\\\)${not_nl}" \
-                "\\\* 2.1 ${not_nl} \\\(running\\\)"]
     } else {
        set test "only $follow_fork marked running"
        gdb_test_multiple "info threads" $test {
@@ -131,7 +120,7 @@ proc do_test { detach_on_fork follow_fork non_stop schedule_multiple } {
            -re "\\\* 1.1 ${not_nl}\\\(running\\\)\r\n  2.1 ${not_nl}\r\n$gdb_prompt $" {
                gdb_assert [string eq $follow_fork "parent"] $test
            }
-           -re "1.1 ${not_nl}\r\n\\\* 2.1 ${not_nl}\\\(running\\\)\r\n$gdb_prompt $" {
+           -re "\\\* 1.1 ${not_nl}\r\n  2.1 ${not_nl}\\\(running\\\)\r\n$gdb_prompt $" {
                gdb_assert [string eq $follow_fork "child"] $test
            }
        }
This page took 0.030502 seconds and 4 git commands to generate.