diff options
author | Sean Callanan <scallanan@apple.com> | 2013-06-27 00:10:26 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-06-27 00:10:26 +0000 |
commit | 70cac8fd817cb1cfc6a120a8cda3b1a601bf6515 (patch) | |
tree | ae62221a346ddb06870bdaaa55f472323543ec86 /lldb/source/Target/Process.cpp | |
parent | ba2c0b9de10cef942822568ab44fd0a81499a4c3 (diff) | |
download | bcm5719-llvm-70cac8fd817cb1cfc6a120a8cda3b1a601bf6515.tar.gz bcm5719-llvm-70cac8fd817cb1cfc6a120a8cda3b1a601bf6515.zip |
Remove the process's reservation cache and don't
bother checking if a region is safe to use. In
cases where regions need to be synthesized rather
than properly allocated, the memory reads required
to determine whether the area is used are
- insufficient, because intermediate locations
could be in use, and
- unsafe, because on some platforms reading from
memory can trigger events.
All this only makes a difference on platforms
where memory allocation in the target is impossible.
Behavior on platforms where it is possible should
stay the same.
<rdar://problem/14023970>
llvm-svn: 185046
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index d78ebc0584a..a00f2085b44 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -996,7 +996,6 @@ Process::Process(Target &target, Listener &listener) : ProcessProperties (false), UserID (LLDB_INVALID_PROCESS_ID), Broadcaster (&(target.GetDebugger()), "lldb.process"), - m_reservation_cache (*this), m_target (target), m_public_state (eStateUnloaded), m_private_state (eStateUnloaded), @@ -5590,60 +5589,3 @@ Process::DidExec () DoDidExec(); CompleteAttach (); } - -Process::ReservationCache::ReservationCache (Process &process) : m_process(process) -{ - m_mod_id = process.GetModID(); -} - -void -Process::ReservationCache::Reserve (lldb::addr_t addr, size_t size) -{ - CheckModID(); - m_reserved_cache[addr] = size; -} - -void -Process::ReservationCache::Unreserve (lldb::addr_t addr) -{ - CheckModID(); - ReservedMap::iterator iter = m_reserved_cache.find(addr); - - if (iter != m_reserved_cache.end()) - { - size_t size = iter->second; - m_reserved_cache.erase(iter); - m_free_cache[size].push_back(addr); - } -} - -lldb::addr_t -Process::ReservationCache::Find (size_t size) -{ - CheckModID(); - lldb::addr_t ret = LLDB_INVALID_ADDRESS; - FreeMap::iterator map_iter = m_free_cache.find(size); - if (map_iter != m_free_cache.end()) - { - if (!map_iter->second.empty()) - { - ret = map_iter->second.back(); - map_iter->second.pop_back(); - m_reserved_cache[ret] = size; - } - } - - return ret; -} - -void -Process::ReservationCache::CheckModID() -{ - if (m_mod_id != m_process.GetModID()) - { - // wipe all our caches, they're invalid - m_reserved_cache.clear(); - m_free_cache.clear(); - m_mod_id = m_process.GetModID(); - } -} |