Blame SOURCES/gdb-rhbz1325795-framefilters-2of2.patch

0b42f8
commit 56d4c712a8fa3a3e06a2ae91881ef4d702e5b491
0b42f8
Author: Tom Tromey <tromey@redhat.com>
0b42f8
Date:   Wed Jan 22 08:52:15 2014 -0700
0b42f8
0b42f8
    avoid python exception in FrameDecorator.py
0b42f8
    
0b42f8
    This fixes a bug in FrameDecorator.py.
0b42f8
    
0b42f8
    FrameVars seems to assume that Frame.block can return None if there is
0b42f8
    no block.  However, it actually throws an exception.
0b42f8
    
0b42f8
    I saw this bug while developing a frame filter, but unfortunately I
0b42f8
    don't know how to reproduce it.  It seems to me that the SAL tests in
0b42f8
    _is_limited_frame should exclude the bad cases; and in my attempts to
0b42f8
    write a test they do.
0b42f8
    
0b42f8
    Nevertheless I think the fix is reasonably obvious and ought to go in.
0b42f8
    
0b42f8
    2014-01-23  Tom Tromey  <tromey@redhat.com>
0b42f8
    
0b42f8
    	PR python/16485:
0b42f8
    	* python/lib/gdb/FrameDecorator.py: (FrameVars.fetch_frame_args):
0b42f8
    	Handle exception from frame.block.
0b42f8
    	(FrameVars.fetch_frame_locals): Likewise.
0b42f8
0b42f8
### a/gdb/ChangeLog
0b42f8
### b/gdb/ChangeLog
0b42f8
## -1,5 +1,12 @@
0b42f8
 2014-01-23  Tom Tromey  <tromey@redhat.com>
0b42f8
 
0b42f8
+	PR python/16485:
0b42f8
+	* python/lib/gdb/FrameDecorator.py: (FrameVars.fetch_frame_args):
0b42f8
+	Handle exception from frame.block.
0b42f8
+	(FrameVars.fetch_frame_locals): Likewise.
0b42f8
+
0b42f8
+2014-01-23  Tom Tromey  <tromey@redhat.com>
0b42f8
+
0b42f8
 	PR python/16487:
0b42f8
 	* python/py-framefilter.c (py_print_frame): Don't call Py_DECREF
0b42f8
 	on a NULL pointer.  Move "goto error" to correct place.
0b42f8
--- a/gdb/python/lib/gdb/FrameDecorator.py
0b42f8
+++ b/gdb/python/lib/gdb/FrameDecorator.py
0b42f8
@@ -258,7 +258,10 @@ class FrameVars(object):
0b42f8
         are no frame local variables, return an empty list."""
0b42f8
         lvars = []
0b42f8
 
0b42f8
-        block = self.frame.block()
0b42f8
+        try:
0b42f8
+            block = self.frame.block()
0b42f8
+        except RuntimeError:
0b42f8
+            block = None
0b42f8
 
0b42f8
         while block != None:
0b42f8
             if block.is_global or block.is_static:
0b42f8
@@ -279,7 +282,12 @@ class FrameVars(object):
0b42f8
         there are no frame argument variables, return an empty list."""
0b42f8
 
0b42f8
         args = []
0b42f8
-        block = self.frame.block()
0b42f8
+
0b42f8
+        try:
0b42f8
+            block = self.frame.block()
0b42f8
+        except RuntimeError:
0b42f8
+            block = None
0b42f8
+
0b42f8
         while block != None:
0b42f8
             if block.function != None:
0b42f8
                 break