(self, info, pybreakpoint, new_frame)
| 946 | self.suspended_frames_manager.add_fake_frame(thread_id, frame_id, frame) |
| 947 | |
| 948 | def handle_breakpoint_condition(self, info, pybreakpoint, new_frame): |
| 949 | condition = pybreakpoint.condition |
| 950 | try: |
| 951 | if pybreakpoint.handle_hit_condition(new_frame): |
| 952 | return True |
| 953 | |
| 954 | if not condition: |
| 955 | return False |
| 956 | |
| 957 | return eval(condition, new_frame.f_globals, new_frame.f_locals) |
| 958 | except Exception as e: |
| 959 | if not isinstance(e, self.skip_print_breakpoint_exception): |
| 960 | stack_trace = io.StringIO() |
| 961 | etype, value, tb = sys.exc_info() |
| 962 | traceback.print_exception(etype, value, tb.tb_next, file=stack_trace) |
| 963 | |
| 964 | msg = "Error while evaluating expression in conditional breakpoint: %s\n%s" % (condition, stack_trace.getvalue()) |
| 965 | api = PyDevdAPI() |
| 966 | api.send_error_message(self, msg) |
| 967 | |
| 968 | if not isinstance(e, self.skip_suspend_on_breakpoint_exception): |
| 969 | try: |
| 970 | # add exception_type and stacktrace into thread additional info |
| 971 | etype, value, tb = sys.exc_info() |
| 972 | error = "".join(traceback.format_exception_only(etype, value)) |
| 973 | stack = traceback.extract_stack(f=tb.tb_frame.f_back) |
| 974 | |
| 975 | # On self.set_suspend(thread, CMD_SET_BREAK) this info will be |
| 976 | # sent to the client. |
| 977 | info.conditional_breakpoint_exception = ("Condition:\n" + condition + "\n\nError:\n" + error, stack) |
| 978 | except: |
| 979 | pydev_log.exception() |
| 980 | return True |
| 981 | |
| 982 | return False |
| 983 | |
| 984 | finally: |
| 985 | etype, value, tb = None, None, None |
| 986 | |
| 987 | def handle_breakpoint_expression(self, pybreakpoint, info, new_frame): |
| 988 | try: |
no test coverage detected