aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectMemory.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2022-10-28 10:52:06 +0100
committerDavid Spickett <david.spickett@linaro.org>2023-02-13 10:15:52 +0000
commite6ec76c647aaa335de48b8534d3a044346d9656f (patch)
treeb5aff8ba212c9e94df8148ac0d51f221541de3ca /lldb/source/Commands/CommandObjectMemory.cpp
parenta9329a96ada35b1b5439da4e29eed7db10ff813b (diff)
downloadllvm-e6ec76c647aaa335de48b8534d3a044346d9656f.zip
llvm-e6ec76c647aaa335de48b8534d3a044346d9656f.tar.gz
llvm-e6ec76c647aaa335de48b8534d3a044346d9656f.tar.bz2
[LLDB] Apply FixCodeAddress to all forms of address arguments
This is a follow up to https://reviews.llvm.org/D141629 and applies the change it made to all paths through ToAddress (now DoToAddress). I have included the test from my previous attempt https://reviews.llvm.org/D136938. The initial change only applied fixing to addresses that would parse as integers, so my test case failed. Since ToAddress has multiple exit points, I've wrapped it into a new method DoToAddress. Now you can call ToAddress, it will call DoToAddress and no matter what path you take, the address will be fixed. For the memory tagging commands we actually want the full address (to work out mismatches). So I added ToRawAddress for that. I have tested this on a QEMU AArch64 Linux system with Memory Tagging, Pointer Authentication and Top Byte Ignore enabled. By running the new test and all other tests in API/linux/aarch64. Some commands have had calls to the ABI plugin removed as ToAddress now does this for them. The "memory region" command still needs to use the ABI plugin to detect the end of memory when there are non-address bits. Reviewed By: jasonmolenda Differential Revision: https://reviews.llvm.org/D142715
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 6606f45..70dd6ea 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -594,18 +594,9 @@ protected:
return false;
}
- ABISP abi;
- if (Process *proc = m_exe_ctx.GetProcessPtr())
- abi = proc->GetABI();
-
- if (abi)
- addr = abi->FixDataAddress(addr);
-
if (argc == 2) {
lldb::addr_t end_addr = OptionArgParser::ToAddress(
&m_exe_ctx, command[1].ref(), LLDB_INVALID_ADDRESS, nullptr);
- if (end_addr != LLDB_INVALID_ADDRESS && abi)
- end_addr = abi->FixDataAddress(end_addr);
if (end_addr == LLDB_INVALID_ADDRESS) {
result.AppendError("invalid end address expression.");
@@ -1045,12 +1036,6 @@ protected:
return false;
}
- ABISP abi = m_exe_ctx.GetProcessPtr()->GetABI();
- if (abi) {
- low_addr = abi->FixDataAddress(low_addr);
- high_addr = abi->FixDataAddress(high_addr);
- }
-
if (high_addr <= low_addr) {
result.AppendError(
"starting address must be smaller than ending address");
@@ -1783,7 +1768,6 @@ protected:
}
auto load_addr_str = command[0].ref();
- // Non-address bits in this will be handled later by GetMemoryRegion
load_addr = OptionArgParser::ToAddress(&m_exe_ctx, load_addr_str,
LLDB_INVALID_ADDRESS, &error);
if (error.Fail() || load_addr == LLDB_INVALID_ADDRESS) {