summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Process
Commit message (Collapse)AuthorAgeFilesLines
...
* Move ArchSpec to the Utility modulePavel Labath2017-11-131-5/+3
| | | | | | | | | | | | | The rationale here is that ArchSpec is used throughout the codebase, including in places which should not depend on the rest of the code in the Core module. This commit touches many files, but most of it is just renaming of #include lines. In a couple of cases, I removed the #include ArchSpec line altogether, as the file was not using it. In one or two places, this necessitated adding other #includes like lldb-private-defines.h. llvm-svn: 318048
* cmake + xcode: prevent gtests from using includes from project rootTim Hammerquist2017-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: At present, several gtests in the lldb open source codebase are using #include statements rooted at $(SOURCE_ROOT)/${LLDB_PROJECT_ROOT}. This patch cleans up this directory/include structure for both CMake and Xcode build systems. rdar://problem/33835795 Reviewers: zturner, jingham, beanz Reviewed By: beanz Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D36598 llvm-svn: 314849
* Fix some warnings in ProcessorTraceTest.cppPavel Labath2017-07-041-17/+15
| | | | llvm-svn: 307071
* Move Timer and TraceOptions from Core to UtilityPavel Labath2017-06-291-1/+1
| | | | | | | | | | | | | | Summary: The classes have no dependencies, and they are used both by lldb and lldb-server, so it makes sense for them to live in the lowest layers. Reviewers: zturner, jingham Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34746 llvm-svn: 306682
* [unittests] Add a helper function for getting an input filePavel Labath2017-06-292-13/+3
| | | | | | | | | | | | | | | | | Summary: Fetching an input file required about five lines of code, and this was repeated in multiple unit tests, with slight variations. Add a helper function for doing that into the lldbUtilityMocks module (which I rename to lldbUtilityHelpers to commemorate the fact it includes more than mocks) Reviewers: zturner, eugene Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34683 llvm-svn: 306668
* Linux unit tests should only run onRavitheja Addepally2017-06-281-1/+3
| | | | | | Linux based systems. llvm-svn: 306520
* Implementation of Intel(R) Processor Trace support for LinuxRavitheja Addepally2017-06-283-0/+161
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements support for Intel(R) Processor Trace in lldb server. The changes have support for starting/stopping and reading the trace data. The code is only available on Linux versions where the perf attributes for aux buffers are available. The patch also consists of Unit tests for testing the core buffer reading function. Reviewers: lldb-commits, labath, clayborg, zturner, tberghammer Reviewed By: labath, clayborg Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D33674 llvm-svn: 306516
* Move StructuredData from Core to UtilityPavel Labath2017-06-271-1/+1
| | | | | | | | | | | | | | | | Summary: It had a dependency on StringConvert and file reading code, which is not in Utility. I've replaced that code by equivalent llvm operations. I've added a unit test to demonstrate that parsing a file still works. Reviewers: zturner, jingham Subscribers: kubamracek, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34625 llvm-svn: 306394
* Simplify the gdb-remote unit testsPavel Labath2017-06-225-236/+126
| | | | | | | | | Instead of every test creating a client-server combo, do that in the SetUp method of the test fixture. This also means that we can rely on gtest to not run the test if the SetUp method fails and delete the if(HasFailure) calls. llvm-svn: 306013
* Fix assorted compiler warnings. NFCPavel Labath2017-06-061-10/+9
| | | | llvm-svn: 304796
* Remove unused variables. NFCPavel Labath2017-06-061-2/+0
| | | | llvm-svn: 304794
* Replaced StructuredData::Type with eStructuredDataType Abhishek Aggarwal2017-05-291-2/+3
| | | | | | ...missing from r304138 "Added new API to SBStructuredData class" llvm-svn: 304147
* Implementation of remote packets for Trace data.Ravitheja Addepally2017-05-261-0/+225
| | | | | | | | | | | | | | | | | | Summary: The changes consist of new packets for trace manipulation and trace collection. The new packets are also documented. The packets are capable of providing custom trace specific parameters to start tracing and also retrieve such configuration from the server. Reviewers: clayborg, lldb-commits, tberghammer, labath, zturner Reviewed By: clayborg, labath Subscribers: krytarowski, lldb-commits Differential Revision: https://reviews.llvm.org/D32585 llvm-svn: 303972
* Rename Error -> Status.Zachary Turner2017-05-122-7/+6
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Re-landing IPv6 support for LLDB HostChris Bieneman2017-04-261-3/+2
| | | | | | | | | | | | | | | | | | | | | | This support was landed in r300579, and reverted in r300669 due to failures on the bots. The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that. Summary from the original change: This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way. This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me). The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call. This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address. The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. https://reviews.llvm.org/D31823 llvm-svn: 301492
* Revert yesterdays IPv6 patchesPavel Labath2017-04-191-2/+3
| | | | | | | | | | | | | The break the linux bots (and probably any other machine which would run the test suite in a massively parallel way). The problem is that it can happen that we only successfully create an IPv6 listening socket (because the relevant IPv4 port is used by another process) and then the connecting side attempts to connect to the IPv4 port and fails. It's not very obvious how to fix this problem, so I am reverting this until we come up with a solution. llvm-svn: 300669
* Update LLDB Host to support IPv6 over TCPChris Bieneman2017-04-181-3/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way. This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me). The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call. This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address. The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. Reviewers: zturner, clayborg Subscribers: jasonmolenda, labath, lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D31823 llvm-svn: 300579
* Verify memory address range validity in GDBRemoteCommunicationClientStephane Sezer2017-03-311-0/+39
| | | | | | | | | | | | | | | | | | | | | Summary: This aims to verify the validity of the response from the debugging server in GDBRemoteCommunicationClient::GetMemoryRegionInfo. I was working with ds2 (https://github.com/facebook/ds2) and encountered a bug that caused the server's response to have a 'size' value of 0, which caused lldb to behave incorrectly. Reviewers: k8stone, labath, clayborg Reviewed By: labath, clayborg Subscribers: clayborg, sas, lldb-commits Differential Revision: https://reviews.llvm.org/D31485 Change by Alex Langford <apl@fb.com> llvm-svn: 299239
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-221-1/+1
| | | | llvm-svn: 298536
* Make LLDB skip server-client roundtrip for signals that don't require any ↵Eugene Zemtsov2017-03-071-0/+24
| | | | | | | | | | | | | | actions If QPassSignals packaet is supported by lldb-server, lldb-client will utilize it and ask the server to ignore signals that don't require stops or notifications. Such signals will be immediately re-injected into inferior to continue normal execution. Differential Revision: https://reviews.llvm.org/D30520 llvm-svn: 297231
* Remove FileSpec::ReadFileContents.Zachary Turner2017-03-061-1/+1
| | | | | | | | | | | | | | | | This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private sections, and in some cases we were using ReadFileContents and then modifying the buffer. To address that I've added a flag to the DataBufferLLVM methods that allow you to map privately, which disables the mmaping path entirely. Eventually we should teach DataBufferLLVM to use mmap with writable private, but that is orthogonal to this effort. Differential Revision: https://reviews.llvm.org/D30622 llvm-svn: 297095
* Move many other files from Core -> Utility.Zachary Turner2017-03-061-1/+1
| | | | llvm-svn: 297043
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-042-3/+3
| | | | llvm-svn: 296943
* [Windows] Remove the #include <eh.h> hack.Zachary Turner2017-03-033-21/+0
| | | | | | | | | | Prior to MSVC 2015 we had to manually include this header any time we were going to include <thread> or <future> due to a bug in MSVC's STL implementation. This has been fixed in MSVC for some time now, and we require VS 2015 minimum, so we can remove this across all subprojects. llvm-svn: 296906
* Fix MinidumpParserTest on 32-bit archesPavel Labath2017-02-271-2/+3
| | | | | | | | load_size should be 64-bit unconditionally to match the underlying API. This makes sure the MAX value correctly signals to auto-detect the file size when mmap()ing. llvm-svn: 296334
* Delete DataBufferMemoryMap.Zachary Turner2017-02-241-4/+6
| | | | | | | | | | | | | | | After a series of patches on the LLVM side to get the mmaping code up to compatibility with LLDB's needs, it is now ready to go, which means LLDB's custom mmapping code is redundant. So this patch deletes it all and uses LLVM's code instead. In the future, we could take this one step further and delete even the lldb DataBuffer base class and rely entirely on LLVM's facilities, but this is a job for another day. Differential Revision: https://reviews.llvm.org/D30054 llvm-svn: 296159
* Switch TestPacketSpeedJSON to use the llvm chrono formatterPavel Labath2017-02-101-0/+1
| | | | llvm-svn: 294739
* [CMake] Update unit tests with accurate dependenciesChris Bieneman2017-02-012-0/+18
| | | | | | This is extending the updates from r293696 to the LLDB unit tests. llvm-svn: 293821
* Fix jModulesInfo handling for cross-path syntax debuggingPavel Labath2017-01-051-2/+10
| | | | | | | We were sending paths with the host path separator, which meant the remote target did not understand our packets correctly. llvm-svn: 291103
* Use Timeout<> in the Listener classPavel Labath2016-11-301-3/+2
| | | | | | | | | | | | | | | | | | | | Summary: Communication classes use the Timeout<> class to specify the timeout. Listener class was converted to chrono some time ago, but it used a different meaning for a timeout of zero (Listener: infinite wait, Communication: no wait). Instead, Listener provided separate functions which performed a non-blocking event read. This converts the Listener class to the new Timeout class, to improve consistency. It also allows us to get merge the different GetNextEvent*** and WaitForEvent*** functions into one. No functional change intended. Reviewers: jingham, clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D27136 llvm-svn: 288238
* Attempt to fix freebsd build after r287864Pavel Labath2016-11-241-3/+2
| | | | | | | | | | the chrono library there uses long long as the underlying chrono type, but defines int64_t as long (or the other way around, I am not sure). In any case, this caused the implicit conversion to not trigger. This should address that. Also fix up the relevant unit test. llvm-svn: 287867
* Fix GDBRemoteCommunicationClientTest.TestPacketSpeedJSONPavel Labath2016-11-041-12/+14
| | | | | | | | | | | | | | The mock server was listening for only one packet (I forgot to put a loop around it), which caused the client to stall in debug builds, as the timeout there is 1000 seconds. In case of a release builds the test would just silently succeed as the tested function does not check or report errors (which should be fixed). This fixes the test by adding the server loop. Since the test was taking quite a long time now (8s), I have added a parameter to control the amount of data sent (default 4MB), and call it with a smaller value in the test, to make the test run faster. llvm-svn: 285992
* Remove usages of TimeValue from gdb-remote process pluginPavel Labath2016-10-311-2/+45
| | | | | | | | | | | | | | | Summary: Most of the changes are very straight-forward, the only tricky part was the "packet speed-test" function, which is very time-heavy. As the function was completely untested, I added a quick unit smoke test for it. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25391 llvm-svn: 285602
* Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the ↵Dimitar Vlahovski2016-10-311-3/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | plugin in SystemInitializerFull Summary: This plugin resembles the already existing Windows-only Minidump plugin. The WinMinidumpPlugin uses the Windows API for parsing Minidumps while this plugin is cross-platform because it includes a Minidump parser (which is already commited) It is able to produce a backtrace, to read the general puprose regiters, inspect local variables, show image list, do memory reads, etc. For now the only arches that this supports are x86_32 and x86_64. This is because I have only written register contexts for those. Others will come in next CLs. I copied the WinMinidump tests and adapted them a little bit for them to work with the new plugin (and they pass) I will add more tests, aiming for better code coverage. There is still functionality to be added, see TODOs in code. Reviewers: labath, zturner Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth Differential Revision: https://reviews.llvm.org/D25905 llvm-svn: 285587
* Minidump plugin: Adding x86_32 register context converterDimitar Vlahovski2016-10-313-34/+76
| | | | | | | | | | | | | | | | | Summary: This, like the x86_64 case, reads the register values from the minidump file, and emits a binary buffer that is ordered using the offsets from the RegisterInfoInterface argument. That way we can reuse an existing register context. Added unit tests. Reviewers: labath, zturner Subscribers: beanz, mgorny, modocache, amccarth, lldb-commits Differential Revision: https://reviews.llvm.org/D25832 llvm-svn: 285584
* Minidump plugin: functions parsing memory structures and filtering module listDimitar Vlahovski2016-10-194-2/+106
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Now the Minidump parser can parse the: 1) MemoryInfoList - containing region info about memory ranges (readable, writable, executable) 2) Memory64List - this is the stuct used when the Minidump is a full-memory one. 3) Adding filtering of the module list (shared libraries list) - there can be mutliple records in the module list under the same name but with different load address (e.g. when the binary has non contigious sections). FilterModuleList eliminates the duplicated modules, leaving the one with the lowest load addr. Added unit tests for everything. Reviewers: labath, zturner Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth Differential Revision: https://reviews.llvm.org/D25569 llvm-svn: 284593
* unittests: Specify types in a bunch of unittest EXPECT'sJustin Bogner2016-10-171-1/+1
| | | | | | | The EXPECT and ASSERT macros in gtest don't do the usual arithmetic conversions. Specify types in several of them to fix -Werror. llvm-svn: 284405
* Removing the new Minidump pluginDimitar Vlahovski2016-10-051-23/+3
| | | | | | | | | | | | | | | | | | | | | | | Tests are failing and build is failing on windows and darwin. Will fix and commit it later ------------------------------------------------------------- Revert "xfailing minidump tests again ... :(" This reverts commit 97eade002c9e43c1e0d11475a4888083a8965044. Revert "Fixing new Minidump plugin tests" This reverts commit 0dd93b3ab39c8288696001dd50b9a093b813b09c. Revert "Add the new minidump files to the Xcode project." This reverts commit 2f638a1d046b8a88e61e212220edc40aecd2ce44. Revert "xfailing tests for Minidump plugin" This reverts commit 99311c0b22338a83e6a00c4fbddfd3577914c003. Revert "Adding a new Minidump post-mortem debugging plugin" This reverts commit b09a7e4dae231663095a84dac4be3da00b03a021. llvm-svn: 283352
* Adding a new Minidump post-mortem debugging pluginDimitar Vlahovski2016-10-041-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This plugin resembles the already existing Windows-only Minidump plugin. The WinMinidumpPlugin uses the Windows API for parsing Minidumps while this plugin is cross-platform because it includes a Minidump parser (which is already commited) It is able to produce a backtrace, to read the general puprose regiters, inspect local variables, show image list, do memory reads, etc. For now the only arch that this supports is x86 64 bit This is because I have only written a register context for that arch. Others will come in next CLs. I copied the WinMinidump tests and adapted them a little bit for them to work with the new plugin (and they pass) I will add more tests, aiming for better code coverage. There is still functionality to be added, see TODOs in code. Reviewers: labath, zturner Subscribers: beanz, mgorny, amccarth, lldb-commits, modocache Differential Revision: https://reviews.llvm.org/D25196 llvm-svn: 283259
* Adding a RegisterContextMinidump_x86_64 converterDimitar Vlahovski2016-09-271-1/+62
| | | | | | | | | | | | | | | | | | Summary: This is a register context converter from Minidump to Linux reg context. This knows the layout of the register context in the Minidump file (which is the same as in Windows FYI) and as a result emits a binary data buffer that matches the Linux register context binary layout. This way we can reuse the existing RegisterContextLinux_x86_64 and RegisterContextCorePOSIX_x86_64 classes. Reviewers: labath, zturner Subscribers: beanz, mgorny, lldb-commits, amccarth Differential Revision: https://reviews.llvm.org/D24919 llvm-svn: 282529
* MinidumpParsing: pid, modules, exceptions, stringsDimitar Vlahovski2016-09-133-10/+89
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Added parsing of the MiscInfo data stream. The main member of it that we care about is the process_id On Linux generated Minidump (from breakpad) we don't have the MiscInfo, we have the /proc/$pid/status from where we can get the pid. Also parsing the module list - the list of all of the loaded modules/shared libraries. Parsing the exception stream. Parsing MinidumpStrings. I have unit tests for all of that. Also added some tests using a Minidump generated from Windows tools (not from breakpad) Reviewers: labath, zturner Subscribers: beanz, lldb-commits Differential Revision: https://reviews.llvm.org/D24385 llvm-svn: 281348
* async structured data packet handling improvementsTodd Fiala2016-09-101-3/+35
| | | | | | | | | | | | | | | | | | | | | | | This change does the following: * Changes the signature for the continuation delegate method that handles async structured data from accepting an already-parsed structured data element to taking just the packet contents. * Moves the conversion of the JSON-async: packet contents from GDBRemoteClientBase to the continuation delegate method. * Adds a new unit test for verifying that the $JSON-asyc: packets get decoded and that the decoded packets get forwarded on to the delegate for further processing. Thanks to Pavel for making that whole section of code easily unit testable! * Tightens up the packet verification on reception of a $JSON-async: packet contents. The code prior to this change is susceptible to a segfault if a packet is carefully crafted that starts with $J but has a total length shorter than the length of "$JSON-async:". Reviewers: labath, clayborg, zturner Differential Revision: https://reviews.llvm.org/D23884 llvm-svn: 281121
* Fix new gdb-remote client unit test for windowsPavel Labath2016-09-091-3/+4
| | | | | | | The behaviour of FileSpec differed between host OS versions. Hardcode the path syntax to posix, as we don't care about that in this test. llvm-svn: 281025
* gdb-remote: Add jModulesInfo packetPavel Labath2016-09-081-0/+74
| | | | | | | | | | | | | | | | | | | | | Summary: This adds the jModulesInfo packet, which is the equivalent of qModulesInfo, but it enables us to query multiple modules at once. This makes a significant speed improvement in case the application has many (over a hundred) modules, and the communication link has a non-negligible latency. This functionality is accessed by ProcessGdbRemote::PrefetchModuleSpecs(), which does the caching. GetModuleSpecs() is modified to first consult the cache before asking the remote stub. PrefetchModuleSpecs is currently only called from POSIX-DYLD dynamic loader plugin, after it reads the list of modules from the inferior memory, but other uses are possible. This decreases the attach time to an android application by about 40%. Reviewers: clayborg Subscribers: tberghammer, lldb-commits, danalbert Differential Revision: https://reviews.llvm.org/D24236 llvm-svn: 280919
* Fix unittest compilation on windowsPavel Labath2016-09-073-3/+2
| | | | | | | | After the reformat, the unittests do not compile due to missing due to redefinition errors between PosixApi.h and ucrt/direct.h. This is a bit of a shot in the dark, as I have not tested it on windows, but I am restoring the original include order, so it should hopefully fix it. llvm-svn: 280793
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-066-568/+541
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Minidump parsingDimitar Vlahovski2016-09-015-0/+131
| | | | | | | | | | | | | | | | | | | Summary: This is a Minidump parsing code. There are still some more structures/data streams that need to be added. The aim ot this is to be used in the implementation of a minidump debugging plugin that works on all platforms/architectures. Currently we have a windows-only plugin that uses the WinAPI to parse the dump files. Also added unittests for the current functionality. Reviewers: labath, amccarth Subscribers: tberghammer, danalbert, srhines, lldb-commits, dschuff Differential Revision: https://reviews.llvm.org/D23545 llvm-svn: 280356
* Revert "gdb-remote: Make the sequence mutex non-recursive"Pavel Labath2016-08-301-31/+11
| | | | | | This reverts commit r279725 as it breaks "dynamic register size" feature of mips. llvm-svn: 280088
* Convert some functions to use StringRef instead of c_str, lenZachary Turner2016-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | This started as an effort to change StringExtractor to store a StringRef internally instead of a std::string. I got that working locally with just 1 test failure which I was unable to figure out the cause of. But it was also a massive changelist due to a trickle down effect of changes. So I'm starting over, using what I learned from the first time to tackle smaller, more isolated changes hopefully leading up to a full conversion by the end. At first the changes (such as in this CL) will seem mostly a matter of preference and pointless otherwise. However, there are some places in my larger CL where using StringRef turned 20+ lines of code into 2, drastically simplifying logic. Hopefully once these go in they will illustrate some of the benefits of thinking in terms of StringRef. llvm-svn: 279917
* gdb-remote: Make the sequence mutex non-recursivePavel Labath2016-08-251-11/+31
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is a preparatory commit for D22914, where I'd like to replace this mutex by an R/W lock (which is also not recursive). This required a couple of changes: - The only caller of Read/WriteRegister, GDBRemoteRegisterContext class, was already acquiring the mutex, so these functions do not need to. All functions which now do not take a lock, take an lock argument instead, to remind the caller of this fact. - GetThreadSuffixSupported() was being called from locked and unlocked contexts (including contexts where the process was running, and the call would fail if it did not have the result cached). I have split this into two functions, one which computes the thread suffix support and caches it (this one always takes the lock), and another, which returns the cached value (and never needs to take the lock). This feels quite natural as ProcessGdbRemote was already pre-caching this value at the start. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23802 llvm-svn: 279725
OpenPOWER on IntegriCloud