aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-06-09 15:20:09 -0600
committerTom Tromey <tom@tromey.com>2016-07-12 13:56:07 -0600
commite0f3fd7c44cebec7d787893b9c800e7de509cb32 (patch)
tree482011f3bd7e241f048825d653d56f2ab45a4cd5 /gdb/testsuite
parentcf143069f39b4feeeca175f88b6d1a5c1cb0fee4 (diff)
downloadgdb-e0f3fd7c44cebec7d787893b9c800e7de509cb32.zip
gdb-e0f3fd7c44cebec7d787893b9c800e7de509cb32.tar.gz
gdb-e0f3fd7c44cebec7d787893b9c800e7de509cb32.tar.bz2
PR python/19293 - invalidate frame cache when unwinders change
PR python/19293 notes that when a Python unwinder is disabled, the frame cache is not invalidated. This means that disabling an unwinder doesn't have any immediate effect -- but in my experience it's often the case that I want to enable or disable an unwinder in order to see what happens. This patch adds a new gdb.invalidate_cached_frames function and arranges for the relevant bits of library code to call it. I've only partially documented this function, considering a warning sufficient without going into all the reasons ordinary code should not call it. The name of the new function was taken from a comment in frame.h next to reinit_frame_cache. No new test as I think the updates to the existing test are sufficient to show that the code is working as intended. Built and regtested on x86-64 Fedora 23. 2016-07-12 Tom Tromey <tom@tromey.com> PR python/19293: * python/lib/gdb/command/unwinders.py (do_enable_unwinder): Call gdb.invalidate_cached_frames. * python/lib/gdb/unwinder.py (register_unwinder): Call gdb.invalidate_cached_frames. * python/python.c (gdbpy_invalidate_cached_frames): New function. (python_GdbMethods): Add entry for invalidate_cached_frames. 2016-07-12 Tom Tromey <tom@tromey.com> PR python/19293: * python.texi (Frames In Python): Document gdb.invalidate_cached_frames. 2016-07-12 Tom Tromey <tom@tromey.com> PR python/19293: * gdb.python/py-unwind-maint.exp: Update tests.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.python/py-unwind-maint.exp11
2 files changed, 14 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a83c9f8..851487f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-12 Tom Tromey <tom@tromey.com>
+
+ PR python/19293:
+ * gdb.python/py-unwind-maint.exp: Update tests.
+
2016-07-12 Yao Qi <yao.qi@linaro.org>
* lib/selftest-support.exp (selftest_setup): Match the output
diff --git a/gdb/testsuite/gdb.python/py-unwind-maint.exp b/gdb/testsuite/gdb.python/py-unwind-maint.exp
index e89d284..3a98cb1 100644
--- a/gdb/testsuite/gdb.python/py-unwind-maint.exp
+++ b/gdb/testsuite/gdb.python/py-unwind-maint.exp
@@ -34,7 +34,11 @@ if ![runto_main ] then {
return -1
}
-gdb_test "source ${pyfile}" "Python script imported" "import python scripts"
+gdb_test_sequence "source ${pyfile}" "import python scripts" {
+ "Python script imported"
+ "py_unwind_maint_ps_unwinder called"
+ "global_unwinder called"
+}
gdb_test_sequence "info unwinder" "Show all unwinders" {
"Global:"
@@ -50,7 +54,10 @@ gdb_test_sequence "continue" "Unwinders called" {
"global_unwinder called"
}
-gdb_test "disable unwinder global .*" "1 unwinder disabled" "Unwinder disabled"
+gdb_test_sequence "disable unwinder global .*" "Unwinder disabled" {
+ "1 unwinder disabled"
+ "py_unwind_maint_ps_unwinder called"
+}
gdb_test_sequence "info unwinder" "Show with global unwinder disabled" {
"Global:"