aboutsummaryrefslogtreecommitdiff
path: root/lldb/source
diff options
context:
space:
mode:
authorJason Molenda <jason@molenda.com>2023-01-23 10:42:31 -0800
committerJason Molenda <jason@molenda.com>2023-01-23 10:44:19 -0800
commit484bc2bcc7990f4ecaf40f3d806ed870cdbdfd95 (patch)
tree8952240a1ff00f1b50f9dfd1ff9f8baaf75289b2 /lldb/source
parentd1c0febeab41bcdda30c29d8e99a5fc83ffb24fc (diff)
downloadllvm-484bc2bcc7990f4ecaf40f3d806ed870cdbdfd95.zip
llvm-484bc2bcc7990f4ecaf40f3d806ed870cdbdfd95.tar.gz
llvm-484bc2bcc7990f4ecaf40f3d806ed870cdbdfd95.tar.bz2
Run cmdline address expressions through ABI's FixAddress
On systems like ARM, where the non-addressable bits of a pointer value may be used for metadata (ARMv8.3 pointer authentication, or Type Byte Ignore), those bits need to be cleared before the address points to a valid memory location. Add a call to the target's ABI to clear those from address expression arguments to the lldb commands (e.g. `disassemble -a`). Differential Revision: https://reviews.llvm.org/D141629
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Interpreter/OptionArgParser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/OptionArgParser.cpp b/lldb/source/Interpreter/OptionArgParser.cpp
index 93b01ab..63ca0f9 100644
--- a/lldb/source/Interpreter/OptionArgParser.cpp
+++ b/lldb/source/Interpreter/OptionArgParser.cpp
@@ -8,6 +8,7 @@
#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/DataFormatters/FormatManager.h"
+#include "lldb/Target/ABI.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
@@ -157,6 +158,10 @@ lldb::addr_t OptionArgParser::ToAddress(const ExecutionContext *exe_ctx,
if (!s.getAsInteger(0, addr)) {
if (error_ptr)
error_ptr->Clear();
+ Process *process = exe_ctx->GetProcessPtr();
+ if (process)
+ if (ABISP abi_sp = process->GetABI())
+ addr = abi_sp->FixCodeAddress(addr);
return addr;
}