summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/POSIX
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove redundant assignmentEd Maste2013-11-251-2/+0
| | | | llvm-svn: 195664
* Add generic ARGn register IDs for FreeBSD and Linux x86Ed Maste2013-11-111-6/+6
| | | | | | | These were previously missing in g_register_infos_x86_64 and so arg lookup failed on FreeBSD and Linux after r194035. llvm-svn: 194392
* Make sure switch covers all values.Joerg Sonnenberger2013-10-201-0/+3
| | | | llvm-svn: 193052
* Added support for reading thread-local storage variables, as defined using ↵Richard Mitton2013-10-172-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Suppress "using extended field designator is an extension" warning in use of ↵Andy Gibbs2013-10-142-8/+10
| | | | | | offsetof. llvm-svn: 192578
* Simplify indirect rld_map for mips (rework r192408).Ed Maste2013-10-111-15/+2
| | | | | | | | | Just pass a Target* into ObjectFileELF::GetImageInfoAddress so that it can do the extra dereference necessary on MIPS, instead of passing a flag back to the caller. Review: http://llvm-reviews.chandlerc.com/D1899 llvm-svn: 192469
* Support mips shared object debug infoEd Maste2013-10-111-5/+17
| | | | | | | | | | MIPS's .dyanamic section is read-only. Instead of using DT_DEBUG for the pointer to dyld information it uses a separate tag DT_MIPS_RLD_MAP which points to storage in the read-write .rld_map section, which in turn points to the dyld information. Review: http://llvm-reviews.chandlerc.com/D1890 llvm-svn: 192408
* Initial FreeBSD mips64 ProcessMonitor supportEd Maste2013-10-105-14/+469
| | | | | | | Committing early to ease tracking other ongoing POSIX changes. Review: http://llvm-reviews.chandlerc.com/D1886 llvm-svn: 192387
* POSIX RegisterContext for mips64Ed Maste2013-10-107-0/+675
| | | | | | | | | Based on the POSIX x86_64 register context. This is sufficient for opening a mips64 (big endian) core file. Subsequent changes will connect the disassembler, dynamic loader support, ABI, etc. Review: http://llvm-reviews.chandlerc.com/D1873 llvm-svn: 192335
* Merge RegisterContextPOSIX_x86_64 and RegisterContextPOSIX_i386 into ↵Michael Sartain2013-10-1016-869/+360
| | | | | | RegisterContextPOSIX_x86 llvm-svn: 192332
* Add exec support for Linux including common support for POSIX.Matt Kopec2013-10-095-3/+58
| | | | llvm-svn: 192319
* Add missing space between words in commentEd Maste2013-10-091-1/+1
| | | | llvm-svn: 192307
* Fix filenames in header comment blocksEd Maste2013-10-096-6/+6
| | | | llvm-svn: 192296
* Clean up RegisterContextPOSIX i386 code.Michael Sartain2013-10-0921-1771/+2475
| | | | | | | | | | | 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
* Change posix thread so that it creates a breakpoint stop reason if the ↵Matt Kopec2013-09-201-18/+9
| | | | | | breakpoint isn't valid for the current thread but specify should stop to false. Also remove selecting a thread on a breakpoint hit. llvm-svn: 191110
* Fixing a problem with thread creation signal order dependencyAndrew Kaylor2013-09-172-1/+23
| | | | llvm-svn: 190831
* Clean up RegisterContextPOSIX. Renamed to POSIXBreakpointProtocol.Michael Sartain2013-09-1410-574/+627
| | | | | | Will clean up header files and m_register_infos shortly. llvm-svn: 190757
* Cleanup POSIX RegisterContext class hierarchies.Michael Sartain2013-09-1315-381/+524
| | | | llvm-svn: 190647
* Clean up handling of FreeBSD thread list on Launch / AttachEd Maste2013-09-033-0/+13
| | | | | | | | Instead of directly manipulating the thread list in Launch and Attach, just rely on RefreshStateAfterStop to populate the initial list. Review: http://llvm-reviews.chandlerc.com/D1565 llvm-svn: 189889
* Move detach to FreeBSD- and Linux-specific classes.Ed Maste2013-08-302-29/+1
| | | | | | | | | 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
* Perform thread lookup after RefreshStateAfterStop()Ed Maste2013-08-291-2/+2
| | | | | | This fixes a crash on FreeBSD llvm-svn: 189607
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This merge brings in the improved 'platform' command that knows how to interface with remote machines; that is, query OS/kernel information, push and pull files, run shell commands, etc... and implementation for the new communication packets that back that interface, at least on Darwin based operating systems via the POSIXPlatform class. Linux support is coming soon. Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS X Mountain Lion. Additional improvements (not in the source SVN branch 'lldb-platform-work'): - cmake build scripts for lldb-platform - cleanup test suite - documentation stub for qPlatform_RunCommand - use log class instead of printf() directly - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely. - add new logging category 'platform' Reviewers: Matt Kopec, Greg Clayton Review: http://llvm-reviews.chandlerc.com/D1493 llvm-svn: 189295
* Remove unreachable code when thread exits on Linux.Matt Kopec2013-08-081-6/+0
| | | | llvm-svn: 187995
* Fix thread name updating in Linux. "thread list" should report correct names ↵Michael Sartain2013-07-314-24/+24
| | | | | | | | | | | 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
* Run-time reg context selection for POSIX targetsEd Maste2013-07-301-8/+12
| | | | | | | | | | | | Instantiate RegisterContext... based on getOS() instead of with compile-time #ifdef-ery. The assert() here is unfortunate, but better than crashing with no explanation. This change is equivalent to r186865 for elf-core. llvm-svn: 187422
* Modify ProcessPOSIX to use the thread list mutex as neededDaniel Malea2013-07-241-0/+17
| | | | | | - should resolve (at least some) of the spurious crashes we are seeing in multithreaded tests on Linux (and likely FreeBSD) llvm-svn: 187081
* Factor out common string match code for POSIX log enable/disableEd Maste2013-07-221-32/+32
| | | | llvm-svn: 186822
* Re-introduces ELF core file support for Linux x86-64Ashok Thirumurthi2013-07-171-36/+90
| | | | | | | | | | 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-6/+0
| | | | | | | | | | | | | | | | | | | | | | | 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-0/+6
| | | | | | | | TODO: Support for RegisterContext_x86_64::ReadFPR. Patch by Samuel Jacob! llvm-svn: 186207
* Handle BreakNotify for threads whose tid doesn't match the ThreadSpec of the ↵Ashok Thirumurthi2013-07-121-7/+27
| | | | | | | | | BreakpointSite to avoid asserts when stepping in a multi-threaded application. Note: Test to follow shortly. llvm-svn: 186190
* Stop process monitor from ProcessPOSIX::FinalizeAndrew Kaylor2013-07-102-0/+11
| | | | llvm-svn: 186039
* Add support for listing inferior thread names on Linux.Matt Kopec2013-07-103-2/+35
| | | | llvm-svn: 186033
* Reverting ProcessMonitor shared pointer changesAndrew Kaylor2013-07-092-6/+2
| | | | llvm-svn: 185981
* Use shared pointers to hold the process in ProcessMonitorAndrew Kaylor2013-07-092-2/+6
| | | | llvm-svn: 185946
* Fix signal handling for POSIX (only tested on Linux) processes in ↵Matt Kopec2013-07-092-19/+64
| | | | | | | | multi-threaded programs. Also fix a related issue where if a thread exits after a thread continue, lldb would hang. llvm-svn: 185944
* Avoid crash if we fail to resolve process in attachEd Maste2013-07-041-3/+2
| | | | llvm-svn: 185661
* Update error message; detach-keeps-stopped is also not on FreeBSDEd Maste2013-07-031-2/+2
| | | | llvm-svn: 185549
* Split symbol support for ELF and Linux.Michael Sartain2013-07-011-1/+1
| | | | llvm-svn: 185366
* Following the modification introduced in llvm by commit 185311Sylvestre Ledru2013-07-011-1/+1
| | | | | | | | | | | | | | | | | | The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. This kind of simplification is sometimes useful, but in general it's not correct. As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the build definitions used for FreeBSD, whereas for userland-related issues we want to match the definitions used for other systems with Glibc. The current modification adjusts the build system so that they can be distinguished, and explicitly adds GNU/kFreeBSD to the build checks in which it belongs. Fixes bug #16446. Patch by Robert Millan in the context of Debian. llvm-svn: 185313
* Remove unneeded limbo state flag.Matt Kopec2013-06-262-20/+2
| | | | llvm-svn: 185010
* Update comment after Linux->POSIX renameEd Maste2013-06-251-2/+2
| | | | llvm-svn: 184850
* Update for Linux->POSIX renameEd Maste2013-06-241-8/+8
| | | | | | | Revision r147613 (2341d35) renamed this file with s/Linux/POSIX/, but header guards and comments were not updated to match. llvm-svn: 184741
* Using offsetof to an item within an array is an extension so mark it as such ↵Andy Gibbs2013-06-243-11/+14
| | | | | | to avoid compiler warnings. llvm-svn: 184738
* Use LLDB_INVALID_REGNUM at Mike Sartain's suggestionAndy Gibbs2013-06-191-1/+1
| | | | llvm-svn: 184342
* Fix two 'variable is used uninitialised' warnings. Change assert to ↵Andy Gibbs2013-06-191-2/+2
| | | | | | llvm_unreachable. llvm-svn: 184334
* Add assertion for when no watchpoint found in POSIX watchnotify handler.Matt Kopec2013-06-182-12/+21
| | | | | | Also, ensure x86_64 watchpoint registers are initialized before they are accessed on the POSIX side. llvm-svn: 184246
* Temporarily disable checking of watchpoint hit on FreeBSD on trace message.Matt Kopec2013-06-181-0/+2
| | | | | | Patch from Ed Maste. llvm-svn: 184241
* Add output of fault address on an address related crash (ie. segfault).Matt Kopec2013-06-105-14/+33
| | | | llvm-svn: 183701
* Use std::vector for the array of RegisterInfo structs that describe the ↵Ashok Thirumurthi2013-06-054-45/+32
| | | | | | | | | | | | register context. - Ensures that this container is populated once for the lifetime of lldb --- In particular, static methods can query this data even after the first RegisterContext has been destroyed. - Uses a singleton function to avoid global constructors. Thanks to Greg Clayton for the suggestion! llvm-svn: 183313
OpenPOWER on IntegriCloud