summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
Commit message (Collapse)AuthorAgeFilesLines
...
* Extend PipePosix with support for named pipes/timeout-based IO and integrate ↵Oleksiy Vyalov2015-01-134-81/+241
| | | | | | | | it with GDBRemoteCommunication / lldb-gdbserver. http://reviews.llvm.org/D6954 llvm-svn: 225849
* Fix needed for the new terminal test I previously checked in. It was ↵Greg Clayton2015-01-061-12/+17
| | | | | | crashing due to a NULL dereference. llvm-svn: 225316
* More fixes to ensure if we are asked to launch a x86_64h process on darwin, ↵Greg Clayton2015-01-061-1/+2
| | | | | | that darwin-debug knows what to do and how to handle it. llvm-svn: 225225
* Fix being able to get a thread result when calling HostThreadPosix::Join(). ↵Greg Clayton2015-01-061-2/+5
| | | | | | | | It was broken when initially checked in by getting the thread result into a temporary variable and never doing anything with it. Most threads in LLDB don't look at their thread results, but launching processes in a terminal window on MacOSX does require getting a thread result and this broke "process launch --tty" on darwin. <rdar://problem/19308966> llvm-svn: 225224
* No need to call SetErrorToErrno when pipe2 succeeds.Oleksiy Vyalov2014-12-191-3/+0
| | | | | | http://reviews.llvm.org/D6743 llvm-svn: 224652
* 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-173-178/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add Linux support for HostInfo::GetOSBuildString and ↵Oleksiy Vyalov2014-12-091-0/+29
| | | | | | HostInfo::GetOSKernelDescription. llvm-svn: 223737
* Fix some posix assumptions related to running shell commands.Zachary Turner2014-12-084-28/+47
| | | | | | | | | | | | | | | | | | | 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-064-45/+27
| | | | llvm-svn: 223568
* Fix a type (MAX_PATH instead of PATH_MAX) and remove an unused variable.Jim Ingham2014-12-061-2/+1
| | | | llvm-svn: 223559
* Fix some posix assumptions related to running shell commands.Zachary Turner2014-12-064-26/+45
| | | | | | | | Differential Revision: http://reviews.llvm.org/D6553 Reviewed By: Greg Clayton llvm-svn: 223548
* Add support for embedding Clang compiler headersSean Callanan2014-12-052-0/+32
| | | | | | | | | like tgmath.h and stdarg.h into the LLDB installation, and then finding them through the Host infrastructure. Also add a script to actually do this on Mac OS X. llvm-svn: 223430
* Only normalize FileSpec paths *after* resolving them.Zachary Turner2014-12-011-2/+6
| | | | | | | Normalizing paths before resolving them can cause the path to become denormalized after resolution. llvm-svn: 223087
* Refactor SocketAddress::getaddrinfo - avoid calling IsValid if ::getaddrinfo ↵Oleksiy Vyalov2014-11-271-3/+7
| | | | | | | | has failed. Otherwise, IsValid crashes on assertation in GetFamilyLength. llvm-svn: 222862
* This is the first step of making lldb able to create target-specific thingsJim Ingham2014-11-221-22/+0
| | | | | | | | | | | | | (e.g. breakpoints, stop-hooks) before we have any targets - for instance in your ~/.lldbinit file. These will then get copied over to any new targets that get created. So far, you can only make stop-hooks. Breakpoints will have to learn to move themselves from target to target for us to get them from no-target to new-target. We should also make a command & SB API way to prime this ur-target. llvm-svn: 222600
* Extend PipePosix with child_processes_inherit support - to control whether ↵Oleksiy Vyalov2014-11-212-2/+39
| | | | | | | | pipe handles should be inherited by a child process. http://reviews.llvm.org/D6348 llvm-svn: 222541
* Change HostThread::GetNativeThread() to return a derived reference.Zachary Turner2014-11-171-4/+4
| | | | | | | | Previously using HostThread::GetNativeThread() required an ugly cast to most-derived type. This solves the issue by simply returning the derived type directly. llvm-svn: 222185
* Disable Editline on Windows.Zachary Turner2014-11-172-4/+8
| | | | | | | | | | | | | | | | | | | | Editline does not work correctly on Windows. This goes back at least to r208369, and as a result r210105 was submitted to disable libedit at runtime on Windows. More recently, r222163 was submitted which re-writes editline entirely, but makes the situation even worse on Windows, to the point that it doesn't even compile. While it would be easy to fix the compilation failure, this patch simply stops compiling Editline entirely on Windows, as the simple compilation fix would still result in a broken use of select on Windows, and as such a broken implementation of Editline. Since Editline was already disabled to begin with on Windows, we don't attempt to fix the compilation failure or the underlying issues, and instead just disable it "even more". llvm-svn: 222177
* Fix broken build after signature change of ResolveExecutable.Zachary Turner2014-11-171-1/+3
| | | | llvm-svn: 222176
* Small tweaks to make the editline sources match the lldb Jason Molenda2014-11-171-36/+72
| | | | | | source layout. llvm-svn: 222171
* Fixed more fallout from running the test suite remotely on iOS devices.Greg Clayton2014-11-171-11/+9
| | | | | | | | | | | | | | | | Fixed include: - Change Platform::ResolveExecutable(...) to take a ModuleSpec instead of a FileSpec + ArchSpec to help resolve executables correctly when we have just a path + UUID (no arch). - Add the ability to set the listener in SBLaunchInfo and SBAttachInfo in case you don't want to use the debugger as the default listener. - Modified all places that use the SBLaunchInfo/SBAttachInfo and the internal ProcessLaunchInfo/ProcessAttachInfo to not take a listener as a parameter since it is in the launch/attach info now - Load a module's sections by default when removing a module from a target. Since we create JIT modules for expressions and helper functions, we could end up with stale data in the section load list if a module was removed from the target as the section load list would still have entries for the unloaded module. Target now has the following functions to help unload all sections a single or multiple modules: size_t Target::UnloadModuleSections (const ModuleList &module_list); size_t Target::UnloadModuleSections (const lldb::ModuleSP &module_sp); llvm-svn: 222167
* Complete rewrite of interactive editing support for single- and multi-line ↵Kate Stone2014-11-171-610/+1097
| | | | | | | | | | | | | | | | | | | input. Improvements include: * Use of libedit's wide character support, which is imperfect but a distinct improvement over ASCII-only * Fallback for ASCII editing path * Support for a "faint" prompt clearly distinguished from input * Breaking lines and insert new lines in the middle of a batch by simply pressing return * Joining lines with forward and backward character deletion * Detection of paste to suppress automatic formatting and statement completion tests * Correctly reformatting when lines grow or shrink to occupy different numbers of rows * Saving multi-line history, and correctly preserving the "tip" of history during editing * Displaying visible ^C and ^D indications when interrupting input or sending EOF * Fledgling VI support for multi-line editing * General correctness and reliability improvements llvm-svn: 222163
* For some reason, sometimes the directory paths that clang emits have internalJim Ingham2014-11-151-2/+116
| | | | | | | | | | | | | | | | | | | | | relative paths, like: /whatever/llvm/lib/Sema/../../include/llvm/Sema/ That causes problems with our type uniquing, since we use the declaration file and line as one component of the uniquing, and different ways of getting to the same file will have different directory spellings, though they are functionally equivalent. We end up with two copies of the exact same type because of this, and that makes the expression parser give "duplicate type" errors. I added a method to resolve paths with ../ in them and used that in the FileSpec::Equals, for comparing Declarations and for doing Breakpoint compares as well, since they also suffer from this if you specify breakpoints by full path (since nobody knows what ../'s to insert...) <rdar://problem/18765814> llvm-svn: 222075
* Apply SOCK_CLOEXEC flag to socket API functions in order to avoid handle ↵Oleksiy Vyalov2014-11-142-23/+68
| | | | | | | | leakage to a forked child process. http://reviews.llvm.org/D6204 llvm-svn: 222004
* fix minor comment typoVince Harron2014-11-131-1/+1
| | | | llvm-svn: 221950
* LLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166Shawn Best2014-11-085-25/+46
| | | | llvm-svn: 221570
* 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
* Fix the build for LLVM changesEnrico Granata2014-11-041-1/+4
| | | | llvm-svn: 221286
* Use kern.proc.auxv to get the aux dataJustin Hibbits2014-11-011-80/+7
| | | | | | | | | | | | | | | | | Summary: Instead of using a homegrown solution to get the auxv from a process, instead use the OS-provided sysctl to get the needed data. This allows the same code to be used for both 32-bit and 64-bit processes on a 64-bit host. Reviewers: emaste Reviewed By: emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D6071 llvm-svn: 221063
* Fix some bugs from D5988Justin Hibbits2014-10-311-0/+2
| | | | | | | | | | | | | | | | | | Summary: Ed Maste found some problems with the commit in D5988. Address most of these. While here, also add floating point return handling. This doesn't handle 128-bit long double yet. Since I don't have any system that uses it, I don't currently have plans to implement it. Reviewers: emaste Reviewed By: emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D6049 llvm-svn: 220963
* First cut of PowerPC(64) support in LLDB.Justin Hibbits2014-10-311-0/+47
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds preliminary support for PowerPC/PowerPC64, for FreeBSD. There are some issues still: * Breakpoints don't work well on powerpc64. * Shared libraries don't yet get loaded for a 32-bit process on powerpc64 host. * Backtraces don't work. This is due to PowerPC ABI using a backchain pointer in memory, instead of a dedicated frame pointer register for the backchain. * Breakpoints on functions without debug info may not work correctly for 32-bit powerpc. Reviewers: emaste, tfiala, jingham, clayborg Reviewed By: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D5988 llvm-svn: 220944
* 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
* Implement explicit thread stack size specification on Windows.Zachary Turner2014-10-241-1/+2
| | | | llvm-svn: 220596
* 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-203-3/+15
| | | | | | | Differential Revision: http://reviews.llvm.org/D5805 Reviewed by: Greg Clayton llvm-svn: 220217
* Remove always-true part of a conditional expression.Jason Molenda2014-10-171-1/+1
| | | | | | clang warning. llvm-svn: 220018
* Fix accidental over-checking of args in launcherXPCService.Jason Molenda2014-10-161-1/+1
| | | | llvm-svn: 219895
* Fix a potential null pointer deref & a potential memory leak,Jason Molenda2014-10-161-26/+54
| | | | | | | | also reformat to conform to the usual lldb coding conventions a little better. clang static analyzer fixit. llvm-svn: 219893
* Allow ThreadLauncher::LaunchThread() to specify a minimum stack byte size ↵Greg Clayton2014-10-151-2/+27
| | | | | | | | | | | | when launching threads. This defaults to zero, which means to use the system default. NOTE: Windows will need to implement this. <rdar://problem/18644448> llvm-svn: 219821
* Remove some unnecessary headers from Host.cppZachary Turner2014-10-151-28/+1
| | | | | | | | After the recent migration of code out of Host.cpp, many unnecessary headers were still being included. This prunes the include list down to only what is still necessary. llvm-svn: 219814
* Ensure that m_syntax is initialized in all the FileSpecJason Molenda2014-10-151-5/+6
| | | | | | | constructors. clang static analyzer fixit. llvm-svn: 219768
* Remove unused variable.Eric Christopher2014-10-151-2/+0
| | | | llvm-svn: 219751
* Create a process launcher abstraction.Zachary Turner2014-10-1410-110/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix deadlock in Python one-line execution.Zachary Turner2014-10-084-33/+246
| | | | | | | | | | | | | | | | | 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
* llgs: add logging to Native*Protocol breakpoints around byte values replaced ↵Todd Fiala2014-10-081-1/+18
| | | | | | | | and restored. Useful for verifying what bytes a software breakpoint clobbers/restores. llvm-svn: 219318
* Fix compile error on Windows.Zachary Turner2014-10-071-1/+1
| | | | llvm-svn: 219232
OpenPOWER on IntegriCloud