summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/SectionLoadList.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-12-14 02:59:59 +0000
committerGreg Clayton <gclayton@apple.com>2010-12-14 02:59:59 +0000
commit8b2fe6dcbdf27b0df84ef4bdf514f9bc577c5804 (patch)
tree9816fbd1612d4cb872b44f996c47f67f9fc6470f /lldb/source/Target/SectionLoadList.cpp
parent12960558416a6797ea7504e7d9934bb11a5b1f42 (diff)
downloadbcm5719-llvm-8b2fe6dcbdf27b0df84ef4bdf514f9bc577c5804.tar.gz
bcm5719-llvm-8b2fe6dcbdf27b0df84ef4bdf514f9bc577c5804.zip
Modified LLDB expressions to not have to JIT and run code just to see variable
values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of a persistent variable only, we will create a value object for it and make a ValueObjectConstResult from it to freeze the value (for program variables only, not persistent variables) and avoid running JITed code. For everything else we still parse up and JIT code and run it in the inferior. There was also a lot of clean up in the expression code. I made the ClangExpressionVariables be stored in collections of shared pointers instead of in collections of objects. This will help stop a lot of copy constructors on these large objects and also cleans up the code considerably. The persistent clang expression variables were moved over to the Target to ensure they persist across process executions. Added the ability for lldb_private::Target objects to evaluate expressions. We want to evaluate expressions at the target level in case we aren't running yet, or we have just completed running. We still want to be able to access the persistent expression variables between runs, and also evaluate constant expressions. Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects can now dump their contents with the UUID, arch and full paths being logged with appropriate prefix values. Thread hardened the Communication class a bit by making the connection auto_ptr member into a shared pointer member and then making a local copy of the shared pointer in each method that uses it to make sure another thread can't nuke the connection object while it is being used by another thread. Added a new file to the lldb/test/load_unload test that causes the test a.out file to link to the libd.dylib file all the time. This will allow us to test using the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else. llvm-svn: 121745
Diffstat (limited to 'lldb/source/Target/SectionLoadList.cpp')
-rw-r--r--lldb/source/Target/SectionLoadList.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/lldb/source/Target/SectionLoadList.cpp b/lldb/source/Target/SectionLoadList.cpp
index 0dcbba42fcb..f900d9697d5 100644
--- a/lldb/source/Target/SectionLoadList.cpp
+++ b/lldb/source/Target/SectionLoadList.cpp
@@ -68,12 +68,17 @@ SectionLoadList::SetSectionLoadAddress (const Section *section, addr_t load_addr
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
if (log)
- log->Printf ("SectionLoadList::%s (section = %p (%s.%s), load_addr = 0x%16.16llx)",
+ {
+ const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
+ log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
__FUNCTION__,
section,
- section->GetModule()->GetFileSpec().GetFilename().AsCString(),
+ module_file_spec.GetDirectory().AsCString(),
+ module_file_spec.GetDirectory() ? "/" : "",
+ module_file_spec.GetFilename().AsCString(),
section->GetName().AsCString(),
load_addr);
+ }
Mutex::Locker locker(m_mutex);
collection::iterator pos = m_collection.find(load_addr);
@@ -97,11 +102,16 @@ SectionLoadList::SetSectionUnloaded (const Section *section)
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
if (log)
- log->Printf ("SectionLoadList::%s (section = %p (%s.%s))",
+ {
+ const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
+ log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s))",
__FUNCTION__,
section,
- section->GetModule()->GetFileSpec().GetFilename().AsCString(),
+ module_file_spec.GetDirectory().AsCString(),
+ module_file_spec.GetDirectory() ? "/" : "",
+ module_file_spec.GetFilename().AsCString(),
section->GetName().AsCString());
+ }
size_t unload_count = 0;
Mutex::Locker locker(m_mutex);
@@ -128,12 +138,17 @@ SectionLoadList::SetSectionUnloaded (const Section *section, addr_t load_addr)
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
if (log)
- log->Printf ("SectionLoadList::%s (section = %p (%s.%s), load_addr = 0x%16.16llx)",
+ {
+ const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
+ log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
__FUNCTION__,
section,
- section->GetModule()->GetFileSpec().GetFilename().AsCString(),
+ module_file_spec.GetDirectory().AsCString(),
+ module_file_spec.GetDirectory() ? "/" : "",
+ module_file_spec.GetFilename().AsCString(),
section->GetName().AsCString(),
load_addr);
+ }
Mutex::Locker locker(m_mutex);
return m_collection.erase (load_addr) != 0;
}
OpenPOWER on IntegriCloud