-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[lldb] Add InstructionARM64 to lldb-server #137267
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
Conversation
@llvm/pr-subscribers-lldb Author: Dmitry Vasilyev (slydiman) ChangesFull diff: https://github.com/llvm/llvm-project/pull/137267.diff 2 Files Affected:
diff --git a/lldb/tools/lldb-server/CMakeLists.txt b/lldb/tools/lldb-server/CMakeLists.txt
index 0135b367fcc21..6eb0e478a23a9 100644
--- a/lldb/tools/lldb-server/CMakeLists.txt
+++ b/lldb/tools/lldb-server/CMakeLists.txt
@@ -55,6 +55,7 @@ add_lldb_tool(lldb-server
lldbVersion
${LLDB_PLUGINS}
lldbPluginInstructionARM
+ lldbPluginInstructionARM64
lldbPluginInstructionLoongArch
lldbPluginInstructionMIPS
lldbPluginInstructionMIPS64
diff --git a/lldb/tools/lldb-server/SystemInitializerLLGS.cpp b/lldb/tools/lldb-server/SystemInitializerLLGS.cpp
index 5b280d6cf5280..7784bc637c843 100644
--- a/lldb/tools/lldb-server/SystemInitializerLLGS.cpp
+++ b/lldb/tools/lldb-server/SystemInitializerLLGS.cpp
@@ -24,6 +24,7 @@ using HostObjectFile = ObjectFileELF;
#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
#define LLDB_TARGET_ARM64
+#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
#endif
#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM) || \
@@ -62,13 +63,16 @@ llvm::Error SystemInitializerLLGS::Initialize() {
HostObjectFile::Initialize();
-#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
+#if defined(LLDB_TARGET_ARM)
EmulateInstructionARM::Initialize();
#endif
+#if defined(LLDB_TARGET_ARM64)
+ EmulateInstructionARM64::Initialize();
+#endif
#if defined(LLDB_TARGET_LoongArch)
EmulateInstructionLoongArch::Initialize();
#endif
-#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
+#if defined(LLDB_TARGET_MIPS)
EmulateInstructionMIPS::Initialize();
#endif
#if defined(LLDB_TARGET_MIPS64)
@@ -84,13 +88,16 @@ llvm::Error SystemInitializerLLGS::Initialize() {
void SystemInitializerLLGS::Terminate() {
HostObjectFile::Terminate();
-#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
+#if defined(LLDB_TARGET_ARM)
EmulateInstructionARM::Terminate();
#endif
+#if defined(LLDB_TARGET_ARM64)
+ EmulateInstructionARM64::Terminate();
+#endif
#if defined(LLDB_TARGET_LoongArch)
EmulateInstructionLoongArch::Terminate();
#endif
-#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
+#if defined(LLDB_TARGET_MIPS)
EmulateInstructionMIPS::Terminate();
#endif
#if defined(LLDB_TARGET_MIPS64)
|
What's the motivation? The instruction emulation plugins are used to implement software single-stepping on architectures without (reliably present) hardware support. AFAIK aarch64 is not one of those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading #129543 (comment) I get the feeling this is just speculative. So yea, there is a reason to not add InstructionARM64 -- it's not needed/used.
I think it's also used in unwinding for some basic prologue/epilogue instructions, but I think that would happen in the client lldb not the server. Also if this code is not in lldb-server now, I don't see a reason to add it unless it's solving a real prolem. |
Ok, thanks. |
No description provided.