[Lldb-commits] [lldb] r190538 - Turns out the number of times you need to resume the process for /bin/sh depends on the
Author: jingham Date: Wed Sep 11 13:23:22 2013 New Revision: 190538 URL: http://llvm.org/viewvc/llvm-project?rev=190538view=rev Log: Turns out the number of times you need to resume the process for /bin/sh depends on the setting of the environment variable COMMAND_MODE. Changed the Platform::GetResumeCountForShell to Platform::GetResumeCountForLaunchInfo, and check both the shell and in the case of /bin/sh the environment as well. Modified: lldb/trunk/include/lldb/Target/Platform.h lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h lldb/trunk/source/Target/Platform.cpp Modified: lldb/trunk/include/lldb/Target/Platform.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=190538r1=190537r2=190538view=diff == --- lldb/trunk/include/lldb/Target/Platform.h (original) +++ lldb/trunk/include/lldb/Target/Platform.h Wed Sep 11 13:23:22 2013 @@ -728,7 +728,7 @@ namespace lldb_private { uint64_t high); virtual int32_t -GetResumeCountForShell (const char *shell) +GetResumeCountForLaunchInfo (ProcessLaunchInfo launch_info) { return 1; } Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=190538r1=190537r2=190538view=diff == --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Wed Sep 11 13:23:22 2013 @@ -415,7 +415,7 @@ PlatformLinux::LaunchProcess (ProcessLau const bool is_localhost = true; const bool will_debug = launch_info.GetFlags().Test(eLaunchFlagDebug); const bool first_arg_is_full_shell_command = false; -uint32_t num_resumes = GetResumeCountForShell (launch_info.GetShell()); +uint32_t num_resumes = GetResumeCountForLaunchInfo (launch_info); if (!launch_info.ConvertArgumentsForLaunchingInShell (error, is_localhost, will_debug, Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=190538r1=190537r2=190538view=diff == --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Wed Sep 11 13:23:22 2013 @@ -1226,8 +1226,12 @@ PlatformDarwin::GetEnvironment (StringLi } int32_t -PlatformDarwin::GetResumeCountForShell (const char *shell) +PlatformDarwin::GetResumeCountForLaunchInfo (ProcessLaunchInfo launch_info) { +const char *shell = launch_info.GetShell(); +if (shell == NULL) +return 1; + const char *shell_name = strrchr (shell, '/'); if (shell_name == NULL) shell_name = shell; @@ -1237,7 +1241,18 @@ PlatformDarwin::GetResumeCountForShell ( if (strcmp (shell_name, sh) == 0) { // /bin/sh re-exec's itself as /bin/bash requiring another resume. -return 2; +// But it only does this if the COMMAND_MODE environment variable +// is set to legacy. +char * const *envp = (char * const*)launch_info.GetEnvironmentEntries().GetConstArgumentVector(); +if (envp != NULL) +{ +for (int i = 0; envp[i] != NULL; i++) +{ +if (strcmp (envp[i], COMMAND_MODE=legacy ) == 0) +return 2; +} +} +return 1; } else if (strcmp (shell_name, csh) == 0 || strcmp (shell_name, tcsh) == 0 Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=190538r1=190537r2=190538view=diff == --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Wed Sep 11 13:23:22 2013 @@ -118,7 +118,7 @@ public: x86GetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec arch); virtual int32_t -GetResumeCountForShell (const char *shell); +GetResumeCountForLaunchInfo (lldb_private::ProcessLaunchInfo launch_info); protected: virtual lldb_private::Error Modified: lldb/trunk/source/Target/Platform.cpp URL:
[Lldb-commits] [lldb] r190550 - When target module add/SBTarget::AddModule()'ing, if an architecture isn't specifically
Author: jmolenda Date: Wed Sep 11 16:25:46 2013 New Revision: 190550 URL: http://llvm.org/viewvc/llvm-project?rev=190550view=rev Log: When target module add/SBTarget::AddModule()'ing, if an architecture isn't specifically requested, use the Target's architecture to pick the correct slice of a universal file. rdar://problem/14813869 Modified: lldb/trunk/source/API/SBTarget.cpp lldb/trunk/source/Commands/CommandObjectTarget.cpp Modified: lldb/trunk/source/API/SBTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=190550r1=190549r2=190550view=diff == --- lldb/trunk/source/API/SBTarget.cpp (original) +++ lldb/trunk/source/API/SBTarget.cpp Wed Sep 11 16:25:46 2013 @@ -1905,6 +1905,8 @@ SBTarget::AddModule (const char *path, if (triple) module_spec.GetArchitecture().SetTriple (triple, target_sp-GetPlatform ().get()); +else +module_spec.GetArchitecture() = target_sp-GetArchitecture(); if (symfile) module_spec.GetSymbolFileSpec ().SetFile(symfile, false); Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=190550r1=190549r2=190550view=diff == --- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Wed Sep 11 16:25:46 2013 @@ -2763,6 +2763,8 @@ protected: module_spec.GetUUID() = m_uuid_option_group.GetOptionValue ().GetCurrentValue(); if (m_symbol_file.GetOptionValue().OptionWasSet()) module_spec.GetSymbolFileSpec() = m_symbol_file.GetOptionValue().GetCurrentValue(); +if (!module_spec.GetArchitecture().IsValid()) +module_spec.GetArchitecture() = target-GetArchitecture(); Error error; ModuleSP module_sp (target-GetSharedModule (module_spec, error)); if (!module_sp) ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r190564 - rdar://problem/14071463
Author: enrico Date: Wed Sep 11 19:48:47 2013 New Revision: 190564 URL: http://llvm.org/viewvc/llvm-project?rev=190564view=rev Log: rdar://problem/14071463 SVN r189964 provided a sample Python script to inspect unordered(multi){set|map} with synthetic children, contribued by Jared Grubb This checkin converts that sample script to a C++ provider built into LLDB A test case is also provided Added: lldb/trunk/source/DataFormatters/LibCxxUnorderedMap.cpp lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/Makefile lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp Modified: lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/DataFormatters/FormatManager.cpp Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=190564r1=190563r2=190564view=diff == --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Wed Sep 11 19:48:47 2013 @@ -767,6 +767,23 @@ public: lldb::ValueObjectSP GetChildAtIndexPath (const std::vector std::pairsize_t, bool idxs, size_t* index_of_error = NULL); + +// this will always create the children if necessary +lldb::ValueObjectSP +GetChildAtNamePath (const std::initializer_listConstString names, +ConstString* name_of_error = NULL); + +lldb::ValueObjectSP +GetChildAtNamePath (const std::vectorConstString names, +ConstString* name_of_error = NULL); + +lldb::ValueObjectSP +GetChildAtNamePath (const std::initializer_list std::pairConstString, bool names, +ConstString* name_of_error = NULL); + +lldb::ValueObjectSP +GetChildAtNamePath (const std::vector std::pairConstString, bool names, +ConstString* name_of_error = NULL); virtual lldb::ValueObjectSP GetChildMemberWithName (const ConstString name, bool can_create); Modified: lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h?rev=190564r1=190563r2=190564view=diff == --- lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h (original) +++ lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h Wed Sep 11 19:48:47 2013 @@ -868,6 +868,39 @@ namespace lldb_private { SyntheticChildrenFrontEnd* LibcxxStdMapSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); +class LibcxxStdUnorderedMapSyntheticFrontEnd : public SyntheticChildrenFrontEnd +{ +public: +LibcxxStdUnorderedMapSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp); + +virtual size_t +CalculateNumChildren (); + +virtual lldb::ValueObjectSP +GetChildAtIndex (size_t idx); + +virtual bool +Update(); + +virtual bool +MightHaveChildren (); + +virtual size_t +GetIndexOfChildWithName (const ConstString name); + +virtual +~LibcxxStdUnorderedMapSyntheticFrontEnd (); +private: + +ValueObject* m_tree; +size_t m_num_elements; +ValueObject* m_next_element; +std::mapsize_t,lldb::ValueObjectSP m_children; +std::vectorstd::pairValueObject*, uint64_t m_elements_cache; +}; + +SyntheticChildrenFrontEnd* LibcxxStdUnorderedMapSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); + } // namespace formatters } // namespace lldb_private Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=190564r1=190563r2=190564view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Sep 11 19:48:47 2013 @@ -531,11 +531,11 @@ 944372DD171F6B4300E57C32 /* RegisterContextDummy.h in Headers */ = {isa = PBXBuildFile; fileRef = 944372DB171F6B4300E57C32 /* RegisterContextDummy.h */; };
[Lldb-commits] [lldb] r190570 - The output of 'log list' was missing a few of the lldb channels:
Author: jmolenda Date: Wed Sep 11 20:48:59 2013 New Revision: 190570 URL: http://llvm.org/viewvc/llvm-project?rev=190570view=rev Log: The output of 'log list' was missing a few of the lldb channels: communication, connection, host, module, mmap, os. Add those. Also sort the entries so they come in alphabetical order, to make it a little easier to scan down the list for a specific channel. Modified: lldb/trunk/source/lldb-log.cpp Modified: lldb/trunk/source/lldb-log.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb-log.cpp?rev=190570r1=190569r2=190570view=diff == --- lldb/trunk/source/lldb-log.cpp (original) +++ lldb/trunk/source/lldb-log.cpp Wed Sep 11 20:48:59 2013 @@ -191,30 +191,30 @@ lldb_private::EnableLog (StreamSP log_s else if (0 == ::strcasecmp(arg, api)) flag_bits |= LIBLLDB_LOG_API; else if (0 == ::strncasecmp(arg, break, 5)) flag_bits |= LIBLLDB_LOG_BREAKPOINTS; else if (0 == ::strcasecmp(arg, commands))flag_bits |= LIBLLDB_LOG_COMMANDS; +else if (0 == ::strncasecmp(arg, commu, 5)) flag_bits |= LIBLLDB_LOG_COMMUNICATION; +else if (0 == ::strncasecmp(arg, conn, 4))flag_bits |= LIBLLDB_LOG_CONNECTION; else if (0 == ::strcasecmp(arg, default)) flag_bits |= LIBLLDB_LOG_DEFAULT; else if (0 == ::strcasecmp(arg, dyld))flag_bits |= LIBLLDB_LOG_DYNAMIC_LOADER; else if (0 == ::strncasecmp(arg, event, 5)) flag_bits |= LIBLLDB_LOG_EVENTS; else if (0 == ::strncasecmp(arg, expr, 4))flag_bits |= LIBLLDB_LOG_EXPRESSIONS; +else if (0 == ::strncasecmp(arg, host, 4))flag_bits |= LIBLLDB_LOG_HOST; +else if (0 == ::strncasecmp(arg, mmap, 4))flag_bits |= LIBLLDB_LOG_MMAP; +else if (0 == ::strncasecmp(arg, module, 6)) flag_bits |= LIBLLDB_LOG_MODULES; else if (0 == ::strncasecmp(arg, object, 6)) flag_bits |= LIBLLDB_LOG_OBJECT; -else if (0 == ::strcasecmp(arg, process)) flag_bits |= LIBLLDB_LOG_PROCESS; +else if (0 == ::strcasecmp(arg, os)) flag_bits |= LIBLLDB_LOG_OS; else if (0 == ::strcasecmp(arg, platform))flag_bits |= LIBLLDB_LOG_PLATFORM; +else if (0 == ::strcasecmp(arg, process)) flag_bits |= LIBLLDB_LOG_PROCESS; else if (0 == ::strcasecmp(arg, script)) flag_bits |= LIBLLDB_LOG_SCRIPT; else if (0 == ::strcasecmp(arg, state)) flag_bits |= LIBLLDB_LOG_STATE; else if (0 == ::strcasecmp(arg, step))flag_bits |= LIBLLDB_LOG_STEP; -else if (0 == ::strcasecmp(arg, thread)) flag_bits |= LIBLLDB_LOG_THREAD; +else if (0 == ::strncasecmp(arg, symbol, 6)) flag_bits |= LIBLLDB_LOG_SYMBOLS; else if (0 == ::strcasecmp(arg, target)) flag_bits |= LIBLLDB_LOG_TARGET; -else if (0 == ::strcasecmp(arg, verbose)) flag_bits |= LIBLLDB_LOG_VERBOSE; -else if (0 == ::strncasecmp(arg, watch, 5)) flag_bits |= LIBLLDB_LOG_WATCHPOINTS; else if (0 == ::strncasecmp(arg, temp, 4))flag_bits |= LIBLLDB_LOG_TEMPORARY; -else if (0 == ::strncasecmp(arg, comm, 4))flag_bits |= LIBLLDB_LOG_COMMUNICATION; -else if (0 == ::strncasecmp(arg, conn, 4))flag_bits |= LIBLLDB_LOG_CONNECTION; -else if (0 == ::strncasecmp(arg, host, 4))flag_bits |= LIBLLDB_LOG_HOST; -else if (0 == ::strncasecmp(arg, unwind, 6)) flag_bits |= LIBLLDB_LOG_UNWIND; +else if (0 == ::strcasecmp(arg, thread)) flag_bits |= LIBLLDB_LOG_THREAD; else if (0 == ::strncasecmp(arg, types, 5)) flag_bits |= LIBLLDB_LOG_TYPES; -else if (0 == ::strncasecmp(arg, symbol, 6)) flag_bits |= LIBLLDB_LOG_SYMBOLS; -else if (0 == ::strncasecmp(arg, module, 6)) flag_bits |= LIBLLDB_LOG_MODULES; -else if (0 == ::strncasecmp(arg, mmap, 4))flag_bits |= LIBLLDB_LOG_MMAP; -else if (0 == ::strcasecmp(arg, os)) flag_bits |= LIBLLDB_LOG_OS; +else if (0 == ::strncasecmp(arg, unwind, 6)) flag_bits |= LIBLLDB_LOG_UNWIND; +else if (0 == ::strcasecmp(arg, verbose)) flag_bits |= LIBLLDB_LOG_VERBOSE; +else if (0 == ::strncasecmp(arg, watch, 5)) flag_bits |= LIBLLDB_LOG_WATCHPOINTS; else { feedback_strm-Printf(error: unrecognized log category '%s'\n, arg); @@ -239,14 +239,19 @@ lldb_private::ListLogCategories (Stream api - enable logging of API calls and return values\n break - log breakpoints\n commands - log command argument parsing\n + communication - log communication activities\n + connection - log connection details\n
[Lldb-commits] [lldb] r190573 - Updated CMakeLists to match XCode project
Author: rmitton Date: Wed Sep 11 21:20:39 2013 New Revision: 190573 URL: http://llvm.org/viewvc/llvm-project?rev=190573view=rev Log: Updated CMakeLists to match XCode project Modified: lldb/trunk/source/DataFormatters/CMakeLists.txt Modified: lldb/trunk/source/DataFormatters/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CMakeLists.txt?rev=190573r1=190572r2=190573view=diff == --- lldb/trunk/source/DataFormatters/CMakeLists.txt (original) +++ lldb/trunk/source/DataFormatters/CMakeLists.txt Wed Sep 11 21:20:39 2013 @@ -11,6 +11,7 @@ add_lldb_library(lldbDataFormatters LibCxx.cpp LibCxxList.cpp LibCxxMap.cpp + LibCxxUnorderedMap.cpp LibStdcpp.cpp NSArray.cpp NSDictionary.cpp ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r190572 - Added a 'jump' command, similar to GDBs.
Author: rmitton Date: Wed Sep 11 21:20:34 2013 New Revision: 190572 URL: http://llvm.org/viewvc/llvm-project?rev=190572view=rev Log: Added a 'jump' command, similar to GDBs. This allows the PC to be directly changed to a different line. It's similar to the example python script in examples/python/jump.py, except implemented as a builtin. Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function) Added: lldb/trunk/test/functionalities/thread/jump/ lldb/trunk/test/functionalities/thread/jump/Makefile lldb/trunk/test/functionalities/thread/jump/TestThreadJump.py lldb/trunk/test/functionalities/thread/jump/main.cpp lldb/trunk/test/functionalities/thread/jump/other.cpp Modified: lldb/trunk/include/lldb/API/SBThread.h lldb/trunk/include/lldb/Core/Error.h lldb/trunk/include/lldb/Core/Module.h lldb/trunk/include/lldb/Core/ModuleList.h lldb/trunk/include/lldb/Target/RegisterContext.h lldb/trunk/include/lldb/Target/Thread.h lldb/trunk/scripts/Python/interface/SBThread.i lldb/trunk/source/API/SBThread.cpp lldb/trunk/source/Commands/CommandObjectThread.cpp lldb/trunk/source/Core/Error.cpp lldb/trunk/source/Core/Module.cpp lldb/trunk/source/Core/ModuleList.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Target/RegisterContext.cpp lldb/trunk/source/Target/Thread.cpp Modified: lldb/trunk/include/lldb/API/SBThread.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBThread.h?rev=190572r1=190571r2=190572view=diff == --- lldb/trunk/include/lldb/API/SBThread.h (original) +++ lldb/trunk/include/lldb/API/SBThread.h Wed Sep 11 21:20:34 2013 @@ -117,6 +117,9 @@ public: lldb::SBFileSpec file_spec, uint32_t line); +SBError +JumpToLine (lldb::SBFileSpec file_spec, uint32_t line); + void RunToAddress (lldb::addr_t addr); Modified: lldb/trunk/include/lldb/Core/Error.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Error.h?rev=190572r1=190571r2=190572view=diff == --- lldb/trunk/include/lldb/Core/Error.h (original) +++ lldb/trunk/include/lldb/Core/Error.h Wed Sep 11 21:20:34 2013 @@ -68,7 +68,7 @@ public: Error (ValueType err, lldb::ErrorType type = lldb::eErrorTypeGeneric); explicit -Error (const char* err_str); +Error (const char *format, ...) __attribute__ ((format (printf, 2, 3))); Error (const Error rhs); //-- Modified: lldb/trunk/include/lldb/Core/Module.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=190572r1=190571r2=190572view=diff == --- lldb/trunk/include/lldb/Core/Module.h (original) +++ lldb/trunk/include/lldb/Core/Module.h Wed Sep 11 21:20:34 2013 @@ -347,6 +347,32 @@ public: SymbolContextList sc_list); //-- +/// Find addresses by file/line +/// +/// @param[in] target_sp +/// The target the addresses are desired for. +/// +/// @param[in] file +/// Source file to locate. +/// +/// @param[in] line +/// Source line to locate. +/// +/// @param[in] function +///Optional filter function. Addresses within this function will be +/// added to the 'local' list. All others will be added to the 'extern' list. +/// +/// @param[out] output_local +/// All matching addresses within 'function' +/// +/// @param[out] output_extern +/// All matching addresses not within 'function' +void FindAddressesForLine (const lldb::TargetSP target_sp, + const FileSpec file, uint32_t line, + Function *function, + std::vectorAddress output_local, std::vectorAddress output_extern); + +//-- /// Find global and static variables by name. /// /// @param[in] name Modified: lldb/trunk/include/lldb/Core/ModuleList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ModuleList.h?rev=190572r1=190571r2=190572view=diff == --- lldb/trunk/include/lldb/Core/ModuleList.h (original) +++ lldb/trunk/include/lldb/Core/ModuleList.h Wed Sep 11 21:20:34 2013 @@ -439,7 +439,35 @@ public: bool FindSourceFile (const FileSpec orig_spec, FileSpec new_spec) const; - + + +