Skip to content
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

[lldb][lldb-dap] Fix for TestDAP_instruction_breakpoint.py test failure on windows. #106200

Merged
merged 78 commits into from
Aug 27, 2024

Conversation

santhoshe447
Copy link
Contributor

TestDAP_instruction_breakpoint.py failed on windows, so these tests were skipped for windows build.

Santhosh Kumar Ellendula and others added 30 commits November 17, 2023 15:09
Adding a "port" property to the VsCode "attach" command likely extends the functionality of the debugger configuratiuon to allow attaching to a process using PID or PORT number.
Currently, the "Attach" configuration lets the user specify a pid. We tell the user to use the attachCommands property to run "gdb-remote <port>".
Followed the below conditions for "attach" command with "port" and "pid"
We should add a "port" property. If port is specified and pid is not, use that port to attach. If both port and pid are specified, return an error saying that the user can't specify both pid and port.

Ex - launch.json
{
	"version": "0.2.0",
    "configurations": [
        {
            "name": "lldb-dap Debug",
            "type": "lldb-dap",
            "request": "attach",
            "port":1234,
            "program": "${workspaceFolder}/a.out",
            "args": [],
            "stopOnEntry": false,
            "cwd": "${workspaceFolder}",
            "env": [],

        }
    ]
}
Adding a "port" property to the VsCode "attach" command likely extends the functionality of the debugger configuration to allow attaching to a process using PID or PORT number.
Currently, the "Attach" configuration lets the user specify a pid. We tell the user to use the attachCommands property to run "gdb-remote ".
Followed the below conditions for "attach" command with "port" and "pid"
We should add a "port" property. If port is specified and pid is not, use that port to attach. If both port and pid are specified, return an error saying that the user can't specify both pid and port.

Ex - launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "lldb-dap Debug",
"type": "lldb-dap",
"request": "attach",
"port":1234,
"program": "${workspaceFolder}/a.out",
"args": [],
"stopOnEntry": false,
"cwd": "${workspaceFolder}",
"env": [],

    }
]
}

In this patch we have resolved code formatting issues and fixed "test_by_name" failure.
…ed review comments

Addressed all review comments.
…d all review comments.

All review comments have been addressed, and the attach-by-port tests have been verified on
Linux machine. Although the functionality is intended to support both Linux and macOS, we were
unable to verify it on macOS due to lack of access.
Added support for "supportsInstructionBreakpoints" capability and now it this command is triggered when we set instruction breakpoint.
We need this support as part of enabling disassembly view debugging. Following features should work as part of this feature enablement:

1. Settings breakpoints in disassembly view: Unsetting the breakpoint is not happening from the disassembly view. Currently we need to unset breakpoint manually from the breakpoint List. Multiple breakpoints are getting set for the same $

2. Step over, step into, continue in the disassembly view

The format for DisassembleRequest and DisassembleResponse at https://raw.githubusercontent.com/microsoft/vscode/master/src/vs/workbench/contrib/debug/common/debugProtocol.d.ts .
The following changes were committed by mistake, so they have been reverted.
"startDebugging", &g_dap.start_debugging_request_handler,
"repl-mode", &g_dap.repl_mode_request_handler,
Few changes were missed in lldb/tools/lldb-dap/DAP.h, so added in this version.
Added stop reason for instruction breakpoint.
Resolved follwoing review comments :
1. Removed usage of removed_ibp, removed deleted instruction breakpoints deirectly from g_dap.instruction_breakpoints.erase(prev_ibp.first)
2. Reused CreateJsonObject function in CreateInstructionBreakpoint.
3. Updated test cases with stop reason.
TestDAP_instruction_breakpoint.py failed on windows, so these test were skipped for windows build.
@santhoshe447 santhoshe447 changed the title [lldb-dap] Skipped TestDAP_instruction_breakpoint.py test for windows. [lldb-dap] Fix for TestDAP_instruction_breakpoint.py test failure on windows. Aug 27, 2024
@DavidSpickett DavidSpickett changed the title [lldb-dap] Fix for TestDAP_instruction_breakpoint.py test failure on windows. [lldb][lldb-dap] Fix for TestDAP_instruction_breakpoint.py test failure on windows. Aug 27, 2024
@DavidSpickett DavidSpickett merged commit fbef4c2 into llvm:main Aug 27, 2024
8 checks passed
@DavidSpickett
Copy link
Collaborator

Thanks!

5c4lar pushed a commit to 5c4lar/llvm-project that referenced this pull request Aug 29, 2024
…re on windows. (llvm#106200)

TestDAP_instruction_breakpoint.py failed on windows, so these tests were
skipped for windows build.

---------

Co-authored-by: Santhosh Kumar Ellendula <sellendu@hu-sellendu-hyd.qualcomm.com>
Co-authored-by: Santhosh Kumar Ellendula <sellendu@hu-sellendu-lv.qualcomm.com>
dmpolukhin pushed a commit to dmpolukhin/llvm-project that referenced this pull request Sep 2, 2024
…re on windows. (llvm#106200)

TestDAP_instruction_breakpoint.py failed on windows, so these tests were
skipped for windows build.

---------

Co-authored-by: Santhosh Kumar Ellendula <sellendu@hu-sellendu-hyd.qualcomm.com>
Co-authored-by: Santhosh Kumar Ellendula <sellendu@hu-sellendu-lv.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants