summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
Commit message (Collapse)AuthorAgeFilesLines
...
* Hardware breakpoints for Linux on Arm/AArch64 targetsOmair Javaid2017-02-241-3/+11
| | | | | | | | Please look at below differential link for upstream discussion. Differential revision: https://reviews.llvm.org/D29669 llvm-svn: 296119
* Implement QPassSignals GDB package in lldb-serverPavel Labath2017-02-243-0/+40
| | | | | | | | | | | | | | | Summary: QPassSignals package allows lldb client to tell lldb-server to ignore certain types of signals and re-inject them back to inferior without stopping execution. Reviewers: jmajors, labath Subscribers: danalbert, srhines, emaste, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D30286 Author: Eugene Zemtsov <ezemtsov@google.com> llvm-svn: 296101
* Ensure lldb-server waits for child debug servers to start up when passing ↵Howard Hellyer2017-02-231-7/+16
| | | | | | | | | | | | | | | | | | | | | | them a port number to listen on. Summary: When lldb-server is started with the -P <port> or -m/-M <min/max port> options to specify which ports are available for remote connections the child debug server is told what port it should listen on. In those cases lldb-server needs to wait for the child to report it’s port number as otherwise it can tell the lldb client that the child is up and listening before it is actually listening on that port. lldb-server already waits in the cases where a port wasn’t specified by waiting until the child reports the port it is using. It was skipping this synchronisation step when passed a port numbers as it knew what the port would be however it does need to ensure the child process has had time to open that port and waiting until the child reports the port number makes sure this has happened. This patch just removes the one case where a child was spawned and lldb-server did not wait for it to report it’s port number before telling the client lldb process the child is ready to connect to. This issue was discussed on lldb-dev in a thread here: http://lists.llvm.org/pipermail/lldb-dev/2017-February/012002.html Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30255 llvm-svn: 295947
* Fix a couple of corner cases in NameMatchesPavel Labath2017-02-202-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I originally set out to move the NameMatches closer to the relevant function and add some unit tests. However, in the process I've found a couple of bugs in the implementation: - the early exits where not always correct: - (test==pattern) does not mean the match will always suceed because of regular expressions - pattern.empty() does not mean the match will fail because the "" is a valid prefix of any string So I cleaned up those and added some tests. The only tricky part here was that regcomp() implementation on darwin did not recognise the empty string as a regular expression and returned an REG_EMPTY error instead. The simples fix here seemed to be to replace the empty expression with an equivalent non-empty one. Reviewers: clayborg, zturner Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D30094 llvm-svn: 295651
* Switch GDBRemoteLog to the new registration mechanismPavel Labath2017-02-173-213/+32
| | | | llvm-svn: 295455
* Fix compiler warnings for missing switch cases in lldb.Pavel Labath2017-02-171-0/+5
| | | | | | | | | | | | | | | | | | | Summary: There have been a few new values added to a few LLVM enums this change makes sure that LLDB code handles them correctly. Reviewers: labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D30005 Author: Eugene Zemtsov <ezemtsov@google.com> llvm-svn: 295445
* Finish breaking the dependency from Utility.Zachary Turner2017-02-161-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D29964 llvm-svn: 295368
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-142-2/+2
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* UriParser cleanupPavel Labath2017-02-102-2/+2
| | | | | | | - move the header file to the include folder - enclose the class in the proper namespace llvm-svn: 294741
* Switch TestPacketSpeedJSON to use the llvm chrono formatterPavel Labath2017-02-101-25/+18
| | | | llvm-svn: 294739
* Add a format_provider for the Timeout classPavel Labath2017-02-101-3/+2
| | | | | | | | | | and use it in the appropriate log statements. Formatting of chrono types in log messages was very clunky. This should make it much nicer to use and give better output. For details of the formatting options see the chrono formatter in llvm. llvm-svn: 294738
* Convert Log class to llvm streamsPavel Labath2017-02-102-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This converts LLDB's logging to use llvm streams instead of lldb_private::Stream and friends. The changes are mostly straight-forward and amount to s/lldb_private::Stream/llvm::raw_ostream. The part worth calling out is the rewrite of the StreamCallback class. Previously this class contained a per-thread buffer of data written. I assume this had something to do with it trying to make sure each log line is delivered as a single event, instead of multiple (possibly interleaved) events. However, this is no longer relevant as the Log class already writes things to a temporary buffer and then delivers the message as a single "write", so I have just removed the code in question. Reviewers: zturner, clayborg Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D29615 llvm-svn: 294736
* Remove the verbose category in the gdb-remote channelPavel Labath2017-02-064-26/+12
| | | | | | replace by LLDB_LOGV llvm-svn: 294224
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-063-6/+10
| | | | | | | | | | | | | | | | | | | | | Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202
* Move classes from Core -> Utility.Zachary Turner2017-02-0210-13/+13
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* Break some dependencies in lldbUtility.Zachary Turner2017-02-011-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D29359 llvm-svn: 293806
* [CMake] [3/4] Update a batch of pluginsChris Bieneman2017-01-311-1/+15
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293700
* Replace chdir() usage with the llvm equivalent.Pavel Labath2017-01-251-6/+2
| | | | | | | This removes a hack in PosixApi.h, which tends to produce strange compile errors when it's included in the wrong order. llvm-svn: 293045
* Fix a bug where lldb does not respect the packet size.Hafiz Abid Qadeer2017-01-241-5/+25
| | | | | | | | | | | | | | Summary: LLDB was using packet size advertised by the target as the max memory size to write in one go. It is wrong because packets have other overhead apart from memory payload. Also memory transferred through 'm' and 'M' packets needs 2 bytes in packet to transfer 1 of memory. Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D28808 llvm-svn: 292987
* Prefer lzfse if it is an available compression method (this wasJason Molenda2017-01-241-3/+3
| | | | | | | defaulting to zlib previously). <rdar://problem/30159130> llvm-svn: 292884
* Replace getcwd with the llvm equivalentPavel Labath2017-01-231-4/+4
| | | | | | | | | | | | | | | | | | | | | Summary: getcwd() is not available (well.. um.. deprecated?) on windows, and the way PosixApi.h is providing it causes strange compile errors when it's included in the wrong order. The best way to avoid that is to just not use chdir. This replaces all uses of getcwd in generic code. There are still a couple of more uses, but these are in platform-specific code. chdir() is causing a similar problem, but for that there is no llvm equivalent for that (yet). Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D28858 llvm-svn: 292795
* Prevent client from querying each thread's PC at each stop.Pavel Labath2017-01-203-33/+71
| | | | | | | | | | | | | | | | | | Summary: The server was no longer sending the thread PCs the way the client expected them. I changed the server to send them back as a threadstop info field, similar to the Apple version of the server. I also changed the client to look for them there, before querying the server. I added a test to ensure the server doesn't stop sending them. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D28880 Author: Jason Majors llvm-svn: 292611
* Avoid unused variable warning when assert is disabled.Hafiz Abid Qadeer2017-01-191-2/+2
| | | | llvm-svn: 292488
* Make lldb -Werror clean for -Wstring-conversionDavid Blaikie2017-01-061-4/+1
| | | | | | | | | Also found/fixed one bug identified by this warning in RenderScriptx86ABIFixups.cpp where a string literal was being used in an effort to provide a name for an instruction/register, but was instead being passed as the bool 'isVolatile' parameter. llvm-svn: 291198
* Fix jModulesInfo handling for cross-path syntax debuggingPavel Labath2017-01-051-1/+1
| | | | | | | 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-4/+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
* Introduce chrono to the Communication classPavel Labath2016-11-253-31/+3
| | | | | | | | This replaces the raw integer timeout parameters in the class with their chrono-based equivalents. To achieve this, I have moved the Timeout class to a more generic place and added a quick unit test for it. llvm-svn: 287920
* Attempt to fix freebsd build after r287864Pavel Labath2016-11-241-5/+8
| | | | | | | | | | 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
* Introduce chrono to more gdb-remote functionsPavel Labath2016-11-247-104/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This replaces the usage of raw integers with duration classes in the gdb-remote packet management functions. The values are still converted back to integers once they go into the generic Communication class -- that I am leaving to a separate change. The changes are mostly straight-forward (*), the only tricky part was representation of infinite timeouts. Currently, we use UINT32_MAX to denote infinite timeout. This is not well suited for duration classes, as they tend to do arithmetic on the values, and the identity of the MAX value can easily get lost (e.g. microseconds(seconds(UINT32_MAX)).count() != UINT32_MAX). We cannot use zero to represent infinity (as Listener classes do) because we already use it to do non-blocking polling reads. For this reason, I chose to have an explicit value for infinity. The way I achieved that is via llvm::Optional, and I think it reads quite natural. Passing llvm::None as "timeout" means "no timeout", while passing zero means "poll". The only tricky part is this breaks implicit conversions (seconds are implicitly convertible to microseconds, but Optional<seconds> cannot be easily converted into Optional<microseconds>). For this reason I added a special class Timeout, inheriting from Optional, and enabling the necessary conversions one would normally expect. (*) The other tricky part was GDBRemoteCommunication::PopPacketFromQueue, which was needlessly complicated. I've simplified it, but that one is only used in non-stop mode, and so is untested. Reviewers: clayborg, zturner, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26971 llvm-svn: 287864
* Convert Platform, Process, and Connection functions to StringRef.Zachary Turner2016-11-172-12/+13
| | | | | | All tests pass on Linux and Windows. llvm-svn: 287259
* Convert UriParser to use StringRef.Zachary Turner2016-11-171-4/+4
| | | | llvm-svn: 287190
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-165-28/+31
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-113-11/+11
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Make the Error class constructor protectedMehdi Amini2016-11-113-11/+11
| | | | | | | | | This is forcing to use Error::success(), which is in a wide majority of cases a lot more readable. Differential Revision: https://reviews.llvm.org/D26481 llvm-svn: 286561
* Fix GDBRemoteCommunicationClientTest.TestPacketSpeedJSONPavel Labath2016-11-043-16/+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
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-026-24/+21
| | | | | | | | | | Reviewers: zturner, labath Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D26233 llvm-svn: 285855
* Remove usages of TimeValue from gdb-remote process pluginPavel Labath2016-10-317-91/+84
| | | | | | | | | | | | | | | 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
* [LLDB][MIPS] Fix qProcessInfo to return correct pointer size based on ELF ABINitesh Jain2016-10-122-7/+11
| | | | | | | | | | Reviewers: clayborg, labath Subscribers: jaydeep, bhushan, slthakur, lldb-commits Differential Revision: https://reviews.llvm.org/D25021 llvm-svn: 284001
* Convert CommandObject constructors to StringRef.Zachary Turner2016-10-051-2/+1
| | | | llvm-svn: 283384
* Try to fix failing tests when running remote test suite.Zachary Turner2016-10-041-1/+1
| | | | llvm-svn: 283168
* [gdb-remote] Remove the const char * version of SendPacketAndWaitForResponsePavel Labath2016-09-233-133/+103
| | | | | | Switch all callers to use the StringRef version. llvm-svn: 282236
* Fix an inefficient StringRef conversion.Zachary Turner2016-09-211-3/+1
| | | | | | | Since the original object was already an llvm::SmallString<> there's no point calling c_str() first. llvm-svn: 282080
* Make lldb::Regex use StringRef.Zachary Turner2016-09-211-4/+3
| | | | | | | | | | This updates getters and setters to use StringRef instead of const char *. I tested the build on Linux, Windows, and OSX and saw no build or test failures. I cannot test any BSD or Android variants, however I expect the required changes to be minimal or non-existant. llvm-svn: 282079
* Fixed the build by changing a couple of const char *s to StringRefs.Sean Callanan2016-09-191-3/+4
| | | | llvm-svn: 281943
* Fix more functions in Args to use StringRef.Zachary Turner2016-09-193-22/+21
| | | | | | | | | | | | | | | This patch also marks the const char* versions as =delete to prevent their use. This has the potential to cause build breakages on some platforms which I can't compile. I have tested on Windows, Linux, and OSX. Best practices for fixing broken callsites are outlined in Args.h in a comment above the deleted function declarations. Eventually we can remove these =delete declarations, but for now they are important to make sure that all implicit conversions from const char * are manually audited to make sure that they do not invoke a conversion from nullptr. llvm-svn: 281919
* Convert many functions to use StringRefs.Zachary Turner2016-09-171-2/+2
| | | | | | | | | | | | | Where possible, remove the const char* version. To keep the risk and impact here minimal, I've only done the simplest functions. In the process, I found a few opportunities for adding some unit tests, so I added those as well. Tested on Windows, Linux, and OSX. llvm-svn: 281799
* Fix about a dozen compile warningsIlia K2016-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: It fixes the following compile warnings: 1. '0' flag ignored with precision and ‘%d’ gnu_printf format 2. enumeral and non-enumeral type in conditional expression 3. format ‘%d’ expects argument of type ‘int’, but argument 4 has type ... 4. enumeration value ‘...’ not handled in switch 5. cast from type ‘const uint64_t* {aka ...}’ to type ‘int64_t* {aka ...}’ casts away qualifiers 6. extra ‘;’ 7. comparison between signed and unsigned integer expressions 8. variable ‘register_operand’ set but not used 9. control reaches end of non-void function Reviewers: jingham, emaste, zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24331 llvm-svn: 281191
* async structured data packet handling improvementsTodd Fiala2016-09-104-43/+52
| | | | | | | | | | | | | | | | | | | | | | | 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 MSVC error from r280919Pavel Labath2016-09-081-4/+4
| | | | | | MSVC did not understand my brace-initializer syntax. :/ llvm-svn: 280965
* Fix for rL280668, Intel(R) Memory Protection Extensions (Intel(R) MPX) support.Valentina Giusti2016-09-082-0/+6
| | | | | | | | | | | | Summary: Signed-off-by: Valentina Giusti <valentina.giusti@intel.com> Reviewers: dvlahovski, granata.enrico, clayborg, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24255 llvm-svn: 280942
OpenPOWER on IntegriCloud