diff options
author | Chelsea Cassanova <sassychels251@gmail.com> | 2022-06-03 20:04:13 -0400 |
---|---|---|
committer | Chelsea Cassanova <sassychels251@gmail.com> | 2022-06-08 18:10:41 -0400 |
commit | 0f02dd34f22650d8af0070e7ad21632525e33da8 (patch) | |
tree | 211f62fc375350925d83a27fd4d7dd503e98c090 /lldb/source/Commands/CommandObjectMemory.cpp | |
parent | ff96d434d0cdc9ba5b367c9776f6dfd95de70a81 (diff) | |
download | llvm-0f02dd34f22650d8af0070e7ad21632525e33da8.zip llvm-0f02dd34f22650d8af0070e7ad21632525e33da8.tar.gz llvm-0f02dd34f22650d8af0070e7ad21632525e33da8.tar.bz2 |
[lldb/Commands] Prevent crash due to reading memory from page zero.
Adds a check to ensure that a process exists before attempting to get
its ABI to prevent lldb from crashing due to trying to read from page zero.
Differential revision: https://reviews.llvm.org/D127016
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index b7678ad..ab54578 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -592,7 +592,10 @@ protected: return false; } - ABISP abi = m_exe_ctx.GetProcessPtr()->GetABI(); + ABISP abi; + if (Process *proc = m_exe_ctx.GetProcessPtr()) + abi = proc->GetABI(); + if (abi) addr = abi->FixDataAddress(addr); |