Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Fix for breakpoint binding issue in VS #1601

Merged
merged 2 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,13 @@ def on_setbreakpoints_request(self, py_db, request):
error_msg = 'Breakpoint not validated (reason unknown -- please report as bug).'

breakpoints_set.append(pydevd_schema.Breakpoint(
verified=False, line=result.translated_line, message=error_msg).to_dict())
verified=False, line=result.translated_line, message=error_msg, source=arguments.source).to_dict())
else:
# Note that the id is made up (the id for pydevd is unique only within a file, so, the
# line is used for it).
# Also, the id is currently not used afterwards, so, we don't even keep a mapping.
breakpoints_set.append(pydevd_schema.Breakpoint(
verified=True, id=self._next_breakpoint_id(), line=result.translated_line).to_dict())
verified=True, id=self._next_breakpoint_id(), line=result.translated_line, source=arguments.source).to_dict())

body = {'breakpoints': breakpoints_set}
set_breakpoints_response = pydevd_base_schema.build_response(request, kwargs={'body': body})
Expand Down
4 changes: 3 additions & 1 deletion tests/func/test_breakpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ def code_to_debug():
assert breakpoints == [{
'verified': False,
'message': 'Breakpoint in file that does not exist.',
'source': {},
'source': ANY.dict_with({
'path': Path('invalid_file.py')
}),
'line': 1
}]

Expand Down
4 changes: 3 additions & 1 deletion tests/func/test_exclude_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ def call_func():
'Breakpoint in file excluded by filters.\n'
'Note: may be excluded because of "justMyCode" option (default == true).'
),
'source': {},
'source': ANY.dict_with({
'path': Path(code_to_debug)
}),
'line': 1
}]

Expand Down