[Lldb-commits] [lldb] r157682 - in /lldb/branches/apple/python-GIL: ./ include/lldb/Core/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/DynamicLoader/Static/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Target/ test/api/check_public_api_headers/ test/lang/cpp/stl/ test/lang/objc/objc-new-syntax/ test/python_api/formatters/
Filipe Cabecinhas
me at filcab.net
Wed May 30 01:43:50 PDT 2012
Author: filcab
Date: Wed May 30 03:43:50 2012
New Revision: 157682
URL: http://llvm.org/viewvc/llvm-project?rev=157682&view=rev
Log:
Merge changes from ToT trunk.
Modified:
lldb/branches/apple/python-GIL/ (props changed)
lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h
lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp
lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp
lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp
lldb/branches/apple/python-GIL/source/Expression/ClangASTSource.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
lldb/branches/apple/python-GIL/source/Target/Process.cpp
lldb/branches/apple/python-GIL/test/api/check_public_api_headers/TestPublicAPIHeaders.py
lldb/branches/apple/python-GIL/test/lang/cpp/stl/Makefile
lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
lldb/branches/apple/python-GIL/test/python_api/formatters/Makefile
Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 30 03:43:50 2012
@@ -1 +1 @@
-/lldb/trunk:156467-157664
+/lldb/trunk:156467-157679
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h Wed May 30 03:43:50 2012
@@ -116,6 +116,13 @@
LogUUIDAndPaths (lldb::LogSP &log_sp,
const char *prefix_cstr);
+
+ Mutex &
+ GetMutex ()
+ {
+ return m_modules_mutex;
+ }
+
uint32_t
GetIndexForModule (const Module *module) const;
@@ -135,6 +142,23 @@
GetModuleAtIndex (uint32_t idx);
//------------------------------------------------------------------
+ /// Get the module shared pointer for the module at index \a idx without
+ /// acquiring the ModuleList mutex. This MUST already have been
+ /// acquired with ModuleList::GetMutex and locked for this call to be safe.
+ ///
+ /// @param[in] idx
+ /// An index into this module collection.
+ ///
+ /// @return
+ /// A shared pointer to a Module which can contain NULL if
+ /// \a idx is out of range.
+ ///
+ /// @see ModuleList::GetSize()
+ //------------------------------------------------------------------
+ lldb::ModuleSP
+ GetModuleAtIndexUnlocked (uint32_t idx);
+
+ //------------------------------------------------------------------
/// Get the module pointer for the module at index \a idx.
///
/// @param[in] idx
@@ -150,6 +174,23 @@
GetModulePointerAtIndex (uint32_t idx) const;
//------------------------------------------------------------------
+ /// Get the module pointer for the module at index \a idx without
+ /// acquiring the ModuleList mutex. This MUST already have been
+ /// acquired with ModuleList::GetMutex and locked for this call to be safe.
+ ///
+ /// @param[in] idx
+ /// An index into this module collection.
+ ///
+ /// @return
+ /// A pointer to a Module which can by NULL if \a idx is out
+ /// of range.
+ ///
+ /// @see ModuleList::GetSize()
+ //------------------------------------------------------------------
+ Module*
+ GetModulePointerAtIndexUnlocked (uint32_t idx) const;
+
+ //------------------------------------------------------------------
/// Find compile units by partial or full path.
///
/// Finds all compile units that match \a path in all of the modules
Modified: lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp Wed May 30 03:43:50 2012
@@ -317,6 +317,7 @@
void
Breakpoint::ModulesChanged (ModuleList &module_list, bool load, bool delete_locations)
{
+ Mutex::Locker modules_mutex(module_list.GetMutex());
if (load)
{
// The logic for handling new modules is:
@@ -332,11 +333,11 @@
// resolving breakpoints will add new locations potentially.
const size_t num_locs = m_locations.GetSize();
-
- for (size_t i = 0; i < module_list.GetSize(); i++)
+ size_t num_modules = module_list.GetSize();
+ for (size_t i = 0; i < num_modules; i++)
{
bool seen = false;
- ModuleSP module_sp (module_list.GetModuleAtIndex (i));
+ ModuleSP module_sp (module_list.GetModuleAtIndexUnlocked (i));
if (!m_filter_sp->ModulePasses (module_sp))
continue;
@@ -403,10 +404,11 @@
shared_from_this());
else
removed_locations_event = NULL;
-
- for (size_t i = 0; i < module_list.GetSize(); i++)
+
+ size_t num_modules = module_list.GetSize();
+ for (size_t i = 0; i < num_modules; i++)
{
- ModuleSP module_sp (module_list.GetModuleAtIndex (i));
+ ModuleSP module_sp (module_list.GetModuleAtIndexUnlocked (i));
if (m_filter_sp->ModulePasses (module_sp))
{
size_t loc_idx = 0;
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp Wed May 30 03:43:50 2012
@@ -1882,6 +1882,7 @@
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
+ Mutex::Locker modules_locker(target->GetImages().GetMutex());
const uint32_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
@@ -1894,7 +1895,10 @@
result.GetOutputStream().EOL();
}
num_dumped++;
- DumpModuleSymtab (m_interpreter, result.GetOutputStream(), target->GetImages().GetModulePointerAtIndex(image_idx), m_options.m_sort_order);
+ DumpModuleSymtab (m_interpreter,
+ result.GetOutputStream(),
+ target->GetImages().GetModulePointerAtIndexUnlocked(image_idx),
+ m_options.m_sort_order);
}
}
else
@@ -2179,13 +2183,15 @@
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
- const uint32_t num_modules = target->GetImages().GetSize();
+ ModuleList &target_modules = target->GetImages();
+ Mutex::Locker modules_locker (target_modules.GetMutex());
+ const uint32_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
result.GetOutputStream().Printf("Dumping debug symbols for %u modules.\n", num_modules);
for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
- if (DumpModuleSymbolVendor (result.GetOutputStream(), target->GetImages().GetModulePointerAtIndex(image_idx)))
+ if (DumpModuleSymbolVendor (result.GetOutputStream(), target_modules.GetModulePointerAtIndexUnlocked(image_idx)))
num_dumped++;
}
}
@@ -2288,7 +2294,10 @@
for (int arg_idx = 0; (arg_cstr = command.GetArgumentAtIndex(arg_idx)) != NULL; ++arg_idx)
{
FileSpec file_spec(arg_cstr, false);
- const uint32_t num_modules = target->GetImages().GetSize();
+
+ ModuleList &target_modules = target->GetImages();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
+ const uint32_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
uint32_t num_dumped = 0;
@@ -2296,7 +2305,7 @@
{
if (DumpCompileUnitLineTable (m_interpreter,
result.GetOutputStream(),
- target->GetImages().GetModulePointerAtIndex(i),
+ target_modules.GetModulePointerAtIndexUnlocked(i),
file_spec,
exe_ctx.GetProcessPtr() && exe_ctx.GetProcessRef().IsAlive()))
num_dumped++;
@@ -2807,9 +2816,6 @@
result.GetErrorStream().SetAddressByteSize(addr_byte_size);
}
// Dump all sections for all modules images
- uint32_t num_modules = 0;
- Mutex::Locker locker;
-
Stream &strm = result.GetOutputStream();
if (m_options.m_module_addr != LLDB_INVALID_ADDRESS)
@@ -2845,6 +2851,11 @@
return result.Succeeded();
}
+ uint32_t num_modules = 0;
+ Mutex::Locker locker; // This locker will be locked on the mutex in module_list_ptr if it is non-NULL.
+ // Otherwise it will lock the AllocationModuleCollectionMutex when accessing
+ // the global module list directly.
+
ModuleList module_list;
ModuleList *module_list_ptr = NULL;
const size_t argc = command.GetArgumentCount();
@@ -2858,7 +2869,6 @@
else
{
module_list_ptr = &target->GetImages();
- num_modules = target->GetImages().GetSize();
}
}
else
@@ -2879,9 +2889,14 @@
}
}
- num_modules = module_list.GetSize();
module_list_ptr = &module_list;
}
+
+ if (module_list_ptr != NULL)
+ {
+ locker.Lock(module_list_ptr->GetMutex());
+ num_modules = module_list_ptr->GetSize();
+ }
if (num_modules > 0)
{
@@ -2891,7 +2906,7 @@
Module *module;
if (module_list_ptr)
{
- module_sp = module_list_ptr->GetModuleAtIndex(image_idx);
+ module_sp = module_list_ptr->GetModuleAtIndexUnlocked(image_idx);
module = module_sp.get();
}
else
@@ -3414,12 +3429,14 @@
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
- const uint32_t num_modules = target->GetImages().GetSize();
+ ModuleList &target_modules = target->GetImages();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
+ const uint32_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
for (i = 0; i<num_modules && syntax_error == false; ++i)
{
- if (LookupInModule (m_interpreter, target->GetImages().GetModulePointerAtIndex(i), result, syntax_error))
+ if (LookupInModule (m_interpreter, target_modules.GetModulePointerAtIndexUnlocked(i), result, syntax_error))
{
result.GetOutputStream().EOL();
num_successful_lookups++;
Modified: lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp Wed May 30 03:43:50 2012
@@ -201,6 +201,12 @@
ModuleList::GetModulePointerAtIndex (uint32_t idx) const
{
Mutex::Locker locker(m_modules_mutex);
+ return GetModulePointerAtIndexUnlocked(idx);
+}
+
+Module*
+ModuleList::GetModulePointerAtIndexUnlocked (uint32_t idx) const
+{
if (idx < m_modules.size())
return m_modules[idx].get();
return NULL;
@@ -210,6 +216,12 @@
ModuleList::GetModuleAtIndex(uint32_t idx)
{
Mutex::Locker locker(m_modules_mutex);
+ return GetModuleAtIndexUnlocked(idx);
+}
+
+ModuleSP
+ModuleList::GetModuleAtIndexUnlocked(uint32_t idx)
+{
ModuleSP module_sp;
if (idx < m_modules.size())
module_sp = m_modules[idx];
Modified: lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp Wed May 30 03:43:50 2012
@@ -160,11 +160,12 @@
searcher.SearchCallback (*this, empty_sc, NULL, false);
else
{
+ Mutex::Locker modules_locker(modules.GetMutex());
const size_t numModules = modules.GetSize();
for (size_t i = 0; i < numModules; i++)
{
- ModuleSP module_sp(modules.GetModuleAtIndex(i));
+ ModuleSP module_sp(modules.GetModuleAtIndexUnlocked(i));
if (ModulePasses(module_sp))
{
if (DoModuleIteration(module_sp, searcher) == Searcher::eCallbackReturnStop)
@@ -191,12 +192,15 @@
{
if (!context.module_sp)
{
- size_t n_modules = m_target_sp->GetImages().GetSize();
+ ModuleList &target_images = m_target_sp->GetImages();
+ Mutex::Locker modules_locker(target_images.GetMutex());
+
+ size_t n_modules = target_images.GetSize();
for (size_t i = 0; i < n_modules; i++)
{
// If this is the last level supplied, then call the callback directly,
// otherwise descend.
- ModuleSP module_sp(m_target_sp->GetImages().GetModuleAtIndex(i));
+ ModuleSP module_sp(target_images.GetModuleAtIndexUnlocked (i));
if (!ModulePasses (module_sp))
continue;
@@ -427,11 +431,13 @@
// filespec that passes. Otherwise, we need to go through all modules and
// find the ones that match the file name.
- ModuleList matching_modules;
- const size_t num_modules = m_target_sp->GetImages().GetSize ();
+ ModuleList &target_modules = m_target_sp->GetImages();
+ Mutex::Locker modules_locker (target_modules.GetMutex());
+
+ const size_t num_modules = target_modules.GetSize ();
for (size_t i = 0; i < num_modules; i++)
{
- Module* module = m_target_sp->GetImages().GetModulePointerAtIndex(i);
+ Module* module = target_modules.GetModulePointerAtIndexUnlocked(i);
if (FileSpec::Compare (m_module_spec, module->GetFileSpec(), false) == 0)
{
SymbolContext matchingContext(m_target_sp, module->shared_from_this());
@@ -591,11 +597,13 @@
// filespec that passes. Otherwise, we need to go through all modules and
// find the ones that match the file name.
- ModuleList matching_modules;
- const size_t num_modules = m_target_sp->GetImages().GetSize ();
+ ModuleList &target_modules = m_target_sp->GetImages();
+ Mutex::Locker modules_locker (target_modules.GetMutex());
+
+ const size_t num_modules = target_modules.GetSize ();
for (size_t i = 0; i < num_modules; i++)
{
- Module* module = m_target_sp->GetImages().GetModulePointerAtIndex(i);
+ Module* module = target_modules.GetModulePointerAtIndexUnlocked(i);
if (m_module_spec_list.FindFileIndex(0, module->GetFileSpec(), false) != UINT32_MAX)
{
SymbolContext matchingContext(m_target_sp, module->shared_from_this());
@@ -762,11 +770,14 @@
// find the ones that match the file name.
ModuleList matching_modules;
- const size_t num_modules = m_target_sp->GetImages().GetSize ();
+ ModuleList &target_images = m_target_sp->GetImages();
+ Mutex::Locker modules_locker(target_images.GetMutex());
+
+ const size_t num_modules = target_images.GetSize ();
bool no_modules_in_filter = m_module_spec_list.GetSize() == 0;
for (size_t i = 0; i < num_modules; i++)
{
- lldb::ModuleSP module_sp = m_target_sp->GetImages().GetModuleAtIndex(i);
+ lldb::ModuleSP module_sp = target_images.GetModuleAtIndexUnlocked(i);
if (no_modules_in_filter || m_module_spec_list.FindFileIndex(0, module_sp->GetFileSpec(), false) != UINT32_MAX)
{
SymbolContext matchingContext(m_target_sp, module_sp);
Modified: lldb/branches/apple/python-GIL/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangASTSource.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangASTSource.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangASTSource.cpp Wed May 30 03:43:50 2012
@@ -561,13 +561,14 @@
}
else
{
- ModuleList &images = m_target->GetImages();
+ ModuleList &target_images = m_target->GetImages();
+ Mutex::Locker modules_locker (target_images.GetMutex());
- for (uint32_t i = 0, e = images.GetSize();
+ for (uint32_t i = 0, e = target_images.GetSize();
i != e;
++i)
{
- lldb::ModuleSP image = images.GetModuleAtIndex(i);
+ lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
if (!image)
continue;
@@ -1339,14 +1340,16 @@
}
else
{
- ModuleList &images = m_target->GetImages();
+ ModuleList &target_images = m_target->GetImages();
+ Mutex::Locker modules_locker(target_images.GetMutex());
+
ClangNamespaceDecl null_namespace_decl;
- for (uint32_t i = 0, e = images.GetSize();
+ for (uint32_t i = 0, e = target_images.GetSize();
i != e;
++i)
{
- lldb::ModuleSP image = images.GetModuleAtIndex(i);
+ lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
if (!image)
continue;
Modified: lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Wed May 30 03:43:50 2012
@@ -1057,12 +1057,14 @@
// to an equivalent version. We don't want it to stay in the target's module list or it will confuse
// us, so unload it here.
Target &target = m_process->GetTarget();
- ModuleList &modules = target.GetImages();
+ ModuleList &target_modules = target.GetImages();
ModuleList not_loaded_modules;
- size_t num_modules = modules.GetSize();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
+
+ size_t num_modules = target_modules.GetSize();
for (size_t i = 0; i < num_modules; i++)
{
- ModuleSP module_sp = modules.GetModuleAtIndex(i);
+ ModuleSP module_sp = target_modules.GetModuleAtIndexUnlocked (i);
if (!module_sp->IsLoadedInTarget (&target))
{
if (log)
Modified: lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp Wed May 30 03:43:50 2012
@@ -97,10 +97,12 @@
ModuleList loaded_module_list;
+ Mutex::Locker mutex_locker(module_list.GetMutex());
+
const size_t num_modules = module_list.GetSize();
for (uint32_t idx = 0; idx < num_modules; ++idx)
{
- ModuleSP module_sp (module_list.GetModuleAtIndex (idx));
+ ModuleSP module_sp (module_list.GetModuleAtIndexUnlocked (idx));
if (module_sp)
{
bool changed = false;
Modified: lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Wed May 30 03:43:50 2012
@@ -263,11 +263,13 @@
return eObjC_VersionUnknown;
Target &target = process->GetTarget();
- ModuleList &images = target.GetImages();
- size_t num_images = images.GetSize();
+ ModuleList &target_modules = target.GetImages();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
+
+ size_t num_images = target_modules.GetSize();
for (size_t i = 0; i < num_images; i++)
{
- ModuleSP module_sp = images.GetModuleAtIndex(i);
+ ModuleSP module_sp = target_modules.GetModuleAtIndexUnlocked(i);
// One tricky bit here is that we might get called as part of the initial module loading, but
// before all the pre-run libraries get winnowed from the module list. So there might actually
// be an old and incorrect ObjC library sitting around in the list, and we don't want to look at that.
Modified: lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp Wed May 30 03:43:50 2012
@@ -43,13 +43,14 @@
uint32_t ret = 0;
- ModuleList &images = m_process->GetTarget().GetImages();
+ ModuleList &target_modules = m_process->GetTarget().GetImages();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
- for (size_t image_index = 0, end_index = images.GetSize();
+ for (size_t image_index = 0, end_index = target_modules.GetSize();
image_index < end_index;
++image_index)
{
- Module *image = images.GetModulePointerAtIndex(image_index);
+ Module *image = target_modules.GetModulePointerAtIndexUnlocked(image_index);
if (!image)
continue;
Modified: lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Wed May 30 03:43:50 2012
@@ -334,15 +334,16 @@
return true;
Target &target = m_process_sp->GetTarget();
- ModuleList &modules = target.GetImages();
- size_t num_modules = modules.GetSize();
+ ModuleList &target_modules = target.GetImages();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
+ size_t num_modules = target_modules.GetSize();
if (!m_objc_module_sp)
{
for (size_t i = 0; i < num_modules; i++)
{
- if (m_process_sp->GetObjCLanguageRuntime()->IsModuleObjCLibrary (modules.GetModuleAtIndex(i)))
+ if (m_process_sp->GetObjCLanguageRuntime()->IsModuleObjCLibrary (target_modules.GetModuleAtIndexUnlocked(i)))
{
- m_objc_module_sp = modules.GetModuleAtIndex(i);
+ m_objc_module_sp = target_modules.GetModuleAtIndexUnlocked(i);
break;
}
}
Modified: lldb/branches/apple/python-GIL/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Process.cpp?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Process.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Process.cpp Wed May 30 03:43:50 2012
@@ -2814,19 +2814,23 @@
m_os_ap.reset (OperatingSystem::FindPlugin (this, NULL));
// Figure out which one is the executable, and set that in our target:
- ModuleList &modules = m_target.GetImages();
+ ModuleList &target_modules = m_target.GetImages();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
+ size_t num_modules = target_modules.GetSize();
+ ModuleSP new_executable_module_sp;
- size_t num_modules = modules.GetSize();
for (int i = 0; i < num_modules; i++)
{
- ModuleSP module_sp (modules.GetModuleAtIndex(i));
+ ModuleSP module_sp (target_modules.GetModuleAtIndexUnlocked (i));
if (module_sp && module_sp->IsExecutable())
{
if (m_target.GetExecutableModulePointer() != module_sp.get())
- m_target.SetExecutableModule (module_sp, false);
+ new_executable_module_sp = module_sp;
break;
}
}
+ if (new_executable_module_sp)
+ m_target.SetExecutableModule (new_executable_module_sp, false);
}
Error
Modified: lldb/branches/apple/python-GIL/test/api/check_public_api_headers/TestPublicAPIHeaders.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/api/check_public_api_headers/TestPublicAPIHeaders.py (original)
+++ lldb/branches/apple/python-GIL/test/api/check_public_api_headers/TestPublicAPIHeaders.py Wed May 30 03:43:50 2012
@@ -28,7 +28,7 @@
if sys.platform.startswith("darwin"):
d = {'FRAMEWORK_INCLUDES' : "-F%s" % self.build_dir}
- if sys.platform.startswith("linux"):
+ if sys.platform.startswith("linux") or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
d = {'FRAMEWORK_INCLUDES' : "-I%s" % os.path.join(os.environ["LLDB_SRC"], "include")}
self.buildDefault(dictionary=d)
self.exe_name = 'a.out'
@@ -48,7 +48,7 @@
# For different platforms, the include statement can vary.
if sys.platform.startswith("darwin"):
include_stmt = "'#include <%s>' % os.path.join('LLDB', header)"
- if sys.platform.startswith("linux"):
+ if sys.platform.startswith("linux") or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
include_stmt = "'#include <%s>' % os.path.join(public_api_dir, header)"
list = [eval(include_stmt) for header in public_headers if (header.startswith("SB") and
header.endswith(".h"))]
Modified: lldb/branches/apple/python-GIL/test/lang/cpp/stl/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lang/cpp/stl/Makefile?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lang/cpp/stl/Makefile (original)
+++ lldb/branches/apple/python-GIL/test/lang/cpp/stl/Makefile Wed May 30 03:43:50 2012
@@ -3,4 +3,6 @@
CXX_SOURCES := main.cpp
CFLAGS :=-arch x86_64 -gdwarf-2 -O0
+clean: OBJECTS+=$(wildcard main.d.*)
+
include $(LEVEL)/Makefile.rules
Modified: lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original)
+++ lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Wed May 30 03:43:50 2012
@@ -13,13 +13,13 @@
mydir = os.path.join("lang", "objc", "objc-new-syntax")
- @expectedFailurei386
+ @unittest2.expectedFailure
@dsym_test
def test_expr_with_dsym(self):
self.buildDsym()
self.expr()
- @expectedFailurei386
+ @unittest2.expectedFailure
@dwarf_test
def test_expr_with_dwarf(self):
self.buildDwarf()
Modified: lldb/branches/apple/python-GIL/test/python_api/formatters/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/python_api/formatters/Makefile?rev=157682&r1=157681&r2=157682&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/python_api/formatters/Makefile (original)
+++ lldb/branches/apple/python-GIL/test/python_api/formatters/Makefile Wed May 30 03:43:50 2012
@@ -2,4 +2,7 @@
CXX_SOURCES := main.cpp
+# Clean renamed executable on 'make clean'
+clean: OBJECTS+=no_synth
+
include $(LEVEL)/Makefile.rules
More information about the lldb-commits
mailing list