-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb][lldb-dap] Respect x86 disassembly flavor setting #134722
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
Merged
Conversation
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
@llvm/pr-subscribers-lldb Author: Ebuka Ezike (da-viper) ChangesEnsure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets. Depends on #134626 Full diff: https://github.com/llvm/llvm-project/pull/134722.diff 1 Files Affected:
diff --git a/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp
index f0cb7be70210d..0fd9390623046 100644
--- a/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/DisassembleRequestHandler.cpp
@@ -116,7 +116,22 @@ void DisassembleRequestHandler::operator()(
const auto inst_count =
GetInteger<int64_t>(arguments, "instructionCount").value_or(0);
- lldb::SBInstructionList insts = dap.target.ReadInstructions(addr, inst_count);
+
+ std::string flavor_string{};
+ const auto target_triple = llvm::StringRef(dap.target.GetTriple());
+ if (target_triple.starts_with("x86_64") || target_triple.starts_with("x86")) {
+ const lldb::SBStructuredData flavor =
+ dap.debugger.GetSetting("target.x86-disassembly-flavor");
+
+ const size_t str_length = flavor.GetStringValue(nullptr, 0);
+ if (str_length != 0) {
+ flavor_string.resize(str_length + 1);
+ flavor.GetStringValue(flavor_string.data(), flavor_string.length());
+ }
+ }
+
+ lldb::SBInstructionList insts =
+ dap.target.ReadInstructions(addr, inst_count, flavor_string.c_str());
if (!insts.IsValid()) {
response["success"] = false;
|
walter-erquinigo
requested changes
Apr 16, 2025
Ensure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets. Depends on llvm#134626
Signed-off-by: Ebuka Ezike <[email protected]>
c3b2816
to
c69872d
Compare
Co-authored-by: Jonas Devlieghere <[email protected]>
Co-authored-by: Jonas Devlieghere <[email protected]>
JDevlieghere
approved these changes
Apr 25, 2025
Co-authored-by: Jonas Devlieghere <[email protected]>
jyli0116
pushed a commit
to jyli0116/llvm-project
that referenced
this pull request
Apr 28, 2025
Ensure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets. Depends on llvm#134626 --------- Signed-off-by: Ebuka Ezike <[email protected]> Co-authored-by: Jonas Devlieghere <[email protected]>
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
Ensure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets. Depends on llvm#134626 --------- Signed-off-by: Ebuka Ezike <[email protected]> Co-authored-by: Jonas Devlieghere <[email protected]>
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
Ensure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets. Depends on llvm#134626 --------- Signed-off-by: Ebuka Ezike <[email protected]> Co-authored-by: Jonas Devlieghere <[email protected]>
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
Ensure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets. Depends on llvm#134626 --------- Signed-off-by: Ebuka Ezike <[email protected]> Co-authored-by: Jonas Devlieghere <[email protected]>
Ankur-0429
pushed a commit
to Ankur-0429/llvm-project
that referenced
this pull request
May 9, 2025
Ensure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets. Depends on llvm#134626 --------- Signed-off-by: Ebuka Ezike <[email protected]> Co-authored-by: Jonas Devlieghere <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ensure the disassembly respects the "target.x86-disassembly-flavor" setting for x86 and x86_64 targets.
Depends on #134626