summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/Android/AdbClient.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Fixes -Wrange-loop-analysis warningsMark de Wever2020-01-011-1/+1
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
* [LLDB] Cleanup the DataEncoder utility. (NFC)Jonas Devlieghere2019-11-131-1/+1
| | | | | This commit removes unused methods from the DataEncoder class and cleans up the API by making all the internal methods private.
* [Platform/Android] Read the adb server from an env variable if setNathan Lanza2019-08-271-1/+6
| | | | | | | | | | | | | | | Summary: The environment variable ANDROID_ADB_SERVER_PORT can be defined to have adbd litsen on a different port. Teach lldb how to understand this via simply checking the env var. Reviewers: xiaobai, clayborg Subscribers: srhines Differential Revision: https://reviews.llvm.org/D66689 llvm-svn: 370106
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-2/+2
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* 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
* Remove header grouping comments.Jonas Devlieghere2018-11-111-1/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* [FileSystem] Extend file system and have it use the VFS.Jonas Devlieghere2018-10-311-1/+1
| | | | | | | | | | | | | | | | This patch extends the FileSystem class with a bunch of functions that are currently implemented as methods of the FileSpec class. These methods will be removed in future commits and replaced by calls to the file system. The new functions are operated in terms of the virtual file system which was recently moved from clang into LLVM so it could be reused in lldb. Because the VFS is stateful, we turned the FileSystem class into a singleton. Differential revision: https://reviews.llvm.org/D53532 llvm-svn: 345783
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Increase AdbClient read timeoutPavel Labath2017-10-311-1/+1
| | | | | | | | The previous value was not sufficient for Pixel 2 phones. One would have hoped that the newer phones are faster, but that does not seem to be the case here. llvm-svn: 316993
* Skip TestWatchedVarHitWhenInScope on android arm because it triggers a ↵Pavel Labath2017-05-161-1/+1
| | | | | | kernel bug llvm-svn: 303160
* Rename Error -> Status.Zachary Turner2017-05-121-92/+95
| | | | | | | | | | | | | | | 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
* iwyu fixes for lldbCore.Zachary Turner2017-04-061-0/+1
| | | | | | | | | | | | | | This adjusts header file includes for headers and source files in Core. In doing so, one dependency cycle is eliminated because all the includes from Core to that project were dead includes anyway. In places where some files in other projects were only compiling due to a transitive include from another header, fixups have been made so that those files also include the header they need. Tested on Windows and Linux, and plan to address failures on OSX and FreeBSD after watching the bots. llvm-svn: 299714
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-221-1/+1
| | | | llvm-svn: 298536
* Replace std::ofstream with llvm::raw_fd_ostreamPavel Labath2017-03-211-5/+10
| | | | | | | | | | | | | | Summary: ofstream does not handle paths with non-ascii characters correctly on windows, so I am switching these to llvm streams to fix that. Reviewers: zturner, eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31079 llvm-svn: 298375
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-041-4/+4
| | | | llvm-svn: 296943
* Move classes from Core -> Utility.Zachary Turner2017-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Introduce Chrono to the Connection class. NFCI.Pavel Labath2016-11-251-5/+4
| | | | llvm-svn: 287922
* Use more chrono in AdbClientPavel Labath2016-11-241-4/+4
| | | | | | This refactors AdbClient interface in terms of std::chrono. llvm-svn: 287880
* Use chrono in AdbClientPavel Labath2016-11-241-18/+15
| | | | | | | This refactors the class implementations to use chrono. I'll follow this up with a refactor of the class interface. llvm-svn: 287879
* Convert UriParser to use StringRef.Zachary Turner2016-11-171-2/+2
| | | | llvm-svn: 287190
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-161-1/+1
| | | | | | | | | | | | | | | 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-111-4/+4
| | | | | | | | 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-111-4/+4
| | | | | | | | | 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 Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-021-1/+1
| | | | | | | | | | Reviewers: zturner, labath Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D26233 llvm-svn: 285855
* Remove TimeValue usage from FileSpec.hPavel Labath2016-11-011-2/+6
| | | | | | | | | | | | | | | | | | | | | Summary: The only usage there was in GetModificationTime(). I also took the opportunity to move this function from FileSpec to the FileSystem class - since we are using FileSpecs to also represent remote files for which we cannot (easily) retrieve modification time, it makes sense to make the decision to get the modification time more explicit. The new function returns a llvm::sys::TimePoint<>. To aid the transition from TimeValue, I have added a constructor to it which enables implicit conversion from a time_point. Reviewers: zturner, clayborg Subscribers: mehdi_amini, tberghammer, danalbert, beanz, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D25392 llvm-svn: 285702
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-528/+467
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Delete Host/windows/win32.hZachary Turner2016-08-091-0/+1
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* Use shell cat command as a workaround if ADB stat cannot lookup a file.Oleksiy Vyalov2016-07-081-12/+54
| | | | | | http://reviews.llvm.org/D22081 llvm-svn: 274895
* Respect ANDROID_SERIAL environment variable used by ADBLuke Drummond2016-07-071-6/+12
| | | | | | | | | | | When multiple Android devices are attached, the default behaviour of ADB is to resolve a device number based on the presence of ANDROID_SERIAL if the serial number is not explicitly passed by the -s parameter. This patch emulates that behaviour in lldb's ADB platform connector Differential Revision: http://reviews.llvm.org/D22052 llvm-svn: 274776
* Fix ADB client disconnect issues.Oleksiy Vyalov2016-07-061-7/+54
| | | | | | http://reviews.llvm.org/D22029 llvm-svn: 274638
* Fix for Windows builds.Adrian McCarthy2016-06-301-0/+6
| | | | llvm-svn: 274277
* Improve ADB utilization within Android platform.Oleksiy Vyalov2016-06-301-150/+174
| | | | | | http://reviews.llvm.org/D21770 llvm-svn: 274256
* Bump up adb timeout morePavel Labath2016-05-161-1/+1
| | | | | | still seeing very rare timeouts on the buildbot. llvm-svn: 269648
* Bump up timeout in AdbClientPavel Labath2016-05-051-1/+1
| | | | | | | now that the timeout actually means something, we see that sometimes adb is just really slow in replying to the DONE packet during file push. Give it more time to complete. llvm-svn: 268623
* Fix EOF handling in AdbClient (take 2)Pavel Labath2016-05-051-5/+16
| | | | | | | | | | | | | | Summary: AdbClient would spin in a loop in ReadAllBytes in case the remote end was closed before reading the requested number of bytes. Make sure we return an error in this case instead. Reviewers: ovyalov Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: http://reviews.llvm.org/D19916 llvm-svn: 268617
* Revert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"Pavel Labath2016-05-031-11/+13
| | | | | | | This reverts commit r268380 as it breaks windows build (I forgot to make neccesary adjustments to ConnectionGenericFileWindows). llvm-svn: 268384
* Add a read_full_buffer argument to ConnectionFileDescriptor::ReadPavel Labath2016-05-031-13/+11
| | | | | | | | | | | | | | | | | | | | | Summary: AdbClient was attempting to handle the case where the socket input arrived in pieces, but it was failing to handle the case where the connection was closed before that happened. In this case, it would just spin in an infinite loop calling Connection::Read. (This was also the cause of the spurious timeouts on the darwin->android buildbot. The exact cause of the premature EOF remains to be investigated, but is likely a server bug.) Since this wait-for-a-certain-number-of-bytes seems like a useful functionality to have, I am moving it (with the infinite loop fixed) to the Connection class, and adding an appropriate test for it. Reviewers: clayborg, zturner, ovyalov Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: http://reviews.llvm.org/D19533 llvm-svn: 268380
* Provide ADB port forwarding support for abstract sockets.Oleksiy Vyalov2015-11-031-2/+12
| | | | | | http://reviews.llvm.org/D14262 llvm-svn: 251879
* Revert r251578. I was in the middle of editing the commit messageJason Molenda2015-10-281-1/+1
| | | | | | | | | | | | | and decided to not commit the change, but accidentally committed it anyway. This was based on a static analysis complaint; it thought there was a code path where AdbClient::PushFile would call AdbClient::ReadSyncHeader and AdbClient::ReadSyncHeader wouldn't set data_len. But in that case, the Error object returned will be Fail and we won't use the data_len or response_id contents. llvm-svn: 251580
* Initialize data_len to 0 in source/Plugins/Platform/Android/AdbClient.cppJason Molenda2015-10-281-1/+1
| | | | llvm-svn: 251578
* Add domain socket support to gdb-remote protocol and lldb-server.Oleksiy Vyalov2015-10-211-0/+13
| | | | | | http://reviews.llvm.org/D13881 llvm-svn: 250933
* Change oat symbolization code for android to work on non-rooted devicesTamas Berghammer2015-09-291-0/+51
| | | | | | | | | | | | | | On android when debugging an apk we run lldb-server as application user because the sell user (on non-rooted device) can't attach to an application. The problem is that "adb pull" will run as a shell user what can't access to files created by lldb-server because they will be owned by the application user. This CL changes the oat symbolization code to run "oatdump --symbolize" to generate an output what is owned by the shell user. Differential revision: http://reviews.llvm.org/D13162 llvm-svn: 248788
* Make remote-android platform to use dynamic local tcp ports when forwarding ↵Oleksiy Vyalov2015-09-011-4/+4
| | | | | | | | device ports. http://reviews.llvm.org/D12510 llvm-svn: 246574
* Fix error handling in AdbClient - PushFile and PullFile.Oleksiy Vyalov2015-06-051-10/+79
| | | | | | http://reviews.llvm.org/D10176 llvm-svn: 239130
* Refactor AdbClient and make PlatformAndroid::GetFile to use "adb pull".Oleksiy Vyalov2015-05-281-23/+32
| | | | | | http://reviews.llvm.org/D10082 llvm-svn: 238442
* Implement and use adb push for PlatformAndroid::PutFileRobert Flack2015-05-271-1/+48
| | | | | | | | | | | | | Using the adb push protocol is significantly faster than the current method of sending the hex encoded file data for the remote to write to the file. Test Plan: Tests continue to pass - and much faster (e.g. TestSBValuePersist.py takes 10s down from 4m51s on mac -> android) Differential Revision: http://reviews.llvm.org/D9943 llvm-svn: 238274
* Use ADB pull to download modules from android target.Oleksiy Vyalov2015-05-181-32/+181
| | | | | | http://reviews.llvm.org/D9816 llvm-svn: 237640
* Fixed a ton of gcc compile warningsVince Harron2015-05-131-1/+1
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Support remote-android with multiple connected devices.Chaoren Lin2015-05-011-11/+12
| | | | | | | | | | | | | | | | | | Summary: This change introduces a new URL scheme for `platform connect`: ``` adb://device-id:port ``` Reviewers: vharron, tberghammer, clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D9358 llvm-svn: 236321
* Remove 'z' modifier from printf/sscanf operations in AdbClient - the ↵Oleksiy Vyalov2015-04-101-5/+5
| | | | | | modifier isn't supported by MS C++ compiler. llvm-svn: 234562
OpenPOWER on IntegriCloud