Blame SOURCES/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch
|
|
8dc7a2 |
--- a/Tools/gdb/libpython.py 2013-04-06 03:41:58.000000000 -0400
|
|
|
8dc7a2 |
+++ b/Tools/gdb/libpython.py 2013-04-24 03:51:04.720540343 -0400
|
|
|
8dc7a2 |
@@ -274,6 +274,9 @@
|
|
|
8dc7a2 |
self.tp_name = tp_name
|
|
|
8dc7a2 |
self.address = address
|
|
|
8dc7a2 |
|
|
|
8dc7a2 |
+ def __len__(self):
|
|
|
8dc7a2 |
+ return len(repr(self))
|
|
|
8dc7a2 |
+
|
|
|
8dc7a2 |
def __repr__(self):
|
|
|
8dc7a2 |
# For the NULL pointer, we have no way of knowing a type, so
|
|
|
8dc7a2 |
# special-case it as per
|
|
|
8dc7a2 |
@@ -881,6 +884,8 @@
|
|
|
8dc7a2 |
filename = self.filename()
|
|
|
8dc7a2 |
try:
|
|
|
8dc7a2 |
f = open(os_fsencode(filename), 'r')
|
|
|
8dc7a2 |
+ except TypeError: # filename is FakeRepr
|
|
|
8dc7a2 |
+ return None
|
|
|
8dc7a2 |
except IOError:
|
|
|
8dc7a2 |
return None
|
|
|
8dc7a2 |
with f:
|
|
|
8dc7a2 |
@@ -1523,9 +1528,12 @@
|
|
|
8dc7a2 |
|
|
|
8dc7a2 |
def print_summary(self):
|
|
|
8dc7a2 |
if self.is_evalframeex():
|
|
|
8dc7a2 |
- pyop = self.get_pyop()
|
|
|
8dc7a2 |
- if pyop:
|
|
|
8dc7a2 |
+ try:
|
|
|
8dc7a2 |
+ pyop = self.get_pyop()
|
|
|
8dc7a2 |
line = pyop.get_truncated_repr(MAX_OUTPUT_LEN)
|
|
|
8dc7a2 |
+ except:
|
|
|
8dc7a2 |
+ pyop = None
|
|
|
8dc7a2 |
+ if pyop:
|
|
|
8dc7a2 |
write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(), line))
|
|
|
8dc7a2 |
if not pyop.is_optimized_out():
|
|
|
8dc7a2 |
line = pyop.current_line()
|
|
|
8dc7a2 |
@@ -1542,7 +1550,10 @@
|
|
|
8dc7a2 |
|
|
|
8dc7a2 |
def print_traceback(self):
|
|
|
8dc7a2 |
if self.is_evalframeex():
|
|
|
8dc7a2 |
- pyop = self.get_pyop()
|
|
|
8dc7a2 |
+ try:
|
|
|
8dc7a2 |
+ pyop = self.get_pyop()
|
|
|
8dc7a2 |
+ except:
|
|
|
8dc7a2 |
+ pyop = None
|
|
|
8dc7a2 |
if pyop:
|
|
|
8dc7a2 |
pyop.print_traceback()
|
|
|
8dc7a2 |
if not pyop.is_optimized_out():
|