summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux
Commit message (Collapse)AuthorAgeFilesLines
* FreeBSD hardware watchpoint implementationEd Maste2014-02-192-25/+0
| | | | | | | | | | | | | | | Implement x86_64 debug register read/write in support of hardware watchpoints. Hoist LinuxThread::TraceNotify code back into POSIXThread::TraceNotify() Patch by John Wolfe. We still need to rework this later to avoid the #ifdef FreeBSD. llvm-reviews.chandlerc.com/D2572 llvm.org/pr16706 llvm-svn: 201706
* Fix group stop signal handling issue on Linux.Todd Fiala2014-01-271-5/+14
| | | | | | | | | | This patch addresses a bug where in a multi-threaded program a new signal from the inferior may be received before all group-stop messages from an earlier signal have been handled. Patch by Andrew MacPherson llvm-svn: 200226
* Fix crash on Linux if sem_wait() is interrupted.Todd Fiala2014-01-241-2/+12
| | | | | | Patch by Andrew MacPherson. llvm-svn: 200049
* Fix Linux by partially reverting 196787Ed Maste2013-12-114-176/+1
| | | | llvm-svn: 197065
* Fix Linux build after r196787Ed Maste2013-12-094-2/+9
| | | | | | Patch from Xavier de Gaye llvm-svn: 196830
* Threaded inferior support for FreeBSDEd Maste2013-12-094-2/+170
| | | | | | | 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
* Removed unnecessary call to OpenFirstAvailableMaster.Richard Mitton2013-10-171-8/+0
| | | | | | | | ::Fork already does this internally, so this was simply leaking file handles. This fixes the problem where the test suite would occasionally run out of file handles. llvm-svn: 192929
* Added support for reading thread-local storage variables, as defined using ↵Richard Mitton2013-10-172-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the __thread modifier. To make this work this patch extends LLDB to: - Explicitly track the link_map address for each module. This is effectively the module handle, not sure why it wasn't already being stored off anywhere. As an extension later, it would be nice if someone were to add support for printing this as part of the modules list. - Allow reading the per-thread data pointer via ptrace. I have added support for Linux here. I'll be happy to add support for FreeBSD once this is reviewed. OS X does not appear to have __thread variables, so maybe we don't need it there. Windows support should eventually be workable along the same lines. - Make DWARF expressions track which module they originated from. - Add support for the DW_OP_GNU_push_tls_address DWARF opcode, as generated by gcc and recent versions of clang. Earlier versions of clang (such as 3.2, which is default on Ubuntu right now) do not generate TLS debug info correctly so can not be supported here. - Understand the format of the pthread DTV block. This is where it gets tricky. We have three basic options here: 1) Call "dlinfo" or "__tls_get_addr" on the inferior and ask it directly. However this won't work on core dumps, and generally speaking it's not a good idea for the debugger to call functions itself, as it has the potential to not work depending on the state of the target. 2) Use libthread_db. This is what GDB does. However this option requires having a version of libthread_db on the host cross-compiled for each potential target. This places a large burden on the user, and would make it very hard to cross-debug from Windows to Linux, for example. Trying to build a library intended exclusively for one OS on a different one is not pleasant. GDB sidesteps the problem and asks the user to figure it out. 3) Parse the DTV structure ourselves. On initial inspection this seems to be a bad option, as the DTV structure (the format used by the runtime to manage TLS data) is not in fact a kernel data structure, it is implemented entirely in useerland in libc. Therefore the layout of it's fields are version and OS dependent, and are not standardized. However, it turns out not to be such a problem. All OSes use basically the same algorithm (a per-module lookup table) as detailed in Ulrich Drepper's TLS ELF ABI document, so we can easily write code to decode it ourselves. The only question therefore is the exact field layouts required. Happily, the implementors of libpthread expose the structure of the DTV via metadata exported as symbols from the .so itself, designed exactly for this kind of thing. So this patch simply reads that metadata in, and re-implements libthread_db's algorithm itself. We thereby get cross-platform TLS lookup without either requiring third-party libraries, while still being independent of the version of libpthread being used. Test case included. llvm-svn: 192922
* Add exec support for Linux including common support for POSIX.Matt Kopec2013-10-091-2/+4
| | | | llvm-svn: 192319
* Clean up RegisterContextPOSIX i386 code.Michael Sartain2013-10-091-1/+2
| | | | | | | | | | | Use 32-bit register enums without gaps on 64-bit hosts. Don't show 64-bit registers when debugging 32-bit targets. Add psuedo gpr registers (ax, ah, al, etc.) Add mmx registers. Fix TestRegisters.py to not read ymm15 register on 32-bit targets. Fill out and move gcc/dwarf/gdb register enums to RegisterContext_x86.h llvm-svn: 192263
* If setgid fails for any reason, exit lldb.Sylvestre Ledru2013-09-281-2/+7
| | | | | | | scan-build was complaining about: The return value from the call to 'setgid' is not checked. If an error occurs in 'setgid', the following code may execute with unexpected privileges llvm-svn: 191618
* Fix build failures under GNU/Linux running on mipsSylvestre Ledru2013-09-191-0/+2
| | | | llvm-svn: 191027
* Warning cleanup.Michael Sartain2013-09-181-6/+5
| | | | llvm-svn: 190942
* Fixing a problem with thread creation signal order dependencyAndrew Kaylor2013-09-172-0/+78
| | | | llvm-svn: 190831
* Improve stability of Linux ProcessMonitor by not using fds for synchronization:Daniel Malea2013-09-162-113/+33
| | | | | | | | | | | | | | | | | | - ProcessMonitor::[Do|Serve]Operation no longer depend on file descriptors! - removed unused member functions CloseFD and EnableIPC - add semaphores to signal when an Operation is ready to be processed/complete. This commit fixes a bug that was identified under stress-testing (i.e. build LLVM while running tests) that led to LLDB becoming unresponsive because the read/write operations on file descriptors in ProcessMonitor were not checked. Other test runner improvement/convenience: - pickup environment variables LLDB_LINUX_LOG and LLDB_LINUX_LOG_OPTIONS to enable (Linux) logging when running the test suite. Example usage: $ LLDB_LINUX_LOG="mylog.txt" LLDB_LINUX_LOG_OPTIONS="process thread" python dotest.py llvm-svn: 190820
* Clean up RegisterContextPOSIX. Renamed to POSIXBreakpointProtocol.Michael Sartain2013-09-141-1/+1
| | | | | | Will clean up header files and m_register_infos shortly. llvm-svn: 190757
* Stop closing terminal fd from ProcessMonitor. It is owned by ↵Andrew Kaylor2013-09-141-1/+4
| | | | | | ConnectionFileDescriptor. llvm-svn: 190733
* Fixing a problem with inferior exit caused by signalAndrew Kaylor2013-09-041-0/+6
| | | | llvm-svn: 189953
* Move detach to FreeBSD- and Linux-specific classes.Ed Maste2013-08-302-0/+32
| | | | | | | | | 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
* Handle SI_KERNEL signal code for SIGSEGV exceptions.Matt Kopec2013-08-091-0/+6
| | | | | | Patch by Richard Mitton. llvm-svn: 188075
* Fix thread name updating in Linux. "thread list" should report correct names ↵Michael Sartain2013-07-316-12/+123
| | | | | | | | | | | 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-172-5/+25
| | | | | | | | | | 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
* Correct comment to match class nameEd Maste2013-07-171-1/+1
| | | | llvm-svn: 186509
* Revert the ELF core file support until a few things can be worked out:Greg Clayton2013-07-122-25/+4
| | | | | | | | | | | | | | | | | | | | | | | 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-122-4/+25
| | | | | | | | TODO: Support for RegisterContext_x86_64::ReadFPR. Patch by Samuel Jacob! llvm-svn: 186207
* Fix unhandled SIGTRAP signal on Linux causing assertion.Matt Kopec2013-07-111-0/+7
| | | | llvm-svn: 186112
* Stop process monitor from ProcessPOSIX::FinalizeAndrew Kaylor2013-07-101-3/+4
| | | | llvm-svn: 186039
* Add support for listing inferior thread names on Linux.Matt Kopec2013-07-101-0/+10
| | | | llvm-svn: 186033
* Reverting ProcessMonitor shared pointer changesAndrew Kaylor2013-07-092-8/+8
| | | | llvm-svn: 185981
* Use shared pointers to hold the process in ProcessMonitorAndrew Kaylor2013-07-092-8/+8
| | | | llvm-svn: 185946
* Fix signal handling for POSIX (only tested on Linux) processes in ↵Matt Kopec2013-07-091-3/+25
| | | | | | | | multi-threaded programs. Also fix a related issue where if a thread exits after a thread continue, lldb would hang. llvm-svn: 185944
* Remove empty files left behind from move to POSIX/Ed Maste2013-07-031-0/+0
| | | | llvm-svn: 185559
* Update comment to match class nameEd Maste2013-06-241-1/+1
| | | | llvm-svn: 184745
* Fix various build warnings.Matt Kopec2013-06-031-2/+2
| | | | llvm-svn: 183140
* Add ability to attach/detach to multi-threaded inferiors on Linux.Matt Kopec2013-05-312-42/+103
| | | | | | All running threads will be detected and stopped on attach and all threads get resumed on detach. llvm-svn: 183049
* Adding support for stopping all threads of multithreaded inferiors on Linux. ↵Andrew Kaylor2013-05-284-7/+256
| | | | | | Also adding multithreaded test cases. llvm-svn: 182809
* The Linux process plugin wasn't returning the correct linux signals. This ↵Matt Kopec2013-05-172-11/+9
| | | | | | | | fixes that. Thus, this patch also negates a previous fix for handling SIGCHLD. llvm-svn: 182166
* ProcessMonitor improvements for Linux.Matt Kopec2013-05-171-3/+28
| | | | | | | | -Remove tracing of fork/vfork until we add support for tracing inferiors' children on Linux. -Add trace exec option for ptrace so that we don't receive legacy SIGTRAP signals on execve calls. -Add handling of SIGCHLD sent by kernel (for now, deliver the signal to the inferior). llvm-svn: 182153
* Fix Linux warning about missing virtual destructor in Operation classesDaniel Malea2013-05-131-0/+1
| | | | llvm-svn: 181712
* <rdar://problem/13854277>Greg Clayton2013-05-102-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <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
* Fixed "log enable linux registers" and added a test.Ashok Thirumurthi2013-05-092-15/+14
| | | | | | | | | | - Eliminated the use of static for methods that read m_register_infos, so that these routines can be implemented in the base class. - Eliminated m_register_infos in the base class because this is not used when derived classes call UpdateRegisterInfo. - Also moved the namespace using declarations from headers to source files. Thanks to Daniel and Samuel for their review feedback. llvm-svn: 181538
* Add watchpoint support for Linux on 64-bit host.Matt Kopec2013-05-071-0/+9
| | | | llvm-svn: 181341
* Platform-specific specialization for the GPR register file.Ashok Thirumurthi2013-05-011-48/+0
| | | | | | | | - Required for platform-independant handling of general purpose registers (i.e. for core dumps). Thanks to Samuel Jacob for this patch. llvm-svn: 180878
* Adds 64-bit POSIX support for AVXAshok Thirumurthi2013-04-251-0/+4
| | | | | | | | | | | | | | | | | - Adds unique enums for ymm registers to the ABI and the POSIX register context. - Reworks the register context data structures to support a union of FXSAVE and XSAVE --- Allows the same code base to deal with the FPU independent of the availability of AVX. - Determine if AVX is supported by attempting to read XSAVE using ptrace. --- Support an extended register set for avx registers if available. - Provide a mechanism to assemble/parse register halves into a single ymm buffer for use with RegisterValue. --- Reworked Read/WriteRegister routines to read/write/parse ymm registers. Adds tests for ymm register write with read-back, and expressions involving ymm registers. - Tests vary depending on the availability of an avx register set. Thanks to Daniel and Matt for their reviews. llvm-svn: 180572
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-2/+2
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-181-2/+2
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* Fix the Linux build issues introduced by r178191.Ashok Thirumurthi2013-03-281-8/+8
| | | | | | | | | - All Linux logging channels now use a single global instance of lldb_private::Log, to handle the case of logging during process tear down. - Also removed a single use of LogSP in FreeBSD and fixed a typo in a comment while reading through ProcessKDPLog. Reviewed by Daniel Malea. llvm-svn: 178242
* test commitAshok Thirumurthi2013-03-271-1/+1
| | | | | | - modified a comment llvm-svn: 178178
* Add Linux support for reading/writing extended register sets.Matt Kopec2013-03-202-8/+116
| | | | | | Patch by Ashok Thirumurthi. llvm-svn: 177568
OpenPOWER on IntegriCloud