diff options
| author | Adrian McCarthy <amccarth@google.com> | 2015-12-04 22:22:15 +0000 |
|---|---|---|
| committer | Adrian McCarthy <amccarth@google.com> | 2015-12-04 22:22:15 +0000 |
| commit | 0c35cde9b1fd0e7b54e77e7ba14116af6aae0ea9 (patch) | |
| tree | f71047ab9225277c30fa4cfe4a30d7596058c033 /lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp | |
| parent | 072bff80362c24ae81a4e5a3feff2caa128aec10 (diff) | |
| download | bcm5719-llvm-0c35cde9b1fd0e7b54e77e7ba14116af6aae0ea9.tar.gz bcm5719-llvm-0c35cde9b1fd0e7b54e77e7ba14116af6aae0ea9.zip | |
Implement GetMemoryRegionInfo for mini dumps.
Differential Revision: http://reviews.llvm.org/D15218
llvm-svn: 254780
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp index fcb4c8efcae..0e6900d8fb7 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -15,6 +15,7 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" #include "lldb/Core/State.h" +#include "lldb/Host/windows/windows.h" #include "lldb/Target/DynamicLoader.h" #include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/Target.h" @@ -74,4 +75,26 @@ ProcessWindows::GetImageInfoAddress() return LLDB_INVALID_ADDRESS; } +// The Windows page protection bits are NOT independent masks that can be bitwise-ORed +// together. For example, PAGE_EXECUTE_READ is not (PAGE_EXECUTE | PAGE_READ). +// To test for an access type, it's necessary to test for any of the bits that provide +// that access type. +bool +ProcessWindows::IsPageReadable(uint32_t protect) +{ + return (protect & PAGE_NOACCESS) == 0; +} + +bool +ProcessWindows::IsPageWritable(uint32_t protect) +{ + return (protect & (PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY | PAGE_READWRITE | PAGE_WRITECOPY)) != 0; +} + +bool +ProcessWindows::IsPageExecutable(uint32_t protect) +{ + return (protect & (PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY)) != 0; +} + } |

