MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / build_exception_info_response

Function build_exception_info_response

_pydevd_bundle/pydevd_comm.py:1452–1606  ·  view source on GitHub ↗

:return ExceptionInfoResponse

(dbg, thread_id, thread, request_seq, set_additional_thread_info, iter_visible_frames_info, max_frames)

Source from the content-addressed store, hash-verified

1450
1451
1452def build_exception_info_response(dbg, thread_id, thread, request_seq, set_additional_thread_info, iter_visible_frames_info, max_frames):
1453 """
1454 :return ExceptionInfoResponse
1455 """
1456 additional_info = set_additional_thread_info(thread)
1457 topmost_frame = additional_info.get_topmost_frame(thread)
1458
1459 current_paused_frame_name = ""
1460
1461 source_path = "" # This is an extra bit of data used by Visual Studio
1462 stack_str_lst = []
1463 name = None
1464 description = None
1465
1466 if topmost_frame is not None:
1467 try:
1468 try:
1469 frames_list = dbg.suspended_frames_manager.get_frames_list(thread_id)
1470 while frames_list is not None and len(frames_list):
1471 frames = []
1472
1473 frame = None
1474
1475 if not name:
1476 exc_type = frames_list.exc_type
1477 if exc_type is not None:
1478 try:
1479 name = exc_type.__qualname__
1480 except:
1481 try:
1482 name = exc_type.__name__
1483 except:
1484 try:
1485 name = str(exc_type)
1486 except:
1487 pass
1488
1489 if not description:
1490 exc_desc = frames_list.exc_desc
1491 if exc_desc is not None:
1492 try:
1493 description = str(exc_desc)
1494 except:
1495 pass
1496
1497 for (
1498 frame_id,
1499 frame,
1500 method_name,
1501 original_filename,
1502 filename_in_utf8,
1503 lineno,
1504 _applied_mapping,
1505 show_as_current_frame,
1506 line_col_info,
1507 ) in iter_visible_frames_info(dbg, frames_list):
1508 line_text = linecache.getline(original_filename, lineno)
1509

Calls 7

get_topmost_frameMethod · 0.80
apply_files_filterMethod · 0.80
exceptionMethod · 0.80
get_frames_listMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected