diff --git a/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py b/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py index 2203ee6ac..3d8f02f40 100644 --- a/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py +++ b/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py @@ -253,14 +253,18 @@ def process_net_command(py_db, cmd_id, seq, text): # func name: 'None': match anything. Empty: match global, specified: only method context. # command to add some breakpoint. # text is file\tline. Add to breakpoints dictionary - suspend_policy = "NONE" + suspend_policy = "NONE" # Can be 'NONE' or 'ALL' is_logpoint = False hit_condition = None if py_db._set_breakpoints_with_id: try: - breakpoint_id, type, file, line, func_name, condition, expression, hit_condition, is_logpoint = text.split('\t', 8) + try: + breakpoint_id, type, file, line, func_name, condition, expression, hit_condition, is_logpoint, suspend_policy = text.split('\t', 9) + except ValueError: # not enough values to unpack + # No suspend_policy passed (use default). + breakpoint_id, type, file, line, func_name, condition, expression, hit_condition, is_logpoint = text.split('\t', 8) is_logpoint = is_logpoint == 'True' - except Exception: + except ValueError: # not enough values to unpack breakpoint_id, type, file, line, func_name, condition, expression = text.split('\t', 6) breakpoint_id = int(breakpoint_id) @@ -274,8 +278,8 @@ def process_net_command(py_db, cmd_id, seq, text): expression = expression.replace("@_@NEW_LINE_CHAR@_@", '\n').\ replace("@_@TAB_CHAR@_@", '\t').strip() else: - #Note: this else should be removed after PyCharm migrates to setting - #breakpoints by id (and ideally also provides func_name). + # Note: this else should be removed after PyCharm migrates to setting + # breakpoints by id (and ideally also provides func_name). type, file, line, func_name, suspend_policy, condition, expression = text.split('\t', 6) # If we don't have an id given for each breakpoint, consider # the id to be the line. diff --git a/ptvsd/_vendored/pydevd/tests_python/debugger_unittest.py b/ptvsd/_vendored/pydevd/tests_python/debugger_unittest.py index 13f8cefaf..3452afdb5 100644 --- a/ptvsd/_vendored/pydevd/tests_python/debugger_unittest.py +++ b/ptvsd/_vendored/pydevd/tests_python/debugger_unittest.py @@ -502,16 +502,25 @@ def wait_for_breakpoint_hit(self, *args, **kwargs): def wait_for_breakpoint_hit_with_suspend_type(self, reason=REASON_STOP_ON_BREAKPOINT, get_line=False, get_name=False): ''' - 108 is over - 109 is return - 111 is breakpoint + 108 is over + 109 is return + 111 is breakpoint + + :param reason: may be the actual reason (int or string) or a list of reasons. ''' self.log.append('Start: wait_for_breakpoint_hit') # wait for hit breakpoint - last = self.reader_thread.get_next_message('wait_for_breakpoint_hit. reason=%s' % (reason,)) - while not ('stop_reason="%s"' % reason) in last: + if not isinstance(reason, (list, tuple)): + reason = (reason,) + while True: last = self.reader_thread.get_next_message('wait_for_breakpoint_hit. reason=%s' % (reason,)) - + found = False + for r in reason: + if ('stop_reason="%s"' % (r,)) in last: + found = True + break + if found: + break # we have something like