aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectMemory.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-07-26 19:03:47 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-07-26 19:04:23 +0000
commit7fa27ce4a07f19b07799a767fc29416f3b625afb (patch)
tree27825c83636c4de341eb09a74f49f5d38a15d165 /lldb/source/Commands/CommandObjectMemory.cpp
parente3b557809604d036af6e00c60f012c2025b59a5e (diff)
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 6606f4564dc8..ba5aad3d4ad5 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");
@@ -1062,7 +1047,8 @@ protected:
DataBufferHeap buffer;
if (m_memory_options.m_string.OptionWasSet()) {
- llvm::StringRef str = m_memory_options.m_string.GetStringValue();
+ llvm::StringRef str =
+ m_memory_options.m_string.GetValueAs<llvm::StringRef>().value_or("");
if (str.empty()) {
result.AppendError("search string must have non-zero length.");
return false;
@@ -1073,7 +1059,9 @@ protected:
ValueObjectSP result_sp;
if ((eExpressionCompleted ==
process->GetTarget().EvaluateExpression(
- m_memory_options.m_expr.GetStringValue(), frame, result_sp)) &&
+ m_memory_options.m_expr.GetValueAs<llvm::StringRef>().value_or(
+ ""),
+ frame, result_sp)) &&
result_sp) {
uint64_t value = result_sp->GetValueAsUnsigned(0);
std::optional<uint64_t> size =
@@ -1783,7 +1771,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) {