-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb-dap] Support column breakpoints #113787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vogelsgesang
merged 16 commits into
llvm:main
from
vogelsgesang:lldb-dap-column-breakpoints
Nov 16, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
af45bc2
[lldb-dap] Support column breakpoints
vogelsgesang 6937686
Fix formatting
vogelsgesang 1d0cf67
Merge remote-tracking branch 'upstream/main' into lldb-dap-column-bre…
vogelsgesang 1f655ec
Fix test case
vogelsgesang c239d23
Merge remote-tracking branch 'upstream/main' into lldb-dap-column-bre…
vogelsgesang 8a9aa70
Merge remote-tracking branch 'upstream/main' into lldb-dap-column-bre…
vogelsgesang 46ce2bf
Addres review comment re `self.assertTrue`
vogelsgesang 50d9ce8
Undo unrelated comment change
vogelsgesang 4e05a8e
Merge remote-tracking branch 'upstream/main' into lldb-dap-column-bre…
vogelsgesang 5cde5bc
Merge remote-tracking branch 'upstream/main' into lldb-dap-column-bre…
vogelsgesang 5165914
Fix merge conflict
vogelsgesang e3131b4
Check file spec
vogelsgesang 3a4fb43
Minor: Fix `IsValid` check
vogelsgesang a4e627b
Merge remote-tracking branch 'upstream/main' into lldb-dap-column-bre…
vogelsgesang c60ec26
Fix rebase conflict
vogelsgesang d811551
Use raw pointer comparison
vogelsgesang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
""" | ||
Test lldb-dap breakpointLocations request | ||
""" | ||
|
||
|
||
import dap_server | ||
import shutil | ||
from lldbsuite.test.decorators import * | ||
from lldbsuite.test.lldbtest import * | ||
from lldbsuite.test import lldbutil | ||
import lldbdap_testcase | ||
import os | ||
|
||
|
||
class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase): | ||
def setUp(self): | ||
lldbdap_testcase.DAPTestCaseBase.setUp(self) | ||
|
||
self.main_basename = "main-copy.cpp" | ||
self.main_path = os.path.realpath(self.getBuildArtifact(self.main_basename)) | ||
|
||
@skipIfWindows | ||
def test_column_breakpoints(self): | ||
"""Test retrieving the available breakpoint locations.""" | ||
program = self.getBuildArtifact("a.out") | ||
self.build_and_launch(program, stopOnEntry=True) | ||
loop_line = line_number(self.main_path, "// break loop") | ||
self.dap_server.request_continue() | ||
|
||
# Ask for the breakpoint locations based only on the line number | ||
response = self.dap_server.request_breakpointLocations( | ||
self.main_path, loop_line | ||
) | ||
self.assertTrue(response["success"]) | ||
self.assertEqual( | ||
response["body"]["breakpoints"], | ||
[ | ||
{"line": loop_line, "column": 9}, | ||
{"line": loop_line, "column": 13}, | ||
{"line": loop_line, "column": 20}, | ||
{"line": loop_line, "column": 23}, | ||
{"line": loop_line, "column": 25}, | ||
{"line": loop_line, "column": 34}, | ||
{"line": loop_line, "column": 37}, | ||
{"line": loop_line, "column": 39}, | ||
{"line": loop_line, "column": 51}, | ||
], | ||
) | ||
|
||
# Ask for the breakpoint locations for a column range | ||
response = self.dap_server.request_breakpointLocations( | ||
self.main_path, | ||
loop_line, | ||
column=24, | ||
end_column=46, | ||
) | ||
self.assertTrue(response["success"]) | ||
self.assertEqual( | ||
response["body"]["breakpoints"], | ||
[ | ||
{"line": loop_line, "column": 25}, | ||
{"line": loop_line, "column": 34}, | ||
{"line": loop_line, "column": 37}, | ||
{"line": loop_line, "column": 39}, | ||
], | ||
) | ||
|
||
# Ask for the breakpoint locations for a range of line numbers | ||
response = self.dap_server.request_breakpointLocations( | ||
self.main_path, | ||
line=loop_line, | ||
end_line=loop_line + 2, | ||
column=39, | ||
) | ||
self.maxDiff = None | ||
self.assertTrue(response["success"]) | ||
self.assertEqual( | ||
response["body"]["breakpoints"], | ||
[ | ||
{"column": 39, "line": 40}, | ||
{"column": 51, "line": 40}, | ||
{"column": 3, "line": 42}, | ||
{"column": 18, "line": 42}, | ||
], | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.