summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Host/NativeProcessProtocolTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "Add ReadCStringFromMemory for faster string reads""Antonio Afonso2019-07-231-0/+51
| | | | | | This reverts commit 9c10b620c0619611dfe062216459431955ac4801. llvm-svn: 366848
* Revert "Add ReadCStringFromMemory for faster string reads"Antonio Afonso2019-06-251-51/+0
| | | | | | | | This reverts commit a7335393f50246b59db450dc6005f7c8f29e73a6. It seems this is breaking a bunch of tests (https://reviews.llvm.org/D62503#1549874) so reverting until I find the time to repro and fix. llvm-svn: 364355
* Add ReadCStringFromMemory for faster string readsAntonio Afonso2019-06-181-0/+51
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is the fifth patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499 Reading strings with ReadMemory is really slow when reading the path of the shared library. This is because we don't know the length of the path so use PATH_MAX (4096) and these strings are actually super close to the boundary of an unreadable page. So even though we use process_vm_readv it will usually fail because the read size spans to the unreadable page and we then default to read the string word by word with ptrace. This new function is very similar to another ReadCStringFromMemory that already exists in lldb that makes sure it never reads cross page boundaries and checks if we already read the entire string by finding '\0'. I was able to reduce the GetLoadedSharedLibraries call from 30ms to 4ms (or something of that order). Reviewers: clayborg, xiaobai, labath Reviewed By: labath Subscribers: emaste, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62503 llvm-svn: 363750
* Implement GetSharedLibraryInfoAddressAntonio Afonso2019-06-141-138/+12
| | | | | | | | | | | | | | | | | | | | | Summary: This is the third patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499 Add functions to read the r_debug location to know where the linked list of loaded libraries are so I can generate the `xfer:libraries-svr4` packet. I'm also using this function to implement `GetSharedLibraryInfoAddress` that was "not implemented" for linux. Most of this code was inspired by the current ds2 implementation here: https://github.com/facebook/ds2/blob/master/Sources/Target/POSIX/ELFProcess.cpp. Reviewers: clayborg, xiaobai, labath Reviewed By: clayborg, labath Subscribers: emaste, krytarowski, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62501 llvm-svn: 363458
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* NativeProcessProtocolTest: fix -Winconsistent-missing-override warningPavel Labath2019-01-021-4/+7
| | | | | | | | The warning comes from the fact that the MOCK_METHOD macros don't use the override keyword internally. This makes us not use it in the manually overriden methods either, to be consistent. llvm-svn: 350209
* Fix assertion failure in NativeProcessProtocolTestPavel Labath2018-12-271-1/+2
| | | | | | | | | The assertion fired (with a debug visual studio STL) because we tried to dereference the end of a vector (although it was only to take its address again and form an end iterator). Rewrite this logic to avoid the questionable code. llvm-svn: 350091
* [unittest] Fix NativeProcessProtocolTest.cpp (NFC)Jonas Devlieghere2018-09-261-2/+2
| | | | | | | Cast std::min's second argument to size_t to prevent conflicting types for parameter deduction. llvm-svn: 343087
* Fix a memory read bug in lldb-serverPavel Labath2018-09-261-0/+67
| | | | | | | | | | | | | | NativeProcessProtocol::ReadMemoryWithoutTrap had a bug, where it failed to properly remove inserted breakpoint opcodes if the memory read partially overlapped the trap opcode. This could not happen on x86 because it has a one-byte breakpoint instruction, but it could happen on arm, which has a 4-byte breakpoint instruction (in arm mode). Since triggerring this condition would only be possible on an arm machine (and even then it would be a bit tricky). I test this using a NativeProcessProtocol unit test. llvm-svn: 343076
* Add NativeProcessProtocol unit testsPavel Labath2018-09-241-0/+154
Summary: NativeProcessProtocol is an abstract class, but it still contains a significant amount of code. Some of that code is tested via tests of specific derived classes, but these tests don't run everywhere, as they are OS and arch-specific. They are also relatively high-level, which means some functionalities (particularly the failure cases) are hard/impossible to test. In this approach, I replace the abstract methods with mocks, which allows me to inject failures into the lowest levels of breakpoint setting code and test the class behavior in this situation. Reviewers: zturner, teemperor Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D52152 llvm-svn: 342875
OpenPOWER on IntegriCloud