summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Section.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-08-22 02:49:39 +0000
committerGreg Clayton <gclayton@apple.com>2011-08-22 02:49:39 +0000
commit56d9a1b31b590fb4c3e546800866f4cea2f84559 (patch)
tree687e8944f13061581b3f23f1505a7e9eec35dded /lldb/source/Core/Section.cpp
parentaec683afec76274fbee62f90fc36bf791fd63796 (diff)
downloadbcm5719-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/Core/Section.cpp')
-rw-r--r--lldb/source/Core/Section.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index f32c72bdba4..60b3e15fccb 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -117,7 +117,9 @@ Section::GetLoadBaseAddress (Target *target) const
addr_t load_base_addr = LLDB_INVALID_ADDRESS;
if (m_linked_section)
{
- load_base_addr = m_linked_section->GetLoadBaseAddress(target) + m_linked_offset;
+ load_base_addr = m_linked_section->GetLoadBaseAddress(target);
+ if (load_base_addr != LLDB_INVALID_ADDRESS)
+ load_base_addr += m_linked_offset;
}
else
if (m_parent)
OpenPOWER on IntegriCloud