+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-07 Walfred Tedeschi <walfred.tedeschi@intel.com>
* cp-namespace.c (cp_lookup_bare_symbol): Initialize
+2016-07-12 Tom Tromey <tom@tromey.com>
+
+ PR python/19293:
+ * python.texi (Frames In Python): Document
+ gdb.invalidate_cached_frames.
+
2016-06-21 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Interpreters): Update intepreter-exec section,
@code{unwind_stop_reason} method further down in this section).
@end defun
+@findex gdb.invalidate_cached_frames
+@defun gdb.invalidate_cached_frames
+@value{GDBN} internally keeps a cache of the frames that have been
+unwound. This function invalidates this cache.
+
+This function should not generally be called by ordinary Python code.
+It is documented for the sake of completeness.
+@end defun
+
A @code{gdb.Frame} object has the following methods:
@defun Frame.is_valid ()
if locus_re.match(objfile.filename):
total += do_enable_unwinder1(objfile.frame_unwinders, name_re,
flag)
+ if total > 0:
+ gdb.invalidate_cached_frames()
print("%d unwinder%s %s" % (total, "" if total == 1 else "s",
"enabled" if flag else "disabled"))
unwinder.name)
i += 1
locus.frame_unwinders.insert(0, unwinder)
+ gdb.invalidate_cached_frames()
return result;
}
+/* Implementation of gdb.invalidate_cached_frames. */
+
+static PyObject *
+gdbpy_invalidate_cached_frames (PyObject *self, PyObject *args)
+{
+ reinit_frame_cache ();
+ Py_RETURN_NONE;
+}
+
/* Read a file as Python code.
This is the extension_language_script_ops.script_sourcer "method".
FILE is the file to load. FILENAME is name of the file FILE.
{ "inferiors", gdbpy_inferiors, METH_NOARGS,
"inferiors () -> (gdb.Inferior, ...).\n\
Return a tuple containing all inferiors." },
+
+ { "invalidate_cached_frames", gdbpy_invalidate_cached_frames, METH_NOARGS,
+ "invalidate_cached_frames () -> None.\n\
+Invalidate any cached frame objects in gdb.\n\
+Intended for internal use only." },
+
{NULL, NULL, 0, NULL}
};
+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
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:"
"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:"