[Lldb-commits] [lldb] r157714 - in /lldb/branches/lldb-platform-work: ./ include/lldb/Core/ lib/ lldb.xcodeproj/ resources/ scripts/ scripts/Python/ source/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Host/macosx/launcherXPCService/ source/Interpreter/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/DynamicLoader/Static/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Plugins/ObjectFile/Mach-O/ source/Plugins/Platform/MacOSX/ source/Plugins/Process/gdb-re...
Johnny Chen
johnny.chen at apple.com
Wed May 30 13:55:52 PDT 2012
Author: johnny
Date: Wed May 30 15:55:52 2012
New Revision: 157714
URL: http://llvm.org/viewvc/llvm-project?rev=157714&view=rev
Log:
Merge changes from ToT trunk.
Modified:
lldb/branches/lldb-platform-work/ (props changed)
lldb/branches/lldb-platform-work/include/lldb/Core/Disassembler.h
lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h
lldb/branches/lldb-platform-work/include/lldb/Core/StreamString.h
lldb/branches/lldb-platform-work/include/lldb/Core/StringList.h
lldb/branches/lldb-platform-work/lib/Makefile
lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
lldb/branches/lldb-platform-work/resources/LLDB-Info.plist
lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh
lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh
lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl
lldb/branches/lldb-platform-work/source/API/SBFrame.cpp
lldb/branches/lldb-platform-work/source/Breakpoint/Breakpoint.cpp
lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp
lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.h
lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp
lldb/branches/lldb-platform-work/source/Commands/CommandObjectRegister.cpp
lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp
lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp
lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp
lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp
lldb/branches/lldb-platform-work/source/Core/StreamString.cpp
lldb/branches/lldb-platform-work/source/Core/StringList.cpp
lldb/branches/lldb-platform-work/source/Expression/ClangASTSource.cpp
lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp
lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
lldb/branches/lldb-platform-work/source/Interpreter/CommandObject.cpp
lldb/branches/lldb-platform-work/source/Interpreter/Makefile
lldb/branches/lldb-platform-work/source/Makefile
lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp
lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp
lldb/branches/lldb-platform-work/source/Target/Process.cpp
lldb/branches/lldb-platform-work/source/Target/Target.cpp
lldb/branches/lldb-platform-work/test/Makefile
lldb/branches/lldb-platform-work/test/api/check_public_api_headers/TestPublicAPIHeaders.py
lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
lldb/branches/lldb-platform-work/test/functionalities/register/TestRegisters.py
lldb/branches/lldb-platform-work/test/help/TestHelp.py
lldb/branches/lldb-platform-work/test/lang/cpp/stl/Makefile
lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
lldb/branches/lldb-platform-work/test/python_api/formatters/Makefile
lldb/branches/lldb-platform-work/tools/debugserver/scripts/dbgnub-config.pl
lldb/branches/lldb-platform-work/tools/driver/Makefile
lldb/branches/lldb-platform-work/tools/lldb-platform/Makefile
Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 30 15:55:52 2012
@@ -1 +1 @@
-/lldb/trunk:154223-157405
+/lldb/trunk:154223-157712
Modified: lldb/branches/lldb-platform-work/include/lldb/Core/Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/Disassembler.h?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/Disassembler.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/Disassembler.h Wed May 30 15:55:52 2012
@@ -338,7 +338,8 @@
size_t
ParseInstructions (const ExecutionContext *exe_ctx,
- const AddressRange &range);
+ const AddressRange &range,
+ Stream *error_strm_ptr);
size_t
ParseInstructions (const ExecutionContext *exe_ctx,
Modified: lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h Wed May 30 15:55:52 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/lldb-platform-work/include/lldb/Core/StreamString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/StreamString.h?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/StreamString.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/StreamString.h Wed May 30 15:55:52 2012
@@ -37,6 +37,9 @@
void
Clear();
+ bool
+ Empty() const;
+
const char *
GetData () const;
Modified: lldb/branches/lldb-platform-work/include/lldb/Core/StringList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/StringList.h?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/StringList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/StringList.h Wed May 30 15:55:52 2012
@@ -52,6 +52,9 @@
GetStringAtIndex (size_t idx) const;
void
+ Join (const char *separator, Stream &strm);
+
+ void
Clear ();
void
Modified: lldb/branches/lldb-platform-work/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lib/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lib/Makefile (original)
+++ lldb/branches/lldb-platform-work/lib/Makefile Wed May 30 15:55:52 2012
@@ -12,14 +12,14 @@
LIBRARYNAME = lldb
-#EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../resources/lldb-framework-exports
+#EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports
NO_BUILD_ARCHIVE = 1
LINK_LIBS_IN_SHARED = 1
SHARED_LIBRARY = 1
PYTHON_BUILD_FLAGS = $(shell python-config --ldflags)
-# Include all archives in liblldb.a files
+# Include all archives in liblldb.so file
USEDLIBS = lldbAPI.a \
lldbBreakpoint.a \
lldbCommands.a \
@@ -33,6 +33,7 @@
lldbPluginABISysV_x86_64.a \
lldbPluginDisassemblerLLVM.a \
lldbPluginDynamicLoaderStatic.a \
+ lldbPluginDynamicLoaderPOSIX.a \
lldbPluginEmulateInstructionARM.a \
lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \
lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \
@@ -88,13 +89,11 @@
ifeq ($(HOST_OS),Linux)
USEDLIBS += lldbPluginProcessPOSIX.a \
lldbPluginProcessLinux.a \
- lldbPluginDynamicLoaderPOSIX.a \
lldbHostLinux.a
endif
ifeq ($(HOST_OS),FreeBSD)
USEDLIBS += lldbHostFreeBSD.a \
- lldbPluginDynamicLoaderPOSIX.a \
lldbPluginProcessPOSIX.a \
lldbPluginProcessFreeBSD.a
endif
@@ -114,7 +113,9 @@
LLVMLibsOptions += -framework Foundation -framework CoreFoundation
LLVMLibsOptions += -framework CoreServices -framework Carbon -framework Security
LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
- LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports"
+ ifneq ($(EXPORTED_SYMBOL_FILE),)
+ LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(EXPORTED_SYMBOL_FILE)"
+ endif
# Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
ifneq ($(DARWIN_VERS),8)
@@ -130,7 +131,7 @@
# Don't allow unresolved symbols.
LLVMLibsOptions += -Wl,--no-undefined
# Link in python
- LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt
+ LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt
endif
ifeq ($(HOST_OS),FreeBSD)
@@ -140,5 +141,5 @@
# Allow unresolved symbols.
LLVMLibsOptions += -Wl,--allow-shlib-undefined
# Link in python
- LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo
+ LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo
endif
Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj Wed May 30 15:55:52 2012
@@ -4215,9 +4215,9 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 150;
+ DYLIB_CURRENT_VERSION = 152;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4277,10 +4277,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 150;
+ DYLIB_CURRENT_VERSION = 152;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4338,7 +4338,7 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
DEBUGGING_SYMBOLS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4364,7 +4364,7 @@
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4381,7 +4381,7 @@
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4395,8 +4395,8 @@
2689FFD513353D7A00698AC0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 150;
- DYLIB_CURRENT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
+ DYLIB_CURRENT_VERSION = 152;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4424,8 +4424,8 @@
2689FFD613353D7A00698AC0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 150;
- DYLIB_CURRENT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
+ DYLIB_CURRENT_VERSION = 152;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4453,8 +4453,8 @@
2689FFD713353D7A00698AC0 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 150;
- DYLIB_CURRENT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
+ DYLIB_CURRENT_VERSION = 152;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4542,7 +4542,7 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4582,10 +4582,10 @@
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 150;
+ DYLIB_CURRENT_VERSION = 152;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4886,7 +4886,7 @@
26F5C26C10F3D9A5009D5894 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4916,7 +4916,7 @@
26F5C26D10F3D9A5009D5894 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 150;
+ CURRENT_PROJECT_VERSION = 152;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
Modified: lldb/branches/lldb-platform-work/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/resources/LLDB-Info.plist?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/resources/LLDB-Info.plist (original)
+++ lldb/branches/lldb-platform-work/resources/LLDB-Info.plist Wed May 30 15:55:52 2012
@@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>150</string>
+ <string>152</string>
<key>CFBundleName</key>
<string>${EXECUTABLE_NAME}</string>
</dict>
Modified: lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh Wed May 30 15:55:52 2012
@@ -25,7 +25,10 @@
swig_python_typemaps=${SRC_ROOT}/scripts/Python/python-typemaps.swig
if [ $LLDB_DISABLE_PYTHON = "1" ] ; then
- # LLDB_DISABLE_PYTHON is set, which currently means iOS cross build where python is disabled
+ # We don't want Python for this build, but touch the output file so we don't have to
+ # conditionalize the build on this as well.
+ # Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
+ # set LLDB_DISABLE_PYTHON to 1.
rm -rf ${swig_output_file}
touch ${swig_output_file}
Modified: lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh Wed May 30 15:55:52 2012
@@ -33,8 +33,10 @@
PYTHON_INSTALL_DIR=$4
debug_flag=$5
-# Make sure LLDB_DISABLE_PYTHON is not set, since if it is this is an iOS build where python
-# is disabled
+# If we don't want Python, then just do nothing here.
+# Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
+# set LLDB_DISABLE_PYTHON to 1.
+
if [ ! $LLDB_DISABLE_PYTHON = "1" ] ; then
if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
Modified: lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl (original)
+++ lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl Wed May 30 15:55:52 2012
@@ -554,6 +554,7 @@
if ($reg_num >= @$registers_aref)
{
printf("\tinvalid register index %d\n", $reg_num);
+ return;
}
my $reg_href = $$registers_aref[$reg_num];
Modified: lldb/branches/lldb-platform-work/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBFrame.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBFrame.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBFrame.cpp Wed May 30 15:55:52 2012
@@ -1055,12 +1055,12 @@
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
{
+#ifdef LLDB_CONFIGURATION_DEBUG
StreamString frame_description;
frame->DumpUsingSettingsFormat (&frame_description);
-
Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
expr, fetch_dynamic_value, frame_description.GetString().c_str());
-
+#endif
const bool coerce_to_id = false;
const bool keep_in_memory = false;
@@ -1073,7 +1073,9 @@
fetch_dynamic_value,
expr_value_sp);
expr_result.SetSP(expr_value_sp);
+#ifdef LLDB_CONFIGURATION_DEBUG
Host::SetCrashDescription (NULL);
+#endif
}
else
{
Modified: lldb/branches/lldb-platform-work/source/Breakpoint/Breakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Breakpoint/Breakpoint.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Breakpoint/Breakpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Breakpoint/Breakpoint.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp Wed May 30 15:55:52 2012
@@ -49,6 +49,7 @@
CommandObjectBreakpointSet::CommandOptions::CommandOptions(CommandInterpreter &interpreter) :
Options (interpreter),
+ m_condition (),
m_filenames (),
m_line_num (0),
m_column (0),
@@ -91,6 +92,9 @@
{ LLDB_OPT_SET_ALL, false, "ignore-count", 'i', required_argument, NULL, 0, eArgTypeCount,
"Set the number of times this breakpoint is skipped before stopping." },
+ { LLDB_OPT_SET_ALL, false, "condition", 'c', required_argument, NULL, 0, eArgTypeExpression,
+ "The breakpoint stops only if this condition expression evaluates to true."},
+
{ LLDB_OPT_SET_ALL, false, "thread-index", 'x', required_argument, NULL, 0, eArgTypeThreadIndex,
"The breakpoint stops only for the thread whose index matches this argument."},
@@ -111,7 +115,7 @@
// Comment out this option for the moment, as we don't actually use it, but will in the future.
// This way users won't see it, but the infrastructure is left in place.
- // { 0, false, "column", 'c', required_argument, NULL, "<column>",
+ // { 0, false, "column", 'C', required_argument, NULL, "<column>",
// "Set the breakpoint by source location at this particular column."},
{ LLDB_OPT_SET_2, true, "address", 'a', required_argument, NULL, 0, eArgTypeAddress,
@@ -179,10 +183,14 @@
error.SetErrorStringWithFormat ("invalid address string '%s'", option_arg);
break;
- case 'c':
+ case 'C':
m_column = Args::StringToUInt32 (option_arg, 0);
break;
+ case 'c':
+ m_condition.assign(option_arg);
+ break;
+
case 'f':
m_filenames.AppendIfUnique (FileSpec(option_arg, false));
break;
@@ -325,6 +333,7 @@
void
CommandObjectBreakpointSet::CommandOptions::OptionParsingStarting ()
{
+ m_condition.clear();
m_filenames.Clear();
m_line_num = 0;
m_column = 0;
@@ -586,6 +595,9 @@
if (m_options.m_ignore_count != 0)
bp->GetOptions()->SetIgnoreCount(m_options.m_ignore_count);
+
+ if (!m_options.m_condition.empty())
+ bp->GetOptions()->SetCondition(m_options.m_condition.c_str());
}
if (bp)
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.h?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.h (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.h Wed May 30 15:55:52 2012
@@ -98,6 +98,7 @@
// Instance variables to hold the values for command options.
+ std::string m_condition;
FileSpecList m_filenames;
uint32_t m_line_num;
uint32_t m_column;
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp Wed May 30 15:55:52 2012
@@ -613,8 +613,15 @@
bytes_read = target->ReadMemory(address, false, data_sp->GetBytes (), data_sp->GetByteSize(), error);
if (bytes_read == 0)
{
- result.AppendWarningWithFormat("Read from 0x%llx failed.\n", addr);
- result.AppendError(error.AsCString());
+ const char *error_cstr = error.AsCString();
+ if (error_cstr && error_cstr[0])
+ {
+ result.AppendError(error_cstr);
+ }
+ else
+ {
+ result.AppendErrorWithFormat("failed to read memory from 0x%llx.\n", addr);
+ }
result.SetStatus(eReturnStatusFailed);
return false;
}
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectRegister.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectRegister.cpp Wed May 30 15:55:52 2012
@@ -124,7 +124,8 @@
DumpRegisterSet (const ExecutionContext &exe_ctx,
Stream &strm,
RegisterContext *reg_ctx,
- uint32_t set_idx)
+ uint32_t set_idx,
+ bool primitive_only=false)
{
uint32_t unavailable_count = 0;
uint32_t available_count = 0;
@@ -137,7 +138,11 @@
for (uint32_t reg_idx = 0; reg_idx < num_registers; ++reg_idx)
{
const uint32_t reg = reg_set->registers[reg_idx];
- if (DumpRegister (exe_ctx, strm, reg_ctx, reg_ctx->GetRegisterInfoAtIndex(reg)))
+ const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg);
+ // Skip the dumping of derived register if primitive_only is true.
+ if (primitive_only && reg_info && reg_info->value_regs)
+ continue;
+ if (DumpRegister (exe_ctx, strm, reg_ctx, reg_info))
++available_count;
else
++unavailable_count;
@@ -202,7 +207,8 @@
for (set_idx = 0; set_idx < num_register_sets; ++set_idx)
{
- DumpRegisterSet (exe_ctx, strm, reg_ctx, set_idx);
+ // When dump_all_sets option is set, dump primitive as well as derived registers.
+ DumpRegisterSet (exe_ctx, strm, reg_ctx, set_idx, !m_command_options.dump_all_sets.GetCurrentValue());
}
}
}
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp Wed May 30 15:55:52 2012
@@ -1946,6 +1946,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)
{
@@ -1958,7 +1959,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
@@ -2243,13 +2247,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++;
}
}
@@ -2352,7 +2358,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;
@@ -2360,7 +2369,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++;
@@ -2871,9 +2880,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)
@@ -2909,6 +2915,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();
@@ -2922,7 +2933,6 @@
else
{
module_list_ptr = &target->GetImages();
- num_modules = target->GetImages().GetSize();
}
}
else
@@ -2943,9 +2953,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)
{
@@ -2955,7 +2970,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
@@ -3478,12 +3493,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/lldb-platform-work/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp Wed May 30 15:55:52 2012
@@ -225,7 +225,7 @@
if (disasm_sp)
{
- size_t bytes_disassembled = disasm_sp->ParseInstructions (&exe_ctx, range);
+ size_t bytes_disassembled = disasm_sp->ParseInstructions (&exe_ctx, range, NULL);
if (bytes_disassembled == 0)
disasm_sp.reset();
}
@@ -290,7 +290,7 @@
ResolveAddress (exe_ctx, disasm_range.GetBaseAddress(), range.GetBaseAddress());
range.SetByteSize (disasm_range.GetByteSize());
- size_t bytes_disassembled = disasm_ap->ParseInstructions (&exe_ctx, range);
+ size_t bytes_disassembled = disasm_ap->ParseInstructions (&exe_ctx, range, &strm);
if (bytes_disassembled == 0)
return false;
@@ -1010,7 +1010,8 @@
Disassembler::ParseInstructions
(
const ExecutionContext *exe_ctx,
- const AddressRange &range
+ const AddressRange &range,
+ Stream *error_strm_ptr
)
{
if (exe_ctx)
@@ -1040,6 +1041,18 @@
m_arch.GetAddressByteSize());
return DecodeInstructions (range.GetBaseAddress(), data, 0, UINT32_MAX, false);
}
+ else if (error_strm_ptr)
+ {
+ const char *error_cstr = error.AsCString();
+ if (error_cstr)
+ {
+ error_strm_ptr->Printf("error: %s\n", error_cstr);
+ }
+ }
+ }
+ else if (error_strm_ptr)
+ {
+ error_strm_ptr->PutCString("error: invalid execution context\n");
}
return 0;
}
Modified: lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Core/SearchFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp Wed May 30 15:55:52 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;
@@ -305,7 +309,9 @@
bool
SearchFilterForNonModuleSpecificSearches::ModulePasses (const lldb::ModuleSP &module_sp)
{
- if (m_target_sp->ModuleIsExcludedForNonModuleSpecificSearches (module_sp))
+ if (!module_sp)
+ return true;
+ else if (m_target_sp->ModuleIsExcludedForNonModuleSpecificSearches (module_sp))
return false;
else
return true;
@@ -425,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());
@@ -589,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());
@@ -760,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/lldb-platform-work/source/Core/StreamString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/StreamString.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/StreamString.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/StreamString.cpp Wed May 30 15:55:52 2012
@@ -47,6 +47,12 @@
m_packet.clear();
}
+bool
+StreamString::Empty() const
+{
+ return GetSize() == 0;
+}
+
const char *
StreamString::GetData () const
{
Modified: lldb/branches/lldb-platform-work/source/Core/StringList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/StringList.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/StringList.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/StringList.cpp Wed May 30 15:55:52 2012
@@ -96,6 +96,22 @@
}
void
+StringList::Join (const char *separator, Stream &strm)
+{
+ uint32_t size = GetSize();
+
+ if (size == 0)
+ return;
+
+ for (uint32_t i = 0; i < size; ++i)
+ {
+ if (i > 0)
+ strm.PutCString(separator);
+ strm.PutCString(GetStringAtIndex(i));
+ }
+}
+
+void
StringList::Clear ()
{
m_strings.clear();
Modified: lldb/branches/lldb-platform-work/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ClangASTSource.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangASTSource.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangASTSource.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Expression/IRDynamicChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp Wed May 30 15:55:52 2012
@@ -611,22 +611,28 @@
return false;
}
- ValidPointerChecker vpc(M, m_checker_functions);
-
- if (!vpc.Inspect(*function))
- return false;
-
- if (!vpc.Instrument())
- return false;
-
- ObjcObjectChecker ooc(M, m_checker_functions);
-
- if (!ooc.Inspect(*function))
- return false;
+ if (m_checker_functions.m_valid_pointer_check.get())
+ {
+ ValidPointerChecker vpc(M, m_checker_functions);
+
+ if (!vpc.Inspect(*function))
+ return false;
+
+ if (!vpc.Instrument())
+ return false;
+ }
- if (!ooc.Instrument())
- return false;
-
+ if (m_checker_functions.m_objc_object_check.get())
+ {
+ ObjcObjectChecker ooc(M, m_checker_functions);
+
+ if (!ooc.Inspect(*function))
+ return false;
+
+ if (!ooc.Instrument())
+ return false;
+ }
+
if (log && log->GetVerbose())
{
std::string s;
Modified: lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist (original)
+++ lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist Wed May 30 15:55:52 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>150</string>
+ <string>152</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
<key>XPCService</key>
Modified: lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist (original)
+++ lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist Wed May 30 15:55:52 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>150</string>
+ <string>152</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
<key>XPCService</key>
Modified: lldb/branches/lldb-platform-work/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/CommandObject.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/CommandObject.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/CommandObject.cpp Wed May 30 15:55:52 2012
@@ -17,6 +17,7 @@
#include <ctype.h>
#include "lldb/Core/Address.h"
+#include "lldb/Core/ArchSpec.h"
#include "lldb/Interpreter/Options.h"
// These are for the Sourcename completers.
@@ -845,13 +846,27 @@
return NULL;
}
+static
+const char *arch_helper()
+{
+ static StreamString g_archs_help;
+ if (g_archs_help.Empty())
+ {
+ StringList archs;
+ ArchSpec::AutoComplete(NULL, archs);
+ g_archs_help.Printf("These are the supported architecture names:\n");
+ archs.Join("\n", g_archs_help);
+ }
+ return g_archs_help.GetData();
+}
+
CommandObject::ArgumentTableEntry
CommandObject::g_arguments_data[] =
{
{ eArgTypeAddress, "address", CommandCompletions::eNoCompletion, { NULL, false }, "A valid address in the target program's execution space." },
{ eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of an abbreviation (alias) for a debugger command." },
{ eArgTypeAliasOptions, "options-for-aliased-command", CommandCompletions::eNoCompletion, { NULL, false }, "Command options to be used as part of an alias (abbreviation) definition. (See 'help commands alias' for more information.)" },
- { eArgTypeArchitecture, "arch", CommandCompletions::eArchitectureCompletion, { NULL, false }, "The architecture name, e.g. i386 or x86_64." },
+ { eArgTypeArchitecture, "arch", CommandCompletions::eArchitectureCompletion, { arch_helper, true }, "The architecture name, e.g. i386 or x86_64." },
{ eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, { NULL, false }, "A Boolean value: 'true' or 'false'" },
{ eArgTypeBreakpointID, "breakpt-id", CommandCompletions::eNoCompletion, { BreakpointIDHelpTextCallback, false }, NULL },
{ eArgTypeBreakpointIDRange, "breakpt-id-list", CommandCompletions::eNoCompletion, { BreakpointIDRangeHelpTextCallback, false }, NULL },
Modified: lldb/branches/lldb-platform-work/source/Interpreter/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/Makefile (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/Makefile Wed May 30 15:55:52 2012
@@ -16,16 +16,96 @@
include $(LLDB_LEVEL)/Makefile
-include $(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.d
-PYTHON_DIR := $(ToolDir)
+PYTHON_DIR := $(LibDir)/python/lldb
ifeq ($(HOST_OS),Darwin)
-PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,/Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages)
+PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,/Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages)/lldb
else
-PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,$(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages)
+PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,$(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages)/lldb
endif
LLDB_SWIG_INCLUDE_DIRS:= -I"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include" -I./.
LIBLLDB := $(LibDir)/liblldb$(SHLIBEXT)
INST_LIBLLDB := $(PROJ_libdir)/liblldb$(SHLIBEXT)
+# Subpackages of the main LLDB package
+LLDB_SUBPACKAGES := FORMATTERS FORMATTERS_CPP FORMATTERS_OBJC RUNTIME RUNTIME_OBJC UTILS
+# lldb.formatters
+LLDB_PACKAGE_FORMATTERS := formatters
+LLDB_PACKAGE_FORMATTERS_FILES := $(addprefix \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/, \
+ cache.py metrics.py attrib_fromdict.py Logger.py)
+# lldb.formatters.cpp
+LLDB_PACKAGE_FORMATTERS_CPP := formatters/cpp
+LLDB_PACKAGE_FORMATTERS_CPP_FILES := $(addprefix \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/synthetic/,gnu_libstdcpp.py libcxx.py)
+# lldb.formatters.objc
+LLDB_PACKAGE_FORMATTERS_OBJC := formatters/objc
+LLDB_PACKAGE_FORMATTERS_OBJC_FILES := \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/Selector.py \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/objc.py \
+ $(addprefix $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/, \
+ Class.py CFArray.py CFBag.py CFBinaryHeap.py CFBitVector.py \
+ CFDictionary.py CFString.py NSBundle.py NSData.py NSDate.py \
+ NSException.py NSIndexSet.py NSMachPort.py NSNotification.py \
+ NSNumber.py NSSet.py NSURL.py \
+ )
+# lldb.runtime
+LLDB_PACKAGE_RUNTIME := runtime
+LLDB_PACKAGE_RUNTIME_FILES :=
+# lldb.runtime.objc
+LLDB_PACKAGE_RUNTIME_OBJC := runtime/objc
+LLDB_PACKAGE_RUNTIME_OBJC_FILES := \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/objc_runtime.py
+# lldb.utils
+LLDB_PACKAGE_UTILS := utils
+LLDB_PACKAGE_UTILS_FILES := \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/python/symbolication.py
+
+ifeq ($(HOST_OS),Darwin)
+# Additional packages for Darwin/Mac OS X
+LLDB_SUBPACKAGES += MACOSX
+# lldb.macosx
+LLDB_PACKAGE_MACOSX := macosx
+LLDB_PACKAGE_MACOSX_FILES := $(addprefix \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/, python/crashlog.py darwin/heap_find/heap.py \
+)
+endif
+
+LLDB_ALL_SUBPACKAGE_FILES := $(foreach subpackage,$(LLDB_SUBPACKAGES),$(LLDB_PACKAGE_$(subpackage)_FILES))
+LLDB_ALL_INSTALLED_SUBPACKAGE_FILES := $(foreach subpackage,$(LLDB_SUBPACKAGES),$(addprefix $(LLDB_PACKAGE_$(subpackage))/,$(notdir $(LLDB_PACKAGE_$(subpackage)_FILES))))
+
+comma := ,
+LLDB_COPY_PACKAGE = $(Verb) \
+$(foreach subpackage,$(LLDB_SUBPACKAGES), \
+ init_file="$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py"; \
+ $(MKDIR) "$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))"; \
+ $(foreach file,$(LLDB_PACKAGE_$(subpackage)_FILES), \
+ $(CP) "$(file)" "$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))"; \
+ ) \
+ echo "__all__ = [$(patsubst %,\"%\"$(comma),\
+ $(basename $(notdir $(LLDB_PACKAGE_$(subpackage)_FILES))))]" >$$init_file; \
+ echo "for x in __all__:" >>$$init_file; \
+ echo " __import__('lldb.$(subst /,.,$(LLDB_PACKAGE_$(subpackage))).'+x)" >>$$init_file; \
+)
+
+LLDB_INSTALL_SUBPACKAGES = $(Verb) \
+$(foreach subpackage,$(LLDB_SUBPACKAGES), \
+ $(MKDIR) $(PYTHON_DEST_DIR)/$(LLDB_PACKAGE_$(subpackage)); \
+ $(DataInstall) $(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py \
+ $(PYTHON_DEST_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py; \
+) \
+$(foreach file,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES), \
+ $(DataInstall) $(PYTHON_DIR)/$(file) $(PYTHON_DEST_DIR)/$(file); \
+)
+
+ifeq ($(HOST_OS),Darwin)
+# Install the heap_find sources, too.
+LLDB_INSTALL_SUBPACKAGES += $(MKDIR) $(PYTHON_DEST_DIR)/macosx/heap/; \
+$(DataInstall) $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/darwin/heap_find/heap/heap_find.cpp \
+ $(PYTHON_DEST_DIR)/macosx/heap/heap_find.cpp; \
+$(DataInstall) $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/darwin/heap_find/heap/Makefile \
+ $(PYTHON_DEST_DIR)/macosx/heap/Makefile;
+endif
+
# We need Swig to process stdint.h, but by default it will not inspect system
# include directories. The following should cover the standard locations on
# most platforms.
@@ -39,6 +119,8 @@
LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include/gcc/darwin/4.2"
endif
+ifndef DISABLE_AUTO_DEPENDENCIES
+
SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"
CPP_DEPEND_MOVEFILE = then $(MV) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" "$(PROJ_OBJ_DIR)/$*.cpp.d"; \
else $(RM) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"; exit 1; fi
@@ -46,6 +128,7 @@
LLDBWrapPython.cpp: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \
$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py
$(Echo) Generating LLDBWrapPython.cpp
+ $(Verb) $(MKDIR) $(PYTHON_DIR)
$(Verb) if swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
-D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)" \
$(SWIG_DEPEND_OPTIONS) \
@@ -56,20 +139,49 @@
$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
"$(PROJ_OBJ_DIR)"
$(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
- mv "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
- "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
- $(Verb) cp "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
+ $(MV) "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
+ "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
+ $(Verb) $(MV) "$(PYTHON_DIR)/lldb.py" "$(PYTHON_DIR)/__init__.py"
+ $(Verb) $(CP) "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
+ $(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so
+ $(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so
+ $(LLDB_COPY_PACKAGE)
+
+else
+
+LLDBWrapPython.cpp: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \
+ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py
+ $(Echo) Generating LLDBWrapPython.cpp
+ $(Verb) $(MKDIR) $(PYTHON_DIR)
+ $(Verb) swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
+ -D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)" \
+ -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig"
+ $(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \
+ "$(PYTHON_DIR)"
+ $(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
+ "$(PROJ_OBJ_DIR)"
+ $(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
+ $(MV) "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
+ "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
+ $(Verb) $(MV) "$(PYTHON_DIR)/lldb.py" "$(PYTHON_DIR)/__init__.py"
+ $(Verb) $(CP) "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
$(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so
$(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so
+ $(LLDB_COPY_PACKAGE)
+
+endif
-install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py
+install-local:: $(PYTHON_DIR)/__init__.py $(PYTHON_DIR)/embedded_interpreter.py \
+ $(addprefix $(PYTHON_DIR)/,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES))
$(Echo) Installing $(BuildMode) LLDB python modules
- $(Verb) $(MKDIR) $(PYTHON_DEST_DIR)/lib-dynload
- $(Verb) $(DataInstall) $(PYTHON_DIR)/lldb.py $(PYTHON_DEST_DIR)/lldb.py
+ $(Verb) $(MKDIR) $(PYTHON_DEST_DIR)
+ $(Verb) $(DataInstall) $(PYTHON_DIR)/__init__.py $(PYTHON_DEST_DIR)/__init__.py
$(Verb) $(DataInstall) $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DEST_DIR)/embedded_interpreter.py
- $(Verb) $(RM) -f $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so
- $(Verb) $(AliasTool) $(INST_LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so
+ $(Verb) $(RM) -f $(PYTHON_DEST_DIR)/_lldb.so
+ $(Verb) $(AliasTool) $(INST_LIBLLDB) $(PYTHON_DEST_DIR)/_lldb.so
+ $(LLDB_INSTALL_SUBPACKAGES)
clean-local::
$(Verb) $(RM) -f LLDBWrapPython.cpp $(PYTHON_DIR)/_lldb.so \
- $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DIR)/lldb.py
+ $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DIR)/__init__.py \
+ $(addprefix $(PYTHON_DIR)/,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES))
Modified: lldb/branches/lldb-platform-work/source/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Makefile (original)
+++ lldb/branches/lldb-platform-work/source/Makefile Wed May 30 15:55:52 2012
@@ -13,6 +13,7 @@
BUILD_ARCHIVE = 1
BUILT_SOURCES = LLDB_vers.c
+SOURCES := lldb-log.cpp lldb.cpp
include $(LLDB_LEVEL)/Makefile
Modified: lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCSymbolVendor.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Wed May 30 15:55:52 2012
@@ -751,7 +751,6 @@
{
lldb::user_id_t segID = 0;
lldb::user_id_t sectID = 0;
- struct segment_command_64 load_cmd;
uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
const bool is_core = GetType() == eTypeCoreFile;
@@ -760,24 +759,32 @@
// First look up any LC_ENCRYPTION_INFO load commands
typedef RangeArray<uint32_t, uint32_t, 8> EncryptedFileRanges;
EncryptedFileRanges encrypted_file_ranges;
+ encryption_info_command encryption_cmd;
for (i=0; i<m_header.ncmds; ++i)
{
const uint32_t load_cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &encryption_cmd, 2) == NULL)
break;
- if (load_cmd.cmd == LoadCommandEncryptionInfo)
+ if (encryption_cmd.cmd == LoadCommandEncryptionInfo)
{
- EncryptedFileRanges::Entry entry;
- entry.SetRangeBase(m_data.GetU32(&offset));
- entry.SetByteSize(m_data.GetU32(&offset));
- encrypted_file_ranges.Append(entry);
+ if (m_data.GetU32(&offset, &encryption_cmd.cryptoff, 3))
+ {
+ if (encryption_cmd.cryptid != 0)
+ {
+ EncryptedFileRanges::Entry entry;
+ entry.SetRangeBase(encryption_cmd.cryptoff);
+ entry.SetByteSize(encryption_cmd.cryptsize);
+ encrypted_file_ranges.Append(entry);
+ }
+ }
}
- offset = load_cmd_offset + load_cmd.cmdsize;
+ offset = load_cmd_offset + encryption_cmd.cmdsize;
}
offset = MachHeaderSizeFromMagic(m_header.magic);
+ struct segment_command_64 load_cmd;
for (i=0; i<m_header.ncmds; ++i)
{
const uint32_t load_cmd_offset = offset;
@@ -1359,21 +1366,25 @@
}
- if (process)
+ const bool have_strtab_data = strtab_data.GetByteSize() > 0;
+ if (!have_strtab_data)
{
- if (strtab_addr == LLDB_INVALID_ADDRESS)
+ if (process)
+ {
+ if (strtab_addr == LLDB_INVALID_ADDRESS)
+ {
+ if (log)
+ module_sp->LogMessage(log.get(), "failed to locate the strtab in memory");
+ return 0;
+ }
+ }
+ else
{
if (log)
- module_sp->LogMessage(log.get(), "failed to locate the strtab in memory");
+ module_sp->LogMessage(log.get(), "failed to read strtab data");
return 0;
}
}
- else if (strtab_data.GetByteSize() == 0)
- {
- if (log)
- module_sp->LogMessage(log.get(), "failed to read strtab data");
- return 0;
- }
const ConstString &g_segment_name_TEXT = GetSegmentNameTEXT();
const ConstString &g_segment_name_DATA = GetSegmentNameDATA();
@@ -1449,14 +1460,7 @@
SymbolType type = eSymbolTypeInvalid;
const char *symbol_name = NULL;
- if (process)
- {
- const addr_t str_addr = strtab_addr + nlist.n_strx;
- Error str_error;
- if (process->ReadCStringFromMemory(str_addr, memory_symbol_name, str_error))
- symbol_name = memory_symbol_name.c_str();
- }
- else
+ if (have_strtab_data)
{
symbol_name = strtab_data.PeekCStr(nlist.n_strx);
@@ -1476,6 +1480,13 @@
if (symbol_name[0] == '\0')
symbol_name = NULL;
}
+ else
+ {
+ const addr_t str_addr = strtab_addr + nlist.n_strx;
+ Error str_error;
+ if (process->ReadCStringFromMemory(str_addr, memory_symbol_name, str_error))
+ symbol_name = memory_symbol_name.c_str();
+ }
const char *symbol_name_non_abi_mangled = NULL;
SectionSP symbol_section;
@@ -1654,10 +1665,28 @@
{
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
- if (symbol_name[0] == '/')
- N_SO_index = sym_idx;
+ const bool N_SO_has_full_path = symbol_name[0] == '/';
+ if (N_SO_has_full_path)
+ {
+ if (minimize && (N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms))
+ {
+ // We have two consecutive N_SO entries where the first contains a directory
+ // and the second contains a full path.
+ sym[sym_idx - 1].GetMangled().SetValue(symbol_name, false);
+ m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
+ add_nlist = false;
+ }
+ else
+ {
+ // This is the first entry in a N_SO that contains a directory or
+ // a full path to the source file
+ N_SO_index = sym_idx;
+ }
+ }
else if (minimize && (N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms))
{
+ // This is usually the second N_SO entry that contains just the filename,
+ // so here we combine it with the first one if we are minimizing the symbol table
const char *so_path = sym[sym_idx - 1].GetMangled().GetDemangledName().AsCString();
if (so_path && so_path[0])
{
Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Wed May 30 15:55:52 2012
@@ -703,6 +703,9 @@
bool
PlatformDarwin::ModuleIsExcludedForNonModuleSpecificSearches (lldb_private::Target &target, const lldb::ModuleSP &module_sp)
{
+ if (!module_sp)
+ return false;
+
ObjectFile *obj_file = module_sp->GetObjectFile();
if (!obj_file)
return false;
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Wed May 30 15:55:52 2012
@@ -557,7 +557,16 @@
// for the async packet did cause the stop
if (continue_after_async)
{
- //continue_packet.assign (1, 'c');
+ // Reverting this for now as it is causing deadlocks
+ // in programs (<rdar://problem/11529853>). In the future
+ // we should check our thread list and "do the right thing"
+ // for new threads that show up while we stop and run async
+ // packets. Setting the packet to 'c' to continue all threads
+ // is the right thing to do 99.99% of the time because if a
+ // thread was single stepping, and we sent an interrupt, we
+ // will notice above that we didn't stop due to an interrupt
+ // but stopped due to stepping and we would _not_ continue.
+ continue_packet.assign (1, 'c');
continue;
}
}
Modified: lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Wed May 30 15:55:52 2012
@@ -676,40 +676,69 @@
}
// Now look at the byte at the end of the AddressRange for a limited attempt at describing the
- // epilogue. If this function is built -fomit-frame-pointer (so the CFA is defined in terms of the
- // stack pointer) we'd need to profile every instruction which causes rsp to change to backtrace
- // all the time. But assuming the CFA is in terms of rbp most of the time, this one additional Row
- // will be sufficient.
+ // epilogue. We're looking for the sequence
- if (m_func_bounds.GetByteSize() > 2)
+ // [ 0x5d ] mov %rbp, %rsp
+ // [ 0xc3 ] ret
+ // [ 0xe8 xx xx xx xx ] call __stack_chk_fail (this is sometimes the final insn in the function)
+
+ // We want to add a Row describing how to unwind when we're stopped on the 'ret' instruction where the
+ // CFA is no longer defined in terms of rbp, but is now defined in terms of rsp like on function entry.
+
+ uint64_t ret_insn_offset = LLDB_INVALID_ADDRESS;
+ Address end_of_fun(m_func_bounds.GetBaseAddress());
+ end_of_fun.SetOffset (end_of_fun.GetOffset() + m_func_bounds.GetByteSize());
+
+ if (m_func_bounds.GetByteSize() > 7)
{
- Address last_insn (m_func_bounds.GetBaseAddress());
- last_insn.SetOffset (last_insn.GetOffset() + m_func_bounds.GetByteSize() - 1);
- uint8_t bytebuf[1];
- if (target->ReadMemory (last_insn, prefer_file_cache, bytebuf, 1, error) != -1)
+ uint8_t bytebuf[7];
+ Address last_seven_bytes(end_of_fun);
+ last_seven_bytes.SetOffset (last_seven_bytes.GetOffset() - 7);
+ if (target->ReadMemory (last_seven_bytes, prefer_file_cache, bytebuf, 7, error) != -1)
{
- if (bytebuf[0] == 0xc3) // ret aka retq
+ if (bytebuf[5] == 0x5d && bytebuf[6] == 0xc3) // mov, ret
{
- // Create a fresh, empty Row and RegisterLocation - don't mention any other registers
- UnwindPlan::Row epi_row;
- UnwindPlan::Row::RegisterLocation epi_regloc;
-
- // When the ret instruction is about to be executed, here's our state
- epi_row.SetOffset (m_func_bounds.GetByteSize() - 1);
- epi_row.SetCFARegister (m_lldb_sp_regnum);
- epi_row.SetCFAOffset (m_wordsize);
-
- // caller's stack pointer value before the call insn is the CFA address
- epi_regloc.SetIsCFAPlusOffset (0);
- epi_row.SetRegisterInfo (m_lldb_sp_regnum, epi_regloc);
-
- // saved instruction pointer can be found at CFA - wordsize
- epi_regloc.SetAtCFAPlusOffset (-m_wordsize);
- epi_row.SetRegisterInfo (m_lldb_ip_regnum, epi_regloc);
-
- unwind_plan.AppendRow (epi_row);
+ ret_insn_offset = m_func_bounds.GetByteSize() - 1;
+ }
+ else if (bytebuf[0] == 0x5d && bytebuf[1] == 0xc3 && bytebuf[2] == 0xe8) // mov, ret, call
+ {
+ ret_insn_offset = m_func_bounds.GetByteSize() - 6;
}
}
+ } else if (m_func_bounds.GetByteSize() > 2)
+ {
+ uint8_t bytebuf[2];
+ Address last_two_bytes(end_of_fun);
+ last_two_bytes.SetOffset (last_two_bytes.GetOffset() - 2);
+ if (target->ReadMemory (last_two_bytes, prefer_file_cache, bytebuf, 2, error) != -1)
+ {
+ if (bytebuf[0] == 0x5d && bytebuf[1] == 0xc3) // mov, ret
+ {
+ ret_insn_offset = m_func_bounds.GetByteSize() - 1;
+ }
+ }
+ }
+
+ if (ret_insn_offset != LLDB_INVALID_ADDRESS)
+ {
+ // Create a fresh, empty Row and RegisterLocation - don't mention any other registers
+ UnwindPlan::Row epi_row;
+ UnwindPlan::Row::RegisterLocation epi_regloc;
+
+ // When the ret instruction is about to be executed, here's our state
+ epi_row.SetOffset (ret_insn_offset);
+ epi_row.SetCFARegister (m_lldb_sp_regnum);
+ epi_row.SetCFAOffset (m_wordsize);
+
+ // caller's stack pointer value before the call insn is the CFA address
+ epi_regloc.SetIsCFAPlusOffset (0);
+ epi_row.SetRegisterInfo (m_lldb_sp_regnum, epi_regloc);
+
+ // saved instruction pointer can be found at CFA - wordsize
+ epi_regloc.SetAtCFAPlusOffset (-m_wordsize);
+ epi_row.SetRegisterInfo (m_lldb_ip_regnum, epi_regloc);
+
+ unwind_plan.AppendRow (epi_row);
}
unwind_plan.SetSourceName ("assembly insn profiling");
Modified: lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp Wed May 30 15:55:52 2012
@@ -431,10 +431,15 @@
{
if (NamedDecl *from_named_decl = dyn_cast<clang::NamedDecl>(from))
{
+ std::string name_string;
+ llvm::raw_string_ostream name_stream(name_string);
+ from_named_decl->printName(name_stream);
+ name_stream.flush();
+
log->Printf(" [ClangASTImporter] Imported (%sDecl*)%p, named %s (from (Decl*)%p), metadata 0x%llx",
from->getDeclKindName(),
to,
- from_named_decl->getName().str().c_str(),
+ name_string.c_str(),
from,
m_master.GetDeclMetadata(from));
}
Modified: lldb/branches/lldb-platform-work/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Process.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Process.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Process.cpp Wed May 30 15:55:52 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/lldb-platform-work/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Target.cpp?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Target.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Target.cpp Wed May 30 15:55:52 2012
@@ -1062,6 +1062,7 @@
// If the contents of this section are encrypted, the on-disk file is unusuable. Read only from live memory.
if (section_sp->IsEncrypted())
{
+ error.SetErrorString("section is encrypted");
return 0;
}
ModuleSP module_sp (section_sp->GetModule());
Modified: lldb/branches/lldb-platform-work/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/Makefile (original)
+++ lldb/branches/lldb-platform-work/test/Makefile Wed May 30 15:55:52 2012
@@ -31,7 +31,8 @@
check-local::
rm -rf ../test-rdir
env PATH="$(ToolDir):$(PATH)" \
- PYTHONPATH=$(ToolDir) \
+ PYTHONPATH=$(LibDir)/python \
LLDB_EXEC=$(ToolDir)/lldb \
+ LLDB_BUILD_TYPE=Makefile \
$(SHLIBPATH_VAR)=$(LibDir):$($(SHLIBPATH_VAR)) \
python $(PROJ_SRC_DIR)/dotest.py -i -v -r ../test-rdir
Modified: lldb/branches/lldb-platform-work/test/api/check_public_api_headers/TestPublicAPIHeaders.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/api/check_public_api_headers/TestPublicAPIHeaders.py (original)
+++ lldb/branches/lldb-platform-work/test/api/check_public_api_headers/TestPublicAPIHeaders.py Wed May 30 15:55:52 2012
@@ -29,7 +29,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'
@@ -49,7 +49,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/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Wed May 30 15:55:52 2012
@@ -14,7 +14,7 @@
@classmethod
def classCleanup(cls):
"""Cleanup the test byproduct of breakpoint_command_sequence(self)."""
- system(["/bin/sh", "-c", "rm -f output.txt"])
+ system(["/bin/sh", "-c", "rm -f output.txt output2.txt"])
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@dsym_test
Modified: lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py Wed May 30 15:55:52 2012
@@ -14,28 +14,41 @@
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@dsym_test
- def test_with_dsym_and_run_command(self):
+ def test_breakpoint_condition_with_dsym_and_run_command(self):
"""Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
self.buildDsym()
self.breakpoint_conditions()
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @dsym_test
+ def test_breakpoint_condition_inline_with_dsym_and_run_command(self):
+ """Exercise breakpoint condition inline with 'breakpoint set'."""
+ self.buildDsym()
+ self.breakpoint_conditions(inline=True)
+
+ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
@dsym_test
- def test_with_dsym_and_python_api(self):
+ def test_breakpoint_condition_with_dsym_and_python_api(self):
"""Use Python APIs to set breakpoint conditions."""
self.buildDsym()
self.breakpoint_conditions_python()
@dwarf_test
- def test_with_dwarf_and_run_command(self):
+ def test_breakpoint_condition_with_dwarf_and_run_command(self):
"""Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
self.buildDwarf()
self.breakpoint_conditions()
+ @dwarf_test
+ def test_breakpoint_condition_inline_with_dwarf_and_run_command(self):
+ """Exercise breakpoint condition inline with 'breakpoint set'."""
+ self.buildDwarf()
+ self.breakpoint_conditions(inline=True)
+
@python_api_test
@dwarf_test
- def test_with_dwarf_and_python_api(self):
+ def test_breakpoint_condition_with_dwarf_and_python_api(self):
"""Use Python APIs to set breakpoint conditions."""
self.buildDwarf()
self.breakpoint_conditions_python()
@@ -47,17 +60,22 @@
self.line1 = line_number('main.c', '// Find the line number of function "c" here.')
self.line2 = line_number('main.c', "// Find the line number of c's parent call here.")
- def breakpoint_conditions(self):
+ def breakpoint_conditions(self, inline=False):
"""Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- # Create a breakpoint by function name 'c'.
- self.expect("breakpoint set -n c", BREAKPOINT_CREATED,
- startstr = "Breakpoint created: 1: name = 'c', locations = 1")
+ if inline:
+ # Create a breakpoint by function name 'c' and set the condition.
+ self.expect("breakpoint set -n c -c 'val == 3'", BREAKPOINT_CREATED,
+ startstr = "Breakpoint created: 1: name = 'c', locations = 1")
+ else:
+ # Create a breakpoint by function name 'c'.
+ self.expect("breakpoint set -n c", BREAKPOINT_CREATED,
+ startstr = "Breakpoint created: 1: name = 'c', locations = 1")
- # And set a condition on the breakpoint to stop on when 'val == 3'.
- self.runCmd("breakpoint modify -c 'val == 3' 1")
+ # And set a condition on the breakpoint to stop on when 'val == 3'.
+ self.runCmd("breakpoint modify -c 'val == 3' 1")
# Now run the program.
self.runCmd("run", RUN_SUCCEEDED)
Modified: lldb/branches/lldb-platform-work/test/functionalities/register/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/register/TestRegisters.py?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/register/TestRegisters.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/register/TestRegisters.py Wed May 30 15:55:52 2012
@@ -71,6 +71,13 @@
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped', 'stop reason = breakpoint'])
+ # The vanilla "register read" command does not output derived register like eax.
+ self.expect("register read", matching=False,
+ substrs = ['eax'])
+ # While "register read -a" does output derived register like eax.
+ self.expect("register read -a", matching=True,
+ substrs = ['eax'])
+
# Test reading of rax and eax.
self.runCmd("register read rax eax")
Modified: lldb/branches/lldb-platform-work/test/help/TestHelp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/help/TestHelp.py?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/help/TestHelp.py (original)
+++ lldb/branches/lldb-platform-work/test/help/TestHelp.py Wed May 30 15:55:52 2012
@@ -65,6 +65,11 @@
return None
+ def test_help_arch(self):
+ """Test 'help arch' which should list of supported architectures."""
+ self.expect("help arch",
+ substrs = ['arm', 'x86_64', 'i386'])
+
def test_help_version(self):
"""Test 'help version' and 'version' commands."""
self.expect("help version",
Modified: lldb/branches/lldb-platform-work/test/lang/cpp/stl/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/cpp/stl/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/cpp/stl/Makefile (original)
+++ lldb/branches/lldb-platform-work/test/lang/cpp/stl/Makefile Wed May 30 15:55:52 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/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original)
+++ lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Wed May 30 15:55:52 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/lldb-platform-work/test/python_api/formatters/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/python_api/formatters/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/python_api/formatters/Makefile (original)
+++ lldb/branches/lldb-platform-work/test/python_api/formatters/Makefile Wed May 30 15:55:52 2012
@@ -2,4 +2,7 @@
CXX_SOURCES := main.cpp
+# Clean renamed executable on 'make clean'
+clean: OBJECTS+=no_synth
+
include $(LEVEL)/Makefile.rules
Modified: lldb/branches/lldb-platform-work/tools/debugserver/scripts/dbgnub-config.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/scripts/dbgnub-config.pl?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/scripts/dbgnub-config.pl (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/scripts/dbgnub-config.pl Wed May 30 15:55:52 2012
@@ -33,6 +33,7 @@
my $val;
while (($key, $val) = each %ENV)
{
+ $val =~ s/\n/\n\/\/ /;
printf CONFIG "// %s = %s\n", $key, $val;
}
print CONFIG "//" . "-" x 72 . "\n";
Modified: lldb/branches/lldb-platform-work/tools/driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/driver/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/driver/Makefile (original)
+++ lldb/branches/lldb-platform-work/tools/driver/Makefile Wed May 30 15:55:52 2012
@@ -10,21 +10,21 @@
TOOLNAME = lldb
-LD.Flags += -ledit -llldb -llldbUtility
+LLVMLibsOptions += -ledit -llldb -llldbUtility
include $(LLDB_LEVEL)/Makefile
ifeq ($(HOST_OS),Darwin)
- LD.Flags += -Wl,-rpath, at loader_path/../lib/
- LD.Flags += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
+ LLVMLibsOptions += -Wl,-rpath, at loader_path/../lib/
+ LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
endif
ifeq ($(HOST_OS),Linux)
- LD.Flags += -Wl,-rpath,$(LibDir)
+ LLVMLibsOptions += -Wl,-rpath,$(LibDir)
endif
ifeq ($(HOST_OS),FreeBSD)
CPP.Flags += -I/usr/include/edit #-v
- LD.Flags += -Wl,-rpath,$(LibDir)
+ LLVMLibsOptions += -Wl,-rpath,$(LibDir)
endif
Modified: lldb/branches/lldb-platform-work/tools/lldb-platform/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/lldb-platform/Makefile?rev=157714&r1=157713&r2=157714&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/lldb-platform/Makefile (original)
+++ lldb/branches/lldb-platform-work/tools/lldb-platform/Makefile Wed May 30 15:55:52 2012
@@ -10,14 +10,14 @@
TOOLNAME = lldb-platform
-LD.Flags += -llldb -llldbUtility
+LLVMLibsOptions += -llldb -llldbUtility
include $(LLDB_LEVEL)/Makefile
ifeq ($(HOST_OS),Darwin)
- LD.Flags += -Wl,-rpath, at loader_path/../lib/
+ LLVMLibsOptions += -Wl,-rpath, at loader_path/../lib/
endif
ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD))
- LD.Flags += -Wl,-rpath,$(LibDir)
+ LLVMLibsOptions += -Wl,-rpath,$(LibDir)
endif
More information about the lldb-commits
mailing list