[Lldb-commits] [lldb] r157045 - in /lldb/branches/apple/python-GIL: ./ examples/python/ include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Target/ lldb.xcodeproj/ resources/ scripts/ source/Breakpoint/ source/Commands/ source/Core/ source/Host/common/ source/Host/macosx/launcherXPCService/ source/Interpreter/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Target/ test/lang/objc/objc-new-syntax/
Filipe Cabecinhas
me at filcab.net
Fri May 18 01:09:22 PDT 2012
Author: filcab
Date: Fri May 18 03:09:22 2012
New Revision: 157045
URL: http://llvm.org/viewvc/llvm-project?rev=157045&view=rev
Log:
Merge changes from ToT trunk.
Added:
lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff
- copied unchanged from r157042, lldb/trunk/scripts/clang.amalgamated.diff
Removed:
lldb/branches/apple/python-GIL/scripts/clang.check-definition-for-superclasses.diff
lldb/branches/apple/python-GIL/scripts/clang.complete-type-getObjCLayout.diff
lldb/branches/apple/python-GIL/scripts/clang.complete-type-isSafeToConvert.diff
lldb/branches/apple/python-GIL/scripts/clang.decl-printer-reference-type.diff
lldb/branches/apple/python-GIL/scripts/clang.tail-padded-arrays.diff
lldb/branches/apple/python-GIL/scripts/clang.template-keyword-fixes.diff
Modified:
lldb/branches/apple/python-GIL/ (props changed)
lldb/branches/apple/python-GIL/examples/python/crashlog.py
lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Breakpoint.h
lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointList.h
lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h
lldb/branches/apple/python-GIL/include/lldb/Target/Process.h
lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h
lldb/branches/apple/python-GIL/include/lldb/Target/ThreadList.h
lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj
lldb/branches/apple/python-GIL/llvm.zip
lldb/branches/apple/python-GIL/resources/LLDB-Info.plist
lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp
lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointList.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.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/Host/common/Host.cpp
lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.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/source/Target/Target.cpp
lldb/branches/apple/python-GIL/source/Target/Thread.cpp
lldb/branches/apple/python-GIL/source/Target/ThreadList.cpp
lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 18 03:09:22 2012
@@ -1 +1 @@
-/lldb/trunk:156467-156961
+/lldb/trunk:156467-157042
Modified: lldb/branches/apple/python-GIL/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/python/crashlog.py?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/python/crashlog.py (original)
+++ lldb/branches/apple/python-GIL/examples/python/crashlog.py Fri May 18 03:09:22 2012
@@ -556,7 +556,12 @@
#prev_frame_index = -1
for frame_idx, frame in enumerate(thread.frames):
disassemble = (this_thread_crashed or options.disassemble_all_threads) and frame_idx < options.disassemble_depth;
- symbolicated_frame_addresses = crash_log.symbolicate (frame.pc)
+ if frame_idx == 0:
+ symbolicated_frame_addresses = crash_log.symbolicate (frame.pc)
+ else:
+ # Any frame above frame zero and we have to subtract one to get the previous line entry
+ symbolicated_frame_addresses = crash_log.symbolicate (frame.pc - 1)
+
if symbolicated_frame_addresses:
symbolicated_frame_address_idx = 0
for symbolicated_frame_address in symbolicated_frame_addresses:
Modified: lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Breakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Breakpoint.h?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Breakpoint.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Breakpoint.h Fri May 18 03:09:22 2012
@@ -203,11 +203,11 @@
/// Tell this breakpoint to scan a given module list and resolve any
/// new locations that match the breakpoint's specifications.
///
- /// @param[in] changedModules
+ /// @param[in] changed_modules
/// The list of modules to look in for new locations.
//------------------------------------------------------------------
void
- ResolveBreakpointInModules (ModuleList &changedModules);
+ ResolveBreakpointInModules (ModuleList &changed_modules);
//------------------------------------------------------------------
@@ -219,13 +219,29 @@
/// The list of modules to look in for new locations.
/// @param[in] load_event
/// If \b true then the modules were loaded, if \b false, unloaded.
+ /// @param[in] delete_locations
+ /// If \b true then the modules were unloaded delete any locations in the changed modules.
//------------------------------------------------------------------
void
- ModulesChanged (ModuleList &changedModules,
- bool load_event);
+ ModulesChanged (ModuleList &changed_modules,
+ bool load_event,
+ bool delete_locations = false);
//------------------------------------------------------------------
+ /// Tells the breakpoint the old module \a old_module_sp has been
+ /// replaced by new_module_sp (usually because the underlying file has been
+ /// rebuilt, and the old version is gone.)
+ ///
+ /// @param[in] old_module_sp
+ /// The old module that is going away.
+ /// @param[in] new_module_sp
+ /// The new module that is replacing it.
+ //------------------------------------------------------------------
+ void
+ ModuleReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp);
+
+ //------------------------------------------------------------------
// The next set of methods provide access to the breakpoint locations
// for this breakpoint.
//------------------------------------------------------------------
Modified: lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointList.h?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointList.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointList.h Fri May 18 03:09:22 2012
@@ -154,6 +154,9 @@
//------------------------------------------------------------------
void
UpdateBreakpoints (ModuleList &module_list, bool added);
+
+ void
+ UpdateBreakpointsWhenModuleIsReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp);
void
ClearAllBreakpointSites ();
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=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h Fri May 18 03:09:22 2012
@@ -355,6 +355,9 @@
size_t
Remove (ModuleList &module_list);
+ bool
+ RemoveIfOrphaned (const Module *module_ptr);
+
size_t
RemoveOrphans (bool mandatory);
@@ -419,6 +422,9 @@
static uint32_t
RemoveOrphanSharedModules (bool mandatory);
+
+ static bool
+ RemoveSharedModuleIfOrphaned (const Module *module_ptr);
protected:
//------------------------------------------------------------------
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Process.h?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Process.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Process.h Fri May 18 03:09:22 2012
@@ -2269,6 +2269,18 @@
return m_target;
}
+ //------------------------------------------------------------------
+ /// Flush all data in the process.
+ ///
+ /// Flush the memory caches, all threads, and any other cached data
+ /// in the process.
+ ///
+ /// This function can be called after a world changing event like
+ /// adding a new symbol file, or after the process makes a large
+ /// context switch (from boot ROM to booted into an OS).
+ //------------------------------------------------------------------
+ void
+ Flush ();
//------------------------------------------------------------------
/// Get accessor for the current process state.
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h Fri May 18 03:09:22 2012
@@ -274,6 +274,9 @@
Vote
ShouldReportRun (Event *event_ptr);
+ void
+ Flush ();
+
// Return whether this thread matches the specification in ThreadSpec. This is a virtual
// method because at some point we may extend the thread spec with a platform specific
// dictionary of attributes, which then only the platform specific Thread implementation
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/ThreadList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/ThreadList.h?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/ThreadList.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/ThreadList.h Fri May 18 03:09:22 2012
@@ -60,6 +60,9 @@
Clear();
void
+ Flush();
+
+ void
Destroy();
// Note that "idx" is not the same as the "thread_index". It is a zero
Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj Fri May 18 03:09:22 2012
@@ -4173,9 +4173,9 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 147;
+ DYLIB_CURRENT_VERSION = 149;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4235,10 +4235,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 147;
+ DYLIB_CURRENT_VERSION = 149;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4296,7 +4296,7 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
DEBUGGING_SYMBOLS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4322,7 +4322,7 @@
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4339,7 +4339,7 @@
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4353,8 +4353,8 @@
2689FFD513353D7A00698AC0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 147;
- DYLIB_CURRENT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
+ DYLIB_CURRENT_VERSION = 149;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4382,8 +4382,8 @@
2689FFD613353D7A00698AC0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 147;
- DYLIB_CURRENT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
+ DYLIB_CURRENT_VERSION = 149;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4411,8 +4411,8 @@
2689FFD713353D7A00698AC0 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 147;
- DYLIB_CURRENT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
+ DYLIB_CURRENT_VERSION = 149;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4498,7 +4498,7 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4538,10 +4538,10 @@
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 147;
+ DYLIB_CURRENT_VERSION = 149;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4842,7 +4842,7 @@
26F5C26C10F3D9A5009D5894 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4872,7 +4872,7 @@
26F5C26D10F3D9A5009D5894 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 147;
+ CURRENT_PROJECT_VERSION = 149;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
Modified: lldb/branches/apple/python-GIL/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/llvm.zip?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
Binary files - no diff available.
Modified: lldb/branches/apple/python-GIL/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/resources/LLDB-Info.plist?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/resources/LLDB-Info.plist (original)
+++ lldb/branches/apple/python-GIL/resources/LLDB-Info.plist Fri May 18 03:09:22 2012
@@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>147</string>
+ <string>149</string>
<key>CFBundleName</key>
<string>${EXECUTABLE_NAME}</string>
</dict>
Removed: lldb/branches/apple/python-GIL/scripts/clang.check-definition-for-superclasses.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/clang.check-definition-for-superclasses.diff?rev=157044&view=auto
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.check-definition-for-superclasses.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.check-definition-for-superclasses.diff (removed)
@@ -1,15 +0,0 @@
-Index: lib/AST/DeclObjC.cpp
-===================================================================
---- lib/AST/DeclObjC.cpp (revision 152265)
-+++ lib/AST/DeclObjC.cpp (working copy)
-@@ -330,6 +330,10 @@
- LoadExternalDefinition();
-
- while (ClassDecl != NULL) {
-+ // FIXME: Should make sure no callers ever do this.
-+ if (!ClassDecl->hasDefinition())
-+ return 0;
-+
- if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance)))
- return MethodDecl;
-
Removed: lldb/branches/apple/python-GIL/scripts/clang.complete-type-getObjCLayout.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/clang.complete-type-getObjCLayout.diff?rev=157044&view=auto
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.complete-type-getObjCLayout.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.complete-type-getObjCLayout.diff (removed)
@@ -1,13 +0,0 @@
-Index: lib/AST/RecordLayoutBuilder.cpp
-===================================================================
---- lib/AST/RecordLayoutBuilder.cpp (revision 152265)
-+++ lib/AST/RecordLayoutBuilder.cpp (working copy)
-@@ -2313,6 +2313,8 @@
- ASTContext::getObjCLayout(const ObjCInterfaceDecl *D,
- const ObjCImplementationDecl *Impl) const {
- // Retrieve the definition
-+ if (D->hasExternalLexicalStorage() && !D->getDefinition())
-+ getExternalSource()->CompleteType(const_cast<ObjCInterfaceDecl*>(D));
- D = D->getDefinition();
- assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!");
-
Removed: lldb/branches/apple/python-GIL/scripts/clang.complete-type-isSafeToConvert.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/clang.complete-type-isSafeToConvert.diff?rev=157044&view=auto
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.complete-type-isSafeToConvert.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.complete-type-isSafeToConvert.diff (removed)
@@ -1,19 +0,0 @@
-Index: lib/CodeGen/CodeGenTypes.cpp
-===================================================================
---- lib/CodeGen/CodeGenTypes.cpp (revision 152265)
-+++ lib/CodeGen/CodeGenTypes.cpp (working copy)
-@@ -133,6 +133,14 @@
- // when a class is translated, even though they aren't embedded by-value into
- // the class.
- if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD)) {
-+ if (!CRD->hasDefinition() && CRD->hasExternalLexicalStorage()) {
-+ ExternalASTSource *EAS = CRD->getASTContext().getExternalSource();
-+ if (!EAS)
-+ return false;
-+ EAS->CompleteType(const_cast<CXXRecordDecl*>(CRD));
-+ if (!CRD->hasDefinition())
-+ return false;
-+ }
- for (CXXRecordDecl::base_class_const_iterator I = CRD->bases_begin(),
- E = CRD->bases_end(); I != E; ++I)
- if (!isSafeToConvert(I->getType()->getAs<RecordType>()->getDecl(),
Removed: lldb/branches/apple/python-GIL/scripts/clang.decl-printer-reference-type.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/clang.decl-printer-reference-type.diff?rev=157044&view=auto
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.decl-printer-reference-type.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.decl-printer-reference-type.diff (removed)
@@ -1,13 +0,0 @@
-Index: lib/AST/DeclPrinter.cpp
-===================================================================
---- lib/AST/DeclPrinter.cpp (revision 152772)
-+++ lib/AST/DeclPrinter.cpp (working copy)
-@@ -114,6 +114,8 @@
- BaseType = FTy->getResultType();
- else if (const VectorType *VTy = BaseType->getAs<VectorType>())
- BaseType = VTy->getElementType();
-+ else if (const ReferenceType *RTy = BaseType->getAs<ReferenceType>())
-+ BaseType = RTy->getPointeeType();
- else
- llvm_unreachable("Unknown declarator!");
- }
Removed: lldb/branches/apple/python-GIL/scripts/clang.tail-padded-arrays.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/clang.tail-padded-arrays.diff?rev=157044&view=auto
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.tail-padded-arrays.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.tail-padded-arrays.diff (removed)
@@ -1,26 +0,0 @@
-Index: lib/Sema/SemaChecking.cpp
-===================================================================
---- lib/Sema/SemaChecking.cpp (revision 152265)
-+++ lib/Sema/SemaChecking.cpp (working copy)
-@@ -4416,12 +4416,16 @@
-
- // Don't consider sizes resulting from macro expansions or template argument
- // substitution to form C89 tail-padded arrays.
-- ConstantArrayTypeLoc TL =
-- cast<ConstantArrayTypeLoc>(FD->getTypeSourceInfo()->getTypeLoc());
-- const Expr *SizeExpr = dyn_cast<IntegerLiteral>(TL.getSizeExpr());
-- if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
-- return false;
-
-+ TypeSourceInfo *TInfo = FD->getTypeSourceInfo();
-+ if (TInfo) {
-+ ConstantArrayTypeLoc TL =
-+ cast<ConstantArrayTypeLoc>(TInfo->getTypeLoc());
-+ const Expr *SizeExpr = dyn_cast<IntegerLiteral>(TL.getSizeExpr());
-+ if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
-+ return false;
-+ }
-+
- const RecordDecl *RD = dyn_cast<RecordDecl>(FD->getDeclContext());
- if (!RD) return false;
- if (RD->isUnion()) return false;
Removed: lldb/branches/apple/python-GIL/scripts/clang.template-keyword-fixes.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/clang.template-keyword-fixes.diff?rev=157044&view=auto
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.template-keyword-fixes.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.template-keyword-fixes.diff (removed)
@@ -1,13 +0,0 @@
-Index: lib/AST/ExprConstant.cpp
-===================================================================
---- lib/AST/ExprConstant.cpp (revision 152265)
-+++ lib/AST/ExprConstant.cpp (working copy)
-@@ -4210,7 +4210,7 @@
- /// character of a string literal.
- template<typename LValue>
- static bool EvaluateBuiltinConstantPForLValue(const LValue &LV) {
-- const Expr *E = LV.getLValueBase().dyn_cast<const Expr*>();
-+ const Expr *E = LV.getLValueBase().template dyn_cast<const Expr*>();
- return E && isa<StringLiteral>(E) && LV.getLValueOffset().isZero();
- }
-
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=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Breakpoint/Breakpoint.cpp Fri May 18 03:09:22 2012
@@ -315,7 +315,7 @@
//----------------------------------------------------------------------
void
-Breakpoint::ModulesChanged (ModuleList &module_list, bool load)
+Breakpoint::ModulesChanged (ModuleList &module_list, bool load, bool delete_locations)
{
if (load)
{
@@ -395,11 +395,7 @@
else
{
// Go through the currently set locations and if any have breakpoints in
- // the module list, then remove their breakpoint sites.
- // FIXME: Think about this... Maybe it's better to delete the locations?
- // Are we sure that on load-unload-reload the module pointer will remain
- // the same? Or do we need to do an equality on modules that is an
- // "equivalence"???
+ // the module list, then remove their breakpoint sites, and their locations if asked to.
BreakpointEventData *removed_locations_event;
if (!IsInternal())
@@ -414,7 +410,9 @@
if (m_filter_sp->ModulePasses (module_sp))
{
size_t loc_idx = 0;
- while (loc_idx < m_locations.GetSize())
+ size_t num_locations = m_locations.GetSize();
+ BreakpointLocationCollection locations_to_remove;
+ for (loc_idx = 0; loc_idx < num_locations; loc_idx++)
{
BreakpointLocationSP break_loc_sp (m_locations.GetByIndex(loc_idx));
SectionSP section_sp (break_loc_sp->GetAddress().GetSection());
@@ -429,9 +427,17 @@
{
removed_locations_event->GetBreakpointLocationCollection().Add(break_loc_sp);
}
- //m_locations.RemoveLocation (break_loc_sp);
+ if (delete_locations)
+ locations_to_remove.Add (break_loc_sp);
+
}
- ++loc_idx;
+ }
+
+ if (delete_locations)
+ {
+ size_t num_locations_to_remove = locations_to_remove.GetSize();
+ for (loc_idx = 0; loc_idx < num_locations_to_remove; loc_idx++)
+ m_locations.RemoveLocation (locations_to_remove.GetByIndex(loc_idx));
}
}
}
@@ -440,6 +446,23 @@
}
void
+Breakpoint::ModuleReplaced (ModuleSP old_module_sp, ModuleSP new_module_sp)
+{
+ ModuleList temp_list;
+ temp_list.Append (new_module_sp);
+ ModulesChanged (temp_list, true);
+
+ // TO DO: For now I'm just adding locations for the new module and removing the
+ // breakpoint locations that were in the old module.
+ // We should really go find the ones that are in the new module & if we can determine that they are "equivalent"
+ // carry over the options from the old location to the new.
+
+ temp_list.Clear();
+ temp_list.Append (old_module_sp);
+ ModulesChanged (temp_list, false, true);
+}
+
+void
Breakpoint::Dump (Stream *)
{
}
Modified: lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointList.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointList.cpp Fri May 18 03:09:22 2012
@@ -210,6 +210,17 @@
}
void
+BreakpointList::UpdateBreakpointsWhenModuleIsReplaced (ModuleSP old_module_sp, ModuleSP new_module_sp)
+{
+ Mutex::Locker locker(m_mutex);
+ bp_collection::iterator end = m_breakpoints.end();
+ bp_collection::iterator pos;
+ for (pos = m_breakpoints.begin(); pos != end; ++pos)
+ (*pos)->ModuleReplaced (old_module_sp, new_module_sp);
+
+}
+
+void
BreakpointList::ClearAllBreakpointSites ()
{
Mutex::Locker locker(m_mutex);
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp Fri May 18 03:09:22 2012
@@ -541,8 +541,18 @@
StateType state = process->WaitForProcessToStop (NULL);
result.SetDidChangeProcessState (true);
- result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
- result.SetStatus (eReturnStatusSuccessFinishNoResult);
+
+ if (state == eStateStopped)
+ {
+ result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
+ result.SetStatus (eReturnStatusSuccessFinishNoResult);
+ }
+ else
+ {
+ result.AppendError ("attach failed: process did not stop (no such process or permission problem?)");
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
}
}
}
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp Fri May 18 03:09:22 2012
@@ -425,6 +425,9 @@
{
if (reg_ctx->WriteRegister (reg_info, reg_value))
{
+ // Toss all frames and anything else in the thread
+ // after a register has been written.
+ exe_ctx.GetThreadRef().Flush();
result.SetStatus (eReturnStatusSuccessFinishNoResult);
return true;
}
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=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp Fri May 18 03:09:22 2012
@@ -3585,21 +3585,21 @@
Execute (Args& args,
CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+ Target *target = exe_ctx.GetTargetPtr();
if (target == NULL)
{
result.AppendError ("invalid target, create a debug target using the 'target create' command");
result.SetStatus (eReturnStatusFailed);
- return false;
}
else
{
+ bool flush = false;
const size_t argc = args.GetArgumentCount();
if (argc == 0)
{
result.AppendError ("one or more symbol file paths must be specified");
result.SetStatus (eReturnStatusFailed);
- return false;
}
else
{
@@ -3633,13 +3633,14 @@
ModuleList module_list;
module_list.Append (old_module_sp);
target->ModulesDidLoad (module_list);
+ flush = true;
}
}
else
{
result.AppendError ("one or more executable image paths must be specified");
result.SetStatus (eReturnStatusFailed);
- return false;
+ break;
}
result.SetStatus (eReturnStatusSuccessFinishResult);
}
@@ -3661,6 +3662,13 @@
}
}
}
+
+ if (flush)
+ {
+ Process *process = exe_ctx.GetProcessPtr();
+ if (process)
+ process->Flush();
+ }
}
return result.Succeeded();
}
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=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp Fri May 18 03:09:22 2012
@@ -110,6 +110,29 @@
return false;
}
+bool
+ModuleList::RemoveIfOrphaned (const Module *module_ptr)
+{
+ if (module_ptr)
+ {
+ Mutex::Locker locker(m_modules_mutex);
+ collection::iterator pos, end = m_modules.end();
+ for (pos = m_modules.begin(); pos != end; ++pos)
+ {
+ if (pos->get() == module_ptr)
+ {
+ if (pos->unique())
+ {
+ pos = m_modules.erase (pos);
+ return true;
+ }
+ else
+ return false;
+ }
+ }
+ }
+ return false;
+}
size_t
ModuleList::RemoveOrphans (bool mandatory)
@@ -817,4 +840,10 @@
return GetSharedModuleList ().Remove (module_sp);
}
+bool
+ModuleList::RemoveSharedModuleIfOrphaned (const Module *module_ptr)
+{
+ return GetSharedModuleList ().RemoveIfOrphaned (module_ptr);
+}
+
Modified: lldb/branches/apple/python-GIL/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/common/Host.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/common/Host.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Host/common/Host.cpp Fri May 18 03:09:22 2012
@@ -1227,22 +1227,19 @@
lldb::TargetSP
Host::GetDummyTarget (lldb_private::Debugger &debugger)
{
- static TargetSP g_dummy_target_sp;
-
- if (!g_dummy_target_sp)
- {
- ArchSpec arch(Target::GetDefaultArchitecture());
- if (!arch.IsValid())
- arch = Host::GetArchitecture ();
- Error err = debugger.GetTargetList().CreateTarget(debugger,
- FileSpec(),
- arch.GetTriple().getTriple().c_str(),
- false,
- NULL,
- g_dummy_target_sp);
- }
-
- return g_dummy_target_sp;
+ lldb::TargetSP dummy_target_sp;
+
+ ArchSpec arch(Target::GetDefaultArchitecture());
+ if (!arch.IsValid())
+ arch = Host::GetArchitecture ();
+ Error err = debugger.GetTargetList().CreateTarget(debugger,
+ FileSpec(),
+ arch.GetTriple().getTriple().c_str(),
+ false,
+ NULL,
+ dummy_target_sp);
+
+ return dummy_target_sp;
}
struct ShellInfo
Modified: lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist Fri May 18 03:09:22 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>147</string>
+ <string>149</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
<key>XPCService</key>
@@ -33,6 +33,7 @@
<key>_AllowedClients</key>
<array>
<string> identifier = com.apple.lldb AND_APPLE_CODE_SIGNED</string>
+ <string> identifier = com.apple.dt.Xcode AND_APPLE_CODE_SIGNED</string>
</array>
<key>_RoleAccount</key>
<string>root</string>
Modified: lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist Fri May 18 03:09:22 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>147</string>
+ <string>149</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
<key>XPCService</key>
@@ -33,6 +33,7 @@
<key>_AllowedClients</key>
<array>
<string> identifier = com.apple.lldb AND_APPLE_CODE_SIGNED</string>
+ <string> identifier = com.apple.dt.Xcode AND_APPLE_CODE_SIGNED</string>
</array>
<key>ServiceType</key>
<string>Application</string>
Modified: lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp Fri May 18 03:09:22 2012
@@ -244,7 +244,7 @@
if (cmd_obj_sp)
{
alias_arguments_vector_sp.reset (new OptionArgVector);
- ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp);
+ ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=/bin/bash --", alias_arguments_vector_sp);
AddAlias ("r", cmd_obj_sp);
AddAlias ("run", cmd_obj_sp);
AddOrReplaceAliasOptions ("r", alias_arguments_vector_sp);
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=157045&r1=157044&r2=157045&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 Fri May 18 03:09:22 2012
@@ -142,7 +142,7 @@
&wrapper_struct_addr,
error_stream,
stop_others,
- 1000000,
+ 100000,
try_all_threads,
unwind_on_error,
ret);
@@ -350,10 +350,12 @@
Target &target(m_process->GetTarget());
static ConstString s_method_signature("-[NSDictionary objectForKeyedSubscript:]");
+ static ConstString s_arclite_method_signature("__arclite_objectForKeyedSubscript");
SymbolContextList sc_list;
- if (target.GetImages().FindSymbolsWithNameAndType(s_method_signature, eSymbolTypeCode, sc_list))
+ if (target.GetImages().FindSymbolsWithNameAndType(s_method_signature, eSymbolTypeCode, sc_list) ||
+ target.GetImages().FindSymbolsWithNameAndType(s_arclite_method_signature, eSymbolTypeCode, sc_list))
return true;
else
return false;
Modified: lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Fri May 18 03:09:22 2012
@@ -121,7 +121,7 @@
LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); // FIXME - a more appropriate log channel?
int32_t debug;
- if (log)
+ if (log && log->GetVerbose())
debug = 1;
else
debug = 0;
@@ -217,7 +217,7 @@
&m_get_class_name_args,
errors,
stop_others,
- 1000000,
+ 100000,
try_all_threads,
unwind_on_error,
void_ptr_value);
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=157045&r1=157044&r2=157045&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 Fri May 18 03:09:22 2012
@@ -966,7 +966,7 @@
dispatch_values.PushValue (flag_value);
break;
}
- if (log)
+ if (log && log->GetVerbose())
flag_value.GetScalar() = 1;
else
flag_value.GetScalar() = 0; // FIXME - Set to 0 when debugging is done.
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=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Process.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Process.cpp Fri May 18 03:09:22 2012
@@ -4707,6 +4707,12 @@
m_pre_resume_actions.clear();
}
+void
+Process::Flush ()
+{
+ m_thread_list.Flush();
+}
+
//--------------------------------------------------------------
// class Process::SettingsController
//--------------------------------------------------------------
Modified: lldb/branches/apple/python-GIL/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Target.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Target.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Target.cpp Fri May 18 03:09:22 2012
@@ -978,12 +978,7 @@
Target::ModuleUpdated (ModuleSP &old_module_sp, ModuleSP &new_module_sp)
{
// A module is replacing an already added module
- ModuleList module_list;
- module_list.Append (old_module_sp);
- ModulesDidUnload (module_list);
- module_list.Clear ();
- module_list.Append (new_module_sp);
- ModulesDidLoad (module_list);
+ m_breakpoint_list.UpdateBreakpointsWhenModuleIsReplaced(old_module_sp, new_module_sp);
}
void
@@ -1287,76 +1282,112 @@
ModuleSP
Target::GetSharedModule (const ModuleSpec &module_spec, Error *error_ptr)
{
- // Don't pass in the UUID so we can tell if we have a stale value in our list
- ModuleSP old_module_sp; // This will get filled in if we have a new version of the library
- bool did_create_module = false;
ModuleSP module_sp;
Error error;
- // If there are image search path entries, try to use them first to acquire a suitable image.
- if (m_image_search_paths.GetSize())
- {
- ModuleSpec transformed_spec (module_spec);
- if (m_image_search_paths.RemapPath (module_spec.GetFileSpec().GetDirectory(), transformed_spec.GetFileSpec().GetDirectory()))
- {
- transformed_spec.GetFileSpec().GetFilename() = module_spec.GetFileSpec().GetFilename();
- error = ModuleList::GetSharedModule (transformed_spec,
- module_sp,
- &GetExecutableSearchPaths(),
- &old_module_sp,
- &did_create_module);
- }
- }
+ // First see if we already have this module in our module list. If we do, then we're done, we don't need
+ // to consult the shared modules list. But only do this if we are passed a UUID.
+ if (module_spec.GetUUID().IsValid())
+ module_sp = m_images.FindFirstModule(module_spec);
+
if (!module_sp)
{
- // If we have a UUID, we can check our global shared module list in case
- // we already have it. If we don't have a valid UUID, then we can't since
- // the path in "module_spec" will be a platform path, and we will need to
- // let the platform find that file. For example, we could be asking for
- // "/usr/lib/dyld" and if we do not have a UUID, we don't want to pick
- // the local copy of "/usr/lib/dyld" since our platform could be a remote
- // platform that has its own "/usr/lib/dyld" in an SDK or in a local file
- // cache.
- if (module_spec.GetUUID().IsValid())
- {
- // We have a UUID, it is OK to check the global module list...
- error = ModuleList::GetSharedModule (module_spec,
- module_sp,
- &GetExecutableSearchPaths(),
- &old_module_sp,
- &did_create_module);
+ ModuleSP old_module_sp; // This will get filled in if we have a new version of the library
+ bool did_create_module = false;
+
+ // If there are image search path entries, try to use them first to acquire a suitable image.
+ if (m_image_search_paths.GetSize())
+ {
+ ModuleSpec transformed_spec (module_spec);
+ if (m_image_search_paths.RemapPath (module_spec.GetFileSpec().GetDirectory(), transformed_spec.GetFileSpec().GetDirectory()))
+ {
+ transformed_spec.GetFileSpec().GetFilename() = module_spec.GetFileSpec().GetFilename();
+ error = ModuleList::GetSharedModule (transformed_spec,
+ module_sp,
+ &GetExecutableSearchPaths(),
+ &old_module_sp,
+ &did_create_module);
+ }
}
-
+
if (!module_sp)
{
- // The platform is responsible for finding and caching an appropriate
- // module in the shared module cache.
- if (m_platform_sp)
+ // If we have a UUID, we can check our global shared module list in case
+ // we already have it. If we don't have a valid UUID, then we can't since
+ // the path in "module_spec" will be a platform path, and we will need to
+ // let the platform find that file. For example, we could be asking for
+ // "/usr/lib/dyld" and if we do not have a UUID, we don't want to pick
+ // the local copy of "/usr/lib/dyld" since our platform could be a remote
+ // platform that has its own "/usr/lib/dyld" in an SDK or in a local file
+ // cache.
+ if (module_spec.GetUUID().IsValid())
{
- FileSpec platform_file_spec;
- error = m_platform_sp->GetSharedModule (module_spec,
- module_sp,
- &GetExecutableSearchPaths(),
- &old_module_sp,
- &did_create_module);
+ // We have a UUID, it is OK to check the global module list...
+ error = ModuleList::GetSharedModule (module_spec,
+ module_sp,
+ &GetExecutableSearchPaths(),
+ &old_module_sp,
+ &did_create_module);
}
- else
+
+ if (!module_sp)
{
- error.SetErrorString("no platform is currently set");
+ // The platform is responsible for finding and caching an appropriate
+ // module in the shared module cache.
+ if (m_platform_sp)
+ {
+ FileSpec platform_file_spec;
+ error = m_platform_sp->GetSharedModule (module_spec,
+ module_sp,
+ &GetExecutableSearchPaths(),
+ &old_module_sp,
+ &did_create_module);
+ }
+ else
+ {
+ error.SetErrorString("no platform is currently set");
+ }
}
}
- }
- // If a module hasn't been found yet, use the unmodified path.
- if (module_sp)
- {
- m_images.Append (module_sp);
- if (did_create_module)
+ // We found a module that wasn't in our target list. Let's make sure that there wasn't an equivalent
+ // module in the list already, and if there was, let's remove it.
+ if (module_sp)
{
+ // GetSharedModule is not guaranteed to find the old shared module, for instance
+ // in the common case where you pass in the UUID, it is only going to find the one
+ // module matching the UUID. In fact, it has no good way to know what the "old module"
+ // relevant to this target is, since there might be many copies of a module with this file spec
+ // in various running debug sessions, but only one of them will belong to this target.
+ // So let's remove the UUID from the module list, and look in the target's module list.
+ // Only do this if there is SOMETHING else in the module spec...
+ if (!old_module_sp)
+ {
+ if (module_spec.GetUUID().IsValid() && !module_spec.GetFileSpec().GetFilename().IsEmpty() && !module_spec.GetFileSpec().GetDirectory().IsEmpty())
+ {
+ ModuleSpec module_spec_copy(module_spec.GetFileSpec());
+ module_spec_copy.GetUUID().Clear();
+
+ ModuleList found_modules;
+ size_t num_found = m_images.FindModules (module_spec_copy, found_modules);
+ if (num_found == 1)
+ {
+ old_module_sp = found_modules.GetModuleAtIndex(0);
+ }
+ }
+ }
+
+ m_images.Append (module_sp);
if (old_module_sp && m_images.GetIndexForModule (old_module_sp.get()) != LLDB_INVALID_INDEX32)
+ {
ModuleUpdated(old_module_sp, module_sp);
+ m_images.Remove (old_module_sp);
+ Module *old_module_ptr = old_module_sp.get();
+ old_module_sp.reset();
+ ModuleList::RemoveSharedModuleIfOrphaned (old_module_ptr);
+ }
else
ModuleAdded(module_sp);
}
Modified: lldb/branches/apple/python-GIL/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Thread.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Thread.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Thread.cpp Fri May 18 03:09:22 2012
@@ -1410,6 +1410,14 @@
}
+void
+Thread::Flush ()
+{
+ ClearStackFrames ();
+ m_reg_context_sp.reset();
+}
+
+
#pragma mark "Thread::SettingsController"
//--------------------------------------------------------------
// class Thread::SettingsController
Modified: lldb/branches/apple/python-GIL/source/Target/ThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ThreadList.cpp?rev=157045&r1=157044&r2=157045&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ThreadList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ThreadList.cpp Fri May 18 03:09:22 2012
@@ -605,4 +605,12 @@
}
}
+void
+ThreadList::Flush ()
+{
+ Mutex::Locker locker(m_threads_mutex);
+ collection::iterator pos, end = m_threads.end();
+ for (pos = m_threads.begin(); pos != end; ++pos)
+ (*pos)->Flush ();
+}
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=157045&r1=157044&r2=157045&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 Fri May 18 03:09:22 2012
@@ -112,11 +112,15 @@
self.expect("expr -o -- @1ull", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["NSNumber", "1"])
- #<rdar://problem/10924364>
- #self.expect("expr -o -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,
- # substrs = ["NSNumber", "123.45"])
- #self.expect("expr -o -- @123.45f", VARIABLES_DISPLAYED_CORRECTLY,
- # substrs = ["NSNumber", "123.45"])
+ self.expect("expr -o -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ["NSNumber", "123.45"])
+ self.expect("expr -o -- @123.45f", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ["NSNumber", "123.45"])
+
+ self.expect("expr -o -- @( 1 + 3 )", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ["NSNumber", "4"])
+ self.expect("expr -o -- @(\"Hello world\" + 6)", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ["NSString", "@\"world\""])
if __name__ == '__main__':
More information about the lldb-commits
mailing list