aboutsummaryrefslogtreecommitdiff
path: root/gdb/selftest-arch.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-arch.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-arch.c')
-rw-r--r--gdb/selftest-arch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/selftest-arch.c b/gdb/selftest-arch.c
index cbc8c50..c4fe60d 100644
--- a/gdb/selftest-arch.c
+++ b/gdb/selftest-arch.c
@@ -81,6 +81,10 @@ tests_with_arch ()
_("Self test failed: arch %s: "), arches[i]);
}
END_CATCH
+
+ /* Clear GDB internal state. */
+ registers_changed ();
+ reinit_frame_cache ();
}
}