diff options
| author | Stella Stamenova <stilis@microsoft.com> | 2018-07-02 21:50:31 +0000 |
|---|---|---|
| committer | Stella Stamenova <stilis@microsoft.com> | 2018-07-02 21:50:31 +0000 |
| commit | 696ce3770b741ef7f913b5eda73f0b2fda24e75c (patch) | |
| tree | 70a28cafc3e15e384a77dabb990792a20fb7afff /lldb/source/Plugins/Process/Windows/Common | |
| parent | 2443bbd4aacd73b61cffe8e7a80a8a320b14dcde (diff) | |
| download | bcm5719-llvm-696ce3770b741ef7f913b5eda73f0b2fda24e75c.tar.gz bcm5719-llvm-696ce3770b741ef7f913b5eda73f0b2fda24e75c.zip | |
[lldbsuite, windows] Don't crash LLDB when we try to retrieve a register on Windows
Summary:
1) When ReadRegister is called with a null register into on Windows, rather than crashing due to an access violation, simply return false. Not all registers and properties will be read or calculated correctly, but that is consistent with other platforms that also return false in that case
2) Update a couple of tests to reference pr37995 as their reason for failure since it is much more accurate. Support for floating point registers doesn't exist on Windows at all, rather than having issues.
Reviewers: asmith, labath, zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48844
llvm-svn: 336147
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/Common')
| -rw-r--r-- | lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp index 5a26d12d9d9..4aa6c785f83 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp @@ -206,6 +206,9 @@ bool RegisterContextWindows_x64::ReadRegister(const RegisterInfo *reg_info, if (!CacheAllRegisterValues()) return false; + if (reg_info == nullptr) + return false; + switch (reg_info->kinds[eRegisterKindLLDB]) { case lldb_rax_x86_64: reg_value.SetUInt64(m_context.Rax); diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp index a580157cdbf..fd486f3d082 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp @@ -176,6 +176,9 @@ bool RegisterContextWindows_x86::ReadRegister(const RegisterInfo *reg_info, if (!CacheAllRegisterValues()) return false; + if (reg_info == nullptr) + return false; + uint32_t reg = reg_info->kinds[eRegisterKindLLDB]; switch (reg) { case lldb_eax_i386: |

