summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/windows
Commit message (Collapse)AuthorAgeFilesLines
...
* Inline fake snprintf to avoid linkage issues on Windows.Chaoren Lin2015-08-201-6/+5
| | | | | | | | | | | | | | Summary: dllexport doesn't work if linking against a static library with its own copy of snprintf. Reviewers: zturner Subscribers: zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D12206 llvm-svn: 245610
* Some fixes to get LLDB compiling with MSVC 2015.Zachary Turner2015-07-241-0/+2
| | | | llvm-svn: 243174
* Fix typos.Bruce Mitchener2015-07-222-10/+10
| | | | | | | | | | | | Summary: Fix a bunch of typos. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11386 llvm-svn: 242856
* 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
* Implement FileSystem::GetPermissions for Windows. Differential Revision: ↵Adrian McCarthy2015-07-171-1/+19
| | | | | | http://reviews.llvm.org/D11303 llvm-svn: 242568
* [Makefiles] Align library names with CMake buildKeno Fischer2015-07-141-16/+0
| | | | | | | | | | | | Summary: This aligns the library names used by the Makefile build to be the same as those create by the CMake build to make switching between the two easier. The only major difficulty was lldbHost which was one library in the CMake system and several in the Makefile system. Most of the other changes are trivial renames. Reviewers: labath Subscribers: emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11154 llvm-svn: 242196
* Don't close handle returned by _get_osfhandle.Oleksiy Vyalov2015-06-011-5/+0
| | | | | | http://reviews.llvm.org/D9931 llvm-svn: 238770
* Fix inferior's i/o connections to its console window on Windows 7.Adrian McCarthy2015-05-291-3/+3
| | | | llvm-svn: 238629
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-292-19/+24
| | | | | | | | | | | | | | | | | Summary: This should solve the issue of sending denormalized paths over gdb-remote if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the server handle any denormalization. Reviewers: ovyalov, zturner, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D9728 llvm-svn: 238604
* Implement snprintf for MSVC with correct return value.Chaoren Lin2015-05-291-2/+27
| | | | | | | | | | Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10048 llvm-svn: 238599
* Implement PlatformWindows::GetEnvironment.Zachary Turner2015-05-221-0/+18
| | | | | | | This fixes a couple of tests that rely on being able to get the host's environment or spawn an inferior with specific arguments. llvm-svn: 238042
* Don't bother dynamic loading the Windows Slim RW Lock API.Zachary Turner2015-05-141-215/+80
| | | | | | | | | | | | This API has been present since XP, and I think it's safe to drop support for XP (since other things have been introduced long ago which already don't work on XP anyway). With this patch, we can statically bind against the exports and not bother falling back to a CRITICAL_SECTION if we can't load the API. llvm-svn: 237402
* Fix an issue with finding python on Windows.Zachary Turner2015-05-131-2/+1
| | | | | | | | | | | | | Someone must have changed the behavior of FileSpec slightly relating to whether or not there is a trailing backslash when calling GetPath() and GetDirectory(). This caused ScriptInterpreterPython to find the wrong values when initializing sys.path, and as a result we couldn't find the lldb module. This patch fixes the issue, and also adds a test to make sure that GetDirectory() does not return a string containing a trailing slash. llvm-svn: 237282
* Windows: fix bug in getcwd() and add chdir().Ted Woodward2015-05-121-3/+15
| | | | | | | | | | | | | | | | | Summary: GetCurrentDirectory() returns the number of characters copied; 0 is a failure, not a success. Add implementation for chdir(). Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9300 llvm-svn: 237162
* Use hard links to link sysroot files within ModuleCache.Oleksiy Vyalov2015-05-081-0/+9
| | | | | | http://reviews.llvm.org/D9587 llvm-svn: 236917
* Use file locks to synchronize access to ModuleCache.Oleksiy Vyalov2015-05-071-0/+98
| | | | | | http://reviews.llvm.org/D9056 llvm-svn: 236736
* Expose Close{Read/Write}FileDescriptor for pipes.Chaoren Lin2015-04-291-5/+5
| | | | llvm-svn: 236136
* Use llvm::sys::fs::create_directories to create new directory on Windows.Oleksiy Vyalov2015-04-101-2/+7
| | | | | | http://reviews.llvm.org/D8977 llvm-svn: 234610
* [Python] Fix issue configuring sys.path during startup.Zachary Turner2015-04-091-6/+8
| | | | | | | | | | Previously, users on Windows had to manually specify PYTHONPATH to point to the site-packages directory before running LLDB. The reason for this was because sys.path was being initialized with a path containing unescaped backslashes, causing escape sequences to end up in the paths. llvm-svn: 234516
* Fix warnings generated by clang-cl.Zachary Turner2015-04-025-16/+23
| | | | | | | | | | | | | | There were a couple of real bugs here regarding error checking and signed/unsigned comparisons, but mostly these were just noise. There was one class of bugs fixed here which is particularly annoying, dealing with MSVC's non-standard behavior regarding the underlying type of enums. See the comment in lldb-enumerations.h for details. In short, from now on please use FLAGS_ENUM and FLAGS_ANONYMOUS_ENUM when defining enums which contain values larger than can fit into a signed integer. llvm-svn: 233943
* Revert "Fix warnings found with clang-cl."Zachary Turner2015-02-255-11/+19
| | | | | | | SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531
* Fix warnings found with clang-cl.Zachary Turner2015-02-255-19/+11
| | | | | | | | | | | Earlier this week I was able to get clang-cl on Windows to be able to self host. This opened the door to being able to get a whole new slew of warnings for the Windows build. This patch fixes all of the warnings, many of which were real bugs. llvm-svn: 230522
* Avoid crashing by not mmap'ing files on network mounted file systems.Greg Clayton2015-02-231-0/+12
| | | | | | | | | | | | | | | | | | | | This is implemented by making a new FileSystem function: bool FileSystem::IsLocal(const FileSpec &spec) Then using this in a new function: DataBufferSP FileSpec::MemoryMapFileContentsIfLocal(off_t file_offset, size_t file_size) const; This function only mmaps data if the file is a local file since that means we can reliably page in data. We were experiencing crashes where people would use debug info files on network mounted file systems and that mount would go away and cause the next access to a page that wasn't paged in to crash LLDB. We now avoid this by just copying the data into a heap buffer and keeping a permanent copy to avoid the crash. Updated all previous users of FileSpec::MemoryMapFileContentsIfLocal() in ObjectFile subclasses over to use the new FileSpec::MemoryMapFileContentsIfLocal() function. <rdar://problem/19470249> llvm-svn: 230283
* Add missing #include. This should fix the Windows build.Zachary Turner2015-02-211-0/+1
| | | | llvm-svn: 230128
* This should fix the Windows buildEnrico Granata2015-02-201-0/+1
| | | | llvm-svn: 230080
* Rename the "glob arguments" feature to "shell expand arguments"Enrico Granata2015-02-201-11/+11
| | | | | | This should not bring any feature change, except changing names of things here and there llvm-svn: 230077
* Start the refactoring of globbingEnrico Granata2015-02-201-1/+87
| | | | | | | | | | | | | - Add Host::GlobArguments() to perform local-globbing I implemented this on OSX and Windows in terms of argdumper (Windows implementation is essentially the same as the OSX version + a change in binary name and some string magic) Other platforms did not specifically chime in, so I left it unimplemented for them for the time being. Please feel free to fill in the blanks - Add Platform::GlobArguments() to support remote-globbing For now, no feature change here - but now we have infrastructure to help GDBRemote targets to support globbing - and patches to that effect will follow No visible feature change llvm-svn: 230065
* Introduce FileSystem::CalculateMD5AsString that supports any platform and ↵Oleksiy Vyalov2015-02-201-6/+0
| | | | | | | | make existing FileSystem::CalculateMD5 to use it. http://reviews.llvm.org/D7771 llvm-svn: 230036
* 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 Mingw build.Hafiz Abid Qadeer2015-02-111-0/+2
| | | | | | | | | | | | | Following changes are done. Add missing headers. Replace _snprintf with snprintf. It is already changed to _snprintf for MSVC. Add a file in the build for autoconf. Call DynamicLoaderWindows::Terminate and DynamicLoaderWindows::Initialize only for MSVC build. Reviewed in http://reviews.llvm.org/D7536. llvm-svn: 228822
* 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
* Fix compilation failure on Windows.Zachary Turner2015-02-031-1/+1
| | | | llvm-svn: 227998
* Fixed bugs in the multi-threaded access in HostInfoBase. Prior to this fix, ↵Greg Clayton2015-02-031-8/+7
| | | | | | | | | | static bool variables were used but this is not sufficient. We now use std::call_once in all places where the previous static bool code was used to try to implement thread safety. This was causing code that opened multiple targets to try and get a path to debugserver from the GDB remote communication class, and it would get the LLDB path and some instances would return empty strings and it would cause debugserver to not be found. <rdar://problem/18756927> llvm-svn: 227935
* Added Connection::GetURI()Vince Harron2015-01-171-0/+8
| | | | | | | | | | | | | This function returns a URI of the resource that the connection is connected to. This is especially important for connections established by accepting a connection from a remote host. Also added implementations for ConnectionMachPort, ConnectionSharedMemory, Also fixed up some documentation in Connection::Write Renamed ConnectionFileDescriptorPosix::SocketListen to ConnectionFileDescriptorPosix::SocketListenAndAccept Fixed a log message in Socket.cpp Differential Review: http://reviews.llvm.org/D7026 llvm-svn: 226362
* 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
* Only compile RegisterContextWindows_x86.cpp for x86 host architecture.Zachary Turner2014-12-181-1/+9
| | | | | | | | | | This fixes compilation failures in the 64-bit build of LLDB on Windows. Patch by Aidan Dodds Differential Revision: http://reviews.llvm.org/D6704 llvm-svn: 224528
* 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
* Add a method to disable the Windows crash / assert dialogs.Zachary Turner2014-12-121-0/+7
| | | | | | | | | | | | | | | | | | When running the test suite on Windows, we can't have Windows popping up dialogs when LLDB crashes in native code because it will hang the test suite. This patch silences those dialogs by checking an environment variable at startup and configuring Windows based on its value. This patch also adds an environment variable to force inferiors to never spawn in their own console window. This is useful to prevent new window spawm when running the test suite. Reviewed by: Scott Graham Differential Revision: http://reviews.llvm.org/D6628 llvm-svn: 224137
* Fix some posix assumptions related to running shell commands.Zachary Turner2014-12-081-1/+1
| | | | | | | | | | | | | | | | | | | This is a resubmit of r223548, which was reverted due to breaking tests on Linux and Mac. This resubmit fixes the reason for the revert by adding back some accidentally removed code which appends -c to the command line when running /bin/sh. This resubmit also differs from the original patch in that it sets the architecture on the ProcessLaunchInfo. A follow-up patch will refactor this to separate the logic for different platforms. Differential Revision: http://reviews.llvm.org/D6553 Reviewed By: Greg Clayton llvm-svn: 223695
* Reverting r223548 which broke running in the shell on OS X.Jim Ingham2014-12-061-1/+1
| | | | llvm-svn: 223568
* Fix some posix assumptions related to running shell commands.Zachary Turner2014-12-061-1/+1
| | | | | | | | Differential Revision: http://reviews.llvm.org/D6553 Reviewed By: Greg Clayton llvm-svn: 223548
* Decouple ProcessWindows from the Windows debug driver thread.Zachary Turner2014-11-053-3/+23
| | | | | | | | | In the llgs world, ProcessWindows will eventually go away and we'll implement a different protocol. This patch decouples ProcessWindows from the core debug loop so that this transition will not be more difficult than it needs to be. llvm-svn: 221405
* Added a missing call to 'Reset'.Hafiz Abid Qadeer2014-10-261-0/+2
| | | | | | | | | | | HostThreadWindows::Join() did not call the Reset as is done by the HostThreadPosix::Join(). As a result, future call to IsJoinable() can fail. Committed as obvious. llvm-svn: 220651
* Make ProcessWindows just use Host::LaunchProcess.Zachary Turner2014-10-241-1/+1
| | | | llvm-svn: 220574
* Fix code where goto jumped over local variable initialization.Hafiz Abid Qadeer2014-10-231-5/+7
| | | | llvm-svn: 220473
* Remove LLDB_DEFAULT_SHELL #define, and determine this at runtime.Zachary Turner2014-10-201-0/+6
| | | | | | | Differential Revision: http://reviews.llvm.org/D5805 Reviewed by: Greg Clayton llvm-svn: 220217
* Create a process launcher abstraction.Zachary Turner2014-10-143-10/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements Host::LaunchProcess for windows, and in doing so does some minor refactor to move towards a more modular process launching design. The original motivation for this is that launching processes on windows needs some very windows specific code, which would live most appropriately in source/Host/windows somewhere. However, there is already some common code that all platforms use when launching a process before delegating to the platform specific stuff, which lives in source/Host/common/Host.cpp which would be nice to reuse without duplicating. This commonality has been abstracted into MonitoringProcessLauncher, a class which abstracts out the notion of launching a process using an arbitrary algorithm, and then monitoring it for state changes. The windows specific launching code lives in ProcessLauncherWindows, and the posix specific launching code lives in ProcessLauncherPosix. When launching a process MonitoringProcessLauncher is created, and then an appropriate delegate launcher is created and given to the MonitoringProcessLauncher. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5781 llvm-svn: 219731
* Correctly fix ScriptInterpreterPython::ExecuteOneLine for windows.Zachary Turner2014-10-091-1/+1
| | | | llvm-svn: 219435
OpenPOWER on IntegriCloud