summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
* llgs: fix Ctrl-C inferior interrupt handling to do the right thing.Todd Fiala2014-09-115-42/+229
| | | | | | | | | | | | | | | | * Sends a SIGSTOP to the process. * Fixes busted SIGSTOP handling. Now builds a list of non-stopped that we wait for the PTRACE group-stop for. When the final must-stop tid gets its group stop, we propagate the process state change. Only the signal receiving the notification of the pending SIGSTOP is marked with the SIGSTOP signal. All the rest, if they weren't already stopped, are marked as stopped with signal 0. * Fixes a few broken tests. * Marks the Linux test I added earlier as expect-pass (no longer XFAIL). Implements fix for http://llvm.org/bugs/show_bug.cgi?id=20908. llvm-svn: 217647
* llgs: implement qThreadStopInfo.Todd Fiala2014-09-102-2/+27
| | | | | | | | | | | This change implements this ticket: http://llvm.org/bugs/show_bug.cgi?id=20899 Adds the qThreadStopInfo RSP command for llgs and includes a test that verifies both debugserver and llgs respond with something reasonable on a multithreaded app. llvm-svn: 217549
* Fix FreeBSD build after thread changesEd Maste2014-09-101-2/+2
| | | | | | | More work on the GetName/SetName arguments (thread_t vs tid_t) is needed but this change should restore the build and basic operation. llvm-svn: 217502
* Create a HostThread abstraction.Zachary Turner2014-09-0915-130/+104
| | | | | | | | | | | | | This patch moves creates a thread abstraction that represents a thread running inside the LLDB process. This is a replacement for otherwise using lldb::thread_t, and provides a platform agnostic interface to managing these threads. Differential Revision: http://reviews.llvm.org/D5198 Reviewed by: Jim Ingham llvm-svn: 217460
* Remove unused class variable and update all callers/users.Eric Christopher2014-09-093-5/+2
| | | | llvm-svn: 217419
* Fix configure & make build with python disabledKeno Fischer2014-09-093-6/+6
| | | | | | | | | | | | | This makes sure that nothing that requires Python is being built when the LLDB_DISABLE_PYTHON flag is being passed in. It also changes a use of CPPFLAGS to CPP.Flags since the former is overridden when external flags are passed in while the later is not. I'm not sure exactly why LLDB_DISABLE_PYTHON is in CXXFLAGS rather than CPPFLAGS, but cleaning that up is for another commit. Differential Revision: http://reviews.llvm.org/D4918 llvm-svn: 217414
* Linux/FreeBSD local debugging: allow redirection to pts for POSIX process.Todd Fiala2014-09-082-8/+11
| | | | | | | | See http://reviews.llvm.org/D5135 for more details. Change by Zephyr Zhao. llvm-svn: 217382
* remove a couple of default cases from switchesSaleem Abdulrasool2014-09-081-5/+11
| | | | | | | | | This cleans up a couple of warnings [-Wcovered-switch-default] from the build by removing the default case from a couple of switches which are fully covered. This is generally better as it will help identify when a new item is added to the enumeration but the use sites are not updated. llvm-svn: 217376
* Set the process vendor in GDBRemoteCommunicationClient::GetCurrentProcessInfo.Todd Fiala2014-09-051-0/+1
| | | | | | Change by Stephane Sezer. llvm-svn: 217252
* Fix build break on Ubuntu 12.04 with ARM64 changes.Todd Fiala2014-09-041-1/+3
| | | | | | | | | | See http://llvm.org/bugs/show_bug.cgi?id=20824 for more details. Tested: Ubuntu 12.04 x86_64, gcc-4.9.1-built lldb Ubuntu 14.04 x86_64, clang-3.5-build lldb llvm-svn: 217169
* ASan malloc/free history threadsKuba Brecka2014-09-041-0/+12
| | | | | | Reviewed at http://reviews.llvm.org/D4596 llvm-svn: 217116
* RegisterContextLLDB::InitializeNonZerothFrame had a bit of code toJason Molenda2014-09-022-17/+34
| | | | | | | | | | | | | | | | | | | | detct unwind loops but there was a code path through there (using architecture default unwind plans) that didn't do the check, and could end up with an infinite loop unwind. Move that code into a separate method and call it from both places where it is needed. Also remove the use of ABI::FunctionCallsChangeCFA in that check. I thought about it a lot and none of the architecutres that we're supporting today can have a looping CFA. Since the unwinder isn't using ABI::FunctionCallsChangeCFA() and ABI::StackUsesFrames(), and the unwinder was the only reason those methods exists, I removed them from the ABI and all its plugins. <rdar://problem/17364005> llvm-svn: 216992
* Linux ARM64: add ProcessMonitor-related RegisterContext support.Todd Fiala2014-09-027-0/+996
| | | | | | | | See http://reviews.llvm.org/D5089 for more details. Change by Paul Osmialowski. llvm-svn: 216907
* Consolidate UnixSignals setting/getting in Process.Todd Fiala2014-08-2910-80/+48
| | | | | | | | | | | | | | | | See http://reviews.llvm.org/D5108 for details. This change does the following: * eliminates the Process::GetUnixSignals() virtual method and replaces with a fixed getter. * replaces the Process UnixSignals storage with a shared pointer. * adds a Process constructor variant that can be passed the UnixSignalsSP. When the constructor without the UnixSignalsSP is specified, the Host's default UnixSignals is used. * adds a host-specific version of GetUnixSignals() that is used when we need the host's appropriate UnixSignals variant. * replaces GetUnixSignals() overrides in PlatformElfCore, ProcessGDBRemote, ProcessFreeBSD and ProcessLinux with code that appropriately sets the Process::UnixSignals for the process. This change also enables some future patches that will enable llgs to be used for local Linux debugging. llvm-svn: 216748
* Add arbitrary command line flags to llgs/debugserver startup for local ↵Todd Fiala2014-08-291-1/+19
| | | | | | | | | | | | | | | | | | | | debugging. This patch accepts environment variables of the form: LLDB_DEBUGSERVER_EXTRA_ARG_n where n starts with 1, and may continue nearly indefinitely (up through std::numeric_limits<uint32_t>::max()). The code loops around, starting with 1, until it doesn't find one of the environment variables. For each one it does find defined, it appends the environment variable's contents to the end of the debugserver/llgs startup command line issued when the stub is started for local debugging. I am using this to add arbitrary startup commands to the llgs command line for turning on additional logging. For example: export LLDB_DEBUGSERVER_EXTRA_ARG_1="-c" export LLDB_DEBUGSERVER_EXTRA_ARG_2="log enable -f /tmp/llgs_packets.log gdb-remote packets" export LLDB_DEBUGSERVER_EXTRA_ARG_3="-c" export LLDB_DEBUGSERVER_EXTRA_ARG_4="log enable -f /tmp/llgs_process.log lldb process" llvm-svn: 216745
* lldb - Register Context Linux ARM64Todd Fiala2014-08-297-301/+537
| | | | | | | | | | | | | Yet another step toward ARM64 support. With this commit, lldb-gdbserver started on ARM64 target can be accessed by lldb running on desktop PC and it can process simple commands (like 'continue'). Still ARM64 support lacks NativeRegisterContextLinux_arm64.* code which waits to be implemented. Based on similar files for Linux x86_64 and Darwin ARM64. Due to common code extraction from Darwin related files, lldb should be tested for any unexpected regression on Darwin ARM64 machines too. See the following for more details: http://reviews.llvm.org/D4580 http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012670.html Change by Paul Osmialowski. llvm-svn: 216737
* llgs: add proper exec support for Linux.Todd Fiala2014-08-285-10/+125
| | | | | | | | | | | | | | | This change: * properly captures execs in NativeProcessLinux. * clears out all non-main-thread thread metadata in NativeProcessLinux on exec. * adds a DidExec() method to the NativeProcessProtocol delegate. * clears out the auxv data cache when we exec (on Linux). This is a small part of the llgs for local Linux debugging work going on here: https://github.com/tfiala/lldb/tree/dev-llgs-local I'm breaking it into small patches. llvm-svn: 216670
* NativeThreadLinux: remove translation of some Linux signals to gdb signals.Todd Fiala2014-08-271-26/+14
| | | | | | | | | | | I copied this originally based on what debugserver was doing. This appears to be incorrect and unncessary for Linux. The LinuxSignals on the lldb side don't look for these and therefore they get handled incorrectly. Leaving the hook in place since I think darwin will continue to need to translate those signal numbers. llvm-svn: 216564
* lldb Missing ARM64 breakpoint opcode for ProcessPOSIX added.Todd Fiala2014-08-271-0/+6
| | | | | | | | See http://reviews.llvm.org/D5078. Change by Paul Osmialowski. llvm-svn: 216559
* lldb Missing break statement added.Todd Fiala2014-08-271-0/+1
| | | | | | | | See http://reviews.llvm.org/D5069. Change by Paul Osmialowski. llvm-svn: 216554
* Add Linux support for get thread area on ARM64 using ProcessMonitor debugging.Todd Fiala2014-08-271-5/+14
| | | | | | | | See http://reviews.llvm.org/D5073. Change by Paul Osmialowski. llvm-svn: 216553
* Don't have ProcessMachCore::CanDebug use the Target's arch whenJason Molenda2014-08-261-1/+5
| | | | | | | | | | creating the ModuleSpec to load the core file - we won't have a fat core file and we can end up with cpu subtype mismatches if the core file header isn't written out completely accurately. We need to be a little loose in this particular case. <rdar://problem/17843388> llvm-svn: 216498
* Fix llgs to send triple for non-Apple platforms and lldb to interpret correctly.Todd Fiala2014-08-262-3/+24
| | | | | | | | | | | | | This change addresses this bug: http://llvm.org/bugs/show_bug.cgi?id=20755 This change: * Modifies llgs to send triple instead of cputype and cpusubtype when not on Apple platforms in qProcessInfo. * Modifies lldb's GDBRemoteCommunicationClient to handle the triple returned from qProcessInfo if given. When given, it will prefer to use triple over cputype and cpusubtype. * Adds gdb-remote protocol tests to verify that cputype and cpusubtype are specified on darwin, and that triple is specified on Linux. llvm-svn: 216470
* On x86 & x86_64, try to use eh_frame for frame 0.Todd Fiala2014-08-251-2/+2
| | | | | | | | | | | | | We decided to use assmbly profiler instead of eh_frame for frame 0 because for compiler generated code, eh_frame is usually synchronous(a.k.a. only valid at call site); and we have no way to tell if it's asynchronous or not. But for x86 & x86_64 compiler generated code: 1. clang & GCC describes all prologue instructions in eh_frame; 2. mid-function stack pointer altering instructions can be easily detected. So we can grab eh_frame, and use assembly profiler to augment it into asynchronous unwind table. This change also benefits hand-written assembly; eh_frame for hand-written assembly is often asynchronous,so we have a much better chance to successfully unwind through them. Change by Tong Shen. llvm-svn: 216406
* Fixes a few more places where we were manually setting the filename.Zachary Turner2014-08-211-1/+1
| | | | llvm-svn: 216247
* Two small fixes to get Mac native + debugserver working after theJason Molenda2014-08-211-1/+1
| | | | | | | HostInfo et al changes from Zachary. Changes suggested by Zachary - fixes the problems I was seeing. llvm-svn: 216243
* Move GetUsername and GetGroupname to HostInfoPosixZachary Turner2014-08-211-2/+6
| | | | llvm-svn: 216210
* Move Host::GetLLDBPath to HostInfo.Zachary Turner2014-08-211-3/+4
| | | | | | | | This continues the effort to get Host code moved over to HostInfo, and removes many more instances of preprocessor defines along the way. llvm-svn: 216195
* Add software breakpoint support for Linux aarch64.Todd Fiala2014-08-211-0/+11
| | | | | | | | See http://reviews.llvm.org/D4969 for details. Change by Paul Osmialowski. llvm-svn: 216188
* Enable more Linux aarch64 PTRACE support for local and remote debugging.Todd Fiala2014-08-212-15/+105
| | | | | | | | See http://reviews.llvm.org/D4803 for more details. Change by Paul Osmialowski. llvm-svn: 216185
* Move Host::GetArchitecture to HostInfo::GetArchitecture.Zachary Turner2014-08-204-11/+14
| | | | | | | | As a side effect, this patch also eliminates all of the preprocessor conditionals previously used to implement GetArchitecture(). llvm-svn: 216074
* Move some Host logic into HostInfo class.Zachary Turner2014-08-192-6/+11
| | | | | | | | | | | | | | | | | | This patch creates a HostInfo class, a static class used to answer basic queries about the host platform. As part of this change, some functionality is moved from Host to HostInfo, and relevant fixups are performed in the rest of the codebase. This is part of a larger effort to isolate more code in the Host layer into platform-specific groups, to make it easier to make platform specific changes for a particular Host without breaking other hosts. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D4963 llvm-svn: 215992
* Fix Linux to respect ASLR settings when launching processes to debug locally ↵Todd Fiala2014-08-177-8/+94
| | | | | | | | | | and remotely. See the following links for details: http://llvm.org/bugs/show_bug.cgi?id=20658 See http://reviews.llvm.org/D4941 llvm-svn: 215822
* Move FileSystem functions out of Host and into their own classes.Zachary Turner2014-08-156-20/+18
| | | | | | | | | | | | | | | | 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
* Don't crash when specifying a core file that isn't readable.Greg Clayton2014-08-151-1/+1
| | | | | | | | | | | | | Fixes include: 1 - added new FileSpec method: bool FileSpec::Readable() 2 - detect when an executable is not readable and give an appropriate error for: (lldb) file /tmp/unreadablefile 3 - detect when a core file is not readable and give an appropriate error 4 - detect when a specified core file doesn't exist and give an appropriate error <rdar://problem/17727734> llvm-svn: 215741
* Refactor FileAction out of ProcessLaunchInfo.Zachary Turner2014-08-146-15/+17
| | | | | | | | | | | | | 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
* gcc_esp_i386 and gcc_ebp_i386 had their values backwards forJason Molenda2014-08-131-2/+10
| | | | | | | | | i386 eh_frame register numbering, encoding a darwin-specific bug in the register numbering. Update the definitions to be the correct values, Darwin can use the register numbers from debugserver. Patch from Tong Shen. llvm-svn: 215488
* llgs: corrected Linux signal reception notification for SIGABRT, SIGSEGV and ↵Todd Fiala2014-08-121-81/+84
| | | | | | | | | their ilk. Added llgs/debugserver gdb-remote tests around SIGABRT and SIGSEGV signal reception notification. Found a few bugs in exception signal handling in Linux llgs. Fixed those. llvm-svn: 215458
* Fix incorrect Linux i386 register info initialization on x86_64.Todd Fiala2014-08-121-1/+1
| | | | | | Fix by Tong Shen. llvm-svn: 215424
* Fix ProcessKDP after Host/Socket additionKeno Fischer2014-08-061-2/+3
| | | | | | | | | | Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D4815 llvm-svn: 214996
* Creates a socket host object.Zachary Turner2014-08-062-3/+4
| | | | | | | | | | | | | | | | | | This patch moves the logic of many common socket operations into its own class lldb_private::Socket. It then modifies the ConnectionFileDescriptor class, and a few users of that class, to use this new Socket class instead of hardcoding socket logic directly. Finally, this patch creates a common interface called IOObject for any objects that support reading and writing, so that endpoints such as sockets and files can be treated the same. Differential Revision: http://reviews.llvm.org/D4641 Reviewed by: Todd Fiala, Greg Clayton llvm-svn: 214984
* Teach ProcessWindows plugin to support stdio i/o redirection.Zachary Turner2014-08-041-11/+61
| | | | llvm-svn: 214816
* Change ProcessGDBRemote::DidLaunchOrAttach to Jason Molenda2014-08-031-2/+2
| | | | | | | | call Target::SetArchitecture instead of modifying a reference to the target's architecture so that the target logging can show that the arch has been changed. llvm-svn: 214667
* After you attach, give the process plugin a chance to report back (throughJim Ingham2014-08-024-16/+22
| | | | | | | | DidAttach) the architecture of the binary you attached to. <rdar://problem/17891396> llvm-svn: 214603
* Change the encoding of the Triple string exchanged across GDB-RSPMatthew Gardiner2014-08-012-11/+4
| | | | | | | | | | | and update documentation to suit, as suggested by Jason Molenda and discussed in: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140721/011978.html Differential Revision: http://reviews.llvm.org/D4704 llvm-svn: 214480
* Add $vAttach support to llgs.Todd Fiala2014-07-292-0/+45
| | | | | | Also adds a new test case for vAttach;{pid} for llgs and debugserver. llvm-svn: 214236
* Teach LLDB about Windows processes.Zachary Turner2014-07-284-0/+322
| | | | | | | | | This patch creates a simple ProcessWindows process plugin. The only thing it knows how to do currently is create processes. Differential Revision: http://reviews.llvm.org/D4681 llvm-svn: 214094
* Add debug asserts / sanity checks toJason Molenda2014-07-241-0/+19
| | | | | | | | | | | | | | GDBRemoteRegisterContext::ReadRegisterBytes and GDBRemoteRegisterContext::WriteRegisterBytes to ensure we don't try to read/write off the end of the register buffer. This should never happen but we've had some target confusion in the past where it did; adding the checks is prudent to avoid crashing here if it happens again. <rdar://problem/16450971> <rdar://problem/16458182> llvm-svn: 213829
* Increase the gdb-remote packet timeout for the first packet we sendJason Molenda2014-07-241-1/+11
| | | | | | | | | | | | | to the remote side (QStartNoAckMode) - it may take a little longer than normal to get a reply. In debugserver, hardcode the priority for several threads so they aren't de-prioritized when a user app is using system resources. Also, set the names of the threads. <rdar://problem/17509866> llvm-svn: 213828
* Update lldb to track recent Triple arm64 enum removal and collapse into aarch64.Todd Fiala2014-07-234-6/+6
| | | | | | | | | | | See the following llvm change for details: r213743 | tnorthover | 2014-07-23 05:32:47 -0700 (Wed, 23 Jul 2014) | 9 lines AArch64: remove arm64 triple enumerator. This change fixes build breaks on Linux and MacOSX lldb. llvm-svn: 213755
OpenPOWER on IntegriCloud