summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/ProcessLinux.h
AgeCommit message (Collapse)Author
2015-06-24Remove old local-only linux debugging codePavel Labath
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
2015-05-13Fixed a ton of gcc compile warningsVince Harron
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
2015-03-31Move several plugin to its own namespaceTamas Berghammer
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
2015-03-25Remove virtual and add override for lots of function.Tamas Berghammer
Effeted pathes: * Host/posix/* * Platform/gdb-server/* * Process/Linux/* * Process/POSIX/* llvm-svn: 233193
2014-09-27Enable llgs to build against experimental Android AOSP ↵Todd Fiala
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
2014-08-29Consolidate UnixSignals setting/getting in Process.Todd Fiala
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
2014-06-30Add lldb-gdbserver support for Linux x86_64.Todd Fiala
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
2014-03-25Make ProcessLinux return true for DetachRequiresHalt() because PTRACE_DETACH ↵Andrew MacPherson
requires this. llvm-svn: 204759
2013-12-11Fix Linux by partially reverting 196787Ed Maste
llvm-svn: 197065
2013-12-09Fix Linux build after r196787Ed Maste
Patch from Xavier de Gaye llvm-svn: 196830
2013-12-09Threaded inferior support for FreeBSDEd Maste
Modelled in part on GDBRemoteCommunicationClient. Review: http://llvm-reviews.chandlerc.com/D2267 llvm-svn: 196787
2013-12-04Correct header guard #endif commentsEd Maste
llvm-svn: 196381
2013-08-30Move detach to FreeBSD- and Linux-specific classes.Ed Maste
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
2013-07-31Fix thread name updating in Linux. "thread list" should report correct names ↵Michael Sartain
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
2013-07-17Re-introduces ELF core file support for Linux x86-64Ashok Thirumurthi
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
2013-07-12Revert the ELF core file support until a few things can be worked out:Greg Clayton
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
2013-07-12Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.Ashok Thirumurthi
TODO: Support for RegisterContext_x86_64::ReadFPR. Patch by Samuel Jacob! llvm-svn: 186207
2013-05-28Adding support for stopping all threads of multithreaded inferiors on Linux. ↵Andrew Kaylor
Also adding multithreaded test cases. llvm-svn: 182809
2013-05-17The Linux process plugin wasn't returning the correct linux signals. This ↵Matt Kopec
fixes that. Thus, this patch also negates a previous fix for handling SIGCHLD. llvm-svn: 182166
2013-05-10<rdar://problem/13854277>Greg Clayton
<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
2012-04-12Remove the GetSequenceMutex timeout that isn't being used in the GDB remote ↵Greg Clayton
plug-in. Also fixed the ProcessLinux, ProcessPOSIX and ProcessFreeBSD to have the correct UpdateThreadList() prototype. llvm-svn: 154603
2012-02-21Linux fix patch from Dmitry Vyukov.Greg Clayton
llvm-svn: 151072
2012-01-05This patch combines common code from Linux and FreeBSD intoJohnny Chen
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
2011-11-05Patch from Dragos Tatulea which was a modified version of a patch fromGreg Clayton
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
2011-10-18This patch fixes debugging of single threaded apps on Linux. Johnny Chen
It also adds some asserts and additional logging support. from dawn@burble.org llvm-svn: 142384
2011-10-10Patch from dawn@burble.org to build on linux!Johnny Chen
llvm-svn: 141593
2011-07-22Update ProcessLinux::CanDebug prototypePeter Collingbourne
llvm-svn: 135791
2011-06-03Implement ProcessLinux::Do{Allocate,Deallocate}Memory using inferior ↵Peter Collingbourne
mmap/munmap calls llvm-svn: 132585
2011-03-30linux: initial support for 'real' signal handlingStephen Wilson
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
2011-03-23linux: simple support for process input and outputStephen Wilson
llvm-svn: 128137
2011-02-16The DynamicLoader plug-in instance now lives up in lldb_private::Process whereGreg Clayton
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
2011-01-23Added a new variant of SBTarget::Launch() that deprectates the old one thatGreg Clayton
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
2011-01-16Initial support for a DynamicLoader plugin on Linux.Stephen Wilson
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
2011-01-15Implement ProcessLinux::GetImageInfoAddress().Stephen Wilson
llvm-svn: 123499
2011-01-04Do not load sections manually when launching a Linux process.Stephen Wilson
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
2011-01-04Update ProcessLinux method signatures to be in line with LLDB's current API.Stephen Wilson
llvm-svn: 122836
2010-07-24Add a new Process plugin for Linux.Stephen Wilson
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