Skip to content

Commit

Permalink
Improvements to step into target. Work in progress: #576
Browse files Browse the repository at this point in the history
Description:
- Changes the structure to create a stack from the bytecode information
  so that function call names are correctly computed (this is still a work
  in progress as not all bytecode instructions are currently supported).
- Support to step into function calls inside comprehensions/generators.
- Updates the bytecode dependency to 0.12.0.
  Note: changes were done to the bytecode library to keep the bytecode offset.
  • Loading branch information
fabioz authored and int19h committed May 4, 2021
1 parent 8ec0a31 commit c7bb276
Show file tree
Hide file tree
Showing 41 changed files with 7,851 additions and 5,014 deletions.
4 changes: 2 additions & 2 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"Type": "git",
"git": {
"Name": "bytecode",
"RepositoryUrl": "https://github.com/vstinner/bytecode",
"CommitHash": "e3e77fb690ed05ac171e15694e1c5d0e0dc34e86"
"RepositoryUrl": "https://github.com/MatthieuDartiailh/bytecode",
"CommitHash": "826344ec533643fad068754e0b9799bfeac46634"
},
"DevelopmentDependency": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ class PyDBAdditionalThreadInfo(object):

# Used for CMD_SMART_STEP_INTO (to know which smart step into variant to use)
'pydev_smart_parent_offset',
'pydev_smart_child_offset',

# Used for CMD_SMART_STEP_INTO (list[_pydevd_bundle.pydevd_bytecode_utils.Variant])
# Filled when the cmd_get_smart_step_into_variants is requested (so, this is a copy
# of the last request for a given thread and pydev_smart_parent_offset relies on it).
# of the last request for a given thread and pydev_smart_parent_offset/pydev_smart_child_offset relies on it).
'pydev_smart_step_into_variants',
'target_id_to_smart_step_into_variant',
]
# ENDIF

Expand Down Expand Up @@ -84,7 +86,9 @@ def __init__(self):
self.thread_tracer = None
self.step_in_initial_location = None
self.pydev_smart_parent_offset = -1
self.pydev_smart_child_offset = -1
self.pydev_smart_step_into_variants = ()
self.target_id_to_smart_step_into_variant = {}

def get_topmost_frame(self, thread):
'''
Expand Down
4 changes: 2 additions & 2 deletions src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def request_step(self, py_db, thread_id, step_cmd_id):
elif thread_id.startswith('__frame__:'):
sys.stderr.write("Can't make tasklet step command: %s\n" % (thread_id,))

def request_smart_step_into(self, py_db, seq, thread_id, offset):
def request_smart_step_into(self, py_db, seq, thread_id, offset, child_offset):
t = pydevd_find_thread_by_id(thread_id)
if t:
py_db.post_method_as_internal_command(
thread_id, internal_smart_step_into, thread_id, offset, set_additional_thread_info=set_additional_thread_info)
thread_id, internal_smart_step_into, thread_id, offset, child_offset, set_additional_thread_info=set_additional_thread_info)
elif thread_id.startswith('__frame__:'):
sys.stderr.write("Can't set next statement in tasklet: %s\n" % (thread_id,))

Expand Down
Loading

0 comments on commit c7bb276

Please sign in to comment.