fix crash in frame filters
authorTom Tromey <tromey@redhat.com>
Wed, 22 Jan 2014 15:10:01 +0000 (08:10 -0700)
committerTom Tromey <tromey@redhat.com>
Thu, 23 Jan 2014 15:03:50 +0000 (08:03 -0700)
commit21909fa1c6d934bfa0c7ad3ef95909db48f6f756
tree458b58f502263c4a6c293dbb9fa5578bf7fe29cc
parent17fde6d091a9a661119d152e2304012de5fce056
fix crash in frame filters

apply_frame_filter calls ensure_python_env before computing the
gdbarch to use.  This means that python_gdbarch can be NULL while in
Python code, and if a frame filter depends on this somehow (easy to
do), gdb will crash.

The fix is to compute the gdbarch first.

Built and regtested on x86-64 Fedora 18.
New test case included.

2014-01-23  Tom Tromey  <tromey@redhat.com>

PR python/16491:
* python/py-framefilter.c (apply_frame_filter): Call
ensure_python_env after computing gdbarch.

2014-01-23  Tom Tromey  <tromey@redhat.com>

PR python/16491:
* gdb.python/py-framefilter.py (Reverse_Function.function): Read a
string from an inferior frame.
* gdb.python/py-framefilter-mi.exp: Update.
gdb/ChangeLog
gdb/python/py-framefilter.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-framefilter-mi.exp
gdb/testsuite/gdb.python/py-framefilter.py