summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectMemory.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2011-07-09 00:55:34 +0000
committerJim Ingham <jingham@apple.com>2011-07-09 00:55:34 +0000
commitb8e8a5f3ee11fe58983f11a54941f04f2a8dbd53 (patch)
treee1b558cf06c182fae92485dadd897e515bba02e1 /lldb/source/Commands/CommandObjectMemory.cpp
parent9e00b6a6545e4d459cff2663ec679af1e147de68 (diff)
downloadbcm5719-llvm-b8e8a5f3ee11fe58983f11a54941f04f2a8dbd53.tar.gz
bcm5719-llvm-b8e8a5f3ee11fe58983f11a54941f04f2a8dbd53.zip
Allow reading memory from files before the target has been run.
llvm-svn: 134780
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 87dc3378520..98b1df53b57 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -298,7 +298,7 @@ public:
"memory read",
"Read from the memory of the process being debugged.",
NULL,
- eFlagProcessMustBeLaunched),
+ eFlagProcessMustBePaused),
m_option_group (interpreter),
m_format_options (eFormatBytesWithASCII, 0, true),
m_memory_options (),
@@ -351,9 +351,9 @@ public:
CommandReturnObject &result)
{
ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
- if (exe_ctx.process == NULL)
+ if (exe_ctx.target == NULL)
{
- result.AppendError("need a process to read memory");
+ result.AppendError("need at least a target to read memory");
result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -561,7 +561,8 @@ public:
if (!clang_ast_type.GetOpaqueQualType())
{
data_sp.reset (new DataBufferHeap (total_byte_size, '\0'));
- bytes_read = exe_ctx.process->ReadMemory(addr, data_sp->GetBytes (), data_sp->GetByteSize(), error);
+ Address address(NULL, addr);
+ bytes_read = exe_ctx.target->ReadMemory(address, false, data_sp->GetBytes (), data_sp->GetByteSize(), error);
if (bytes_read == 0)
{
result.AppendWarningWithFormat("Read from 0x%llx failed.\n", addr);
OpenPOWER on IntegriCloud