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

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