busy waits until the thread state changes to RUN it expects thread's state as attributes of the thread. Upon running, processes any outstanding Stepping commands. :param exception_type: If pausing due to an exception, its type.
(self, thread, frame, event, arg, exception_type=None)
| 2100 | return self.suspended_frames_manager.find_frame(thread_id, frame_id) |
| 2101 | |
| 2102 | def do_wait_suspend(self, thread, frame, event, arg, exception_type=None): # @UnusedVariable |
| 2103 | """busy waits until the thread state changes to RUN |
| 2104 | it expects thread's state as attributes of the thread. |
| 2105 | Upon running, processes any outstanding Stepping commands. |
| 2106 | |
| 2107 | :param exception_type: |
| 2108 | If pausing due to an exception, its type. |
| 2109 | """ |
| 2110 | if USE_CUSTOM_SYS_CURRENT_FRAMES_MAP: |
| 2111 | constructed_tid_to_last_frame[thread.ident] = sys._getframe() |
| 2112 | |
| 2113 | # Only process from all threads, not for current one (we'll do that later on in this method). |
| 2114 | self.process_internal_commands(("*",)) |
| 2115 | |
| 2116 | thread_id = get_current_thread_id(thread) |
| 2117 | |
| 2118 | # if DebugInfoHolder.DEBUG_TRACE_LEVEL >= 2: |
| 2119 | # pydev_log.debug('do_wait_suspend %s %s %s %s %s %s (%s)' % (frame.f_lineno, frame.f_code.co_name, frame.f_code.co_filename, event, arg, constant_to_str(thread.additional_info.pydev_step_cmd), constant_to_str(thread.additional_info.pydev_original_step_cmd))) |
| 2120 | # pydev_log.debug('--- internal stack ---') |
| 2121 | # _f = sys._getframe() |
| 2122 | # while _f is not None: |
| 2123 | # pydev_log.debug(' -> %s' % (_f)) |
| 2124 | # _f = _f.f_back |
| 2125 | # pydev_log.debug('--- end internal stack ---') |
| 2126 | |
| 2127 | # Send the suspend message |
| 2128 | message = thread.additional_info.pydev_message |
| 2129 | trace_suspend_type = thread.additional_info.trace_suspend_type |
| 2130 | thread.additional_info.trace_suspend_type = "trace" # Reset to trace mode for next call. |
| 2131 | stop_reason = thread.stop_reason |
| 2132 | |
| 2133 | frames_list = None |
| 2134 | |
| 2135 | if arg is not None and event == "exception": |
| 2136 | # arg must be the exception info (tuple(exc_type, exc, traceback)) |
| 2137 | exc_type, exc_desc, trace_obj = arg |
| 2138 | if trace_obj is not None: |
| 2139 | frames_list = pydevd_frame_utils.create_frames_list_from_traceback( |
| 2140 | trace_obj, frame, exc_type, exc_desc, exception_type=exception_type |
| 2141 | ) |
| 2142 | |
| 2143 | if frames_list is None: |
| 2144 | frames_list = pydevd_frame_utils.create_frames_list_from_frame(frame) |
| 2145 | |
| 2146 | if DebugInfoHolder.DEBUG_TRACE_LEVEL > 2: |
| 2147 | pydev_log.debug( |
| 2148 | "PyDB.do_wait_suspend\nname: %s (line: %s)\n file: %s\n event: %s\n arg: %s\n step: %s (original step: %s)\n thread: %s, thread id: %s, id(thread): %s", |
| 2149 | frame.f_code.co_name, |
| 2150 | frame.f_lineno, |
| 2151 | frame.f_code.co_filename, |
| 2152 | event, |
| 2153 | arg, |
| 2154 | constant_to_str(thread.additional_info.pydev_step_cmd), |
| 2155 | constant_to_str(thread.additional_info.pydev_original_step_cmd), |
| 2156 | thread, |
| 2157 | thread_id, |
| 2158 | id(thread), |
| 2159 | ) |
no test coverage detected