summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadList.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Initial check-in of "fancy" inlined stepping. Doesn't do anything useful ↵Jim Ingham2012-09-011-4/+9
| | | | | | | | | unless you switch LLDB_FANCY_INLINED_STEPPING to true. With that on, basic inlined stepping works, including step-over of inlined functions. But for some as yet mysterious reason i386 debugging gets an assert and dies immediately. So for now its off. llvm-svn: 163044
* When we are preparing all threads to run, if the overall run state of a ↵Jim Ingham2012-05-311-1/+6
| | | | | | | | thread is "suspended" that should override the thread's thread plan's run state. llvm-svn: 157766
* <rdar://problem/11386214>Greg Clayton2012-05-181-0/+8
| | | | | | | | | | | <rdar://problem/11455913> "target symbol add" should flush the cached frames "register write" should flush the thread state in case registers modifications change stack llvm-svn: 157042
* First pass at mach-o core file support is in. It currently works for x86_64 Greg Clayton2012-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | user space programs. The core file support is implemented by making a process plug-in that will dress up the threads and stack frames by using the core file memory. Added many default implementations for the lldb_private::Process functions so that plug-ins like the ProcessMachCore don't need to override many many functions only to have to return an error. Added new virtual functions to the ObjectFile class for extracting the frozen thread states that might be stored in object files. The default implementations return no thread information, but any platforms that support core files that contain frozen thread states (like mach-o) can make a module using the core file and then extract the information. The object files can enumerate the threads and also provide the register state for each thread. Since each object file knows how the thread registers are stored, they are responsible for creating a suitable register context that can be used by the core file threads. Changed the process CreateInstace callbacks to return a shared pointer and to also take an "const FileSpec *core_file" parameter to allow for core file support. This will also allow for lldb_private::Process subclasses to be made that could load crash logs. This should be possible on darwin where the crash logs contain all of the stack frames for all of the threads, yet the crash logs only contain the registers for the crashed thrad. It should also allow some variables to be viewed for the thread that crashed. llvm-svn: 150154
* Threads now store their "temporary" resume state, so we know whether they ↵Jim Ingham2012-01-311-59/+21
| | | | | | | | | were suspended in the most recent step, and if they weren't allowed to run, don't ask questions about their state unless explicitly requested to do so. llvm-svn: 149443
* Switching back to using std::tr1::shared_ptr. We originally switched awayGreg Clayton2012-01-291-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | due to RTTI worries since llvm and clang don't use RTTI, but I was able to switch back with no issues as far as I can tell. Once the RTTI issue wasn't an issue, we were looking for a way to properly track weak pointers to objects to solve some of the threading issues we have been running into which naturally led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared pointer from just a pointer, which is also easily solved using the std::tr1::enable_shared_from_this class. The main reason for this move back is so we can start properly having weak references to objects. Currently a lldb_private::Thread class has a refrence to its parent lldb_private::Process. This doesn't work well when we now hand out a SBThread object that contains a shared pointer to a lldb_private::Thread as this SBThread can be held onto by external clients and if they end up using one of these objects we can easily crash. So the next task is to start adopting std::tr1::weak_ptr where ever it makes sense which we can do with lldb_private::Debugger, lldb_private::Target, lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and many more objects now that they are no longer using intrusive ref counted pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive pointers). llvm-svn: 149207
* Moved lldb::user_id_t values to be 64 bit. This was going to be needed forGreg Clayton2011-10-191-6/+6
| | | | | | | | | | | process IDs, and thread IDs, but was mainly needed for for the UserID's for Types so that DWARF with debug map can work flawlessly. With DWARF in .o files the type ID was the DIE offset in the DWARF for the .o file which is not unique across all .o files, so now the SymbolFileDWARFDebugMap class will make the .o file index part (the high 32 bits) of the unique type identifier so it can uniquely identify the types. llvm-svn: 142534
* Make the "log enable lldb-step" output easier to parse.Jim Ingham2011-10-151-15/+17
| | | | llvm-svn: 142025
* In ThreadList::GetSelectedThread, handle the case where we have noJason Molenda2011-09-131-0/+2
| | | | | | | valid threads - can happen if attaching to a process fails in a certain way. llvm-svn: 139567
* Move the SourceManager from the Debugger to the Target. That way it can ↵Jim Ingham2011-09-081-4/+11
| | | | | | | | | | store the per-Target default Source File & Line. Set the default Source File & line to main (if it can be found.) at startup. Selecting the current thread & or frame resets the current source file & line, and "source list" as well as the breakpoint command "break set -l <NUM>" will use the current source file. llvm-svn: 139323
* Modify the impl of ThreadList::GetSelectedThread() so that it tries to fetch theJohnny Chen2011-08-251-3/+7
| | | | | | | m_selected_tid thread first, check to see if it is valid (might be null if the thread just exited), and if not select/return the 0th thread instead. llvm-svn: 138591
* Make ThreadList::GetSelectedThread() select and return the 0th thread if ↵Johnny Chen2011-08-251-0/+2
| | | | | | | | there's no currently selected thread. And update the call sites accordingly. llvm-svn: 138577
* Added a new plug-in type: lldb_private::OperatingSystem. The operating system Greg Clayton2011-08-221-0/+17
| | | | | | | | | | | | | | | | | | | | plug-ins are add on plug-ins for the lldb_private::Process class that can add thread contexts that are read from memory. It is common in kernels to have a lot of threads that are not currently executing on any cores (JTAG debugging also follows this sort of thing) and are context switched out whose state is stored in memory data structures. Clients can now subclass the OperatingSystem plug-ins and then make sure their Create functions correcltly only enable themselves when the right binary/target triple are being debugged. The operating system plug-ins get a chance to attach themselves to processes just after launching or attaching and are given a lldb_private::Process object pointer which can be inspected to see if the main executable, target triple, or any shared libraries match a case where the OS plug-in should be used. Currently the OS plug-ins can create new threads, define the register contexts for these threads (which can all be different if desired), and populate and manage the thread info (stop reason, registers in the register context) as the debug session goes on. llvm-svn: 138228
* Fixed the LLDB build so that we can have private types, private enums andGreg Clayton2011-03-241-1/+1
| | | | | | | | public types and public enums. This was done to keep the SWIG stuff from parsing all sorts of enums and types that weren't needed, and allows us to abstract our API better. llvm-svn: 128239
* Fix a crasher when you have no log.Greg Clayton2011-01-241-3/+4
| | | | llvm-svn: 124109
* Some useful logging. Also don't stuff the temporary thread into a shared ↵Jim Ingham2011-01-241-13/+18
| | | | | | pointer for no apparent reason. llvm-svn: 124108
* Added an interface for noticing new thread creation. At this point, I only ↵Jim Ingham2011-01-221-0/+18
| | | | | | | | | | turn it on when we are requesting a single thread to run. May seem like a silly thing to do, but the kernel on MacOS X will inject new threads into a program willy-nilly, and I would like to keep them from running if I can. llvm-svn: 124018
* Thread safety changes in debugserver and also in the process GDB remote plugin.Greg Clayton2011-01-181-0/+2
| | | | | | | | | | | | | | I added support for asking if the GDB remote server supports thread suffixes for packets that should be thread specific (register read/write packets) because the way the GDB remote protocol does it right now is to have a notion of a current thread for register and memory reads/writes (set via the "$Hg%x" packet) and a current thread for running ("$Hc%x"). Now we ask the remote GDB server if it supports adding the thread ID to the register packets and we enable that feature in LLDB if supported. This stops us from having to send a bunch of packets that update the current thread ID to some value which is prone to error, or extra packets. llvm-svn: 123762
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-061-2/+2
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Don't cache the public stop reason, since it can change as plan completion ↵Jim Ingham2010-10-201-9/+1
| | | | | | gets processed. That means GetStopReason needs to return a shared pointer, not a pointer to the thread's cached version. Also allow the thread plans to get and set the thread private stop reason - that is usually more appropriate for the logic the thread plans need to do. llvm-svn: 116892
* Cleaned up step logging a bit.Greg Clayton2010-09-031-13/+19
| | | | llvm-svn: 113023
* Fixed the StackFrame to correctly resolve the StackID's SymbolContextScope.Greg Clayton2010-09-031-12/+74
| | | | | | | | | Added extra logging for stepping. Fixed an issue where cached stack frame data could be lost between runs when the thread plans read a stack frame. llvm-svn: 112973
* Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to ↵Jim Ingham2010-08-261-16/+16
| | | | | | "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected. llvm-svn: 112221
* Don't call PrepareForResume on threads that aren't going to get a chance to ↵Jim Ingham2010-07-141-4/+33
| | | | | | run this time around. llvm-svn: 108312
* I enabled some extra warnings for hidden local variables and for hiddenGreg Clayton2010-07-141-1/+1
| | | | | | virtual functions and caught some things and did some general code cleanup. llvm-svn: 108299
* Two changes in this checkin. Added a ThreadPlanKind so that I can do some ↵Jim Ingham2010-06-191-4/+4
| | | | | | | | | | | reasoning based on the kind of thread plan without having to use RTTI. Removed the ThreadPlanContinue and replaced with a ShouldAutoContinue query that serves the same purpose. Having to push another plan to assert that if there's no other indication the target should continue when this plan is popped was flakey and error prone. This method is more stable, and fixed problems we were having with thread specific breakpoints. llvm-svn: 106378
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+460
llvm-svn: 105619
OpenPOWER on IntegriCloud