summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/POSIX
Commit message (Collapse)AuthorAgeFilesLines
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-32/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Use SI_KERNEL on platforms defining itStephane Sezer2015-09-141-2/+3
| | | | | | | | | | | | | | | | | Summary: Linux and FreeBSD occasionally send SI_KERNEL codes, nonexistent on other platforms. Problem caught on NetBSD. Reviewers: joerg, sas Subscribers: sas, lldb-commits, emaste Differential Revision: http://reviews.llvm.org/D12659 Change by Kamil Rytarowski <n54@gmx.com> llvm-svn: 247579
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Remove old local-only linux debugging codePavel Labath2015-06-2418-4657/+0
| | | | | | | | | | | | | | | | | | | | Summary: Currently, the local-only path fails about 50% of the tests, which means that: a) nobody is using it; and b) the remote debugging path is much more stable. This commit removes the local-only linux debugging code (ProcessLinux) and makes remote-loopback the only way to debug local applications (the same architecture as OSX). The ProcessPOSIX code is moved to the FreeBSD directory, which is now the only user of this class. Hopefully, FreeBSD will soon move to the new architecture as well and then this code can be removed completely. Test Plan: Test suite passes via remote stub. Reviewers: emaste, vharron, ovyalov, clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D10661 llvm-svn: 240543
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-292-49/+48
| | | | | | | | | | | | | | | | | 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
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-292-4/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Report inferior SIGSEGV as a signal instead of an exception on linuxPavel Labath2015-05-291-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we reported inferior receiving SIGSEGV (or SIGILL, SIGFPE, SIGBUS) as an "exception" to LLDB, presumably to match OSX behaviour. Beside the fact that we were basically lying to the user, this was also causing problems with inferiors which handle SIGSEGV by themselves, since LLDB was unable to reinject this signal back into the inferior. This commit changes LLGS to report SIGSEGV as a signal. This has necessitated some changes in the test-suite, which had previously used eStopReasonException to locate threads that crashed. Now it uses platform-specific logic, which in the case of linux searches for eStopReasonSignaled with signal=SIGSEGV. I have also added the ability to set the description of StopInfoUnixSignal using the description field of the gdb-remote packet. The linux stub uses this to display additional information about the segfault (invalid address, address access protected, etc.). Test Plan: All tests pass on linux and osx. Reviewers: ovyalov, clayborg, emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D10057 llvm-svn: 238549
* Initial FreeBSD/arm live debugging supportEd Maste2015-05-131-0/+4
| | | | | | | Patch by Tom Rix, except using the RegisterContextFreeBSD_arm files added in r235305 instead. llvm-svn: 237303
* Remove DoAttachToProcessWithId(lldb::pid_t).Zachary Turner2015-05-132-10/+1
| | | | | | | | | | There were two versions of DoAttachToprocessWithId. One that takes a pid_t, and the other which takes a pid_t and a ProcessAttachInfo. There were no callers of the former version, and all of the implementations of this version were simply forwarding calls to one version or the other. llvm-svn: 237281
* Get lldb-server building on android-9Vince Harron2015-05-121-0/+2
| | | | | | Build lldb-server with an android-9 sysroot. llvm-svn: 237078
* Adds Register Context Linux/POSIX for ARM Architecture Omair Javaid2015-04-145-0/+461
| | | | | | | | This patch is major step towards supporting lldb on ARM. This adds all the required bits to support register manipulation on Linux Arm. Also adds utility enumerations, definitions and register context classes for arm. llvm-svn: 234870
* Fix compilation failure caused by r234366.Chaoren Lin2015-04-071-1/+1
| | | | llvm-svn: 234373
* Make sure the OperatingSystem plug-ins will work on linux as well. This goes ↵Greg Clayton2015-04-071-1/+4
| | | | | | with my previous fix with revision 234364. llvm-svn: 234366
* Remove dead code in ProcessPOSIX.Davide Italiano2015-04-011-33/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D8761 llvm-svn: 233831
* Remove virtual and add override for lots of function.Tamas Berghammer2015-03-252-45/+45
| | | | | | | | | | Effeted pathes: * Host/posix/* * Platform/gdb-server/* * Process/Linux/* * Process/POSIX/* llvm-svn: 233193
* Create NativeRegisterContext for android-arm64Tamas Berghammer2015-03-131-0/+3
| | | | | | Differential revision: http://reviews.llvm.org/D8058 llvm-svn: 232160
* Initialize ProcessGDBRemoteLog for LLGS to fix remote platform loggingRobert Flack2015-03-112-0/+24
| | | | | | | | This was previously initialized by ProcessGDBRemote::Initialize but lldb-server does not contain ProcessGDBRemote anymore so this needs to be initialized directly. Differential Revision: http://reviews.llvm.org/D8186 llvm-svn: 231966
* Don't #include ClangPersistentVariables.h from Process.hZachary Turner2015-03-034-4/+8
| | | | | | | Nothing from this header file was even being referenced in Process.h anyway, so it was a completely unnecessary include. llvm-svn: 231131
* Fix TestProcesslaunch regression caused by D7372Pavel Labath2015-02-061-1/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: After closing all the leaked file descriptors to the inferior tty, the following problem occured: - when stdin, stdout and stderr are redirected, there are no slave descriptors open (which is good) - lldb has a reader thread, which attempts to read from the master end of the tty - this thread receives an EOF - in response, it closes it's master end - as this is the last open file descriptor for the master end, this deletes the tty and sends SIGHUP to the inferior (this is bad) I fix this problem by making sure the master end remains open for the duration of the inferior process by storing a copy of the file descriptor in ProcessMonitor. I create a copy to avoid ownership issues with the reading thread. Reviewers: ovyalov, emaste Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7440 llvm-svn: 228391
* Implement initial Altivec supportJustin Hibbits2015-02-052-0/+23
| | | | | | | | | | | | | | | | | Summary: This adds the register plumbing, as well as register reading in FreeBSD core dumps. Further work on the POSIX/FreeBSD ProcessMonitor is required in order to support ptrace access to these registers. Reviewers: tfiala, emaste Reviewed By: emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D7039 llvm-svn: 228278
* Add PowerPC FPR access to the process monitorJustin Hibbits2015-02-051-21/+22
| | | | | | | | | | | | | | Summary: This adds reading and writing to the POSIX PowerPC ProcessMonitor. Reviewers: emaste Reviewed By: emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D7040 llvm-svn: 228277
* Share crash information between LLGS and local POSIX debugging withChaoren Lin2015-02-037-254/+402
| | | | | | | CrashReason class. Deliver crash information from LLGS to lldb via description field of thread stop packet. llvm-svn: 227926
* Add test for denied process attach by pid and fix found bugs in ↵Oleksiy Vyalov2014-11-191-0/+5
| | | | | | | | | | Process/ProcessPOSIX.cpp and FreeBSD/ProcessMonitor. http://reviews.llvm.org/D6240 llvm-svn: 222372
* Fix broken Linux build after signature change of ResolveExecutable.Oleksiy Vyalov2014-11-171-6/+7
| | | | llvm-svn: 222182
* Improve PowerPC unwind supportJustin Hibbits2014-11-121-1/+6
| | | | | | | | | | | | | | | | | Summary: Taking advantage of the new 'CFAIsRegisterDereferenced' CFA register type, add full stack unwind support to the PowerPC/PowerPC64 ABI. Also, add a new register set for powerpc32-on-64, so the register sizes are correct. This also requires modifying the ProcessMonitor to add support for non-uintptr_t-sized register values. Reviewers: jasonmolenda, emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D6183 llvm-svn: 221789
* Fix a bunch of [-Werror,-Winconsistent-missing-override] errors.Eric Christopher2014-11-041-28/+28
| | | | llvm-svn: 221231
* First cut of PowerPC(64) support in LLDB.Justin Hibbits2014-10-314-0/+434
| | | | | | | | | | | | | | | | | | | | | | | 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
* Minor tweak to Ed's FreeBSD fix.Todd Fiala2014-10-011-1/+1
| | | | | | | Fall back to including the Linux version if not on __FreeBSD__. Also covers __ANDROID__ case. llvm-svn: 218770
* Add a bandaid to fix the FreeBSD buildEd Maste2014-10-011-0/+4
| | | | | | | | | | | | r218568 added an explicit #include of the Linux ProcessMonitor.h to POSIXThread.cpp, rather than including just "ProcessMonitor.h" and relying on the build infrastructure for the appropriate paths. For now add #ifdefs in the source to use the FreeBSD or Linux header as appropriate; a cleaner fix (and perhaps some refactoring of the POSIX classes) should still be done later. llvm-svn: 218762
* Enable llgs to build against experimental Android AOSP ↵Todd Fiala2014-09-276-17/+17
| | | | | | | | | | | | 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
* use std::atomic<> to protect variables being accessed by multiple threadsTodd Fiala2014-09-151-2/+1
| | | | | | | | | | There are several places where multiple threads are accessing the same variables simultaneously without any kind of protection. I propose using std::atomic<> to make it safer. I did a special build of lldb, using the google tool 'thread sanitizer' which identified many cases of multiple threads accessing the same memory. std::atomic is low overhead and does not use any locks for simple types such as int/bool. See http://reviews.llvm.org/D5302 for more details. Change by Shawn Best. llvm-svn: 217818
* Create a HostThread abstraction.Zachary Turner2014-09-091-1/+5
| | | | | | | | | | | | | 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
* Fix configure & make build with python disabledKeno Fischer2014-09-091-4/+4
| | | | | | | | | | | | | 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
* Linux ARM64: add ProcessMonitor-related RegisterContext support.Todd Fiala2014-09-024-0/+424
| | | | | | | | 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-292-16/+4
| | | | | | | | | | | | | | | | 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
* lldb - Register Context Linux ARM64Todd Fiala2014-08-291-0/+5
| | | | | | | | | | | | | 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
* 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
* Move Host::GetArchitecture to HostInfo::GetArchitecture.Zachary Turner2014-08-201-4/+6
| | | | | | | | As a side effect, this patch also eliminates all of the preprocessor conditionals previously used to implement GetArchitecture(). llvm-svn: 216074
* Fix Linux to respect ASLR settings when launching processes to debug locally ↵Todd Fiala2014-08-171-0/+1
| | | | | | | | | | 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-152-7/+3
| | | | | | | | | | | | | | | | 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-142-4/+4
| | | | | | | | | | | | | 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
* Fix typos.Bruce Mitchener2014-07-011-1/+1
| | | | llvm-svn: 212132
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-302-0/+16
| | | | | | | | | | | | | | | | | | | | | This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64. (More architectures coming soon). Not every debugserver option is covered yet. Currently the lldb-gdbserver command line can start unattached, start attached to a pid (process-name attach not supported yet), or accept lldb attaching and launching a process or connecting by process id. The history of this large change can be found here: https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64 Until mid/late April, I was not sharing the work and continued to rebase it off of head (developed via id tfiala@google.com). I switched over to user todd.fiala@gmail.com in the middle, and once I went to github, I did merges rather than rebasing so I could share with others. llvm-svn: 212069
* Remove useless callSylvestre Ledru2014-06-211-1/+0
| | | | llvm-svn: 211454
* Refactored RegisterInfoInterface into its own header.Todd Fiala2014-05-164-4/+4
| | | | | | | | | Also moved it into the lldb_private namespace. The llgs branch is making use of this interface and its use is not strictly limited to POSIX. llvm-svn: 209016
* Address hung tests in Linux.Todd Fiala2014-04-181-1/+1
| | | | | | Follow-up patch coming to address test failures exposed by this change. llvm-svn: 206618
* Use getpgid() with waitpid() in case the process pgid is not equal to its ↵Andrew MacPherson2014-04-021-2/+10
| | | | | | pid, as is the case with a forked subprocess. Also a couple of fixes for unit test failures from Todd Fiala. llvm-svn: 205405
* Implement ProcessMonitor::Kill for LinuxEd Maste2014-04-011-4/+0
| | | | | | | | | | | | | | | | | | | | | On FreeBSD ptrace(PT_KILL) is used to terminate the traced process (as if PT_CONTINUE had been used with SIGKILL as the signal to be delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy. On Linux, after ptrace(PTRACE_KILL) the traced process still exists and can be interrogated. It is only upon resume that it exits as though it received SIGKILL. As the Linux PTRACE_KILL behaviour is not used by LLDB, rename BringProcessIntoLimbo to Kill, and change the implementation to simply call kill() instead of using ptrace. Thanks to Todd F for testing (Ubuntu 12.04, gcc 4.8.2). Sponsored by: DARPA, AFRL Differential Revision: http://llvm-reviews.chandlerc.com/D3159 llvm-svn: 205337
* Implement ProcessMonitor::Kill for FreeBSDEd Maste2014-04-011-3/+5
| | | | | | | | | | | | | | | | | On FreeBSD ptrace(PT_KILL) is used to terminate the traced process (as if PT_CONTINUE had been used with SIGKILL as the signal to be delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy. On Linux, after ptrace(PTRACE_KILL) the traced process still exists and can be interrogated. It is only upon resume that it exits as though it received SIGKILL. For now I'm committing only the FreeBSD change, until the Linux change (review D3159) is successfully tested. http://llvm.org/pr18894 llvm-svn: 205315
OpenPOWER on IntegriCloud