Skip to content

Conversation

santhoshe447
Copy link
Contributor

Parse ELF attributes to automatically set disassembler features.
llvm-objdump calls ELFObjectFile::getFeatures, then turns that into a cstr to pass to createMCSubtargetInfo.
The lldb disassembler builds features for various architectures manually and adds in the value from the command line.
If this is empty, it uses the default. then it turns that into a cstr and passes it to createMCSubtargetInfo.

For Hexagon and RISC-V, parse the attributes, set up features, add anything else needed.
If this is empty, pick the default.
Then turn into a cstr and pass to createMCSubtargetInfo (via MCDisasmInstance::Create).

This patch adds RISCV feature attribute support and allows overriding additional(default) feature.

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.
Copy link

github-actions bot commented Aug 1, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@santhoshe447
Copy link
Contributor Author

Kindly share any inputs or suggestion, if any.

@tedwoodward
Copy link
Contributor

@JDevlieghere @jasonmolenda any more thoughts?

@bulbazord
Copy link
Member

This PR has 182 commits in it, most of which are merge commits. Please change your branch to only include the commits relevant to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants