summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/POSIX/POSIXThread.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove old local-only linux debugging codePavel Labath2015-06-241-135/+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
* Remove virtual and add override for lots of function.Tamas Berghammer2015-03-251-17/+17
| | | | | | | | | | 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-1/+1
| | | | | | | | | | | | 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
* Fix Linux by partially reverting 196787Ed Maste2013-12-111-0/+2
| | | | llvm-svn: 197065
* Threaded inferior support for FreeBSDEd Maste2013-12-091-2/+0
| | | | | | | Modelled in part on GDBRemoteCommunicationClient. Review: http://llvm-reviews.chandlerc.com/D2267 llvm-svn: 196787
* Added support for reading thread-local storage variables, as defined using ↵Richard Mitton2013-10-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+1
| | | | llvm-svn: 192319
* Clean up RegisterContextPOSIX. Renamed to POSIXBreakpointProtocol.Michael Sartain2013-09-141-7/+5
| | | | | | Will clean up header files and m_register_infos shortly. llvm-svn: 190757
* Fix thread name updating in Linux. "thread list" should report correct names ↵Michael Sartain2013-07-311-2/+3
| | | | | | | | | | | 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
* Add support for listing inferior thread names on Linux.Matt Kopec2013-07-101-0/+9
| | | | llvm-svn: 186033
* Update comment after Linux->POSIX renameEd Maste2013-06-251-2/+2
| | | | llvm-svn: 184850
* Fix setting of watchpoints on inferior thread creation for Linux.Matt Kopec2013-06-031-0/+2
| | | | llvm-svn: 183139
* Adding support for stopping all threads of multithreaded inferiors on Linux. ↵Andrew Kaylor2013-05-281-0/+5
| | | | | | Also adding multithreaded test cases. llvm-svn: 182809
* Fixed "log enable linux registers" and added a test.Ashok Thirumurthi2013-05-091-4/+4
| | | | | | | | | | - 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
* Changed the formerly pure virtual function:Greg Clayton2013-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | namespace lldb_private { class Thread { virtual lldb::StopInfoSP GetPrivateStopReason() = 0; }; } To not be virtual. The lldb_private::Thread now handles the correct caching and will call a new pure virtual function: namespace lldb_private { class Thread { virtual bool CalculateStopInfo() = 0; } } This function must be overridden by thead lldb_private::Thread subclass and the only thing it needs to do is to set the Thread::StopInfo() with the current stop reason and return true, or return false if there is no stop reason. The lldb_private::Thread class will take care of calling this function only when it is required. This allows lldb_private::Thread subclasses to be a bit simpler and not all need to duplicate the cache and invalidation settings. Also renamed: lldb::StopInfoSP lldb_private::Thread::GetPrivateStopReason(); To: lldb::StopInfoSP lldb_private::Thread::GetPrivateStopInfo(); Also cleaned up a case where the ThreadPlanStepOverBreakpoint might not re-set its breakpoint if the thread disappears (which was happening due to a bug when using the OperatingSystem plug-ins with memory threads and real threads). llvm-svn: 181501
* Add watchpoint support for Linux on 64-bit host.Matt Kopec2013-05-071-0/+10
| | | | llvm-svn: 181341
* Reinstating r181091 and r181106 with fix for Linux regressions.Andrew Kaylor2013-05-071-1/+0
| | | | llvm-svn: 181340
* <rdar://problem/13700260>Greg Clayton2013-05-011-1/+1
| | | | | | | | | | | | | | <rdar://problem/13723772> Modified the lldb_private::Thread to work much better with the OperatingSystem plug-ins. Operating system plug-ins can now return have a "core" key/value pair in each thread dictionary for the OperatingSystemPython plug-ins which allows the core threads to be contained with memory threads. It also allows these memory threads to be stepped, resumed, and controlled just as if they were the actual backing threads themselves. A few things are introduced: - lldb_private::Thread now has a GetProtocolID() method which returns the thread protocol ID for a given thread. The protocol ID (Thread::GetProtocolID()) is usually the same as the thread id (Thread::GetID()), but it can differ when a memory thread has its own id, but is backed by an actual API thread. - Cleaned up the Thread::WillResume() code to do the mandatory parts in Thread::ShouldResume(), and let the thread subclasses override the Thread::WillResume() which is now just a notification. - Cleaned up ClearStackFrames() implementations so that fewer thread subclasses needed to override them - Changed the POSIXThread class a bit since it overrode Thread::WillResume(). It is doing the wrong thing by calling "Thread::SetResumeState()" on its own, this shouldn't be done by thread subclasses, but the current code might rely on it so I left it in with a TODO comment with an explanation. llvm-svn: 180886
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-1/+1
| | | | | | 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-1/+1
| | | | | | | | 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
* Add initial support to trace spawned threads in a process on Linux.Matt Kopec2013-01-081-0/+1
| | | | llvm-svn: 171864
* Patch from Daniel Malea that cleans up the process parameters for ↵Greg Clayton2012-10-121-1/+1
| | | | | | Process/Thread classes for POSIX and Linux. llvm-svn: 165806
* Linux fix patch from Dmitry Vyukov.Greg Clayton2012-02-211-1/+1
| | | | llvm-svn: 151072
* Fix incomplete commit of ↵Johnny Chen2012-01-051-0/+106
http://llvm.org/viewvc/llvm-project?rev=147609&view=rev: This patch combines common code from Linux and FreeBSD into 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: 147613
OpenPOWER on IntegriCloud