diff options
author | Greg Clayton <gclayton@apple.com> | 2011-08-22 02:49:39 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-08-22 02:49:39 +0000 |
commit | 56d9a1b31b590fb4c3e546800866f4cea2f84559 (patch) | |
tree | 687e8944f13061581b3f23f1505a7e9eec35dded /lldb/source/Plugins/Process/Utility/ThreadMemory.h | |
parent | aec683afec76274fbee62f90fc36bf791fd63796 (diff) | |
download | bcm5719-llvm-56d9a1b31b590fb4c3e546800866f4cea2f84559.tar.gz bcm5719-llvm-56d9a1b31b590fb4c3e546800866f4cea2f84559.zip |
Added a new plug-in type: lldb_private::OperatingSystem. The operating system
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
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/ThreadMemory.h')
-rw-r--r-- | lldb/source/Plugins/Process/Utility/ThreadMemory.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Utility/ThreadMemory.h b/lldb/source/Plugins/Process/Utility/ThreadMemory.h new file mode 100644 index 00000000000..93cc255a128 --- /dev/null +++ b/lldb/source/Plugins/Process/Utility/ThreadMemory.h @@ -0,0 +1,64 @@ +//===-- ThreadMemory.h -----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_ThreadMemory_h_ +#define liblldb_ThreadMemory_h_ + +#include "lldb/Target/Thread.h" + +class ThreadMemory : + public lldb_private::Thread +{ +public: + + ThreadMemory (lldb_private::Process &process, + lldb::tid_t tid, + const lldb::ValueObjectSP &thread_info_valobj_sp); + + virtual + ~ThreadMemory(); + + //------------------------------------------------------------------ + // lldb_private::Thread methods + //------------------------------------------------------------------ + virtual void + RefreshStateAfterStop(); + + virtual lldb::RegisterContextSP + GetRegisterContext (); + + virtual lldb::RegisterContextSP + CreateRegisterContextForFrame (lldb_private::StackFrame *frame); + + virtual lldb::StopInfoSP + GetPrivateStopReason (); + + virtual bool + WillResume (lldb::StateType resume_state); + + lldb::ValueObjectSP & + GetValueObject () + { + return m_thread_info_valobj_sp; + } + +protected: + //------------------------------------------------------------------ + // For ThreadMemory and subclasses + //------------------------------------------------------------------ + lldb::ValueObjectSP m_thread_info_valobj_sp; + +private: + //------------------------------------------------------------------ + // For ThreadMemory only + //------------------------------------------------------------------ + DISALLOW_COPY_AND_ASSIGN (ThreadMemory); +}; + +#endif // liblldb_ThreadMemory_h_ |