MCPcopy Index your code
hub / github.com/python/cpython / print_traceback_until_shim

Method print_traceback_until_shim

Tools/gdb/libpython.py:1283–1302  ·  view source on GitHub ↗
(self, frame_index=None)

Source from the content-addressed store, hash-verified

1281 self.co_name.proxyval(visited)))
1282
1283 def print_traceback_until_shim(self, frame_index=None):
1284 # Print traceback for _PyInterpreterFrame and return previous frame
1285 interp_frame = self
1286 while True:
1287 if not interp_frame:
1288 sys.stdout.write(' (unable to read python frame information)\n')
1289 return None
1290 if interp_frame.is_shim():
1291 return interp_frame.previous()
1292
1293 if frame_index is not None:
1294 line = interp_frame.get_truncated_repr(MAX_OUTPUT_LEN)
1295 sys.stdout.write('#%i %s\n' % (frame_index, line))
1296 else:
1297 interp_frame.print_traceback()
1298 if not interp_frame.is_optimized_out():
1299 line = interp_frame.current_line()
1300 if line is not None:
1301 sys.stdout.write(' %s\n' % line.strip())
1302 interp_frame = interp_frame.previous()
1303
1304 def get_truncated_repr(self, maxlen):
1305 '''

Callers 2

print_summaryMethod · 0.80
print_traceback_helperFunction · 0.80

Calls 8

is_shimMethod · 0.80
print_tracebackMethod · 0.80
writeMethod · 0.45
previousMethod · 0.45
get_truncated_reprMethod · 0.45
is_optimized_outMethod · 0.45
current_lineMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected