summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/windows
Commit message (Collapse)AuthorAgeFilesLines
* Fix Windows build.Chaoren Lin2016-04-191-0/+1
| | | | llvm-svn: 266702
* Unicode support on Win32.Zachary Turner2016-03-228-125/+306
| | | | | | | | | | | | | 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
* Add support for reading line tables from PDB files.Zachary Turner2016-03-021-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | PDB is Microsoft's debug information format, and although we cannot yet generate it, we still must be able to consume it. Reason for this is that debug information for system libraries (e.g. kernel32, C Runtime Library, etc) only have debug info in PDB format, so in order to be able to support debugging of system code, we must support it. Currently this code should compile on every platform, but on non-Windows platforms the PDB plugin will return 0 capabilities, meaning that for now PDB is only supported on Windows. This may change in the future, but the API is designed in such a way that this will require few (if any) changes on the LLDB side. In the future we can just flip a switch and everything will work. This patch only adds support for line tables. It does not return information about functions, types, global variables, or anything else. This functionality will be added in a followup patch. Differential Revision: http://reviews.llvm.org/D17363 Reviewed by: Greg Clayton llvm-svn: 262528
* Fix TestProcessLaunch for Python 3.Zachary Turner2016-01-131-2/+33
| | | | | | | | | | | | | | | | | | There were a number of problems preventing this from working: 1. The SWIG typemaps for converting Python lists to and from C++ arrays were not updated for Python 3. So they were doing things like PyString_Check instead of using the PythonString from PythonDataObjects. 2. ProcessLauncherWindows was ignoring the environment completely. So any test that involved launching an inferior with any kind of environment variable would have failed. 3. The test itself was using process.GetSTDOUT(), which isn't implemented on Windows. So this was changed to save the value of the environment variable in a local variable and have the debugger look at the value of the variable. llvm-svn: 257669
* Fix an issue where LLDB would not launch argdumper correctly if there were ↵Enrico Granata2015-11-191-1/+1
| | | | | | spaces in the path to it llvm-svn: 253599
* Rename argdumper to lldb-argdumperTodd Fiala2015-10-291-4/+4
| | | | | | http://reviews.llvm.org/D14169 llvm-svn: 251616
* Make uses of /dev/null portable across OSes.Zachary Turner2015-10-141-0/+3
| | | | | | | | | Most platforms have "/dev/null". Windows has "nul". Instead of hardcoding the string /dev/null at various places, make a constant that contains the correct value depending on the platform, and use that everywhere instead. llvm-svn: 250331
* Moved ResolveSymbolicLink() to the FileSystem where it belongs, thanksSean Callanan2015-09-181-0/+6
| | | | | | | | zturner! http://reviews.llvm.org/D12984 llvm-svn: 248055
* Remove unused modules from module cache.Oleksiy Vyalov2015-09-181-0/+23
| | | | | | http://reviews.llvm.org/D12971 llvm-svn: 248017
* Move GetOptInc to the common namespacePavel Labath2015-09-041-470/+0
| | | | | | | | | | | | | | | | | | | Summary: GetOptInc provides getopt(), getopt_long() and getopt_long_only(). Windows (for defined(_MSC_VER)) doesn't ship with all of the getopt(3) family members and needs all of them. NetBSD requires only getopt_long_only(3). While there fix the code for clang diagnostics. Author: Kamil Rytarowski Reviewers: joerg Subscribers: labath, zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D12582 llvm-svn: 246843
* When redirecting stdio, use FILE_SHARE_DELETE.Zachary Turner2015-09-021-1/+1
| | | | | | | | | | Some tests were failing because the test would try to delete the file before inferior had exited, but on Windows this will fail by default unless you specify FILE_SHARE_DELETE when opening the file. Can't think of a good reason not to do this, so here it is. llvm-svn: 246682
* 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
OpenPOWER on IntegriCloud