aboutsummaryrefslogtreecommitdiff
path: root/gdb/selftest.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-05-24 22:15:22 +0100
committerYao Qi <yao.qi@linaro.org>2017-05-24 22:15:22 +0100
commit7a3929c417b1388c689a0cd6b0b2f6579d85ec78 (patch)
tree2389ef4efe2e4fe086ca004be7138fd8c278bc98 /gdb/selftest.c
parent88c1242dc0a1e1ab582a65ea8bd05eb5f244c59b (diff)
downloadgdb-7a3929c417b1388c689a0cd6b0b2f6579d85ec78.zip
gdb-7a3929c417b1388c689a0cd6b0b2f6579d85ec78.tar.gz
gdb-7a3929c417b1388c689a0cd6b0b2f6579d85ec78.tar.bz2
Clear GDB internal state after each unit test
GDB has some global variables, like sentinel_frame, current_thread_arch, and etc, we need to reset them after each unit tests. gdb: 2017-05-24 Yao Qi <yao.qi@linaro.org> * selftest-arch.c (tests_with_arch): Call registers_changed and reinit_frame_cache. * selftest.c (run_self_tests): Likewise.
Diffstat (limited to 'gdb/selftest.c')
-rw-r--r--gdb/selftest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/selftest.c b/gdb/selftest.c
index adc7dda..14b76f6 100644
--- a/gdb/selftest.c
+++ b/gdb/selftest.c
@@ -53,6 +53,10 @@ run_self_tests (void)
exception_fprintf (gdb_stderr, ex, _("Self test failed: "));
}
END_CATCH
+
+ /* Clear GDB internal state. */
+ registers_changed ();
+ reinit_frame_cache ();
}
printf_filtered (_("Ran %lu unit tests, %d failed\n"),