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

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