summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/windows/PipeWindows.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* [lldb-server] Add unnamed pipe support to PipeWindowsAaron Smith2019-01-101-16/+63
| | | | | | | | | | | | | | | | | Summary: This adds unnamed pipe support in PipeWindows to support communication between a debug server and child process. Modify PipeWindows::CreateNew to support the creation of an unnamed pipe. Rename the previous method that created a named pipe to PipeWindows::CreateNewNamed. Reviewers: zturner, llvm-commits Reviewed By: zturner Subscribers: Hui, labath, lldb-commits Differential Revision: https://reviews.llvm.org/D56234 llvm-svn: 350784
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename Error -> Status.Zachary Turner2017-05-121-38/+40
| | | | | | | | | | | | | | | 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
* Revert unwanted changes in lldb when updating llvm::Error()Mehdi Amini2016-11-111-4/+4
| | | | | | | | My script updated lldb::Errors, and I failed to fix it entirely before pushing. This restore everything in lldb as it was before r286561. llvm-svn: 286565
* 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
* Make lldb -Werror clean on Windows.Zachary Turner2016-10-051-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D25247 llvm-svn: 283344
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-260/+217
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Unicode support on Win32.Zachary Turner2016-03-221-4/+6
| | | | | | | | | | | | | Win32 API calls that are Unicode aware require wide character strings, but LLDB uses UTF8 everywhere. This patch does conversions wherever necessary when passing strings into and out of Win32 API calls. Patch by Cameron Differential Revision: http://reviews.llvm.org/D17107 Reviewed By: zturner, amccarth llvm-svn: 264074
* Revert "Add Pipe::WriteWithTimeout method"Pavel Labath2015-07-211-30/+3
| | | | | | | | I have observed an increased flakyness in the buildbots. I suspect something was relying on the fact that Pipe::Write had an implicit timeout of 1s, which this commit has removed. Reverting while I investigate. llvm-svn: 242767
* Add Pipe::WriteWithTimeout methodPavel Labath2015-07-211-3/+30
| | | | | | | | | | | | | | | | | | Summary: This commit adds a WriteWithTimeout method to time Pipe class, analogous to the existing ReadWithTimeout(). It also changes the meaning of passing zero as a timeout value. Previously, zero was used as an infinite timeout value. Now, the meaning of zero timeout to return the data avaiable without sleeping (basically, a non-blocking operation). This makes the behaviour of Pipe consistent with the Communication/Connection classes. For blocking operatios with infinite timeout, I introduce a special constant for this purpose. Reviewers: ovyalov, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11358 llvm-svn: 242764
* Expose Close{Read/Write}FileDescriptor for pipes.Chaoren Lin2015-04-291-5/+5
| | | | llvm-svn: 236136
* Make PipeWindows::CreateWithUniqueName() use GUIDs on Windows.Zachary Turner2015-02-111-6/+16
| | | | | | | Patch by Adrian McCarthy Differential Revision: http://reviews.llvm.org/D7509 llvm-svn: 228859
* Fix warning about the use of mktemp and make platform agnostic by adding and ↵Oleksiy Vyalov2015-02-051-0/+20
| | | | | | | | using PipeBase::CreateWithUniqueName - on behalf of flackr. http://reviews.llvm.org/D7348 llvm-svn: 228307
* Extend PipePosix with support for named pipes/timeout-based IO and integrate ↵Oleksiy Vyalov2015-01-141-1/+1
| | | | | | | | it with GDBRemoteCommunication / lldb-gdbserver - include reviews fixes. http://reviews.llvm.org/D6954 llvm-svn: 225923
* Extend PipePosix with support for named pipes/timeout-based IO and integrate ↵Oleksiy Vyalov2015-01-131-10/+10
| | | | | | | | it with GDBRemoteCommunication / lldb-gdbserver. http://reviews.llvm.org/D6954 llvm-svn: 225849
* Enhance the Pipe interface for better portability.Zachary Turner2014-12-171-113/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes a number of improvements to the Pipe interface. 1) An interface (PipeBase) is provided which exposes pure virtual methods for any implementation of Pipe to override. While not strictly necessary, this helps catch errors where the interfaces are out of sync. 2) All methods return lldb_private::Error instead of returning bool or void. This allows richer error information to be propagated up to LLDB. 3) A new ReadWithTimeout() method is exposed in the base class and implemented on Windows. 4) Support for both named and anonymous pipes is exposed through the base interface and implemented on Windows. For creating a new pipe, both named and anonymous pipes are supported, and for opening an existing pipe, only named pipes are supported. New methods described in points #3 and #4 are stubbed out on posix, but fully implemented on Windows. These should be implemented by someone on the linux / mac / bsd side. Reviewed by: Greg Clayton, Oleksiy Vyalov Differential Revision: http://reviews.llvm.org/D6686 llvm-svn: 224442
* Fix deadlock in Python one-line execution.Zachary Turner2014-10-081-0/+231
Python one-line execution was using ConnectionFileDescriptor to do a non-blocking read against a pipe. This won't work on Windows, as CFD is implemented using select(), and select() only works with sockets on Windows. The solution is to use ConnectionGenericFile on Windows, which uses the native API to do overlapped I/O on the pipe. This in turn requires re-implementing Host::Pipe on Windows using native OS handles instead of the more portable _pipe CRT api. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5679 llvm-svn: 219339
OpenPOWER on IntegriCloud