[lldb][Windows] Fixup overlapping memory regions testsAs suggested in post-commit review on https://reviews.llvm.org/D129272.* Rename the test case.* Simplify the overlap check.* Correct assert
[lldb][Windows] Fixup overlapping memory regions testsAs suggested in post-commit review on https://reviews.llvm.org/D129272.* Rename the test case.* Simplify the overlap check.* Correct assertion.
show more ...
[lldb][Windows] Fix memory region base addresses when a range is splitPreviously we recorded AllocationBase as the base address of the regionwe get from VirtualQueryEx. However, this is the base o
[lldb][Windows] Fix memory region base addresses when a range is splitPreviously we recorded AllocationBase as the base address of the regionwe 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-- .rdataWhere 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-- .rdatahttps://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-memory_basic_informationThe added test checks for any overlapping regions which meansif we get the base or size wrong it'll fail. This logicapplies to any OS so the test isn't restricted to Windows.Reviewed By: labathDifferential Revision: https://reviews.llvm.org/D129272
[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://r
[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://reviews.llvm.org/D128077
Reland "[lldb] Add --all option to "memory region""This reverts commit 3e928c4b9dfb01efd2cb968795e605760828e873.This fixes an issue seen on Windows where we did not properlyget the section names
Reland "[lldb] Add --all option to "memory region""This reverts commit 3e928c4b9dfb01efd2cb968795e605760828e873.This fixes an issue seen on Windows where we did not properlyget the section names of regions if they overlapped. Windowshas regions like:[0x00007fff928db000-0x00007fff949a0000) ---[0x00007fff949a0000-0x00007fff949a1000) r-- PECOFF header[0x00007fff949a0000-0x00007fff94a3d000) r-x .hexpthk[0x00007fff949a0000-0x00007fff94a85000) r-- .rdata[0x00007fff949a0000-0x00007fff94a88000) rw- .data[0x00007fff949a0000-0x00007fff94a94000) r-- .pdata[0x00007fff94a94000-0x00007fff95250000) ---I assumed that you could just resolve the address and get the sectionname using the start of the region but here you'd always get"PECOFF header" because they all have the same start point.The usual command repeating loop used the end address of the previousregion when requesting the next, or getting the section name.So I've matched this in the --all scenario.In the example above, somehow asking for the region at0x00007fff949a1000 would get you a region that starts at0x00007fff949a0000 but has a different end point. Using the loadaddress you get (what I assume is) the correct section name.
Revert "[lldb] Add --all option to "memory region""This reverts commit 8e648f195c3d57e573fdd8023edcfd80e0516c61due to test failures on Windows:https://lab.llvm.org/buildbot/#/builders/83/builds/1
Revert "[lldb] Add --all option to "memory region""This reverts commit 8e648f195c3d57e573fdd8023edcfd80e0516c61due to test failures on Windows:https://lab.llvm.org/buildbot/#/builders/83/builds/19094
[lldb] Add --all option to "memory region"This adds an option to the memory region commandto print all regions at once. Like you can do bystarting at address 0 and repeating the commandmanually.
[lldb] Add --all option to "memory region"This adds an option to the memory region commandto print all regions at once. Like you can do bystarting at address 0 and repeating the commandmanually.memory region [-a] [<address-expression>](lldb) memory region --all[0x0000000000000000-0x0000000000400000) ---[0x0000000000400000-0x0000000000401000) r-x <...>/a.out PT_LOAD[0]<...>[0x0000fffffffdf000-0x0001000000000000) rw- [stack][0x0001000000000000-0xffffffffffffffff) ---The output matches exactly what you'd get fromrepeating the command. Including that it showsunmapped areas between the mapped regions.(this is why Process GetMemoryRegions is notused, that skips unmapped areas)Help text has been updated to show that you can havean address or --all but not both.Reviewed By: JDevlieghereDifferential Revision: https://reviews.llvm.org/D111791
[lldb] [POSIX-DYLD] Add libraries from initial rendezvous brkpt hitExplicitly consider the libraries reported on the initial rendezvousbreakpoint hit added. This is necessary on FreeBSD since the
[lldb] [POSIX-DYLD] Add libraries from initial rendezvous brkpt hitExplicitly consider the libraries reported on the initial rendezvousbreakpoint hit added. This is necessary on FreeBSD since the dynamicloader issues only a single 'consistent' state rendezvous breakpoint hitfor all the libraries present in DT_NEEDED. It is also helpful on Linuxwhere it ensures that ld-linux is considered loaded as wellas the shared system libraries reported afterwards.Reenable memory maps on FreeBSD since this fixed the issue triggeredby them.Differential Revision: https://reviews.llvm.org/D92187
Revert "[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action"This reverts commit 09b08833f301ea375137931d26b7193101f82ceb.This code is wrong on Linux, and causes ld-linux and linux
Revert "[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action"This reverts commit 09b08833f301ea375137931d26b7193101f82ceb.This code is wrong on Linux, and causes ld-linux and linux-vdso to bereported twice. I need to work on it more.
[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot actionExplicitly consider the libraries reported on the initial eTakeSnapshotaction added, through adding them to the added soentry lis
[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot actionExplicitly consider the libraries reported on the initial eTakeSnapshotaction added, through adding them to the added soentry listin DYLDRendezvous::SaveSOEntriesFromRemote(). This is necessaryon FreeBSD since the dynamic loader issues only a single 'consistent'state rendezvous breakpoint hit for all the libraries presentin DT_NEEDED (while Linux issues an added-consistent event pair).Reenable memory maps on FreeBSD since this fixed the issue triggeredby them.Differential Revision: https://reviews.llvm.org/D92187
[lldb] [test] Update XFAILs/skips for FreeBSDUpdate expected failures and test skips based on common resultsfor the old and new FreeBSD plugins.
Reland "[lldb] Don't send invalid region addresses to lldb server"This reverts commit c65627a1fe3be7521fc232d633bb6df577f55269.The test immediately after the new invalid symbol test wasfailing o
Reland "[lldb] Don't send invalid region addresses to lldb server"This reverts commit c65627a1fe3be7521fc232d633bb6df577f55269.The test immediately after the new invalid symbol test wasfailing on Windows. This was because when we calledVirtualQueryEx to get the region info for 0x0,even if it succeeded we would call GetLastError.Which must have picked up the last error that was set whiletrying to lookup "not_an_address". Which happened to be 2.("The system cannot find the file specified.")To fix this only call GetLastError when we know VirtualQueryExhas failed. (when it returns 0, which we were also checking for anyway)Also convert memory region to an early return styleto make the logic clearer.Reviewed By: labath, stella.stamenovaDifferential Revision: https://reviews.llvm.org/D88229
Revert "[lldb] Don't send invalid region addresses to lldb server"This reverts commit c687af0c30b4dbdc9f614d5e061c888238e0f9c5due to a test failure on Windows.
[lldb] Don't send invalid region addresses to lldb serverPreviously when <addr> in "memory region <addr>" didn'tparse correctly, we'd print an error then also ask lldb-serverfor a region containi
[lldb] Don't send invalid region addresses to lldb serverPreviously when <addr> in "memory region <addr>" didn'tparse correctly, we'd print an error then also ask lldb-serverfor a region containing LLDB_INVALID_ADDRESS.(lldb) memory region not_an_addresserror: invalid address argument "not_an_address"...error: Server returned invalid rangeOnly send the command to lldb-server if the addressparsed correctly.(lldb) memory region not_an_addresserror: invalid address argument "not_an_address"...Reviewed By: labathDifferential Revision: https://reviews.llvm.org/D87694
[lldb][test] Remove symlink for API tests.Summary: Moves lldbsuite tests to lldb/test/API.This is a largely mechanical change, moved with the following steps:```rm lldb/test/API/testcasesmkdi
[lldb][test] Remove symlink for API tests.Summary: Moves lldbsuite tests to lldb/test/API.This is a largely mechanical change, moved with the following steps:```rm lldb/test/API/testcasesmkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runnerfor d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; donefor d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; donefor d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done```lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.Reviewers: labath, JDevlieghereTags: #lldbDifferential Revision: https://reviews.llvm.org/D71151