Skip to content

Commit

Permalink
Show message when stepping into library code with justMyCode=true. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed May 27, 2019
1 parent 016b557 commit 13410c9
Show file tree
Hide file tree
Showing 18 changed files with 5,268 additions and 5,030 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ class PyDBAdditionalThreadInfo(object):
__slots__ = [
'pydev_state',
'pydev_step_stop',
'pydev_original_step_cmd',
'pydev_step_cmd',
'pydev_notify_kill',
'pydev_smart_step_stop',
'pydev_django_resolve_frame',
'pydev_call_from_jinja2',
'pydev_call_inside_jinja2',
'pydev_stop_on_entry',
'is_tracing',
'conditional_breakpoint_exception',
'pydev_message',
Expand All @@ -92,13 +92,21 @@ class PyDBAdditionalThreadInfo(object):
def __init__(self):
self.pydev_state = STATE_RUN # STATE_RUN or STATE_SUSPEND
self.pydev_step_stop = None

# Note: we have `pydev_original_step_cmd` and `pydev_step_cmd` because the original is to
# say the action that started it and the other is to say what's the current tracing behavior
# (because it's possible that we start with a step over but may have to switch to a
# different step strategy -- for instance, if a step over is done and we return the current
# method the strategy is changed to a step in).

self.pydev_original_step_cmd = -1 # Something as CMD_STEP_INTO, CMD_STEP_OVER, etc.
self.pydev_step_cmd = -1 # Something as CMD_STEP_INTO, CMD_STEP_OVER, etc.

self.pydev_notify_kill = False
self.pydev_smart_step_stop = None
self.pydev_django_resolve_frame = False
self.pydev_call_from_jinja2 = None
self.pydev_call_inside_jinja2 = None
self.pydev_stop_on_entry = False
self.is_tracing = False
self.conditional_breakpoint_exception = None
self.pydev_message = ''
Expand Down
5 changes: 3 additions & 2 deletions src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
internal_get_variable_json, internal_change_variable, internal_change_variable_json,
internal_evaluate_expression_json, internal_set_expression_json, internal_get_exception_details_json)
from _pydevd_bundle.pydevd_comm_constants import (CMD_THREAD_SUSPEND, file_system_encoding,
CMD_STEP_INTO_MY_CODE)
CMD_STEP_INTO_MY_CODE, CMD_STOP_ON_START)
from _pydevd_bundle.pydevd_constants import (get_current_thread_id, set_protocol, get_protocol,
HTTP_JSON_PROTOCOL, JSON_PROTOCOL, STATE_RUN, IS_PY3K, DebugInfoHolder, dict_keys)
from _pydevd_bundle.pydevd_net_command_factory_json import NetCommandFactoryJson
Expand Down Expand Up @@ -141,6 +141,7 @@ def request_resume_thread(self, thread_id):
if t is None:
continue
additional_info = set_additional_thread_info(t)
additional_info.pydev_original_step_cmd = -1
additional_info.pydev_step_cmd = -1
additional_info.pydev_step_stop = None
additional_info.pydev_state = STATE_RUN
Expand Down Expand Up @@ -623,5 +624,5 @@ def stop_on_entry(self):
pydev_log.critical('Could not find main thread while setting Stop on Entry.')
else:
info = set_additional_thread_info(main_thread)
info.pydev_original_step_cmd = CMD_STOP_ON_START
info.pydev_step_cmd = CMD_STEP_INTO_MY_CODE
info.pydev_stop_on_entry = True
5 changes: 4 additions & 1 deletion src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ class InternalRunThread(InternalThreadCommand):
def do_it(self, dbg):
t = pydevd_find_thread_by_id(self.thread_id)
if t:
t.additional_info.pydev_original_step_cmd = -1
t.additional_info.pydev_step_cmd = -1
t.additional_info.pydev_step_stop = None
t.additional_info.pydev_state = STATE_RUN
Expand All @@ -626,6 +627,7 @@ def __init__(self, thread_id, cmd_id):
def do_it(self, dbg):
t = pydevd_find_thread_by_id(self.thread_id)
if t:
t.additional_info.pydev_original_step_cmd = self.cmd_id
t.additional_info.pydev_step_cmd = self.cmd_id
t.additional_info.pydev_state = STATE_RUN

Expand All @@ -648,6 +650,7 @@ def __init__(self, thread_id, cmd_id, line, func_name, seq=0):
def do_it(self, dbg):
t = pydevd_find_thread_by_id(self.thread_id)
if t:
t.additional_info.pydev_original_step_cmd = self.cmd_id
t.additional_info.pydev_step_cmd = self.cmd_id
t.additional_info.pydev_next_line = int(self.line)
t.additional_info.pydev_func_name = self.func_name
Expand Down Expand Up @@ -1260,7 +1263,7 @@ def __init__(self, thread_id, arg, curr_frame_id):

def do_it(self, dbg):
try:
cmd = dbg.cmd_factory.make_send_curr_exception_trace_message(self.sequence, self.thread_id, self.curr_frame_id, *self.arg)
cmd = dbg.cmd_factory.make_send_curr_exception_trace_message(dbg, self.sequence, self.thread_id, self.curr_frame_id, *self.arg)
del self.arg
dbg.writer.add_command(cmd)
except:
Expand Down
Loading

0 comments on commit 13410c9

Please sign in to comment.