llvm-project/lldb/source/Plugins/Process/Windows/Common
David Spickett 1ca8a97802 [lldb][Windows] Fix memory region base addresses when a range is split
Previously we recorded AllocationBase as the base address of the region
we get from VirtualQueryEx. However, this is the base of the allocation,
which can later be split into more regions.

So you got stuff like:
[0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
[0x00007fff377c0000-0x00007fff37840000) r-x .text
[0x00007fff377c0000-0x00007fff37870000) r-- .rdata

Where all the base addresses were the same.

Instead, use BaseAddress as the base of the region. So we get:
[0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
[0x00007fff377c1000-0x00007fff37840000) r-x .text
[0x00007fff37840000-0x00007fff37870000) r-- .rdata

https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-memory_basic_information

The added test checks for any overlapping regions which means
if we get the base or size wrong it'll fail. This logic
applies to any OS so the test isn't restricted to Windows.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D129272
2022-07-07 13:55:48 +00:00
..
arm Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
arm64 Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
x64 [LLDB] remove an extra register enum on windows x64 2022-02-03 14:12:24 -08:00
x86 [lldb] Convert ProcessWindowsLog to the new API 2022-01-27 10:05:05 +01:00
CMakeLists.txt
DebuggerThread.cpp [lldb] Fix loading DLL from some ramdisk on Windows 2022-06-15 17:02:33 +03:00
DebuggerThread.h [lldb] Modernize ThreadLauncher 2022-02-23 14:25:59 +01:00
ExceptionRecord.h [lldb][windows] Fix crash on getting nested exception 2022-06-22 17:16:06 +03:00
ForwardDecl.h
IDebugDelegate.h
LocalDebugDelegate.cpp
LocalDebugDelegate.h
NativeProcessWindows.cpp [lldb] [llgs] Support "t" vCont action 2022-06-27 17:33:59 +02:00
NativeProcessWindows.h [lldb] [Windows] Fix continuing from breakpoints and singlestepping on ARM/AArch64 2021-09-22 14:11:41 +03:00
NativeRegisterContextWindows.cpp
NativeRegisterContextWindows.h
NativeRegisterContextWindows_WoW64.cpp [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_WoW64.h [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_arm.cpp [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_arm.h [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_arm64.cpp [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_arm64.h [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_i386.cpp [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_i386.h [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_x86_64.cpp [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeRegisterContextWindows_x86_64.h [lldb] Update the NativeRegisterContext to take a WritableMemoryBuffer 2022-04-05 14:19:01 -07:00
NativeThreadWindows.cpp [lldb] Rename Logging.h to LLDBLog.h and clean up includes 2022-02-03 14:47:01 +01:00
NativeThreadWindows.h
NtStructures.h
ProcessDebugger.cpp [lldb][Windows] Fix memory region base addresses when a range is split 2022-07-07 13:55:48 +00:00
ProcessDebugger.h Revert "[lldb] Remove non address bits when looking up memory regions" 2021-11-03 13:27:41 +00:00
ProcessWindows.cpp [lldb] Include lldb/Host/HostInfo.h in ProcessWindows.cpp 2022-03-11 12:34:41 -08:00
ProcessWindows.h [lldb] Fix typo in ProcessWindows.h 2022-03-11 11:33:16 -08:00
ProcessWindowsLog.cpp [lldb] Fix windows build for D117490 2022-01-25 13:51:53 +01:00
ProcessWindowsLog.h [lldb] Fix windows&mac builds for c34698a811 2022-02-03 18:06:55 +01:00
RegisterContextWindows.cpp [lldb] Update ReadAllRegisterValues in RegisterContextWindows 2022-04-05 15:15:48 -07:00
RegisterContextWindows.h [lldb] Update ReadAllRegisterValues in RegisterContextWindows 2022-04-05 15:15:48 -07:00
TargetThreadWindows.cpp [lldb] Rename Logging.h to LLDBLog.h and clean up includes 2022-02-03 14:47:01 +01:00
TargetThreadWindows.h