diff options
50 files changed, 341 insertions, 327 deletions
diff --git a/lldb/include/lldb/Breakpoint/BreakpointOptions.h b/lldb/include/lldb/Breakpoint/BreakpointOptions.h index 689176b901e..e7c1ec884b8 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointOptions.h +++ b/lldb/include/lldb/Breakpoint/BreakpointOptions.h @@ -18,7 +18,6 @@ #include "lldb/lldb-private.h" #include "lldb/Core/Baton.h" #include "lldb/Core/StringList.h" -#include "lldb/Expression/ClangUserExpression.h" namespace lldb_private { diff --git a/lldb/include/lldb/Core/ArchSpec.h b/lldb/include/lldb/Core/ArchSpec.h index d0009800303..4b253d9a35d 100644 --- a/lldb/include/lldb/Core/ArchSpec.h +++ b/lldb/include/lldb/Core/ArchSpec.h @@ -113,7 +113,7 @@ public: /// Triple. //------------------------------------------------------------------ ArchSpec (const llvm::Triple &triple); - ArchSpec (const char *triple_cstr); + ArchSpec (const char *triple_cstr, Platform *platform); //------------------------------------------------------------------ /// Constructor over architecture name. /// @@ -320,7 +320,7 @@ public: SetTriple (const llvm::Triple &triple); bool - SetTriple (const char *triple_cstr); + SetTriple (const char *triple_cstr, Platform *platform); //------------------------------------------------------------------ /// Returns the default endianness of the architecture. diff --git a/lldb/include/lldb/Core/STLUtils.h b/lldb/include/lldb/Core/STLUtils.h index 342d5b4b57c..9321e057a39 100644 --- a/lldb/include/lldb/Core/STLUtils.h +++ b/lldb/include/lldb/Core/STLUtils.h @@ -11,7 +11,6 @@ #define liblldb_STLUtils_h_ #if defined(__cplusplus) -#include "llvm/ADT/StringExtras.h" #include <string.h> #include <map> @@ -62,15 +61,6 @@ public: } }; -struct StdStringHash -{ - size_t operator()( const std::string& x ) const - { - return llvm::HashString(x); - } -}; - - template <class T> inline void PrintAllCollectionElements (std::ostream &s, const T& coll, const char* header_cstr=NULL, const char* separator_cstr=" ") { diff --git a/lldb/include/lldb/Expression/ClangExpressionDeclMap.h b/lldb/include/lldb/Expression/ClangExpressionDeclMap.h index df44853ec7a..b0a08f7757b 100644 --- a/lldb/include/lldb/Expression/ClangExpressionDeclMap.h +++ b/lldb/include/lldb/Expression/ClangExpressionDeclMap.h @@ -19,6 +19,7 @@ // Other libraries and framework includes // Project includes +#include "llvm/ADT/APInt.h" #include "llvm/ADT/DenseMap.h" #include "lldb/lldb-public.h" #include "lldb/Core/ClangForward.h" diff --git a/lldb/include/lldb/Interpreter/Options.h b/lldb/include/lldb/Interpreter/Options.h index 0c545876b17..4bbef1813e4 100644 --- a/lldb/include/lldb/Interpreter/Options.h +++ b/lldb/include/lldb/Interpreter/Options.h @@ -73,7 +73,7 @@ namespace lldb_private { /// return error; /// } /// -/// CommandOptions () : debug (true), verbose (false), log_file (), log_flags (0) +/// CommandOptions (CommandInterpreter &interpreter) : debug (true), verbose (false), log_file (), log_flags (0) /// {} /// /// bool debug; @@ -112,7 +112,7 @@ class Options { public: - Options (); + Options (CommandInterpreter &interpreter); virtual ~Options (); @@ -157,8 +157,7 @@ public: uint32_t output_max_columns); void - GenerateOptionUsage (CommandInterpreter &interpreter, - Stream &strm, + GenerateOptionUsage (Stream &strm, CommandObject *cmd); // The following two pure virtual functions must be defined by every class that inherits from @@ -227,8 +226,7 @@ public: /// \btrue if we were in an option, \bfalse otherwise. //------------------------------------------------------------------ bool - HandleOptionCompletion (CommandInterpreter &interpreter, - Args &input, + HandleOptionCompletion (Args &input, OptionElementVector &option_map, int cursor_index, int char_pos, @@ -277,8 +275,7 @@ public: /// \btrue if we were in an option, \bfalse otherwise. //------------------------------------------------------------------ virtual bool - HandleOptionArgumentCompletion (CommandInterpreter &interpreter, - Args &input, + HandleOptionArgumentCompletion (Args &input, int cursor_index, int char_pos, OptionElementVector &opt_element_vector, @@ -293,6 +290,7 @@ protected: typedef std::set<char> OptionSet; typedef std::vector<OptionSet> OptionSetVector; + CommandInterpreter &m_interpreter; std::vector<struct option> m_getopt_table; OptionSet m_seen_options; OptionSetVector m_required_options; diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index b3c94d07a6c..f1cb0a8a5c8 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -22,6 +22,7 @@ #include "lldb/Core/Event.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/UserSettingsController.h" +#include "lldb/Expression/ClangPersistentVariables.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ABI.h" #include "lldb/Target/ExecutionContextScope.h" diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index 7369511db5c..a4251c21468 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -51,6 +51,7 @@ class ClangExpressionVariableList; class ClangExpressionVariableList; class ClangExpressionVariables; class ClangPersistentVariables; +class ClangUserExpression; class CommandInterpreter; class CommandObject; class CommandReturnObject; diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 3ba9b77a935..0019e971159 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -2716,8 +2716,8 @@ files = ( ); inputPaths = ( + "$(LLVM_SOURCE_DIR)", "$(LLVM_BUILD_DIR)", - "$(SRCROOT)/scripts/build-llvm.pl", ); name = "Build llvm and clang"; outputPaths = ( @@ -3170,10 +3170,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - x86_64, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -3192,6 +3189,10 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = ""; + LLVM_CONFIGURATION = Release; + LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; @@ -3202,10 +3203,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - x86_64, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( __STDC_CONSTANT_MACROS, @@ -3223,6 +3221,10 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = ""; + LLVM_CONFIGURATION = Release; + LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; }; @@ -3235,11 +3237,9 @@ DEBUG_INFORMATION_FORMAT = dwarf; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; INSTALL_PATH = /Developer/usr/bin; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; PRODUCT_NAME = "darwin-debug"; }; name = Debug; @@ -3251,12 +3251,9 @@ COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; INSTALL_PATH = /Developer/usr/bin; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; PRODUCT_NAME = "darwin-debug"; - ZERO_LINK = NO; }; name = Release; }; @@ -3266,10 +3263,8 @@ ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; INSTALL_PATH = /Developer/usr/bin; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; PRODUCT_NAME = "darwin-debug"; }; name = BuildAndIntegration; @@ -3305,8 +3300,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; OTHER_CFLAGS = "-Wparentheses"; OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3319,9 +3312,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = LLDB; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -3357,8 +3349,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; OTHER_CFLAGS = "-Wparentheses"; OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3371,18 +3361,15 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = LLDB; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = Release; }; 2689FFD513353D7A00698AC0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 46; DYLIB_CURRENT_VERSION = 46; @@ -3403,8 +3390,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = "-Wparentheses"; @@ -3416,7 +3401,7 @@ OTHER_LDFLAGS = "-lllvmclang"; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -3424,7 +3409,6 @@ 2689FFD613353D7A00698AC0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 46; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -3446,8 +3430,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = "-Wparentheses"; @@ -3459,7 +3441,7 @@ OTHER_LDFLAGS = "-lllvmclang"; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; @@ -3467,7 +3449,6 @@ 2689FFD713353D7A00698AC0 /* BuildAndIntegration */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 46; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -3489,8 +3470,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(DERIVED_FILE_DIR)/llvm.build"; - LLVM_CONFIGURATION = Release; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = "-Wparentheses"; @@ -3502,7 +3481,7 @@ OTHER_LDFLAGS = "-lllvmclang"; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = BuildAndIntegration; @@ -3511,10 +3490,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - x86_64, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( __STDC_CONSTANT_MACROS, @@ -3532,6 +3508,10 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/"; + LLVM_CONFIGURATION = Release; + LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; }; @@ -3549,7 +3529,6 @@ ); GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "lldb-Info.plist"; @@ -3563,11 +3542,9 @@ "$(PROJECT_DIR)/tools/driver/lldb-Info.plist", "-Wl,-rpath,@loader_path/../../Library/PrivateFrameworks/", ); - PREBINDING = NO; PRODUCT_NAME = lldb; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = BuildAndIntegration; }; @@ -3602,8 +3579,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(DERIVED_FILE_DIR)/llvm.build"; - LLVM_CONFIGURATION = Release; OTHER_CFLAGS = "-Wparentheses"; OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3616,11 +3591,9 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = LLDB; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = BuildAndIntegration; }; @@ -3636,7 +3609,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = /usr/local/bin; @@ -3646,9 +3618,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = "lldb-platform"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include $(SRCROOT)/source/Plugins/Process/gdb-remote $(SRCROOT)/source"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; }; name = Debug; }; @@ -3664,7 +3635,6 @@ ); GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = /usr/local/bin; OTHER_LDFLAGS = ( @@ -3673,10 +3643,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = "lldb-platform"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include $(SRCROOT)/source/Plugins/Process/gdb-remote $(SRCROOT)/source"; - ZERO_LINK = NO; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; }; name = Release; }; @@ -3690,7 +3658,6 @@ ); GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = /usr/local/bin; OTHER_LDFLAGS = ( @@ -3699,9 +3666,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = "lldb-platform"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include $(SRCROOT)/source/Plugins/Process/gdb-remote $(SRCROOT)/source"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; }; name = BuildAndIntegration; }; @@ -3718,7 +3684,6 @@ ); GCC_DYNAMIC_NO_PIC = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; @@ -3733,9 +3698,8 @@ "$(PROJECT_DIR)/tools/driver/lldb-Info.plist", "-Wl,-rpath,@loader_path/", ); - PREBINDING = NO; PRODUCT_NAME = lldb; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -3743,10 +3707,6 @@ 26F5C26D10F3D9A5009D5894 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - x86_64, - i386, - ); CODE_SIGN_IDENTITY = lldb_codesign; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 46; @@ -3757,7 +3717,6 @@ ); GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "lldb-Info.plist"; @@ -3771,11 +3730,9 @@ "$(PROJECT_DIR)/tools/driver/lldb-Info.plist", "-Wl,-rpath,@loader_path/", ); - PREBINDING = NO; PRODUCT_NAME = lldb; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = Release; }; diff --git a/lldb/scripts/build-llvm.pl b/lldb/scripts/build-llvm.pl index 8aff1101e80..3ada7ce6c2f 100644 --- a/lldb/scripts/build-llvm.pl +++ b/lldb/scripts/build-llvm.pl @@ -13,7 +13,8 @@ use File::Basename; use File::Glob ':glob'; use List::Util qw[min max]; -our $llvm_dstroot = $ENV{SCRIPT_INPUT_FILE_0}; +our $llvm_srcroot = $ENV{SCRIPT_INPUT_FILE_0}; +our $llvm_dstroot = $ENV{SCRIPT_INPUT_FILE_1}; our $libedis_outfile = $ENV{SCRIPT_OUTPUT_FILE_0}; our ($libedis_basename, $libedis_dirname) = fileparse ($libedis_outfile); @@ -27,8 +28,6 @@ our $llvm_configuration = $ENV{LLVM_CONFIGURATION}; our $llvm_revision = "128303"; our $llvm_source_dir = "$ENV{SRCROOT}"; -our $cc = "$ENV{DEVELOPER_BIN_DIR}/gcc-4.2"; -our $cxx = "$ENV{DEVELOPER_BIN_DIR}/g++-4.2"; our @archs = split (/\s+/, $ENV{ARCHS}); our @archive_files = ( @@ -84,7 +83,7 @@ our @archive_files = ( "$llvm_configuration/lib/libLLVMX86Utils.a", ); -if (-l $llvm_dstroot) +if (-e "$llvm_srcroot/lib") { print "Using standard LLVM build directory...\n"; # LLVM in the "lldb" root is a symlink which indicates we are using a @@ -230,7 +229,7 @@ sub build_llvm print "Configuring clang ($arch) in '$llvm_dstroot_arch'...\n"; my $lldb_configuration_options = ''; $llvm_configuration eq 'Release' and $lldb_configuration_options .= '--enable-optimized --disable-assertions'; - do_command ("cd '$llvm_dstroot_arch' && '$llvm_source_dir/llvm/configure' $lldb_configuration_options --enable-targets=x86_64,arm --build=$arch-apple-darwin10 CC=\"$cc -arch $arch\" CXX=\"$cxx -arch $arch\"", + do_command ("cd '$llvm_dstroot_arch' && '$llvm_source_dir/llvm/configure' $lldb_configuration_options --enable-targets=x86_64,arm --build=$arch-apple-darwin10", "configuring llvm build", 1); } diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 5c86d99c73c..c54ff216c94 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -358,7 +358,7 @@ SBDebugger::SetDefaultArchitecture (const char *arch_name) { if (arch_name) { - ArchSpec arch (arch_name); + ArchSpec arch (arch_name, NULL); if (arch.IsValid()) { lldb_private::Target::SetDefaultArchitecture (arch); @@ -425,7 +425,7 @@ SBDebugger::CreateTargetWithFileAndTargetTriple (const char *filename, { ArchSpec arch; FileSpec file_spec (filename, true); - arch.SetTriple (target_triple); + arch.SetTriple (target_triple, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get()); TargetSP target_sp; Error error (m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, file_spec, arch, true, target_sp)); target.reset (target_sp); @@ -455,7 +455,7 @@ SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *arch_ Error error; if (arch_cstr) - arch.SetTriple (arch_cstr); + arch.SetTriple (arch_cstr, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get()); error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, file, arch, true, target_sp); @@ -534,7 +534,7 @@ SBDebugger::FindTargetWithFileAndArch (const char *filename, const char *arch_na if (m_opaque_sp && filename && filename[0]) { // No need to lock, the target list is thread safe - ArchSpec arch (arch_name); + ArchSpec arch (arch_name, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get()); TargetSP target_sp (m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture (FileSpec(filename, false), arch_name ? &arch : NULL)); sb_target.reset(target_sp); } diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp index ce90bbb4fb7..e46e8696ed0 100644 --- a/lldb/source/API/SBInstruction.cpp +++ b/lldb/source/API/SBInstruction.cpp @@ -140,7 +140,7 @@ SBInstruction::DumpEmulation (const char *triple) { if (m_opaque_sp && triple) { - lldb_private::ArchSpec arch (triple); + lldb_private::ArchSpec arch (triple, NULL); return m_opaque_sp->Emulate (arch, NULL, diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp index f75ac0b17ab..26ffa19c7a4 100644 --- a/lldb/source/Commands/CommandObjectArgs.cpp +++ b/lldb/source/Commands/CommandObjectArgs.cpp @@ -36,8 +36,8 @@ using namespace lldb_private; // calling functions. // -CommandObjectArgs::CommandOptions::CommandOptions () : - Options() +CommandObjectArgs::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { // Keep only one place to reset the values to their defaults ResetOptionValues(); @@ -80,7 +80,8 @@ CommandObjectArgs::CommandObjectArgs (CommandInterpreter &interpreter) : CommandObject (interpreter, "args", "When stopped at the start of a function, reads function arguments of type (u?)int(8|16|32|64)_t, (void|char)*", - "args") + "args"), + m_options (interpreter) { } diff --git a/lldb/source/Commands/CommandObjectArgs.h b/lldb/source/Commands/CommandObjectArgs.h index 544d343df22..b6a7f3200c0 100644 --- a/lldb/source/Commands/CommandObjectArgs.h +++ b/lldb/source/Commands/CommandObjectArgs.h @@ -28,7 +28,7 @@ namespace lldb_private { { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 8208ea8123c..c8287015643 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -47,8 +47,8 @@ AddBreakpointDescription (Stream *s, Breakpoint *bp, lldb::DescriptionLevel leve //------------------------------------------------------------------------- #pragma mark Set::CommandOptions -CommandObjectBreakpointSet::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointSet::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_filename (), m_line_num (0), m_column (0), @@ -259,7 +259,8 @@ CommandObjectBreakpointSet::CommandObjectBreakpointSet (CommandInterpreter &inte CommandObject (interpreter, "breakpoint set", "Sets a breakpoint or set of breakpoints in the executable.", - "breakpoint set <cmd-options>") + "breakpoint set <cmd-options>"), + m_options (interpreter) { } @@ -637,8 +638,8 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe //------------------------------------------------------------------------- #pragma mark List::CommandOptions -CommandObjectBreakpointList::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointList::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_level (lldb::eDescriptionLevelBrief) // Breakpoint List defaults to brief descriptions { } @@ -717,7 +718,8 @@ CommandObjectBreakpointList::CommandObjectBreakpointList (CommandInterpreter &in CommandObject (interpreter, "breakpoint list", "List some or all breakpoints at configurable levels of detail.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData bp_id_arg; @@ -1045,8 +1047,8 @@ CommandObjectBreakpointDisable::Execute //------------------------------------------------------------------------- #pragma mark Clear::CommandOptions -CommandObjectBreakpointClear::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointClear::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_filename (), m_line_num (0) { @@ -1114,7 +1116,8 @@ CommandObjectBreakpointClear::CommandObjectBreakpointClear (CommandInterpreter & CommandObject (interpreter, "breakpoint clear", "Clears a breakpoint or set of breakpoints in the executable.", - "breakpoint clear <cmd-options>") + "breakpoint clear <cmd-options>"), + m_options (interpreter) { } @@ -1348,8 +1351,8 @@ CommandObjectBreakpointDelete::Execute //------------------------------------------------------------------------- #pragma mark Modify::CommandOptions -CommandObjectBreakpointModify::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointModify::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_ignore_count (0), m_thread_id(LLDB_INVALID_THREAD_ID), m_thread_id_passed(false), @@ -1504,7 +1507,8 @@ CommandObjectBreakpointModify::CommandObjectBreakpointModify (CommandInterpreter "Modify the options on a breakpoint or set of breakpoints in the executable. " "If no breakpoint is specified, acts on the last created breakpoint. " "With the exception of -e, -d and -i, passing an empty argument clears the modification.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData bp_id_arg; diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h index fdfd1d90bf6..c624dc554e2 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.h +++ b/lldb/source/Commands/CommandObjectBreakpoint.h @@ -76,7 +76,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); @@ -142,7 +142,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); @@ -243,7 +243,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); @@ -303,7 +303,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index c3d50ea0209..f4815159389 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -31,8 +31,8 @@ using namespace lldb_private; // CommandObjectBreakpointCommandAdd::CommandOptions //------------------------------------------------------------------------- -CommandObjectBreakpointCommandAdd::CommandOptions::CommandOptions () : - Options (), +CommandObjectBreakpointCommandAdd::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), m_use_commands (false), m_use_script_language (false), m_script_language (eScriptLanguageNone), @@ -153,7 +153,8 @@ CommandObjectBreakpointCommandAdd::CommandObjectBreakpointCommandAdd (CommandInt CommandObject (interpreter, "add", "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit.", - NULL) + NULL), + m_options (interpreter) { SetHelpLong ( "\nGeneral information about entering breakpoint commands \n\ diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.h b/lldb/source/Commands/CommandObjectBreakpointCommand.h index 5e3e1a1abff..5cfa848e4c2 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.h +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.h @@ -95,7 +95,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index b3a974b538e..8f8dd965293 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -34,7 +34,10 @@ private: { public: - CommandOptions (){} + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter) + { + } virtual ~CommandOptions (){} @@ -106,7 +109,8 @@ public: CommandObject (interpreter, "commands source", "Read in debugger commands from the file <filename> and execute them.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 6567a0896a9..84630ff9955 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -32,8 +32,8 @@ using namespace lldb; using namespace lldb_private; -CommandObjectDisassemble::CommandOptions::CommandOptions () : - Options(), +CommandObjectDisassemble::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter), num_lines_context(0), num_instructions (0), func_name(), @@ -128,7 +128,7 @@ CommandObjectDisassemble::CommandOptions::SetOptionValue (int option_idx, const break; case 'a': - arch.SetTriple (option_arg); + arch.SetTriple (option_arg, m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform().get()); break; default: @@ -195,7 +195,8 @@ CommandObjectDisassemble::CommandObjectDisassemble (CommandInterpreter &interpre CommandObject (interpreter, "disassemble", "Disassemble bytes in the current function, or elsewhere in the executable program as specified by the user.", - "disassemble [<cmd-options>]") + "disassemble [<cmd-options>]"), + m_options (interpreter) { } @@ -248,10 +249,7 @@ CommandObjectDisassemble::Execute if (command.GetArgumentCount() != 0) { result.AppendErrorWithFormat ("\"disassemble\" arguments are specified as options.\n"); - GetOptions()->GenerateOptionUsage (m_interpreter, - result.GetErrorStream(), - this); - + GetOptions()->GenerateOptionUsage (result.GetErrorStream(), this); result.SetStatus (eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectDisassemble.h b/lldb/source/Commands/CommandObjectDisassemble.h index 46b4bacfccd..ac354a8f2c7 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.h +++ b/lldb/source/Commands/CommandObjectDisassemble.h @@ -30,7 +30,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 220801f132c..5e5f96898b4 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -37,8 +37,8 @@ using namespace lldb; using namespace lldb_private; -CommandObjectExpression::CommandOptions::CommandOptions () : - Options() +CommandObjectExpression::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { // Keep only one place to reset the values to their defaults ResetOptionValues(); @@ -115,6 +115,7 @@ CommandObjectExpression::CommandObjectExpression (CommandInterpreter &interprete "expression", "Evaluate a C/ObjC/C++ expression in the current program context, using variables currently in scope.", NULL), + m_options (interpreter), m_expr_line_count (0), m_expr_lines () { diff --git a/lldb/source/Commands/CommandObjectExpression.h b/lldb/source/Commands/CommandObjectExpression.h index 5ddb0db6ddc..fcf308aa3c5 100644 --- a/lldb/source/Commands/CommandObjectExpression.h +++ b/lldb/source/Commands/CommandObjectExpression.h @@ -29,7 +29,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); diff --git a/lldb/source/Commands/CommandObjectFile.cpp b/lldb/source/Commands/CommandObjectFile.cpp index 6f1267ebf1d..e0c81bbf983 100644 --- a/lldb/source/Commands/CommandObjectFile.cpp +++ b/lldb/source/Commands/CommandObjectFile.cpp @@ -25,8 +25,8 @@ using namespace lldb; using namespace lldb_private; -CommandObjectFile::CommandOptions::CommandOptions() : - Options (), +CommandObjectFile::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_arch () // Breakpoint info defaults to brief descriptions { } @@ -58,7 +58,8 @@ CommandObjectFile::CommandOptions::SetOptionValue (int option_idx, const char *o { case 'a': { - ArchSpec option_arch (option_arg); + PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform()); + ArchSpec option_arch (option_arg, platform_sp.get()); if (option_arch.IsValid()) m_arch = option_arch; else @@ -88,7 +89,8 @@ CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) : CommandObject (interpreter, "file", "Set the file to be used as the main executable by the debugger.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; diff --git a/lldb/source/Commands/CommandObjectFile.h b/lldb/source/Commands/CommandObjectFile.h index bccb4bc2e47..bbbacdb4640 100644 --- a/lldb/source/Commands/CommandObjectFile.h +++ b/lldb/source/Commands/CommandObjectFile.h @@ -44,7 +44,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 8c83b674fc3..3b697fd52cb 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -99,8 +99,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { ResetOptionValues (); } @@ -155,7 +155,8 @@ public: "frame select", "Select a frame by index from within the current thread and make it the current frame.", NULL, - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData index_arg; @@ -224,7 +225,7 @@ public: else { result.AppendError ("invalid arguments.\n"); - m_options.GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this); + m_options.GenerateOptionUsage (result.GetErrorStream(), this); } } @@ -289,8 +290,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { ResetOptionValues (); } @@ -407,7 +408,8 @@ public: "Children of aggregate variables can be specified such as " "'var->child.x'.", NULL, - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData var_name_arg; diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index 98fe2ad58c2..bbf1552e7e3 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -140,7 +140,7 @@ CommandObjectHelp::Execute (Args& command, CommandReturnObject &result) else m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1); output_strm.Printf ("\nSyntax: %s\n", sub_cmd_obj->GetSyntax()); - sub_cmd_obj->GetOptions()->GenerateOptionUsage (m_interpreter, output_strm, sub_cmd_obj); + sub_cmd_obj->GetOptions()->GenerateOptionUsage (output_strm, sub_cmd_obj); const char *long_help = sub_cmd_obj->GetHelpLong(); if ((long_help != NULL) && (strlen (long_help) > 0)) diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp index d684bb2df98..a59aff00d9c 100644 --- a/lldb/source/Commands/CommandObjectImage.cpp +++ b/lldb/source/Commands/CommandObjectImage.cpp @@ -603,7 +603,8 @@ public: CommandObjectImageDumpModuleList (interpreter, "image dump symtab", "Dump the symbol table from one or more executable images.", - NULL) + NULL), + m_options (interpreter) { } @@ -719,8 +720,8 @@ public: { public: - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter), m_sort_order (eSortOrderNone) { } @@ -1140,8 +1141,8 @@ public: { public: - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter), m_format_array() { } @@ -1188,7 +1189,8 @@ public: CommandObject (interpreter, "image list", "List current executable and dependent shared library images.", - "image list [<cmd-options>]") + "image list [<cmd-options>]"), + m_options (interpreter) { } @@ -1346,8 +1348,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { ResetOptionValues(); } @@ -1463,7 +1465,8 @@ public: CommandObject (interpreter, "image lookup", "Look up information within executable and dependent shared library images.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; @@ -1572,7 +1575,7 @@ public: break; default: - m_options.GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this); + m_options.GenerateOptionUsage (result.GetErrorStream(), this); syntax_error = true; break; } diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index 383e29974f8..b10e8eca477 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -62,7 +62,8 @@ public: CommandObject (interpreter, "log enable", "Enable logging for a single log channel.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg1; @@ -168,8 +169,8 @@ public: { public: - CommandOptions () : - Options (), + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), log_file (), log_options (0) { diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index f63848c0a65..c731c61836c 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -36,8 +36,8 @@ public: class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { ResetOptionValues(); } @@ -198,7 +198,8 @@ public: "memory read", "Read from the memory of the process being debugged.", NULL, - eFlagProcessMustBeLaunched) + eFlagProcessMustBeLaunched), + m_options (interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -434,8 +435,8 @@ public: class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { ResetOptionValues(); } @@ -521,7 +522,8 @@ public: "Write to the memory of the process being debugged.", //"memory write [<cmd-options>] <addr> [value1 value2 ...]", NULL, - eFlagProcessMustBeLaunched) + eFlagProcessMustBeLaunched), + m_options (interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 12515ce3ec6..a72b0db4d14 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -19,8 +19,10 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/Options.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Platform.h" +#include "lldb/Target/Process.h" using namespace lldb; using namespace lldb_private; @@ -36,7 +38,8 @@ public: "platform create", "Create a platform instance by name and select it as the current platform.", "platform create <platform-name>", - 0) + 0), + m_options (interpreter) { } @@ -86,7 +89,8 @@ protected: { public: - CommandOptions () : + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), os_version_major (UINT32_MAX), os_version_minor (UINT32_MAX), os_version_update (UINT32_MAX) @@ -418,11 +422,12 @@ class CommandObjectPlatformProcessList : public CommandObject { public: CommandObjectPlatformProcessList (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "platform process list", - "List processes on a remote platform by name, pid, or many other matching attributes.", - "platform process list", - 0) + CommandObject (interpreter, + "platform process list", + "List processes on a remote platform by name, pid, or many other matching attributes.", + "platform process list", + 0), + m_options (interpreter) { } @@ -529,7 +534,8 @@ protected: { public: - CommandOptions () : + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), match_info () { } @@ -585,7 +591,7 @@ protected: break; case 'a': - match_info.GetProcessInfo().GetArchitecture().SetTriple (option_arg); + match_info.GetProcessInfo().GetArchitecture().SetTriple (option_arg, m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform().get()); break; case 'n': diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 8287481eec2..116309d94d5 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -40,8 +40,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -121,7 +121,8 @@ public: CommandObject (interpreter, "process launch", "Launch the executable in the debugger.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData run_args_arg; @@ -433,8 +434,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -494,8 +495,7 @@ public: } virtual bool - HandleOptionArgumentCompletion (CommandInterpreter &interpeter, - Args &input, + HandleOptionArgumentCompletion (Args &input, int cursor_index, int char_pos, OptionElementVector &opt_element_vector, @@ -521,7 +521,7 @@ public: const char *partial_name = NULL; partial_name = input.GetArgumentAtIndex(opt_arg_pos); - PlatformSP platform_sp (interpeter.GetDebugger().GetPlatformList().GetSelectedPlatform ()); + PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform ()); if (platform_sp) { ProcessInfoList process_infos; @@ -563,7 +563,8 @@ public: CommandObject (interpreter, "process attach", "Attach to a process.", - "process attach <cmd-options>") + "process attach <cmd-options>"), + m_options (interpreter) { } @@ -983,8 +984,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -1035,11 +1036,12 @@ public: }; CommandObjectProcessConnect (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process connect", - "Connect to a remote debug service.", - "process connect <remote-url>", - 0) + CommandObject (interpreter, + "process connect", + "Connect to a remote debug service.", + "process connect <remote-url>", + 0), + m_options (interpreter) { } @@ -1568,8 +1570,8 @@ public: { public: - CommandOptions () : - Options () + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter) { ResetOptionValues (); } @@ -1632,7 +1634,8 @@ public: CommandObject (interpreter, "process handle", "Show or update what the process and debugger should do with various signals received from the OS.", - NULL) + NULL), + m_options (interpreter) { SetHelpLong ("If no signals are specified, update them all. If no update option is specified, list the current values.\n"); CommandArgumentEntry arg; diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index 55a4782c822..d50d7d71ecf 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -19,6 +19,7 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/Options.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/RegisterContext.h" @@ -37,7 +38,8 @@ public: "Dump the contents of one or more register values from the current frame. If no register is specified, dumps them all.", //"register read [<reg-name1> [<reg-name2> [...]]]", NULL, - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData register_arg; @@ -154,8 +156,8 @@ protected: class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { ResetOptionValues(); } diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index 82a49299cbe..b5cf3260b54 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -66,7 +66,7 @@ CommandObjectSettingsSet::CommandObjectSettingsSet (CommandInterpreter &interpre "settings set", "Set or change the value of a single debugger setting variable.", NULL), - m_options () + m_options (interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -237,8 +237,8 @@ CommandObjectSettingsSet::HandleArgumentCompletion (Args &input, // CommandObjectSettingsSet::CommandOptions //------------------------------------------------------------------------- -CommandObjectSettingsSet::CommandOptions::CommandOptions () : - Options (), +CommandObjectSettingsSet::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), m_override (true), m_reset (false) { diff --git a/lldb/source/Commands/CommandObjectSettings.h b/lldb/source/Commands/CommandObjectSettings.h index 7d78c08f65d..170b7f2fbd6 100644 --- a/lldb/source/Commands/CommandObjectSettings.h +++ b/lldb/source/Commands/CommandObjectSettings.h @@ -59,7 +59,7 @@ public: { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 7435b855a93..9fbf6024a39 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -37,8 +37,8 @@ class CommandObjectSourceInfo : public CommandObject class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { } @@ -98,7 +98,8 @@ public: CommandObject (interpreter, "source info", "Display information about the source lines from the current executable's debug info.", - "source info [<cmd-options>]") + "source info [<cmd-options>]"), + m_options (interpreter) { } @@ -148,8 +149,8 @@ class CommandObjectSourceList : public CommandObject class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { } @@ -227,7 +228,8 @@ public: CommandObject (interpreter, "source list", "Display source code (as specified) based on the current executable's debug info.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 1780f2b4a5c..76866207829 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -489,8 +489,8 @@ public: class CommandOptions : public Options { public: - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter), m_line_start(0), m_line_end (UINT_MAX), m_func_name_type_mask (eFunctionNameTypeAuto), @@ -634,7 +634,8 @@ public: CommandObject (interpreter, "target stop-hook add ", "Add a hook to be executed when the target stops.", - "target stop-hook add") + "target stop-hook add"), + m_options (interpreter) { } diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index d5da8807ae6..abb6f5f1cef 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -249,8 +249,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -325,7 +325,7 @@ public: "Show the stack for one or more threads. If no threads are specified, show the currently selected thread. Use the thread-index \"all\" to see all threads.", NULL, eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), - m_options() + m_options(interpreter) { CommandArgumentEntry arg; CommandArgumentData thread_idx_arg; @@ -487,8 +487,8 @@ public: { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -575,7 +575,7 @@ public: CommandObject (interpreter, name, help, syntax, flags), m_step_type (step_type), m_step_scope (step_scope), - m_options () + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData thread_id_arg; @@ -976,8 +976,8 @@ public: uint32_t m_thread_idx; uint32_t m_frame_idx; - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), m_thread_idx(LLDB_INVALID_THREAD_ID), m_frame_idx(LLDB_INVALID_FRAME_ID) { @@ -1069,7 +1069,7 @@ public: "Run the current or specified thread until it reaches a given line number or leaves the current function.", NULL, eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), - m_options () + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData line_num_arg; diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp index 210d32aa421..e573b99fd9c 100644 --- a/lldb/source/Core/ArchSpec.cpp +++ b/lldb/source/Core/ArchSpec.cpp @@ -18,6 +18,7 @@ #include "llvm/Support/MachO.h" #include "lldb/Host/Endian.h" #include "lldb/Host/Host.h" +#include "lldb/Target/Platform.h" using namespace lldb; using namespace lldb_private; @@ -273,13 +274,13 @@ ArchSpec::ArchSpec() : { } -ArchSpec::ArchSpec (const char *triple_cstr) : +ArchSpec::ArchSpec (const char *triple_cstr, Platform *platform) : m_triple (), m_core (kCore_invalid), m_byte_order (eByteOrderInvalid) { if (triple_cstr) - SetTriple(triple_cstr); + SetTriple(triple_cstr, platform); } ArchSpec::ArchSpec(const llvm::Triple &triple) : @@ -417,18 +418,10 @@ ArchSpec::SetTriple (const llvm::Triple &triple) if (core_def) { m_core = core_def->core; - m_byte_order = core_def->default_byte_order; - - if (m_triple.getVendor() == llvm::Triple::UnknownVendor && - m_triple.getOS() == llvm::Triple::UnknownOS && - m_triple.getEnvironment() == llvm::Triple::UnknownEnvironment) - { - llvm::Triple host_triple(llvm::sys::getHostTriple()); - - m_triple.setVendor(host_triple.getVendor()); - m_triple.setOS(host_triple.getOS()); - m_triple.setEnvironment(host_triple.getEnvironment()); - } + // Set the byte order to the default byte order for an architecture. + // This can be modified if needed for cases when cores handle both + // big and little endian + m_byte_order = core_def->default_byte_order; } else { @@ -440,7 +433,7 @@ ArchSpec::SetTriple (const llvm::Triple &triple) } bool -ArchSpec::SetTriple (const char *triple_cstr) +ArchSpec::SetTriple (const char *triple_cstr, Platform *platform) { if (triple_cstr || triple_cstr[0]) { @@ -459,7 +452,46 @@ ArchSpec::SetTriple (const char *triple_cstr) { std::string normalized_triple_sstr (llvm::Triple::normalize(triple_stref)); triple_stref = normalized_triple_sstr; - SetTriple (llvm::Triple (triple_stref)); + llvm::Triple normalized_triple (triple_stref); + + const bool os_specified = normalized_triple.getOSName().size() > 0; + const bool vendor_specified = normalized_triple.getVendorName().size() > 0; + const bool env_specified = normalized_triple.getEnvironmentName().size() > 0; + + // If we got an arch only, then default the vendor, os, environment + // to match the platform if one is supplied + if (!(os_specified || vendor_specified || env_specified)) + { + if (platform) + { + // If we were given a platform, use the platform's system + // architecture. If this is not available (might not be + // connected) use the first supported architecture. + ArchSpec platform_arch (platform->GetSystemArchitecture()); + if (!platform_arch.IsValid()) + { + if (!platform->GetSupportedArchitectureAtIndex (0, platform_arch)) + platform_arch.Clear(); + } + + if (platform_arch.IsValid()) + { + normalized_triple.setVendor(platform_arch.GetTriple().getVendor()); + normalized_triple.setOS(platform_arch.GetTriple().getOS()); + normalized_triple.setEnvironment(platform_arch.GetTriple().getEnvironment()); + } + } + else + { + // No platform specified, fall back to the host system for + // the default vendor, os, and environment. + llvm::Triple host_triple(llvm::sys::getHostTriple()); + normalized_triple.setVendor(host_triple.getVendor()); + normalized_triple.setOS(host_triple.getOS()); + normalized_triple.setEnvironment(host_triple.getEnvironment()); + } + } + SetTriple (normalized_triple); } } else diff --git a/lldb/source/Core/EmulateInstruction.cpp b/lldb/source/Core/EmulateInstruction.cpp index 8c3456e17da..7130360fb34 100644 --- a/lldb/source/Core/EmulateInstruction.cpp +++ b/lldb/source/Core/EmulateInstruction.cpp @@ -315,7 +315,7 @@ EmulateInstruction::ReadMemoryDefault (void *baton, size_t length) { PrintContext ("Read from memory", context); - fprintf (stdout, " Read from Memory (address = %p, length = %d)\n",(void *) addr, (uint) length); + fprintf (stdout, " Read from Memory (address = %p, length = %d)\n",(void *) addr, (uint32_t) length); *((uint64_t *) dst) = 0xdeadbeef; return length; @@ -329,7 +329,7 @@ EmulateInstruction::WriteMemoryDefault (void *baton, size_t length) { PrintContext ("Write to memory", context); - fprintf (stdout, " Write to Memory (address = %p, length = %d)\n", (void *) addr, (uint) length); + fprintf (stdout, " Write to Memory (address = %p, length = %d)\n", (void *) addr, (uint32_t) length); return length; } diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index e4f4689044b..f93ed6e0344 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -198,7 +198,7 @@ CommandObject::ParseOptions else { // No error string, output the usage information into result - options->GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this); + options->GenerateOptionUsage (result.GetErrorStream(), this); } // Set the return status to failed (this was an error). result.SetStatus (eReturnStatusFailed); @@ -356,8 +356,7 @@ CommandObject::HandleCompletion input.DeleteArgumentAtIndex(input.GetArgumentCount() - 1); bool handled_by_options; - handled_by_options = cur_options->HandleOptionCompletion (m_interpreter, - input, + handled_by_options = cur_options->HandleOptionCompletion (input, opt_element_vector, cursor_index, cursor_char_position, @@ -407,7 +406,7 @@ CommandObject::HelpTextContainsWord (const char *search_word) && GetOptions() != NULL) { StreamString usage_help; - GetOptions()->GenerateOptionUsage (m_interpreter, usage_help, this); + GetOptions()->GenerateOptionUsage (usage_help, this); if (usage_help.GetSize() > 0) { const char *usage_text = usage_help.GetData(); diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 3bc553d4bb3..3c14cc0d44e 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -29,7 +29,8 @@ using namespace lldb_private; //------------------------------------------------------------------------- // Options //------------------------------------------------------------------------- -Options::Options () : +Options::Options (CommandInterpreter &interpreter) : + m_interpreter (interpreter), m_getopt_table () { BuildValidOptionSets(); @@ -362,12 +363,11 @@ Options::OutputFormattedUsageText void Options::GenerateOptionUsage ( - CommandInterpreter &interpreter, Stream &strm, CommandObject *cmd ) { - const uint32_t screen_width = interpreter.GetDebugger().GetTerminalWidth(); + const uint32_t screen_width = m_interpreter.GetDebugger().GetTerminalWidth(); const OptionDefinition *full_options_table = GetDefinitions(); const uint32_t save_indent_level = strm.GetIndentLevel(); @@ -656,7 +656,6 @@ Options::VerifyPartialOptions (CommandReturnObject &result) bool Options::HandleOptionCompletion ( - CommandInterpreter &interpreter, Args &input, OptionElementVector &opt_element_vector, int cursor_index, @@ -778,8 +777,7 @@ Options::HandleOptionCompletion if (opt_defs_index != -1) { - HandleOptionArgumentCompletion (interpreter, - input, + HandleOptionArgumentCompletion (input, cursor_index, strlen (input.GetArgumentAtIndex(cursor_index)), opt_element_vector, @@ -809,7 +807,6 @@ Options::HandleOptionCompletion bool Options::HandleOptionArgumentCompletion ( - CommandInterpreter &interpreter, Args &input, int cursor_index, int char_pos, @@ -868,7 +865,7 @@ Options::HandleOptionArgumentCompletion if (module_name) { FileSpec module_spec(module_name, false); - lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget(); + lldb::TargetSP target_sp = m_interpreter.GetDebugger().GetSelectedTarget(); // Search filters require a target... if (target_sp != NULL) filter_ap.reset (new SearchFilterByModule (target_sp, module_spec)); @@ -878,7 +875,7 @@ Options::HandleOptionArgumentCompletion } } - return CommandCompletions::InvokeCommonCompletionCallbacks (interpreter, + return CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, completion_mask, input.GetArgumentAtIndex (opt_arg_pos), match_start_point, diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp index 285578686e2..4f71a1b339f 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp @@ -150,27 +150,26 @@ InstructionLLVM::Dump } } - int numTokens = EDNumTokens(m_inst); + int numTokens = -1; + + if (!raw) + numTokens = EDNumTokens(m_inst); int currentOpIndex = -1; - std::auto_ptr<RegisterReaderArg> rra; - - if (!raw) + bool printTokenized = false; + + if (numTokens != -1 && !raw) { addr_t base_addr = LLDB_INVALID_ADDRESS; + + RegisterReaderArg rra(base_addr + EDInstByteSize(m_inst), m_disassembler); + if (exe_ctx && exe_ctx->target && !exe_ctx->target->GetSectionLoadList().IsEmpty()) base_addr = GetAddress().GetLoadAddress (exe_ctx->target); if (base_addr == LLDB_INVALID_ADDRESS) base_addr = GetAddress().GetFileAddress (); - - rra.reset(new RegisterReaderArg(base_addr + EDInstByteSize(m_inst), m_disassembler)); - } - - bool printTokenized = false; - - if (numTokens != -1) - { + printTokenized = true; // Handle the opcode column. @@ -246,7 +245,7 @@ InstructionLLVM::Dump { uint64_t operand_value; - if (!EDEvaluateOperand(&operand_value, operand, IPRegisterReader, rra.get())) + if (!EDEvaluateOperand(&operand_value, operand, IPRegisterReader, &rra)) { if (EDInstIsBranch(m_inst)) { @@ -327,7 +326,7 @@ InstructionLLVM::Dump if (EDGetInstString(&str, m_inst)) return; else - s->PutCString(str); + s->Write(str, strlen(str) - 1); } } diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp index 786a2cec6ea..83c58250a94 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -207,7 +207,7 @@ ObjectContainerUniversalMachO::GetObjectFile (const FileSpec *file) { arch = Target::GetDefaultArchitecture (); if (!arch.IsValid()) - arch.SetTriple (LLDB_ARCH_DEFAULT); + arch.SetTriple (LLDB_ARCH_DEFAULT, NULL); } else arch = m_module->GetArchitecture(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 3a46f0d092d..63cb4ac25ee 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -142,6 +142,7 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite { const uint8_t *trap_opcode = NULL; uint32_t trap_opcode_size = 0; + bool bp_is_thumb = false; llvm::Triple::ArchType machine = target.GetArchitecture().GetMachine(); switch (machine) @@ -154,22 +155,26 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite trap_opcode_size = sizeof(g_i386_breakpoint_opcode); } break; - + + case llvm::Triple::thumb: + bp_is_thumb = true; // Fall through... case llvm::Triple::arm: { static const uint8_t g_arm_breakpoint_opcode[] = { 0xFE, 0xDE, 0xFF, 0xE7 }; static const uint8_t g_thumb_breakpooint_opcode[] = { 0xFE, 0xDE }; - lldb::BreakpointLocationSP bp_loc_sp (bp_site->GetOwnerAtIndex (0)); - if (bp_loc_sp) + // Auto detect arm/thumb if it wasn't explicitly specified + if (!bp_is_thumb) { - const AddressClass addr_class = bp_loc_sp->GetAddress().GetAddressClass (); - if (addr_class == eAddressClassCodeAlternateISA) - { - trap_opcode = g_thumb_breakpooint_opcode; - trap_opcode_size = sizeof(g_thumb_breakpooint_opcode); - break; - } + lldb::BreakpointLocationSP bp_loc_sp (bp_site->GetOwnerAtIndex (0)); + if (bp_loc_sp) + bp_is_thumb = bp_loc_sp->GetAddress().GetAddressClass () == eAddressClassCodeAlternateISA; + } + if (bp_is_thumb) + { + trap_opcode = g_thumb_breakpooint_opcode; + trap_opcode_size = sizeof(g_thumb_breakpooint_opcode); + break; } trap_opcode = g_arm_breakpoint_opcode; trap_opcode_size = sizeof(g_arm_breakpoint_opcode); @@ -186,7 +191,7 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite break; default: - assert(!"Unhandled architecture in ProcessMacOSX::GetSoftwareBreakpointTrapOpcode()"); + assert(!"Unhandled architecture in PlatformDarwin::GetSoftwareBreakpointTrapOpcode()"); break; } diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index 70685f751d3..2ae4a903353 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -473,14 +473,14 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch default: switch (idx) { - case 0: arch.SetTriple ("armv7-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7f-apple-darwin"); return true; - case 2: arch.SetTriple ("armv7k-apple-darwin"); return true; - case 3: arch.SetTriple ("armv7s-apple-darwin"); return true; - case 4: arch.SetTriple ("armv6-apple-darwin"); return true; - case 5: arch.SetTriple ("armv5-apple-darwin"); return true; - case 6: arch.SetTriple ("armv4-apple-darwin"); return true; - case 7: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7f-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv7k-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv7s-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 6: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 7: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -488,12 +488,12 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch case ArchSpec::eCore_arm_armv7f: switch (idx) { - case 0: arch.SetTriple ("armv7f-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7-apple-darwin"); return true; - case 2: arch.SetTriple ("armv6-apple-darwin"); return true; - case 3: arch.SetTriple ("armv5-apple-darwin"); return true; - case 4: arch.SetTriple ("armv4-apple-darwin"); return true; - case 5: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7f-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -501,12 +501,12 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch case ArchSpec::eCore_arm_armv7k: switch (idx) { - case 0: arch.SetTriple ("armv7k-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7-apple-darwin"); return true; - case 2: arch.SetTriple ("armv6-apple-darwin"); return true; - case 3: arch.SetTriple ("armv5-apple-darwin"); return true; - case 4: arch.SetTriple ("armv4-apple-darwin"); return true; - case 5: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7k-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -514,12 +514,12 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch case ArchSpec::eCore_arm_armv7s: switch (idx) { - case 0: arch.SetTriple ("armv7s-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7-apple-darwin"); return true; - case 2: arch.SetTriple ("armv6-apple-darwin"); return true; - case 3: arch.SetTriple ("armv5-apple-darwin"); return true; - case 4: arch.SetTriple ("armv4-apple-darwin"); return true; - case 5: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7s-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -527,11 +527,11 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch case ArchSpec::eCore_arm_armv7: switch (idx) { - case 0: arch.SetTriple ("armv7-apple-darwin"); return true; - case 1: arch.SetTriple ("armv6-apple-darwin"); return true; - case 2: arch.SetTriple ("armv5-apple-darwin"); return true; - case 3: arch.SetTriple ("armv4-apple-darwin"); return true; - case 4: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -539,10 +539,10 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch case ArchSpec::eCore_arm_armv6: switch (idx) { - case 0: arch.SetTriple ("armv6-apple-darwin"); return true; - case 1: arch.SetTriple ("armv5-apple-darwin"); return true; - case 2: arch.SetTriple ("armv4-apple-darwin"); return true; - case 3: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -550,9 +550,9 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch case ArchSpec::eCore_arm_armv5: switch (idx) { - case 0: arch.SetTriple ("armv5-apple-darwin"); return true; - case 1: arch.SetTriple ("armv4-apple-darwin"); return true; - case 2: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -560,8 +560,8 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch case ArchSpec::eCore_arm_armv4: switch (idx) { - case 0: arch.SetTriple ("armv4-apple-darwin"); return true; - case 1: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 7ad3d444969..2cebb10c0fb 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -919,7 +919,7 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force) triple += "unknown"; else triple += os_name; - m_host_arch.SetTriple (triple.c_str()); + m_host_arch.SetTriple (triple.c_str(), NULL); if (pointer_byte_size) { assert (pointer_byte_size == m_host_arch.GetAddressByteSize()); @@ -933,7 +933,7 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force) } else { - m_host_arch.SetTriple (triple.c_str()); + m_host_arch.SetTriple (triple.c_str(), NULL); if (pointer_byte_size) { assert (pointer_byte_size == m_host_arch.GetAddressByteSize()); @@ -1159,7 +1159,7 @@ GDBRemoteCommunicationClient::DecodeProcessInfoResponse (StringExtractorGDBRemot extractor.GetStringRef().swap(value); extractor.SetFilePos(0); extractor.GetHexByteString (value); - process_info.GetArchitecture ().SetTriple (value.c_str()); + process_info.GetArchitecture ().SetTriple (value.c_str(), NULL); } else if (name.compare("name") == 0) { diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index d6edbdd6a53..c2431380fd9 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -357,7 +357,7 @@ GDBRemoteCommunicationServer::Handle_qfProcessInfo (StringExtractorGDBRemote &pa } else if (key.compare("triple") == 0) { - match_info.GetProcessInfo().GetArchitecture().SetTriple(value.c_str()); + match_info.GetProcessInfo().GetArchitecture().SetTriple (value.c_str(), NULL); } else { diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 63ec2e4153d..d0624c2cd68 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -10,6 +10,7 @@ #include "lldb/Symbol/SymbolContext.h" #include "lldb/Core/Module.h" +#include "lldb/Interpreter/Args.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Symbol.h" diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 1a9bc8b4562..940ff2bd949 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -20,6 +20,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" +#include "lldb/Expression/ClangUserExpression.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Host/Host.h" #include "lldb/Target/ABI.h" diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 882ff6a1635..05403f82eeb 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -23,6 +23,7 @@ #include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/ValueObject.h" +#include "lldb/Expression/ClangUserExpression.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -1330,7 +1331,7 @@ Target::SettingsController::SetGlobalVariable (const ConstString &var_name, { if (var_name == GetSettingNameForDefaultArch()) { - m_default_architecture.SetTriple (value); + m_default_architecture.SetTriple (value, NULL); if (!m_default_architecture.IsValid()) err.SetErrorStringWithFormat ("'%s' is not a valid architecture or triple.", value); } |