summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/ProcessLinux.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove old local-only linux debugging codePavel Labath2015-06-241-110/+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
* Fixed a ton of gcc compile warningsVince Harron2015-05-131-2/+2
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Move several plugin to its own namespaceTamas Berghammer2015-03-311-22/+27
| | | | | | | | | | | | | Affected paths: * Plugins/Platform/Android/* * Plugins/Platform/Linux/* * Plugins/Platform/gdb-server/* * Plugins/Process/Linux/* * Plugins/Process/gdb-remote/* Differential revision: http://reviews.llvm.org/D8654 llvm-svn: 233679
* Remove virtual and add override for lots of function.Tamas Berghammer2015-03-251-16/+16
| | | | | | | | | | Effeted pathes: * Host/posix/* * Platform/gdb-server/* * Process/Linux/* * Process/POSIX/* llvm-svn: 233193
* Enable llgs to build against experimental Android AOSP ↵Todd Fiala2014-09-271-2/+2
| | | | | | | | | | | | 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
* Consolidate UnixSignals setting/getting in Process.Todd Fiala2014-08-291-14/+0
| | | | | | | | | | | | | | | | 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 lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-301-2/+3
| | | | | | | | | | | | | | | | | | | | | 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
* Make ProcessLinux return true for DetachRequiresHalt() because PTRACE_DETACH ↵Andrew MacPherson2014-03-251-0/+3
| | | | | | requires this. llvm-svn: 204759
* Fix Linux by partially reverting 196787Ed Maste2013-12-111-6/+0
| | | | llvm-svn: 197065
* Fix Linux build after r196787Ed Maste2013-12-091-0/+3
| | | | | | Patch from Xavier de Gaye llvm-svn: 196830
* Threaded inferior support for FreeBSDEd Maste2013-12-091-0/+3
| | | | | | | Modelled in part on GDBRemoteCommunicationClient. Review: http://llvm-reviews.chandlerc.com/D2267 llvm-svn: 196787
* Correct header guard #endif commentsEd Maste2013-12-041-1/+1
| | | | llvm-svn: 196381
* Move detach to FreeBSD- and Linux-specific classes.Ed Maste2013-08-301-0/+3
| | | | | | | | | On Linux there is no separate notion of a process (vs. a thread) for ptrace(); each thread needs to be individually detached. On FreeBSD we have a separate process context, and we detach just it. Review: http://llvm-reviews.chandlerc.com/D1418 llvm-svn: 189666
* Fix thread name updating in Linux. "thread list" should report correct names ↵Michael Sartain2013-07-311-0/+4
| | | | | | | | | | | always now. Created new LinuxThread class inherited from POSIXThread and removed linux / freebsd ifdefs Removed several un-needed set thread name calls CR (and multiple suggestions): mkopec llvm-svn: 187545
* Re-introduces ELF core file support for Linux x86-64Ashok Thirumurthi2013-07-171-1/+7
| | | | | | | | | | Usage: 'lldb a.out -c core'. TODO: FreeBSD support. TODO: Support for AVX registers. TODO: Refactor so that RegisterContextCore* don't inherit from classes that use ProcessMonitor to fix the build on OS/X. llvm-svn: 186516
* Revert the ELF core file support until a few things can be worked out:Greg Clayton2013-07-121-7/+1
| | | | | | | | | | | | | | | | | | | | | | | RegisterContextCoreLinux_x86_64 inherits from RegisterContextLinux_x86_64 which inherits from RegisterContext_x86_64 which uses has: ProcessMonitor &GetMonitor(); This register context used by the core file can't use this since the process plug-in will be ProcessElfCore and the implementation of GetMonitor() does: ProcessMonitor & RegisterContext_x86_64::GetMonitor() { ProcessSP base = CalculateProcess(); ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get()); return process->GetMonitor(); } ProcessELFCore doesn't, nor should it inherit from ProcessPOSIX and any call to GetMonitor() will fail for ELF core files. Suggested cleanups: - Make a register context class that is a base class that doesn't have any reading smarts, then make one that uses ProcessPOSIX and the has the GetMonitor() call, and one that gets its data straight from the core file. llvm-svn: 186223
* Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.Ashok Thirumurthi2013-07-121-1/+7
| | | | | | | | TODO: Support for RegisterContext_x86_64::ReadFPR. Patch by Samuel Jacob! llvm-svn: 186207
* Adding support for stopping all threads of multithreaded inferiors on Linux. ↵Andrew Kaylor2013-05-281-0/+8
| | | | | | Also adding multithreaded test cases. llvm-svn: 182809
* The Linux process plugin wasn't returning the correct linux signals. This ↵Matt Kopec2013-05-171-0/+9
| | | | | | | | fixes that. Thus, this patch also negates a previous fix for handling SIGCHLD. llvm-svn: 182166
* <rdar://problem/13854277>Greg Clayton2013-05-101-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* Remove the GetSequenceMutex timeout that isn't being used in the GDB remote ↵Greg Clayton2012-04-121-1/+1
| | | | | | | | plug-in. Also fixed the ProcessLinux, ProcessPOSIX and ProcessFreeBSD to have the correct UpdateThreadList() prototype. llvm-svn: 154603
* Linux fix patch from Dmitry Vyukov.Greg Clayton2012-02-211-2/+3
| | | | llvm-svn: 151072
* This patch combines common code from Linux and FreeBSD intoJohnny Chen2012-01-051-139/+3
| | | | | | | | | | a new POSIX platform. It also contains fixes for 64bit FreeBSD. The patch is based on changes by Mark Peek <mp@FreeBSD.org> and "K. Macy" <kmacy@freebsd.org> in their github repo located at https://github.com/fbsd/lldb. llvm-svn: 147609
* Patch from Dragos Tatulea which was a modified version of a patch fromGreg Clayton2011-11-051-8/+2
| | | | | | | | | Joel Dillon that fixed 64 debugging for Linux. I also added a patch to fix up the ProcessLinux::DoLaunch() to be up to date. I wasn't able to verify it compiles, but it should b really close. llvm-svn: 143772
* This patch fixes debugging of single threaded apps on Linux. Johnny Chen2011-10-181-1/+2
| | | | | | | | It also adds some asserts and additional logging support. from dawn@burble.org llvm-svn: 142384
* Patch from dawn@burble.org to build on linux!Johnny Chen2011-10-101-0/+4
| | | | llvm-svn: 141593
* Update ProcessLinux::CanDebug prototypePeter Collingbourne2011-07-221-1/+1
| | | | llvm-svn: 135791
* Implement ProcessLinux::Do{Allocate,Deallocate}Memory using inferior ↵Peter Collingbourne2011-06-031-4/+3
| | | | | | mmap/munmap calls llvm-svn: 132585
* linux: initial support for 'real' signal handlingStephen Wilson2011-03-301-0/+20
| | | | | | | | This patch upgrades the Linux process plugin to handle a larger range of signal events. For example, we can detect when the inferior has "crashed" and why, interrupt a running process, deliver an arbitrary signal, and so on. llvm-svn: 128547
* linux: simple support for process input and outputStephen Wilson2011-03-231-0/+9
| | | | llvm-svn: 128137
* The DynamicLoader plug-in instance now lives up in lldb_private::Process whereGreg Clayton2011-02-161-6/+0
| | | | | | | | | | | | | | | | | it should live and the lldb_private::Process takes care of managing the auto pointer to the dynamic loader instance. Also, now that the ArchSpec contains the target triple, we are able to correctly set the Target architecture in DidLaunch/DidAttach in the subclasses, and then the lldb_private::Process will find the dynamic loader plug-in by letting the dynamic loader plug-ins inspect the arch/triple in the target. So now the ProcessGDBRemote plug-in is another step closer to be purely process/platform agnostic. I updated the ProcessMacOSX and the ProcessLinux plug-ins accordingly. llvm-svn: 125650
* Added a new variant of SBTarget::Launch() that deprectates the old one thatGreg Clayton2011-01-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | takes separate file handles for stdin, stdout, and stder and also allows for the working directory to be specified. Added support to "process launch" to a new option: --working-dir=PATH. We can now set the working directory. If this is not set, it defaults to that of the process that has LLDB loaded. Added the working directory to the host LaunchInNewTerminal function to allows the current working directory to be set in processes that are spawned in their own terminal. Also hooked this up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its API changed, but nothing is making use of it yet. Modfied "debugserver" and "darwin-debug" to also handle the current working directory options and modified the code in LLDB that spawns these tools to pass the info along. Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout and stderr. After clearing the default values for the stdin/out/err file handles for process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable which is now fixed. Also fixed the setting of boolean values to be able to be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no", "off", or "0" for false. Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not already opened. Previous to this fix debugserver would only correctly open and dupe file handles for the slave side of a pseudo terminal. It now correctly handles getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to files. Also made sure the file handles were correctly opened with the NOCTTY flag for terminals. llvm-svn: 124060
* Initial support for a DynamicLoader plugin on Linux.Stephen Wilson2011-01-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This patch is enough to have shared objects recognized by LLDB. We can handle position independent executables. We can handle dynamically loaded modules brought in via dlopen. The DYLDRendezvous class provides an interface to a structure present in the address space of ELF-based processes. This structure provides the address of a function which is called by the linker each time a shared object is loaded and unloaded (thus a breakpoint at that address will let LLDB intercept such events), a list of entries describing the currently loaded shared objects, plus a few other things. On Linux, processes are brought up with an auxiliary vector on the stack. One element in this vector contains the (possibly dynamic) entry address of the process. One does not need to walk the stack to find this information as it is also available under /proc/<pid>/auxv. The new AuxVector class provides a convenient read-only view of this auxiliary vector information. We use the dynamic entry address and the address as specified in the object file to compute the actual load address of the inferior image. This strategy works for both normal executables and PIE's. llvm-svn: 123592
* Implement ProcessLinux::GetImageInfoAddress().Stephen Wilson2011-01-151-0/+3
| | | | llvm-svn: 123499
* Do not load sections manually when launching a Linux process.Stephen Wilson2011-01-041-3/+0
| | | | | | | | This code was a temporary workaround due to the lack of a dynamic loader plugin for the Linux platform that has bit rotted over time. Instead of replacing this hack with another a proper plugin will be developed instead. llvm-svn: 122837
* Update ProcessLinux method signatures to be in line with LLDB's current API.Stephen Wilson2011-01-041-1/+2
| | | | llvm-svn: 122836
* Add a new Process plugin for Linux.Stephen Wilson2010-07-241-0/+188
This component is still at an early stage, but allows for simple breakpoint/step-over operations and basic process control. The makefiles are set up to build the plugin under Linux only. llvm-svn: 109318
OpenPOWER on IntegriCloud