summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ProcessLaunchInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Improve the way LLDB escapes arguments before passing them to the shellEnrico Granata2016-04-041-1/+3
| | | | | | | | | | | | | Teach LLDB that different shells have different characters they are sensitive to, and use that knowledge to do shell-aware escaping This helps solve a class of problems on OS X where LLDB would try to launch via sh, and run into problems if the command line being passed to the inferior contained such special markers (hint: the shell would error out and we'd fail to launch) This makes those launch scenarios work transparently via shell expansion Slightly improve the error message when this kind of failure occurs to at least suggest that the user try going through 'process launch' directly Fixes rdar://problem/22749408 llvm-svn: 265357
* Unicode support on Win32.Zachary Turner2016-03-221-4/+11
| | | | | | | | | | | | | 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
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-071-2/+2
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.Eugene Zelenko2016-02-181-38/+36
| | | | llvm-svn: 261179
* Make uses of /dev/null portable across OSes.Zachary Turner2015-10-141-1/+2
| | | | | | | | | 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
* Don't try to make a pseudo terminal if we are launching in a separate ↵Greg Clayton2015-07-101-0/+7
| | | | | | terminal, it causes a deadlock when debugging because we create a PTY and yet it isn't hooked up to anything on the slave side. llvm-svn: 241919
* Rename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.Chaoren Lin2015-06-091-1/+1
| | | | | | | | | | | | | | | | | Summary: `IsRelativeToCurrentWorkingDirectory` was misleading, because relative paths are sometimes appended to other directories, not just the cwd. Plus, the new name is shorter. Also added `IsAbsolute` for completeness. Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10262 llvm-svn: 239419
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-291-55/+50
| | | | | | | | | | | | | | | | | 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
* Fix errors building on linux.Zachary Turner2015-03-031-0/+4
| | | | llvm-svn: 231169
* Rename the "glob arguments" feature to "shell expand arguments"Enrico Granata2015-02-201-4/+4
| | | | | | This should not bring any feature change, except changing names of things here and there llvm-svn: 230077
* Add a "launch with globber" mode that lets you launch a process after having ↵Enrico Granata2015-02-101-0/+8
| | | | | | globbed the command line arguments via argdumper instead of routing via /bin/sh llvm-svn: 228658
* Fix broken windows build due to use of O_CLOEXEC.Zachary Turner2015-02-041-1/+8
| | | | llvm-svn: 228171
* Avoid leakage of file descriptors in LLDB and LLGSPavel Labath2015-02-041-1/+1
| | | | | | | | | | | | | | | Summary: Both LLDB and LLGS are leaking file descriptors into the debugged process. This plugs the leak by closing the unneeded descriptors. In one case I use O_CLOEXEC, which I hope is supported on relevant platforms. I also added a regression test and plugged a fd leak in dosep.py. Reviewers: vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7372 llvm-svn: 228130
* Fix some posix assumptions related to running shell commands.Zachary Turner2014-12-081-4/+11
| | | | | | | | | | | | | | | | | | | 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-5/+4
| | | | llvm-svn: 223568
* Fix some posix assumptions related to running shell commands.Zachary Turner2014-12-061-4/+5
| | | | | | | | Differential Revision: http://reviews.llvm.org/D6553 Reviewed By: Greg Clayton llvm-svn: 223548
* Fixed more fallout from running the test suite remotely on iOS devices.Greg Clayton2014-11-171-0/+13
| | | | | | | | | | | | | | | | 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
* Remove unused variable.Eric Christopher2014-10-211-1/+0
| | | | llvm-svn: 220319
* Remove LLDB_DEFAULT_SHELL #define, and determine this at runtime.Zachary Turner2014-10-201-34/+11
| | | | | | | Differential Revision: http://reviews.llvm.org/D5805 Reviewed by: Greg Clayton llvm-svn: 220217
* Fixed stdio redirection within LLDB to "do the right thing" in all cases.Greg Clayton2014-10-141-7/+19
| | | | | | | | | | The main issue was if you didn't specify all three (stdin/out/err), you would get file actions added to the launch that would always use the pseudo terminal. This is now fixed. Also fixed the test suite test that handles IO to test redirecting things individually and all together and in other combinations to make sure we don't regress. <rdar://problem/18638226> llvm-svn: 219711
* llgs: fixes to PTY/gdb-remote inferior stdout/stderr handling, logging addtions.Todd Fiala2014-10-111-5/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, both local-process llgs and remote-target llgs stdout/stderr handling from inferior work correctly. Several log lines have been added around PTY and stdout/stderr redirection logic on the lldb client side. Regarding remote llgs execution, see the following: With these changes, remote llgs with $O now works properly: $ lldb (lldb) platform select remote-linux (lldb) target create ~/some/inferior/exe (lldb) gdb-remote {some-target}:{port} (lldb) run The sequence above will correctly redirect stdout/stderr over gdb-remote $O, as is needed for remote debugging. That sequence assumes there is a lldb-gdbserver exe running on the target with {some-host}:{port}. You can replace the gdb-remote command with a '(lldb) platform connect connect://{target-ip}:{target-port}'. If you do this and have a lldb-platform running on the remote end, it will go ahead and launch llgs for lldb for each target instance that is run/attached. For local debugging with llgs, the following sequence also works, and uses local PTYs instead to avoid $O and extra gdb-remote messages: $ lldb (lldb) settings set platform.plugin.linux.use-llgs true (lldb) target create ~/some/inferior/exe (lldb) run The above will run the inferior using llgs on the local host, and will use PTYs rather than $O redirection. This change also removes the logging that happened after the fork but before the exec when llgs is launching a new inferior process. Some aspect of the file handling during that portion of code would not do the right thing with log handling. We might want to go back later and have that communicate over a pipe from the child to parent to pass along any messages that previously were logged in that section of code. llvm-svn: 219578
* Enable llgs to build against experimental Android AOSP ↵Todd Fiala2014-09-271-4/+0
| | | | | | | | | | | | lldb/llvm/clang/compiler-rt repos. See http://reviews.llvm.org/D5495 for more details. These are changes that are part of an effort to support building llgs, within the AOSP source tree, using the Android.mk build system, when using the llvm/clang/lldb git repos from AOSP replaced with the experimental ones currently in github.com/tfiala/aosp-{llvm,clang,lldb,compiler-rt}. llvm-svn: 218568
* Fix incorrect initializer list style.Zachary Turner2014-09-121-13/+13
| | | | llvm-svn: 217721
* Make ProcessLaunchInfo copyable.Zachary Turner2014-09-121-16/+16
| | | | llvm-svn: 217714
* Fix the ctor ivar initialization formatting for Debugger,Jason Molenda2014-09-121-13/+13
| | | | | | | TypeValidatorImpl, FileAction, and ProcessLaunchInfo to match the lldb coding convention. llvm-svn: 217653
* Move FileSystem functions out of Host and into their own classes.Zachary Turner2014-08-151-19/+16
| | | | | | | | | | | | | | | | More specifically, this change can be summarized as follows: 1) Makes an lldbHostPosix library which contains code common to all posix platforms. 2) Creates Host/FileSystem.h which defines a common FileSystem interface. 3) Implements FileSystem.h in Host/windows and Host/posix. 4) Creates Host/FileCache.h, implemented in Host/common, which defines a class useful for storing handles to open files needed by the debugger. Differential Revision: http://reviews.llvm.org/D4889 llvm-svn: 215775
* Refactor FileAction out of ProcessLaunchInfo.Zachary Turner2014-08-141-167/+8
| | | | | | | | | | | | | FileAction was previously a nested class in ProcessLaunchInfo. This led to some unfortunate style consequences, such as requiring the AddPosixSpawnFileAction() funciton to be defined in the Target layer, instead of the more appropriate Host layer. This patch makes FileAction its own independent class in the Target layer, and then moves AddPosixSpawnFileAction() into Host as a result. Differential Revision: http://reviews.llvm.org/D4877 llvm-svn: 215649
* Fixed launching in shell on haswell enabled Macs to work more than once when ↵Greg Clayton2014-08-121-1/+3
| | | | | | | | | | | | | | | | you do: % lldb -x /bin/ls (lldb) r (lldb) r Prior to this fix the first time it would run /usr/bin/arch with "-arch x86_64" the first time and succeed, and fail the second when the target had updated its architecture to x86_64h. We can't specify x86_64h to /usr/bin/arch, it doesn't handle it. Also fixed it so /usr/bin/arch is only used for Apple triples. <rdar://problem/17951312> llvm-svn: 215475
* Fixup Windows build breaks for the llgs upstream.Todd Fiala2014-06-301-0/+2
| | | | | | | | Also moves NativeRegisterContextLinux* files into the Linux directory. These, like NativeProcessLinux, should only be built on Linux or a cross compiler with proper headers. llvm-svn: 212074
* Pull ProcessInfo and ProcessLaunchInfo out of Target/Process.Todd Fiala2014-06-301-0/+617
Elevate ProcessInfo and ProcessLaunchInfo into their own headers. llgs will be using ProcessLaunchInfo but doesn't need to pull in the rest of Process.h. This also moves a bunch of implementation details from the header declarations into ProcessInfo.cpp and ProcessLaunchInfo.cpp. Tested on Ubuntu 14.04 Cmake and MacOSX Xcode. Related to https://github.com/tfiala/lldb/issues/26. llvm-svn: 212005
OpenPOWER on IntegriCloud