[Lldb-commits] [lldb] r251905 - [LLDB][Watchpoint] Change ignore_count condition location to fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before
Author: mohit.bhakkad Date: Tue Nov 3 03:04:33 2015 New Revision: 251905 URL: http://llvm.org/viewvc/llvm-project?rev=251905&view=rev Log: [LLDB][Watchpoint] Change ignore_count condition location to fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before Reviewers: jingham. Subscribers: clayborg, jaydeep, bhushan, sagar, nitesh.jain, lldb-commits. Differential Revision: http://reviews.llvm.org/D13296 Modified: lldb/trunk/source/Breakpoint/Watchpoint.cpp lldb/trunk/source/Target/StopInfo.cpp Modified: lldb/trunk/source/Breakpoint/Watchpoint.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/Watchpoint.cpp?rev=251905&r1=251904&r2=251905&view=diff == --- lldb/trunk/source/Breakpoint/Watchpoint.cpp (original) +++ lldb/trunk/source/Breakpoint/Watchpoint.cpp Tue Nov 3 03:04:33 2015 @@ -183,9 +183,6 @@ Watchpoint::ShouldStop (StoppointCallbac if (!IsEnabled()) return false; -if (GetHitCount() <= GetIgnoreCount()) -return false; - return true; } Modified: lldb/trunk/source/Target/StopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StopInfo.cpp?rev=251905&r1=251904&r2=251905&view=diff == --- lldb/trunk/source/Target/StopInfo.cpp (original) +++ lldb/trunk/source/Target/StopInfo.cpp Tue Nov 3 03:04:33 2015 @@ -759,6 +759,16 @@ protected: } } +// TODO: This condition should be checked in the synchronous part of the watchpoint code +// (Watchpoint::ShouldStop), so that we avoid pulling an event even if the watchpoint fails +// the ignore count condition. It is moved here temporarily, because for archs with +// watchpoint_exceptions_received=before, the code in the previous lines takes care of moving +// the inferior to next PC. We have to check the ignore count condition after this is done, +// otherwise we will hit same watchpoint multiple times until we pass ignore condition, but we +// won't actually be ignoring them. +if (wp_sp->GetHitCount() <= wp_sp->GetIgnoreCount()) +m_should_stop = false; + if (m_should_stop && wp_sp->GetConditionText() != NULL) { // We need to make sure the user sees any parse errors in their condition, so we'll hook the ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13296: [LLDB] Fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before
This revision was automatically updated to reflect the committed changes. Closed by commit rL251905: [LLDB][Watchpoint] Change ignore_count condition location to fix watchpoint… (authored by mohit.bhakkad). Changed prior to commit: http://reviews.llvm.org/D13296?vs=36119&id=39035#toc Repository: rL LLVM http://reviews.llvm.org/D13296 Files: lldb/trunk/source/Breakpoint/Watchpoint.cpp lldb/trunk/source/Target/StopInfo.cpp Index: lldb/trunk/source/Breakpoint/Watchpoint.cpp === --- lldb/trunk/source/Breakpoint/Watchpoint.cpp +++ lldb/trunk/source/Breakpoint/Watchpoint.cpp @@ -183,9 +183,6 @@ if (!IsEnabled()) return false; -if (GetHitCount() <= GetIgnoreCount()) -return false; - return true; } Index: lldb/trunk/source/Target/StopInfo.cpp === --- lldb/trunk/source/Target/StopInfo.cpp +++ lldb/trunk/source/Target/StopInfo.cpp @@ -759,6 +759,16 @@ } } +// TODO: This condition should be checked in the synchronous part of the watchpoint code +// (Watchpoint::ShouldStop), so that we avoid pulling an event even if the watchpoint fails +// the ignore count condition. It is moved here temporarily, because for archs with +// watchpoint_exceptions_received=before, the code in the previous lines takes care of moving +// the inferior to next PC. We have to check the ignore count condition after this is done, +// otherwise we will hit same watchpoint multiple times until we pass ignore condition, but we +// won't actually be ignoring them. +if (wp_sp->GetHitCount() <= wp_sp->GetIgnoreCount()) +m_should_stop = false; + if (m_should_stop && wp_sp->GetConditionText() != NULL) { // We need to make sure the user sees any parse errors in their condition, so we'll hook the Index: lldb/trunk/source/Breakpoint/Watchpoint.cpp === --- lldb/trunk/source/Breakpoint/Watchpoint.cpp +++ lldb/trunk/source/Breakpoint/Watchpoint.cpp @@ -183,9 +183,6 @@ if (!IsEnabled()) return false; -if (GetHitCount() <= GetIgnoreCount()) -return false; - return true; } Index: lldb/trunk/source/Target/StopInfo.cpp === --- lldb/trunk/source/Target/StopInfo.cpp +++ lldb/trunk/source/Target/StopInfo.cpp @@ -759,6 +759,16 @@ } } +// TODO: This condition should be checked in the synchronous part of the watchpoint code +// (Watchpoint::ShouldStop), so that we avoid pulling an event even if the watchpoint fails +// the ignore count condition. It is moved here temporarily, because for archs with +// watchpoint_exceptions_received=before, the code in the previous lines takes care of moving +// the inferior to next PC. We have to check the ignore count condition after this is done, +// otherwise we will hit same watchpoint multiple times until we pass ignore condition, but we +// won't actually be ignoring them. +if (wp_sp->GetHitCount() <= wp_sp->GetIgnoreCount()) +m_should_stop = false; + if (m_should_stop && wp_sp->GetConditionText() != NULL) { // We need to make sure the user sees any parse errors in their condition, so we'll hook the ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251906 - [LLDB][MIPS] Fix GetUserRegisterInfoCount to count no of regs which are physically present
Author: mohit.bhakkad Date: Tue Nov 3 03:13:45 2015 New Revision: 251906 URL: http://llvm.org/viewvc/llvm-project?rev=251906&view=rev Log: [LLDB][MIPS] Fix GetUserRegisterInfoCount to count no of regs which are physically present Reviewers: clayborg, labath. Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits. Differential Revision: http://reviews.llvm.org/D13859 Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.h Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp?rev=251906&r1=251905&r2=251906&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp Tue Nov 3 03:13:45 2015 @@ -29,8 +29,17 @@ using namespace lldb; #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT -RegisterContextLinux_mips::RegisterContextLinux_mips(const ArchSpec &target_arch) : -RegisterInfoInterface(target_arch) +uint32_t +GetUserRegisterInfoCount (bool msa_present) +{ +if (msa_present) +return static_cast (k_num_user_registers_mips); +return static_cast (k_num_user_registers_mips - k_num_msa_registers_mips); +} + +RegisterContextLinux_mips::RegisterContextLinux_mips(const ArchSpec &target_arch, bool msa_present) : +RegisterInfoInterface(target_arch), +m_user_register_count (GetUserRegisterInfoCount (msa_present)) { } @@ -63,5 +72,5 @@ RegisterContextLinux_mips::GetRegisterCo uint32_t RegisterContextLinux_mips::GetUserRegisterCount () const { -return static_cast (k_num_user_registers_mips); +return static_cast (m_user_register_count); } Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h?rev=251906&r1=251905&r2=251906&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h Tue Nov 3 03:13:45 2015 @@ -17,7 +17,7 @@ class RegisterContextLinux_mips : public lldb_private::RegisterInfoInterface { public: -RegisterContextLinux_mips(const lldb_private::ArchSpec &target_arch); +RegisterContextLinux_mips(const lldb_private::ArchSpec &target_arch, bool msa_present = true); size_t GetGPRSize() const override; @@ -30,6 +30,9 @@ public: uint32_t GetUserRegisterCount () const override; + +private: +uint32_t m_user_register_count; }; #endif Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp?rev=251906&r1=251905&r2=251906&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp Tue Nov 3 03:13:45 2015 @@ -75,27 +75,31 @@ GetRegisterInfoCount (const ArchSpec &ta } uint32_t -GetUserRegisterInfoCount (const ArchSpec &target_arch) +GetUserRegisterInfoCount (const ArchSpec &target_arch, bool msa_present) { switch (target_arch.GetMachine()) { case llvm::Triple::mips: case llvm::Triple::mipsel: -return static_cast (k_num_user_registers_mips); +if (msa_present) +return static_cast (k_num_user_registers_mips); +return static_cast (k_num_user_registers_mips - k_num_msa_registers_mips); case llvm::Triple::mips64el: case llvm::Triple::mips64: -return static_cast (k_num_user_registers_mips64); +if (msa_present) +return static_cast (k_num_user_registers_mips64); +return static_cast (k_num_user_registers_mips64 - k_num_msa_registers_mips64); default: assert(false && "Unhandled target architecture."); return 0; } } -RegisterContextLinux_mips64::RegisterContextLinux_mips64(const ArchSpec &target_arch) : +RegisterContextLinux_mips64::RegisterContextLinux_mips64(const ArchSpec &target_arch, bool msa_present) : lldb_private::RegisterInfoInterface(target_arch), m_register_info_p (GetRegisterInfoPtr (target_arch)), m_register_info_count (GetRegisterInf
Re: [Lldb-commits] [PATCH] D13859: [LLDB][LLGS Test] Check length of register, only when its available
This revision was automatically updated to reflect the committed changes. Closed by commit rL251906: [LLDB][MIPS] Fix GetUserRegisterInfoCount to count no of regs which are… (authored by mohit.bhakkad). Changed prior to commit: http://reviews.llvm.org/D13859?vs=38785&id=39037#toc Repository: rL LLVM http://reviews.llvm.org/D13859 Files: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.h Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp === --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp @@ -75,27 +75,31 @@ } uint32_t -GetUserRegisterInfoCount (const ArchSpec &target_arch) +GetUserRegisterInfoCount (const ArchSpec &target_arch, bool msa_present) { switch (target_arch.GetMachine()) { case llvm::Triple::mips: case llvm::Triple::mipsel: -return static_cast (k_num_user_registers_mips); +if (msa_present) +return static_cast (k_num_user_registers_mips); +return static_cast (k_num_user_registers_mips - k_num_msa_registers_mips); case llvm::Triple::mips64el: case llvm::Triple::mips64: -return static_cast (k_num_user_registers_mips64); +if (msa_present) +return static_cast (k_num_user_registers_mips64); +return static_cast (k_num_user_registers_mips64 - k_num_msa_registers_mips64); default: assert(false && "Unhandled target architecture."); return 0; } } -RegisterContextLinux_mips64::RegisterContextLinux_mips64(const ArchSpec &target_arch) : +RegisterContextLinux_mips64::RegisterContextLinux_mips64(const ArchSpec &target_arch, bool msa_present) : lldb_private::RegisterInfoInterface(target_arch), m_register_info_p (GetRegisterInfoPtr (target_arch)), m_register_info_count (GetRegisterInfoCount (target_arch)), -m_user_register_count (GetUserRegisterInfoCount (target_arch)) +m_user_register_count (GetUserRegisterInfoCount (target_arch, msa_present)) { } Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.h === --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.h +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.h @@ -19,7 +19,7 @@ : public lldb_private::RegisterInfoInterface { public: -RegisterContextLinux_mips64(const lldb_private::ArchSpec &target_arch); +RegisterContextLinux_mips64(const lldb_private::ArchSpec &target_arch, bool msa_present = true); size_t GetGPRSize() const override; Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp === --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp @@ -29,8 +29,17 @@ #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT -RegisterContextLinux_mips::RegisterContextLinux_mips(const ArchSpec &target_arch) : -RegisterInfoInterface(target_arch) +uint32_t +GetUserRegisterInfoCount (bool msa_present) +{ +if (msa_present) +return static_cast (k_num_user_registers_mips); +return static_cast (k_num_user_registers_mips - k_num_msa_registers_mips); +} + +RegisterContextLinux_mips::RegisterContextLinux_mips(const ArchSpec &target_arch, bool msa_present) : +RegisterInfoInterface(target_arch), +m_user_register_count (GetUserRegisterInfoCount (msa_present)) { } @@ -63,5 +72,5 @@ uint32_t RegisterContextLinux_mips::GetUserRegisterCount () const { -return static_cast (k_num_user_registers_mips); +return static_cast (m_user_register_count); } Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h === --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h @@ -17,7 +17,7 @@ : public lldb_private::RegisterInfoInterface { public: -RegisterContextLinux_mips(const lldb_private::ArchSpec &target_arch); +RegisterContextLinux_mips(const lldb_private::ArchSpec &target_arch, bool msa_present = true); size_t GetGPRSize() const override; @@ -30,6 +30,9 @@ uint32_t GetUserRegisterCount () const override; + +private: +uint32_t m_user_register_count; }; #endif
Re: [Lldb-commits] [lldb] r239007 - [lldb] Enable building with Cmake/BUILD_SHARED_LIBS
Thanks, Zachary, I'll look into it. Cheers, Andrew On Tue, 3 Nov 2015 6:18 am Zachary Turner wrote: > Resending to the correct mailing list. > > > On Mon, Nov 2, 2015 at 2:17 PM Zachary Turner wrote: > >> Hi Andrew, >> >> This CL has been in for quite a while, but apparently it was broken all >> this time. I reverted the changes to finishSwigPythonLLDB.py as they were >> creating a dangling symlink. Please see r251840 ( >> http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20151102/024878.html) >> for >> more information in case you're interested in resubmitting after you figure >> out the correct fix. >> >> On Wed, Jun 3, 2015 at 8:56 PM Andrew Wilkins wrote: >> >>> Author: axw >>> Date: Wed Jun 3 22:12:37 2015 >>> New Revision: 239007 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=239007&view=rev >>> Log: >>> [lldb] Enable building with Cmake/BUILD_SHARED_LIBS >>> >>> Summary: >>> Several changes to fix CMake builds of LLDB with the >>> BUILD_SHARED_LIBS setting on. >>> >>> - Force all internal libraries to be built STATIC. >>> - Add additional library dependencies (pthread, dl, >>> runtimedyld). >>> - modify finalisation of SWIG wrapper to symlink the >>> "lib" dir into python/site-packages, so _lldb.so's >>> RPATH resolves. >>> >>> Test Plan: Verified one test case with "dotest.py". >>> >>> Reviewers: sylvestre.ledru, zturner >>> >>> Reviewed By: zturner >>> >>> Subscribers: zturner, ted, tberghammer, emaste, lldb-commits >>> >>> Differential Revision: http://reviews.llvm.org/D10157 >>> >>> Modified: >>> lldb/trunk/cmake/LLDBDependencies.cmake >>> lldb/trunk/cmake/modules/AddLLDB.cmake >>> lldb/trunk/cmake/modules/LLDBConfig.cmake >>> lldb/trunk/scripts/Python/finishSwigPythonLLDB.py >>> lldb/trunk/tools/lldb-server/CMakeLists.txt >>> >>> Modified: lldb/trunk/cmake/LLDBDependencies.cmake >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=239007&r1=239006&r2=239007&view=diff >>> >>> == >>> --- lldb/trunk/cmake/LLDBDependencies.cmake (original) >>> +++ lldb/trunk/cmake/LLDBDependencies.cmake Wed Jun 3 22:12:37 2015 >>> @@ -169,6 +169,7 @@ set( LLVM_LINK_COMPONENTS >>>core >>>mcdisassembler >>>executionengine >>> + runtimedyld >>>option >>>support >>>) >>> >>> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=239007&r1=239006&r2=239007&view=diff >>> >>> == >>> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original) >>> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Wed Jun 3 22:12:37 2015 >>> @@ -44,13 +44,14 @@ macro(add_lldb_library name) >>> set(libkind MODULE) >>>elseif (PARAM_SHARED) >>> set(libkind SHARED) >>> - elseif (PARAM_STATIC) >>> -set(libkind STATIC) >>>elseif (PARAM_OBJECT) >>> set(libkind OBJECT) >>>else () >>> -# library type unspecified - controlled by BUILD_SHARED_LIBS >>> -unset(libkind) >>> +# PARAM_STATIC or library type unspecified. BUILD_SHARED_LIBS >>> +# does not control the kind of libraries created for LLDB, >>> +# only whether or not they link to shared/static LLVM/Clang >>> +# libraries. >>> +set(libkind STATIC) >>>endif() >>> >>>#PIC not needed on Win >>> >>> Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=239007&r1=239006&r2=239007&view=diff >>> >>> == >>> --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) >>> +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Wed Jun 3 22:12:37 2015 >>> @@ -219,6 +219,14 @@ else() >>> >>> endif() >>> >>> +if (HAVE_LIBPTHREAD) >>> + list(APPEND system_libs pthread) >>> +endif(HAVE_LIBPTHREAD) >>> + >>> +if (HAVE_LIBDL) >>> + list(APPEND system_libs ${CMAKE_DL_LIBS}) >>> +endif() >>> + >>> if(LLDB_REQUIRES_EH) >>>set(LLDB_REQUIRES_RTTI ON) >>> else() >>> >>> Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=239007&r1=239006&r2=239007&view=diff >>> >>> == >>> --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) >>> +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Wed Jun 3 >>> 22:12:37 2015 >>> @@ -304,6 +304,8 @@ def make_symlink( vDictArgs, vstrFramewo >>> # llvm/build/lib/python2.7/site-packages/lldb >>> strBuildDir = os.path.join("..", "..", "..", ".."); >>> strSrc = os.path.normcase(os.path.join(strBuildDir, >>> vstrSrcFile)); >>> +strTargetDir = os.path.dirname(strTarget); >>> +strSrc =
[Lldb-commits] [lldb] r251917 - Changes for Bug 25251
Author: ravitheja Date: Tue Nov 3 08:24:24 2015 New Revision: 251917 URL: http://llvm.org/viewvc/llvm-project?rev=251917&view=rev Log: Changes for Bug 25251 Summary: The solution to bug 24074,rL249673 needed to parse the function information from the Dwarf in order to set the SymbolContext. For that, GetFunction was called for the parent in GetTypeForDIE, which parses the ChildParameters and in the flow, GetTypeForDIE was called for one of the sibling die and so an infinite loop was triggered by calling GetFunction repeatedly for the same function. The changes in this revision modify the GetTypeForDIE to only resolve the function context in the Type Lookup flow and so prevent the infinite loop. A testcase has also been added to check for regression in the future and a test vector had been added to the testcase of 24074. Reviewers: jingham, tberghammer, clayborg Differential Revision: http://reviews.llvm.org/D14202 Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp (with props) lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/main.c lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile?rev=251917&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile Tue Nov 3 08:24:24 2015 @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +CXXFLAGS += -std=c++11 +CXX_SOURCES := ParallelTask.cpp +ENABLE_STD_THREADS := YES +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp?rev=251917&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp Tue Nov 3 08:24:24 2015 @@ -0,0 +1,151 @@ +#include +#include +#include +#include +#include +#include +#include + +class TaskPoolImpl +{ +public: +TaskPoolImpl(uint32_t num_threads) : +m_stop(false) +{ +for (uint32_t i = 0; i < num_threads; ++i) +m_threads.emplace_back(Worker, this); +} + +~TaskPoolImpl() +{ +Stop(); +} + +template +std::future::type> +AddTask(F&& f, Args&&... args) +{ +auto task = std::make_shared::type()>>( +std::bind(std::forward(f), std::forward(args)...)); + +std::unique_lock lock(m_tasks_mutex); +assert(!m_stop && "Can't add task to TaskPool after it is stopped"); +m_tasks.emplace([task](){ (*task)(); }); +lock.unlock(); +m_tasks_cv.notify_one(); + +return task->get_future(); +} + +void +Stop() +{ +std::unique_lock lock(m_tasks_mutex); +m_stop = true; +m_tasks_mutex.unlock(); +m_tasks_cv.notify_all(); +for (auto& t : m_threads) +t.join(); +} + +private: +static void +Worker(TaskPoolImpl* pool) +{ +while (true) +{ +std::unique_lock lock(pool->m_tasks_mutex); +if (pool->m_tasks.empty()) +pool->m_tasks_cv.wait(lock, [pool](){ return !pool->m_tasks.empty() || pool->m_stop; }); +if (pool->m_tasks.empty()) +break; + +std::function f = pool->m_tasks.front(); +pool->m_tasks.pop(); +lock.unlock(); + +f(); +} +} + +std::queue> m_tasks; +std::mutexm_tasks_mutex; +std::condition_variable m_tasks_cv; +bool m_stop; +std::vector m_threads; +}; + +class TaskPool +{ +public: +// Add a new task to the thread pool and return a std::future belongs for the newly created task. +// The caller of this function have to wait on the future for this task to complete. +template +static std::future:
Re: [Lldb-commits] [PATCH] D14118: Changes for Bug 17384
ravitheja added a comment. Hello, I tried making an instance on GCE but it asks for a credit card information which I unfortunately don’t have. Can you provide me maybe access through some other way ? btw I checked the logs u sent me and the vdso is being loaded but the unwinding till main is diferent from what I see on the Ubuntu machine I have. BR, A Ravi Theja http://reviews.llvm.org/D14118 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r251917 - Changes for Bug 25251
Hi, in the future, please add "lldb-commits" as a subscriber when you are having your patches reviewed. pl On 3 November 2015 at 06:24, Ravitheja Addepally via lldb-commits wrote: > Author: ravitheja > Date: Tue Nov 3 08:24:24 2015 > New Revision: 251917 > > URL: http://llvm.org/viewvc/llvm-project?rev=251917&view=rev > Log: > Changes for Bug 25251 > > Summary: > The solution to bug 24074,rL249673 needed > to parse the function information from the Dwarf in order > to set the SymbolContext. For that, GetFunction was called > for the parent in GetTypeForDIE, which parses the > ChildParameters and in the flow, GetTypeForDIE was called > for one of the sibling die and so an infinite > loop was triggered by calling GetFunction repeatedly for the > same function. > > The changes in this revision modify the GetTypeForDIE to only > resolve the function context in the Type Lookup flow and so > prevent the infinite loop. > > A testcase has also been added to check for regression in the > future and a test vector had been added to the testcase of > 24074. > > Reviewers: jingham, tberghammer, clayborg > > Differential Revision: http://reviews.llvm.org/D14202 > > Added: > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp >(with props) > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py > Modified: > lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py > lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/main.c > lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp > lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h > > Added: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile?rev=251917&view=auto > == > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile > (added) > +++ > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/Makefile > Tue Nov 3 08:24:24 2015 > @@ -0,0 +1,6 @@ > +LEVEL = ../../../make > + > +CXXFLAGS += -std=c++11 > +CXX_SOURCES := ParallelTask.cpp > +ENABLE_STD_THREADS := YES > +include $(LEVEL)/Makefile.rules > > Added: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp?rev=251917&view=auto > == > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp > (added) > +++ > lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp > Tue Nov 3 08:24:24 2015 > @@ -0,0 +1,151 @@ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +class TaskPoolImpl > +{ > +public: > +TaskPoolImpl(uint32_t num_threads) : > +m_stop(false) > +{ > +for (uint32_t i = 0; i < num_threads; ++i) > +m_threads.emplace_back(Worker, this); > +} > + > +~TaskPoolImpl() > +{ > +Stop(); > +} > + > +template > +std::future::type> > +AddTask(F&& f, Args&&... args) > +{ > +auto task = std::make_shared std::result_of::type()>>( > +std::bind(std::forward(f), std::forward(args)...)); > + > +std::unique_lock lock(m_tasks_mutex); > +assert(!m_stop && "Can't add task to TaskPool after it is stopped"); > +m_tasks.emplace([task](){ (*task)(); }); > +lock.unlock(); > +m_tasks_cv.notify_one(); > + > +return task->get_future(); > +} > + > +void > +Stop() > +{ > +std::unique_lock lock(m_tasks_mutex); > +m_stop = true; > +m_tasks_mutex.unlock(); > +m_tasks_cv.notify_all(); > +for (auto& t : m_threads) > +t.join(); > +} > + > +private: > +static void > +Worker(TaskPoolImpl* pool) > +{ > +while (true) > +{ > +std::unique_lock lock(pool->m_tasks_mutex); > +if (pool->m_tasks.empty()) > +pool->m_tasks_cv.wait(lock, [pool](){ return > !pool->m_tasks.empty() || pool->m_stop; }); > +if (pool->m_tasks.empty()) > +break; > + > +std::function f = pool->m_tasks.front(); > +pool->m_tasks.pop(); > +lock.unlock(); > + > +f(); > +} > +}
Re: [Lldb-commits] [PATCH] Fix for PR25300
Hi, Looks good, but I'd like to avoid adding new "not remote ready" tests to the test suite. Your test looks like it should be easy to fix -- the only problem there is the stdout redirection. If you *don't* redirect the output, you should be able to access the stdout via self.process.GetSTDOUT() and verify that. Alternatively, you can have the inferior check the environment variable and set the exit status based on that. pl On 3 November 2015 at 06:43, Tim Northover wrote: > On 26 October 2015 at 01:49, Pavel Labath wrote: >> For the testing, I would try writing a test which sets some >> environment variable, runs the inferior and has the inferior verify >> that the variable was passed correctly. You can model this based on >> some simple test in the test/ directory. TestFdLeak is the first that >> comes to mind. > > Thanks, I've done that in the attached patch, which is the > QEnvironmentHex fix. It seemed from comments on PR25300 that the other > fix was incomplete and probably needed more thought. > > OK to commit this one? > > Cheers. > > Tim. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251932 - Fix race during process detach
Author: labath Date: Tue Nov 3 10:05:18 2015 New Revision: 251932 URL: http://llvm.org/viewvc/llvm-project?rev=251932&view=rev Log: Fix race during process detach Summary: The code which was preventing the usage of the OS plugin while detach is in progress also prevented us to update the thread list correctly. This resulted in an empty thread list, which confused the detaching logic. Change the condition do only do what it says (disable the usage of the OS plugin). Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14201 Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py?rev=251932&r1=251931&r2=251932&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py Tue Nov 3 10:05:18 2015 @@ -20,7 +20,6 @@ class AttachResumeTestCase(TestBase): @skipIfRemote @expectedFailureFreeBSD('llvm.org/pr19310') @expectedFailureWindows("llvm.org/pr24778") -@expectedFlakeyLinux('llvm.org/pr19310') def test_attach_continue_interrupt_detach(self): """Test attach/continue/interrupt/detach""" self.build() Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=251932&r1=251931&r2=251932&view=diff == --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Tue Nov 3 10:05:18 2015 @@ -1565,41 +1565,38 @@ Process::UpdateThreadListIfNeeded () // Don't call into the OperatingSystem to update the thread list if we are shutting down, since // that may call back into the SBAPI's, requiring the API lock which is already held by whoever is // shutting us down, causing a deadlock. -if (!m_destroy_in_process) +OperatingSystem *os = GetOperatingSystem (); +if (os && !m_destroy_in_process) { -OperatingSystem *os = GetOperatingSystem (); -if (os) -{ -// Clear any old backing threads where memory threads might have been -// backed by actual threads from the lldb_private::Process subclass -size_t num_old_threads = old_thread_list.GetSize(false); -for (size_t i=0; iClearBackingThread(); +// Clear any old backing threads where memory threads might have been +// backed by actual threads from the lldb_private::Process subclass +size_t num_old_threads = old_thread_list.GetSize(false); +for (size_t i=0; iClearBackingThread(); -// Turn off dynamic types to ensure we don't run any expressions. Objective C -// can run an expression to determine if a SBValue is a dynamic type or not -// and we need to avoid this. OperatingSystem plug-ins can't run expressions -// that require running code... +// Turn off dynamic types to ensure we don't run any expressions. Objective C +// can run an expression to determine if a SBValue is a dynamic type or not +// and we need to avoid this. OperatingSystem plug-ins can't run expressions +// that require running code... -Target &target = GetTarget(); -const lldb::DynamicValueType saved_prefer_dynamic = target.GetPreferDynamicValue (); -if (saved_prefer_dynamic != lldb::eNoDynamicValues) - target.SetPreferDynamicValue(lldb::eNoDynamicValues); +Target &target = GetTarget(); +const lldb::DynamicValueType saved_prefer_dynamic = target.GetPreferDynamicValue (); +if (saved_prefer_dynamic != lldb::eNoDynamicValues) +target.SetPreferDynamicValue(lldb::eNoDynamicValues); -// Now let the OperatingSystem plug-in update the thread list +// Now let the OperatingSystem plug-in update the thread list -os->UpdateThreadList (old_thread_list, // Old list full of threads created by OS plug-in -
Re: [Lldb-commits] [PATCH] D14201: Fix race during process detach
This revision was automatically updated to reflect the committed changes. Closed by commit rL251932: Fix race during process detach (authored by labath). Changed prior to commit: http://reviews.llvm.org/D14201?vs=38806&id=39068#toc Repository: rL LLVM http://reviews.llvm.org/D14201 Files: lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py lldb/trunk/source/Target/Process.cpp Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py @@ -20,7 +20,6 @@ @skipIfRemote @expectedFailureFreeBSD('llvm.org/pr19310') @expectedFailureWindows("llvm.org/pr24778") -@expectedFlakeyLinux('llvm.org/pr19310') def test_attach_continue_interrupt_detach(self): """Test attach/continue/interrupt/detach""" self.build() Index: lldb/trunk/source/Target/Process.cpp === --- lldb/trunk/source/Target/Process.cpp +++ lldb/trunk/source/Target/Process.cpp @@ -1565,41 +1565,38 @@ // Don't call into the OperatingSystem to update the thread list if we are shutting down, since // that may call back into the SBAPI's, requiring the API lock which is already held by whoever is // shutting us down, causing a deadlock. -if (!m_destroy_in_process) +OperatingSystem *os = GetOperatingSystem (); +if (os && !m_destroy_in_process) { -OperatingSystem *os = GetOperatingSystem (); -if (os) -{ -// Clear any old backing threads where memory threads might have been -// backed by actual threads from the lldb_private::Process subclass -size_t num_old_threads = old_thread_list.GetSize(false); -for (size_t i=0; iClearBackingThread(); - -// Turn off dynamic types to ensure we don't run any expressions. Objective C -// can run an expression to determine if a SBValue is a dynamic type or not -// and we need to avoid this. OperatingSystem plug-ins can't run expressions -// that require running code... - -Target &target = GetTarget(); -const lldb::DynamicValueType saved_prefer_dynamic = target.GetPreferDynamicValue (); -if (saved_prefer_dynamic != lldb::eNoDynamicValues) - target.SetPreferDynamicValue(lldb::eNoDynamicValues); - -// Now let the OperatingSystem plug-in update the thread list - -os->UpdateThreadList (old_thread_list, // Old list full of threads created by OS plug-in - real_thread_list, // The actual thread list full of threads created by each lldb_private::Process subclass - new_thread_list); // The new thread list that we will show to the user that gets filled in +// Clear any old backing threads where memory threads might have been +// backed by actual threads from the lldb_private::Process subclass +size_t num_old_threads = old_thread_list.GetSize(false); +for (size_t i=0; iClearBackingThread(); + +// Turn off dynamic types to ensure we don't run any expressions. Objective C +// can run an expression to determine if a SBValue is a dynamic type or not +// and we need to avoid this. OperatingSystem plug-ins can't run expressions +// that require running code... + +Target &target = GetTarget(); +const lldb::DynamicValueType saved_prefer_dynamic = target.GetPreferDynamicValue (); +if (saved_prefer_dynamic != lldb::eNoDynamicValues) +target.SetPreferDynamicValue(lldb::eNoDynamicValues); + +// Now let the OperatingSystem plug-in update the thread list + +os->UpdateThreadList (old_thread_list, // Old list full of threads created by OS plug-in + real_thread_list, // The actual thread list full of threads created by each lldb_private::Process subclass + new_thread_list); // The new thread list that we will show to the user that gets filled in -if (saved_prefer_dynamic != lldb::eNoDynamicValues) -
[Lldb-commits] [lldb] r251950 - Leave TestAttachResume as flakey on linux
Author: labath Date: Tue Nov 3 11:33:31 2015 New Revision: 251950 URL: http://llvm.org/viewvc/llvm-project?rev=251950&view=rev Log: Leave TestAttachResume as flakey on linux there must be (at least) one more race hidden there... Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py?rev=251950&r1=251949&r2=251950&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py Tue Nov 3 11:33:31 2015 @@ -20,6 +20,7 @@ class AttachResumeTestCase(TestBase): @skipIfRemote @expectedFailureFreeBSD('llvm.org/pr19310') @expectedFailureWindows("llvm.org/pr24778") +@expectedFlakeyLinux('llvm.org/pr19310') def test_attach_continue_interrupt_detach(self): """Test attach/continue/interrupt/detach""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251951 - Skip TestBacktraceAll on android-arm
Author: tberghammer Date: Tue Nov 3 12:03:47 2015 New Revision: 251951 URL: http://llvm.org/viewvc/llvm-project?rev=251951&view=rev Log: Skip TestBacktraceAll on android-arm The android compiler can't compile the inferior because of an issue in the standard library. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py?rev=251951&r1=251950&r2=251951&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py Tue Nov 3 12:03:47 2015 @@ -17,7 +17,10 @@ class BreakpointAfterJoinTestCase(TestBa TestBase.setUp(self) # Find the line number for our breakpoint. self.breakpoint = line_number('ParallelTask.cpp', '// Set breakpoint here') - + +@skipIfTargetAndroid(archs=["arm"]) # The android-arm compiler can't compile the inferior +# because of an issue around std::future. +# TODO: Change the test to don't depend on std::future def test(self): """Test breakpoint handling after a thread join.""" self.build(dictionary=self.getBuildFlags()) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251954 - Fix flakyness in TestWatchLocationWithWatchSet
Author: labath Date: Tue Nov 3 12:17:21 2015 New Revision: 251954 URL: http://llvm.org/viewvc/llvm-project?rev=251954&view=rev Log: Fix flakyness in TestWatchLocationWithWatchSet Two threads in the test can hit the watchpoint simultaneously. Fix the test to account for that. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py?rev=251954&r1=251953&r2=251954&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py Tue Nov 3 12:17:21 2015 @@ -80,8 +80,10 @@ class WatchLocationUsingWatchpointSetTes endstr = ' = 99') # Use the '-v' option to do verbose listing of the watchpoint. -# The hit count should now be 1. +# The hit count should now be the same as the number of threads that +# stopped on a watchpoint. +threads = lldbutil.get_stopped_threads(self.process(), lldb.eStopReasonWatchpoint) self.expect("watchpoint list -v", -substrs = ['hit_count = 1']) +substrs = ['hit_count = %d' % len(threads)]) self.runCmd("thread backtrace all") ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251956 - Revert r251882 as it breaks the test suite
Author: enrico Date: Tue Nov 3 12:35:17 2015 New Revision: 251956 URL: http://llvm.org/viewvc/llvm-project?rev=251956&view=rev Log: Revert r251882 as it breaks the test suite Modified: lldb/trunk/source/Host/macosx/Host.mm Modified: lldb/trunk/source/Host/macosx/Host.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=251956&r1=251955&r2=251956&view=diff == --- lldb/trunk/source/Host/macosx/Host.mm (original) +++ lldb/trunk/source/Host/macosx/Host.mm Tue Nov 3 12:35:17 2015 @@ -1371,13 +1371,7 @@ Host::ShellExpandArguments (ProcessLaunc int status; std::string output; -FileSpec cwd(launch_info.GetWorkingDirectory()); -if (!cwd.Exists()) -{ -error.SetErrorStringWithFormat("cwd does not exist; cannot launch with shell argument expansion"); -return error; -} -RunShellCommand(expand_command, cwd, &status, nullptr, &output, 10); +RunShellCommand(expand_command, launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10); if (status != 0) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251959 - Python 3 - Don't use `commands` module anymore.
Author: zturner Date: Tue Nov 3 12:55:22 2015 New Revision: 251959 URL: http://llvm.org/viewvc/llvm-project?rev=251959&view=rev Log: Python 3 - Don't use `commands` module anymore. The `commands` module was deprecated in 2.7 and removed in 3.x. As a workaround, we introduce a new module `seven` in lldbsuite.support, and write helper functions in there that delegate to the commands module if it is available, and re-implement their functionality for cases where it is not available. Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251959&r1=251958&r2=251959&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Tue Nov 3 12:55:22 2015 @@ -25,7 +25,6 @@ import lldbsuite import lldbtest_config import atexit -import commands import importlib import os import dotest_args @@ -43,6 +42,7 @@ import unittest2 import test_categories import six +import lldbsuite.support.seven as seven def is_exe(fpath): """Returns true if fpath is an executable.""" @@ -512,7 +512,7 @@ def parseOptionsAndInitTestdirs(): else: # Use a compiler appropriate appropriate for the Apple SDK if one was specified if platform_system == 'Darwin' and args.apple_sdk: -compilers = [commands.getoutput('xcrun -sdk "%s" -find clang 2> /dev/null' % (args.apple_sdk))] +compilers = [seven.get_command_output('xcrun -sdk "%s" -find clang 2> /dev/null' % (args.apple_sdk))] else: # 'clang' on ubuntu 14.04 is 3.4 so we try clang-3.5 first candidateCompilers = ['clang-3.5', 'clang', 'gcc'] @@ -529,15 +529,15 @@ def parseOptionsAndInitTestdirs(): # Set SDKROOT if we are using an Apple SDK if platform_system == 'Darwin' and args.apple_sdk: -os.environ['SDKROOT'] = commands.getoutput('xcrun --sdk "%s" --show-sdk-path 2> /dev/null' % (args.apple_sdk)) +os.environ['SDKROOT'] = seven.get_command_output('xcrun --sdk "%s" --show-sdk-path 2> /dev/null' % (args.apple_sdk)) if args.archs: archs = args.archs for arch in archs: if arch.startswith('arm') and platform_system == 'Darwin' and not args.apple_sdk: -os.environ['SDKROOT'] = commands.getoutput('xcrun --sdk iphoneos.internal --show-sdk-path 2> /dev/null') +os.environ['SDKROOT'] = seven.get_command_output('xcrun --sdk iphoneos.internal --show-sdk-path 2> /dev/null') if not os.path.exists(os.environ['SDKROOT']): -os.environ['SDKROOT'] = commands.getoutput('xcrun --sdk iphoneos --show-sdk-path 2> /dev/null') +os.environ['SDKROOT'] = seven.get_command_output('xcrun --sdk iphoneos --show-sdk-path 2> /dev/null') else: archs = [platform_machine] Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=251959&r1=251958&r2=251959&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py Tue Nov 3 12:55:22 2015 @@ -6,15 +6,15 @@ from __future__ import print_function import use_lldb_suite import lldb -import commands import os import time from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil +import lldbsuite.support.seven as seven def execute_command (command): #print('%% %s' % (command)) -(exit_status, output) = commands.getstatusoutput(command) +(exit_status, output) = seven.get_command_status_output(command) #if output: #print(output) #print('status = %u' % (exit_status)) Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py?rev=251959&r1=251958&r2=251959&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py Tue Nov 3 12:55:22 2015 @@
[Lldb-commits] [lldb] r251968 - Python 3 - modernize exception catching syntax.
Author: zturner Date: Tue Nov 3 13:49:05 2015 New Revision: 251968 URL: http://llvm.org/viewvc/llvm-project?rev=251968&view=rev Log: Python 3 - modernize exception catching syntax. Old-style syntax: `except Exception, e:` New-style syntax: `except Exception as e:` These two statements are identical, except that the former has been deprecated for may versions, and was removed in Python 3. This converts everything to use the new syntax (which also works in Python 2). I had to convert unittest2 as well. What we really need to do is just delete unittest2, and use unittest instead since it is a standard module that ships with every Python distribution. But this is the path of least resistance for now, although at some point we will really need to do it. Modified: lldb/trunk/examples/synthetic/unordered_multi.py lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py lldb/trunk/third_party/Python/module/unittest2/unittest2/loader.py lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py lldb/trunk/third_party/Python/module/unittest2/unittest2/suite.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/support.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_assertions.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_case.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_loader.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_unittest2_with.py Modified: lldb/trunk/examples/synthetic/unordered_multi.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/synthetic/unordered_multi.py?rev=251968&r1=251967&r2=251968&view=diff == --- lldb/trunk/examples/synthetic/unordered_multi.py (original) +++ lldb/trunk/examples/synthetic/unordered_multi.py Tue Nov 3 13:49:05 2015 @@ -52,7 +52,7 @@ class libcxx_hash_table_SynthProvider: self.next_element = self.begin_ptr else: self.next_element = None - except Exception, e: + except Exception as e: logger >> "Caught exception: %r" % e pass Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py?rev=251968&r1=251967&r2=251968&view=diff == --- lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py (original) +++ lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py Tue Nov 3 13:49:05 2015 @@ -348,7 +348,7 @@ class TestCase(unittest.TestCase): success = False try: self.setUp() -except SkipTest, e: +except SkipTest as e: self._addSkip(result, str(e)) except Exception: result.addError(self, sys.exc_info()) @@ -386,7 +386,7 @@ class TestCase(unittest.TestCase): testMethod() except self.failureException: result.addFailure(self, sys.exc_info()) -except _ExpectedFailure, e: +except _ExpectedFailure as e: addExpectedFailure = getattr(result, 'addExpectedFailure', None) if addExpectedFailure is not None: addExpectedFailure(self, e.exc_info, e.bugnumber) @@ -394,7 +394,7 @@ class TestCase(unittest.TestCase): warnings.warn("Use of a TestResult without an addExpectedFailure method is deprecated", DeprecationWarning) result.addSuccess(self) -except _UnexpectedSuccess, x: +except _UnexpectedSuccess as x: addUnexpectedSuccess = getattr(result, 'addUnexpectedSuccess', None) if addUnexpectedSuccess is not None: addUnexpectedSuccess(self, x.bugnumber) @@ -402,7 +402,7 @@ class TestCase(unittest.TestCase): warnings.warn("Use of a TestResult without an addUnexpectedSuccess method is deprecated", DeprecationWarning) result.addFailure(self, sys.exc_info()) -except SkipTest, e: +except SkipTest as e: self._addSkip(result, str(e)) except Exception: result.addError(self, sys.exc_info()) @@ -807,16 +807,16 @@ class TestCase(unittest.TestCase): """ try: difference1 = set1.difference(set2) -except TypeError, e: +except TypeError as e: self.fail('invalid type when attempting set difference: %s' % e) -except AttributeError, e: +except AttributeError as e: self.fail('first argument does not support set difference: %s' % e) try:
[Lldb-commits] [lldb] r251977 - Python 3: Modernize exception raising syntax.
Author: zturner Date: Tue Nov 3 15:01:45 2015 New Revision: 251977 URL: http://llvm.org/viewvc/llvm-project?rev=251977&view=rev Log: Python 3: Modernize exception raising syntax. Old-style: `raise foo, bar` New-style: `raise foo(bar)` These two statements are equivalent, but the former is an error in Python 3. Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py lldb/trunk/utils/sync-source/syncsource.py Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py?rev=251977&r1=251976&r2=251977&view=diff == --- lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py (original) +++ lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py Tue Nov 3 15:01:45 2015 @@ -510,7 +510,7 @@ class TestCase(unittest.TestCase): excName = excClass.__name__ else: excName = str(excClass) -raise self.failureException, "%s not raised" % excName +raise self.failureException("%s not raised" % excName) def _getAssertEqualityFunc(self, first, second): """Get a detailed comparison function for the types of the two args. @@ -1028,7 +1028,7 @@ class TestCase(unittest.TestCase): excName = expected_exception.__name__ else: excName = str(expected_exception) -raise self.failureException, "%s not raised" % excName +raise self.failureException("%s not raised" % excName) def assertRegexpMatches(self, text, expected_regexp, msg=None): Modified: lldb/trunk/utils/sync-source/syncsource.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/sync-source/syncsource.py?rev=251977&r1=251976&r2=251977&view=diff == --- lldb/trunk/utils/sync-source/syncsource.py (original) +++ lldb/trunk/utils/sync-source/syncsource.py Tue Nov 3 15:01:45 2015 @@ -234,7 +234,7 @@ def sync_configured_sources(options, con if len(transfer_specs) > 0: transfer_agent.transfer(transfer_specs, options.dry_run) else: -raise "nothing to transfer, bad configuration?" +raise Exception("nothing to transfer, bad configuration?") def main(): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251978 - Python 3 - Fix some issues in unittest2.
Author: zturner Date: Tue Nov 3 15:02:00 2015 New Revision: 251978 URL: http://llvm.org/viewvc/llvm-project?rev=251978&view=rev Log: Python 3 - Fix some issues in unittest2. unittest2 was using print statements in a few places, and also using the `cmp` function (which is removed in Python 3). Again, we need to stop using unittest2 and using unittest instead, but this seems like an easier route for now. Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/__init__.py lldb/trunk/third_party/Python/module/unittest2/unittest2/loader.py lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_result.py Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/__init__.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/__init__.py?rev=251978&r1=251977&r2=251978&view=diff == --- lldb/trunk/third_party/Python/module/unittest2/unittest2/__init__.py (original) +++ lldb/trunk/third_party/Python/module/unittest2/unittest2/__init__.py Tue Nov 3 15:02:00 2015 @@ -26,6 +26,14 @@ AND THERE IS NO OBLIGATION WHATSOEVER TO SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. """ +import sys + +if sys.version_info[0] >= 3: +# Python 3 doesn't have the builtin `cmp` function anymore +cmp_ = lambda x, y: (x > y) - (x < y) +else: +cmp_ = cmp + __all__ = ['TestResult', 'TestCase', 'TestSuite', 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main', 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless', @@ -65,4 +73,4 @@ else: # deprecated _TextTestResult = TextTestResult -__unittest = True \ No newline at end of file +__unittest = True Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/loader.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/loader.py?rev=251978&r1=251977&r2=251978&view=diff == --- lldb/trunk/third_party/Python/module/unittest2/unittest2/loader.py (original) +++ lldb/trunk/third_party/Python/module/unittest2/unittest2/loader.py Tue Nov 3 15:02:00 2015 @@ -9,7 +9,7 @@ import unittest from fnmatch import fnmatch -from unittest2 import case, suite +from unittest2 import case, suite, cmp_ try: from os.path import relpath @@ -61,7 +61,7 @@ class TestLoader(unittest.TestLoader): and returning them wrapped in a TestSuite """ testMethodPrefix = 'test' -sortTestMethodsUsing = cmp +sortTestMethodsUsing = cmp_ suiteClass = suite.TestSuite _top_level_dir = None @@ -310,13 +310,13 @@ def _makeLoader(prefix, sortUsing, suite loader.suiteClass = suiteClass return loader -def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp): +def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp_): return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass) -def makeSuite(testCaseClass, prefix='test', sortUsing=cmp, +def makeSuite(testCaseClass, prefix='test', sortUsing=cmp_, suiteClass=suite.TestSuite): return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(testCaseClass) -def findTestCases(module, prefix='test', sortUsing=cmp, +def findTestCases(module, prefix='test', sortUsing=cmp_, suiteClass=suite.TestSuite): return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py?rev=251978&r1=251977&r2=251978&view=diff == --- lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py (original) +++ lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py Tue Nov 3 15:02:00 2015 @@ -99,7 +99,7 @@ class TestProgram(object): def usageExit(self, msg=None): if msg: -print msg +print(msg) usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '', 'buffer': ''} if self.failfast != False: @@ -108,7 +108,7 @@ class TestProgram(object): usage['catchbreak'] = CATCHBREAK if self.buffer != False: usage['buffer'] = BUFFEROUTPUT -print self.USAGE % usage +print(self.USAGE % usage) sys.exit(2) def parseArgs(self, argv): Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_result.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_result.py?rev=251978&r1=251977&r2=251978&view=diff ===
Re: [Lldb-commits] [PATCH] D13816: Fix a some silly warnings
This revision was automatically updated to reflect the committed changes. Closed by commit rL251979: Squelch a silly warning regarding an extra 'default' in 'case' (authored by artagnon). Changed prior to commit: http://reviews.llvm.org/D13816?vs=37611&id=39111#toc Repository: rL LLVM http://reviews.llvm.org/D13816 Files: lldb/trunk/tools/debugserver/source/debugserver.cpp Index: lldb/trunk/tools/debugserver/source/debugserver.cpp === --- lldb/trunk/tools/debugserver/source/debugserver.cpp +++ lldb/trunk/tools/debugserver/source/debugserver.cpp @@ -319,7 +319,6 @@ switch (pid_state) { -default: case eStateInvalid: case eStateUnloaded: case eStateAttaching: @@ -637,28 +636,28 @@ while (mode == eRNBRunLoopModePlatformMode) { std::string set_events_str; -const uint32_t event_mask = RNBContext::event_read_packet_available | +const uint32_t event_mask = RNBContext::event_read_packet_available | RNBContext::event_read_thread_exiting; - + DNBLogThreadedIf (LOG_RNB_EVENTS, "%s ctx.Events().WaitForSetEvents(0x%08x) ...",__FUNCTION__, event_mask); nub_event_t set_events = ctx.Events().WaitForSetEvents(event_mask); DNBLogThreadedIf (LOG_RNB_EVENTS, "%s ctx.Events().WaitForSetEvents(0x%08x) => 0x%08x (%s)",__FUNCTION__, event_mask, set_events, ctx.EventsAsString(set_events, set_events_str)); - + if (set_events) { if (set_events & RNBContext::event_read_packet_available) { if (remote->HandleReceivedPacket() == rnb_not_connected) mode = eRNBRunLoopModeExit; } - + if (set_events & RNBContext::event_read_thread_exiting) { mode = eRNBRunLoopModeExit; } ctx.Events().ResetEvents(set_events); } -} +} return eRNBRunLoopModeExit; } @@ -671,9 +670,9 @@ PortWasBoundCallbackUnixSocket (const void *baton, in_port_t port) { //::printf ("PortWasBoundCallbackUnixSocket (baton = %p, port = %u)\n", baton, port); - + const char *unix_socket_name = (const char *)baton; - + if (unix_socket_name && unix_socket_name[0]) { // We were given a unix socket name to use to communicate the port @@ -685,37 +684,37 @@ perror("error: socket (AF_UNIX, SOCK_STREAM, 0)"); exit(1); } - + saddr_un.sun_family = AF_UNIX; ::strncpy(saddr_un.sun_path, unix_socket_name, sizeof(saddr_un.sun_path) - 1); saddr_un.sun_path[sizeof(saddr_un.sun_path) - 1] = '\0'; saddr_un.sun_len = SUN_LEN (&saddr_un); - + if (::connect (s, (struct sockaddr *)&saddr_un, static_cast(SUN_LEN (&saddr_un))) < 0) { perror("error: connect (socket, &saddr_un, saddr_un_len)"); exit(1); } - + //::printf ("connect () sucess!!\n"); - - + + // We were able to connect to the socket, now write our PID so whomever // launched us will know this process's ID RNBLogSTDOUT ("Listening to port %i...\n", port); - + char pid_str[64]; const int pid_str_len = ::snprintf (pid_str, sizeof(pid_str), "%u", port); const ssize_t bytes_sent = ::send (s, pid_str, pid_str_len, 0); - + if (pid_str_len != bytes_sent) { perror("error: send (s, pid_str, pid_str_len, 0)"); exit (1); } - + //::printf ("send () sucess!!\n"); - + // We are done with the socket close (s); } @@ -893,7 +892,7 @@ #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__) struct sched_param thread_param; int thread_sched_policy; -if (pthread_getschedparam(pthread_self(), &thread_sched_policy, &thread_param) == 0) +if (pthread_getschedparam(pthread_self(), &thread_sched_policy, &thread_param) == 0) { thread_param.sched_priority = 47; pthread_setschedparam(pthread_self(), thread_sched_policy, &thread_param); @@ -915,25 +914,25 @@ //signal (SIGINT, signal_handler); signal (SIGPIPE, signal_handler); signal (SIGHUP, signal_handler); - + // We're always sitting in waitpid or kevent waiting on our target process' death, // we don't need no stinking SIGCHLD's... - + sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGCHLD); sigprocmask(SIG_BLOCK, &sigset, NULL); g_remoteSP.reset (new RNBRemote ()); - - + + RNBRemote *remote = g_remoteSP.get(); if (remote == NULL) { RNBLogSTDERR ("error: failed to create a re
[Lldb-commits] [lldb] r251979 - Squelch a silly warning regarding an extra 'default' in 'case'
Author: artagnon Date: Tue Nov 3 15:29:52 2015 New Revision: 251979 URL: http://llvm.org/viewvc/llvm-project?rev=251979&view=rev Log: Squelch a silly warning regarding an extra 'default' in 'case' Let the editor also clean up whitespace for that file. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13816 Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/debugserver.cpp?rev=251979&r1=251978&r2=251979&view=diff == --- lldb/trunk/tools/debugserver/source/debugserver.cpp (original) +++ lldb/trunk/tools/debugserver/source/debugserver.cpp Tue Nov 3 15:29:52 2015 @@ -319,7 +319,6 @@ RNBRunLoopLaunchInferior (RNBRemote *rem switch (pid_state) { -default: case eStateInvalid: case eStateUnloaded: case eStateAttaching: @@ -637,13 +636,13 @@ RNBRunLoopPlatform (RNBRemote *remote) while (mode == eRNBRunLoopModePlatformMode) { std::string set_events_str; -const uint32_t event_mask = RNBContext::event_read_packet_available | +const uint32_t event_mask = RNBContext::event_read_packet_available | RNBContext::event_read_thread_exiting; - + DNBLogThreadedIf (LOG_RNB_EVENTS, "%s ctx.Events().WaitForSetEvents(0x%08x) ...",__FUNCTION__, event_mask); nub_event_t set_events = ctx.Events().WaitForSetEvents(event_mask); DNBLogThreadedIf (LOG_RNB_EVENTS, "%s ctx.Events().WaitForSetEvents(0x%08x) => 0x%08x (%s)",__FUNCTION__, event_mask, set_events, ctx.EventsAsString(set_events, set_events_str)); - + if (set_events) { if (set_events & RNBContext::event_read_packet_available) @@ -651,14 +650,14 @@ RNBRunLoopPlatform (RNBRemote *remote) if (remote->HandleReceivedPacket() == rnb_not_connected) mode = eRNBRunLoopModeExit; } - + if (set_events & RNBContext::event_read_thread_exiting) { mode = eRNBRunLoopModeExit; } ctx.Events().ResetEvents(set_events); } -} +} return eRNBRunLoopModeExit; } @@ -671,9 +670,9 @@ static void PortWasBoundCallbackUnixSocket (const void *baton, in_port_t port) { //::printf ("PortWasBoundCallbackUnixSocket (baton = %p, port = %u)\n", baton, port); - + const char *unix_socket_name = (const char *)baton; - + if (unix_socket_name && unix_socket_name[0]) { // We were given a unix socket name to use to communicate the port @@ -685,37 +684,37 @@ PortWasBoundCallbackUnixSocket (const vo perror("error: socket (AF_UNIX, SOCK_STREAM, 0)"); exit(1); } - + saddr_un.sun_family = AF_UNIX; ::strncpy(saddr_un.sun_path, unix_socket_name, sizeof(saddr_un.sun_path) - 1); saddr_un.sun_path[sizeof(saddr_un.sun_path) - 1] = '\0'; saddr_un.sun_len = SUN_LEN (&saddr_un); - + if (::connect (s, (struct sockaddr *)&saddr_un, static_cast(SUN_LEN (&saddr_un))) < 0) { perror("error: connect (socket, &saddr_un, saddr_un_len)"); exit(1); } - + //::printf ("connect () sucess!!\n"); - - + + // We were able to connect to the socket, now write our PID so whomever // launched us will know this process's ID RNBLogSTDOUT ("Listening to port %i...\n", port); - + char pid_str[64]; const int pid_str_len = ::snprintf (pid_str, sizeof(pid_str), "%u", port); const ssize_t bytes_sent = ::send (s, pid_str, pid_str_len, 0); - + if (pid_str_len != bytes_sent) { perror("error: send (s, pid_str, pid_str_len, 0)"); exit (1); } - + //::printf ("send () sucess!!\n"); - + // We are done with the socket close (s); } @@ -893,7 +892,7 @@ main (int argc, char *argv[]) #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__) struct sched_param thread_param; int thread_sched_policy; -if (pthread_getschedparam(pthread_self(), &thread_sched_policy, &thread_param) == 0) +if (pthread_getschedparam(pthread_self(), &thread_sched_policy, &thread_param) == 0) { thread_param.sched_priority = 47; pthread_setschedparam(pthread_self(), thread_sched_policy, &thread_param); @@ -915,25 +914,25 @@ main (int argc, char *argv[]) //signal (SIGINT, signal_handler); signal (SIGPIPE, signal_handler); signal (SIGHUP, signal_han
[Lldb-commits] [lldb] r251982 - Introduce seven.cmp_ and use it instead of cmp
Author: zturner Date: Tue Nov 3 15:37:27 2015 New Revision: 251982 URL: http://llvm.org/viewvc/llvm-project?rev=251982&view=rev Log: Introduce seven.cmp_ and use it instead of cmp Modified: lldb/trunk/packages/Python/lldbsuite/support/seven.py lldb/trunk/packages/Python/lldbsuite/test/dosep.py Modified: lldb/trunk/packages/Python/lldbsuite/support/seven.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/support/seven.py?rev=251982&r1=251981&r2=251982&view=diff == --- lldb/trunk/packages/Python/lldbsuite/support/seven.py (original) +++ lldb/trunk/packages/Python/lldbsuite/support/seven.py Tue Nov 3 15:37:27 2015 @@ -5,6 +5,7 @@ if six.PY2: get_command_output = commands.getoutput get_command_status_output = commands.getstatusoutput +cmp_ = cmp else: def get_command_status_output(command): try: @@ -15,3 +16,5 @@ else: def get_command_output(command): return get_command_status_output(command)[1] + +cmp_ = lambda x, y: (x > y) - (x < y) \ No newline at end of file Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=251982&r1=251981&r2=251982&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Tue Nov 3 15:37:27 2015 @@ -59,6 +59,7 @@ import dotest_channels import dotest_args import lldb_utils import process_control +import lldbsuite.support.seven as seven # Status codes for running command with timeout. eTimedOut, ePassed, eFailed = 124, 0, 1 @@ -1244,7 +1245,7 @@ def is_darwin_version_lower_than(target_ return False system_version = distutils.version.StrictVersion(platform.mac_ver()[0]) -return cmp(system_version, target_version) < 0 +return seven.cmp_(system_version, target_version) < 0 def default_test_runner_name(num_threads): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251983 - Python 3 - Fix checking of string types in unittest2 module.
Author: zturner Date: Tue Nov 3 15:37:42 2015 New Revision: 251983 URL: http://llvm.org/viewvc/llvm-project?rev=251983&view=rev Log: Python 3 - Fix checking of string types in unittest2 module. This patch actually introduces a dependency from unittest2 to six. This should be ok since both packages are in our own repo, and we assume a sys.path of the top-level script that can find the third party packages. So unittest2 should be able to find six. Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py lldb/trunk/third_party/Python/module/unittest2/unittest2/suite.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_case.py lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_functiontestcase.py Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py?rev=251983&r1=251982&r2=251983&view=diff == --- lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py (original) +++ lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py Tue Nov 3 15:37:42 2015 @@ -7,6 +7,8 @@ import re import unittest import warnings +import six + from unittest2 import result from unittest2.util import ( safe_repr, safe_str, strclass, @@ -137,7 +139,7 @@ class _AssertRaisesContext(object): return True expected_regexp = self.expected_regexp -if isinstance(expected_regexp, basestring): +if isinstance(expected_regexp, six.string_types): expected_regexp = re.compile(expected_regexp) if not expected_regexp.search(str(exc_value)): raise self.failureException('"%s" does not match "%s"' % @@ -156,7 +158,7 @@ class _TypeEqualityDict(object): def __getitem__(self, key): value = self._store[key] -if isinstance(value, basestring): +if isinstance(value, six.string_types): return getattr(self.testcase, value) return value @@ -940,9 +942,9 @@ class TestCase(unittest.TestCase): def assertMultiLineEqual(self, first, second, msg=None): """Assert that two multi-line strings are equal.""" -self.assert_(isinstance(first, basestring), ( +self.assert_(isinstance(first, six.string_types), ( 'First argument is not a string')) -self.assert_(isinstance(second, basestring), ( +self.assert_(isinstance(second, six.string_types), ( 'Second argument is not a string')) if first != second: @@ -1018,7 +1020,7 @@ class TestCase(unittest.TestCase): try: callable_obj(*args, **kwargs) except expected_exception as exc_value: -if isinstance(expected_regexp, basestring): +if isinstance(expected_regexp, six.string_types): expected_regexp = re.compile(expected_regexp) if not expected_regexp.search(str(exc_value)): raise self.failureException('"%s" does not match "%s"' % @@ -1033,7 +1035,7 @@ class TestCase(unittest.TestCase): def assertRegexpMatches(self, text, expected_regexp, msg=None): """Fail the test unless the text matches the regular expression.""" -if isinstance(expected_regexp, basestring): +if isinstance(expected_regexp, six.string_types): expected_regexp = re.compile(expected_regexp) if not expected_regexp.search(text): msg = msg or "Regexp didn't match" @@ -1042,7 +1044,7 @@ class TestCase(unittest.TestCase): def assertNotRegexpMatches(self, text, unexpected_regexp, msg=None): """Fail the test if the text matches the regular expression.""" -if isinstance(unexpected_regexp, basestring): +if isinstance(unexpected_regexp, six.string_types): unexpected_regexp = re.compile(unexpected_regexp) match = unexpected_regexp.search(text) if match: Modified: lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py?rev=251983&r1=251982&r2=251983&view=diff == --- lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py (original) +++ lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py Tue Nov 3 15:37:42 2015 @@ -3,6 +3,7 @@ import sys import os import types +import six from unittest2 import loader, runner try: @@ -76,7 +77,7 @@ class TestProgram(object): argv=None, testRunner=None, testLoader=loader.defaultTestLoader, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None): -
Re: [Lldb-commits] [PATCH] D13819: LLDBStandalone: Report nice errors on missing vars
clayborg resigned from this revision. clayborg edited reviewers, added: tfiala; removed: clayborg. clayborg added a comment. I don't build cmake either, I am probably not a great person to ask. Todd Fiala might be a good person. http://reviews.llvm.org/D13819 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251992 - wip
Author: tberghammer Date: Tue Nov 3 16:29:16 2015 New Revision: 251992 URL: http://llvm.org/viewvc/llvm-project?rev=251992&view=rev Log: wip Modified: lldb/trunk/source/Symbol/Symtab.cpp Modified: lldb/trunk/source/Symbol/Symtab.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=251992&r1=251991&r2=251992&view=diff == --- lldb/trunk/source/Symbol/Symtab.cpp (original) +++ lldb/trunk/source/Symbol/Symtab.cpp Tue Nov 3 16:29:16 2015 @@ -265,6 +265,7 @@ Symtab::InitNameIndexes() // Protected function, no need to lock mutex... if (!m_name_indexes_computed) { +auto start = std::chrono::system_clock::now(); m_name_indexes_computed = true; Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); // Create the name index vector to be able to quickly search by name @@ -462,6 +463,8 @@ Symtab::InitNameIndexes() //a.Printf ("%s METHOD\n", m_symbols[entry.value].GetMangled().GetName().GetCString()); //} //} +auto end = std::chrono::system_clock::now(); +fprintf(stderr, "Time: %lu\n", std::chrono::duration_cast(end - start).count()); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251993 - Use std::list::splice in TaskPool to avoid an allocation
Author: tberghammer Date: Tue Nov 3 16:29:20 2015 New Revision: 251993 URL: http://llvm.org/viewvc/llvm-project?rev=251993&view=rev Log: Use std::list::splice in TaskPool to avoid an allocation Using std::list::splice to move an element from one list to an other avoids the allocation of a new element and a move of the data. Modified: lldb/trunk/include/lldb/Utility/TaskPool.h Modified: lldb/trunk/include/lldb/Utility/TaskPool.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/TaskPool.h?rev=251993&r1=251992&r2=251993&view=diff == --- lldb/trunk/include/lldb/Utility/TaskPool.h (original) +++ lldb/trunk/include/lldb/Utility/TaskPool.h Tue Nov 3 16:29:20 2015 @@ -153,8 +153,7 @@ TaskRunner::AddTask(F&& f, Args&&... T&& r = f(std::forward(args)...); std::unique_lock lock(this->m_mutex); -this->m_ready.emplace_back(std::move(*it)); -this->m_pending.erase(it); +this->m_ready.splice(this->m_ready.end(), this->m_pending, it); lock.unlock(); this->m_cv.notify_one(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251997 - Revert change comitted in accidentally as r251992
Author: tberghammer Date: Tue Nov 3 16:31:50 2015 New Revision: 251997 URL: http://llvm.org/viewvc/llvm-project?rev=251997&view=rev Log: Revert change comitted in accidentally as r251992 Modified: lldb/trunk/source/Symbol/Symtab.cpp Modified: lldb/trunk/source/Symbol/Symtab.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=251997&r1=251996&r2=251997&view=diff == --- lldb/trunk/source/Symbol/Symtab.cpp (original) +++ lldb/trunk/source/Symbol/Symtab.cpp Tue Nov 3 16:31:50 2015 @@ -265,7 +265,6 @@ Symtab::InitNameIndexes() // Protected function, no need to lock mutex... if (!m_name_indexes_computed) { -auto start = std::chrono::system_clock::now(); m_name_indexes_computed = true; Timer scoped_timer (__PRETTY_FUNCTION__, "%s", __PRETTY_FUNCTION__); // Create the name index vector to be able to quickly search by name @@ -463,8 +462,6 @@ Symtab::InitNameIndexes() //a.Printf ("%s METHOD\n", m_symbols[entry.value].GetMangled().GetName().GetCString()); //} //} -auto end = std::chrono::system_clock::now(); -fprintf(stderr, "Time: %lu\n", std::chrono::duration_cast(end - start).count()); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252001 - With the new modules debugging, we have seen cases where clang is not emitting full definitions for types that are member variables of classes. If we try to make a clas
Author: gclayton Date: Tue Nov 3 16:40:07 2015 New Revision: 252001 URL: http://llvm.org/viewvc/llvm-project?rev=252001&view=rev Log: With the new modules debugging, we have seen cases where clang is not emitting full definitions for types that are member variables of classes. If we try to make a class with a member where the type of the class in a forward declaration, clang will assert and crash and bring down the IDE. This is not acceptable so we need to work around it. We work around it by making sure that if we have a member that is an instance (not a pointer or reference) of a class/struct/union, that it is a complete type. If it isn't then we emit an error to let the user know to file a bug against the compiler, and then we make the class complete, but empty. We also do this for base classes elsewhere. We use the DWARF to help layout the type, so we will get all instance variables correct, but we just won't have visibility into this instance variable. Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=252001&r1=252000&r2=252001&view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Tue Nov 3 16:40:07 2015 @@ -2777,6 +2777,23 @@ DWARFASTParserClang::ParseChildMembers ( } } +if (ClangASTContext::IsCXXClassType(member_clang_type) && member_clang_type.GetCompleteType() == false) +{ +module_sp->ReportError ("DWARF DIE at 0x%8.8x (class %s) has a member variable 0x%8.8x (%s) whose type is a forward declaration, not a complete definition.\nPlease file a bug against the compiler and include the preprocessed output for %s", + parent_die.GetOffset(), + parent_die.GetName(), +die.GetOffset(), +name, +sc.comp_unit ? sc.comp_unit->GetPath().c_str() : "the source file"); +// We have no choice other than to pretend that the member class +// is complete. If we don't do this, clang will crash when trying +// to layout the class. Since we provide layout assistance, all +// ivars in this class and other classes will be fine, this is +// the best we can do short of crashing. + ClangASTContext::StartTagDeclarationDefinition(member_clang_type); + ClangASTContext::CompleteTagDeclarationDefinition(member_clang_type); +} + field_decl = ClangASTContext::AddFieldToRecordType (class_clang_type, name, member_clang_type, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252005 - Fix a deadlock when connecting to a remote GDB server that might not support all packets that lldb-server or debugserver supports. The issue was the m_last_stop_packet_
Author: gclayton Date: Tue Nov 3 16:42:04 2015 New Revision: 252005 URL: http://llvm.org/viewvc/llvm-project?rev=252005&view=rev Log: Fix a deadlock when connecting to a remote GDB server that might not support all packets that lldb-server or debugserver supports. The issue was the m_last_stop_packet_mutex mutex was being held by another thread and it was deadlocking getting the thread list. We now try to lock the m_last_stop_packet_mutex, and only continue if we successfully lock it. Else we fall back to qfThreadInfo/qsThreadInfo. Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=252005&r1=252004&r2=252005&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Nov 3 16:42:04 2015 @@ -1832,25 +1832,29 @@ ProcessGDBRemote::UpdateThreadIDList () // that might contain a "threads" key/value pair // Lock the thread stack while we access it -Mutex::Locker stop_stack_lock(m_last_stop_packet_mutex); -// Get the number of stop packets on the stack -int nItems = m_stop_packet_stack.size(); -// Iterate over them -for (int i = 0; i < nItems; i++) +//Mutex::Locker stop_stack_lock(m_last_stop_packet_mutex); +Mutex::Locker stop_stack_lock; +if (stop_stack_lock.TryLock(m_last_stop_packet_mutex)) { -// Get the thread stop info -StringExtractorGDBRemote &stop_info = m_stop_packet_stack[i]; -const std::string &stop_info_str = stop_info.GetStringRef(); -const size_t threads_pos = stop_info_str.find(";threads:"); -if (threads_pos != std::string::npos) +// Get the number of stop packets on the stack +int nItems = m_stop_packet_stack.size(); +// Iterate over them +for (int i = 0; i < nItems; i++) { -const size_t start = threads_pos + strlen(";threads:"); -const size_t end = stop_info_str.find(';', start); -if (end != std::string::npos) +// Get the thread stop info +StringExtractorGDBRemote &stop_info = m_stop_packet_stack[i]; +const std::string &stop_info_str = stop_info.GetStringRef(); +const size_t threads_pos = stop_info_str.find(";threads:"); +if (threads_pos != std::string::npos) { -std::string value = stop_info_str.substr(start, end - start); -if (UpdateThreadIDsFromStopReplyThreadsValue(value)) -return true; +const size_t start = threads_pos + strlen(";threads:"); +const size_t end = stop_info_str.find(';', start); +if (end != std::string::npos) +{ +std::string value = stop_info_str.substr(start, end - start); +if (UpdateThreadIDsFromStopReplyThreadsValue(value)) +return true; +} } } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252007 - Fix build for go parser unittest.
Author: ribrdb Date: Tue Nov 3 16:46:37 2015 New Revision: 252007 URL: http://llvm.org/viewvc/llvm-project?rev=252007&view=rev Log: Fix build for go parser unittest. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/unittests/Expression/GoParserTest.cpp Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=252007&r1=252006&r2=252007&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov 3 16:46:37 2015 @@ -847,6 +847,7 @@ AE7F56291B8FE418001377A8 /* GoASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEFFBA7C1AC4835D0087B932 /* GoASTContext.cpp */; }; AE8F624919EF3E1E00326B21 /* OperatingSystemGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */; }; AEB0E4591BD6E9F800B24093 /* LLVMUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEB0E4581BD6E9F800B24093 /* LLVMUserExpression.cpp */; }; + AEC6FFA01BE970A2007882C1 /* GoParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */; }; AEEA34051AC88A7400AB639D /* TypeSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEEA34041AC88A7400AB639D /* TypeSystem.cpp */; }; AF061F87182C97ED00B6A19C /* RegisterContextHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF061F85182C97ED00B6A19C /* RegisterContextHistory.cpp */; }; AF0C112818580CD800C4C45B /* QueueItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0C112718580CD800C4C45B /* QueueItem.cpp */; }; @@ -2702,6 +2703,7 @@ AE8F624819EF3E1E00326B21 /* OperatingSystemGo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OperatingSystemGo.h; path = Go/OperatingSystemGo.h; sourceTree = ""; }; AEB0E4581BD6E9F800B24093 /* LLVMUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLVMUserExpression.cpp; path = source/Expression/LLVMUserExpression.cpp; sourceTree = ""; }; AEB0E45A1BD6EA1400B24093 /* LLVMUserExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLVMUserExpression.h; path = include/lldb/Expression/LLVMUserExpression.h; sourceTree = ""; }; + AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GoParserTest.cpp; sourceTree = ""; }; AEEA33F61AC74FE700AB639D /* TypeSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeSystem.h; path = include/lldb/Symbol/TypeSystem.h; sourceTree = ""; }; AEEA34041AC88A7400AB639D /* TypeSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSystem.cpp; path = source/Symbol/TypeSystem.cpp; sourceTree = ""; }; AEEA340F1ACA08A000AB639D /* GoASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GoASTContext.h; path = include/lldb/Symbol/GoASTContext.h; sourceTree = ""; }; @@ -3005,6 +3007,7 @@ 2321F9371BDD32ED00BA9A93 /* Host */, 2321F93C1BDD339A00BA9A93 /* Interpreter */, 2326CF501BDD68CA00A5CEAC /* Editline */, + AEC6FF9D1BE97035007882C1 /* Expression */, 2321F93F1BDD33D800BA9A93 /* ScriptInterpreter */, 2321F9421BDD343A00BA9A93 /* Utility */, ); @@ -5628,6 +5631,14 @@ name = Go; sourceTree = ""; }; + AEC6FF9D1BE97035007882C1 /* Expression */ = { + isa = PBXGroup; + children = ( + AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */, + ); + path = Expression; + sourceTree = ""; + }; AF11CB34182CA85A00D9B618 /* SystemRuntime */ = { isa = PBXGroup; children = ( @@ -6215,6 +6226,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + AEC6FFA01BE970A2007882C1 /* GoParserTest.cpp in Sources */, 239504E51BDD454B00963CEA /* UriParserTest.cpp in Sources */, 239504DF1BDD453200963CEA /* SocketT
Re: [Lldb-commits] [PATCH] D13819: LLDBStandalone: Report nice errors on missing vars
brucem added a comment. This looks reasonable to me as well, but I also have never built standalone. http://reviews.llvm.org/D13819 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252013 - All instance variables start with "m_". Fix "options" to be "m_options".
Author: gclayton Date: Tue Nov 3 17:23:59 2015 New Revision: 252013 URL: http://llvm.org/viewvc/llvm-project?rev=252013&view=rev Log: All instance variables start with "m_". Fix "options" to be "m_options". Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=252013&r1=252012&r2=252013&view=diff == --- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original) +++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Nov 3 17:23:59 2015 @@ -157,7 +157,7 @@ private: ValueObject *m_orig_valobj; ValueObject *m_valobj; Stream *m_stream; -DumpValueObjectOptions options; +DumpValueObjectOptions m_options; Flags m_type_flags; CompilerType m_compiler_type; DumpValueObjectOptions::PointerDepth m_ptr_depth; Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=252013&r1=252012&r2=252013&view=diff == --- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original) +++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Tue Nov 3 17:23:59 2015 @@ -29,12 +29,12 @@ ValueObjectPrinter::ValueObjectPrinter ( if (valobj) { DumpValueObjectOptions options(*valobj); -Init (valobj,s,options,options.m_max_ptr_depth,0); +Init (valobj,s,options,m_options.m_max_ptr_depth,0); } else { DumpValueObjectOptions options; -Init (valobj,s,options,options.m_max_ptr_depth,0); +Init (valobj,s,options,m_options.m_max_ptr_depth,0); } } @@ -42,7 +42,7 @@ ValueObjectPrinter::ValueObjectPrinter ( Stream* s, const DumpValueObjectOptions& options) { -Init(valobj,s,options,options.m_max_ptr_depth,0); +Init(valobj,s,options,m_options.m_max_ptr_depth,0); } ValueObjectPrinter::ValueObjectPrinter (ValueObject* valobj, @@ -64,7 +64,7 @@ ValueObjectPrinter::Init (ValueObject* v m_orig_valobj = valobj; m_valobj = nullptr; m_stream = s; -this->options = options; +m_options = options; m_ptr_depth = ptr_depth; m_curr_depth = curr_depth; assert (m_orig_valobj && "cannot print a NULL ValueObject"); @@ -125,7 +125,7 @@ ValueObjectPrinter::GetMostSpecializedVa { if (m_orig_valobj->IsDynamic()) { -if (options.m_use_dynamic == eNoDynamicValues) +if (m_options.m_use_dynamic == eNoDynamicValues) { ValueObject *static_value = m_orig_valobj->GetStaticValue().get(); if (static_value) @@ -138,9 +138,9 @@ ValueObjectPrinter::GetMostSpecializedVa } else { -if (options.m_use_dynamic != eNoDynamicValues) +if (m_options.m_use_dynamic != eNoDynamicValues) { -ValueObject *dynamic_value = m_orig_valobj->GetDynamicValue(options.m_use_dynamic).get(); +ValueObject *dynamic_value = m_orig_valobj->GetDynamicValue(m_options.m_use_dynamic).get(); if (dynamic_value) m_valobj = dynamic_value; else @@ -152,7 +152,7 @@ ValueObjectPrinter::GetMostSpecializedVa if (m_valobj->IsSynthetic()) { -if (options.m_use_synthetic == false) +if (m_options.m_use_synthetic == false) { ValueObject *non_synthetic = m_valobj->GetNonSyntheticValue().get(); if (non_synthetic) @@ -161,7 +161,7 @@ ValueObjectPrinter::GetMostSpecializedVa } else { -if (options.m_use_synthetic == true) +if (m_options.m_use_synthetic == true) { ValueObject *synthetic = m_valobj->GetSyntheticValue().get(); if (synthetic) @@ -188,9 +188,9 @@ ValueObjectPrinter::GetDescriptionForDis const char* ValueObjectPrinter::GetRootNameForDisplay (const char* if_fail) { -const char *root_valobj_name = options.m_root_valobj_name.empty() ? +const char *root_valobj_name = m_options.m_root_valobj_name.empty() ? m_valobj->GetName().AsCString() : -options.m_root_valobj_name.c_str(); +m_options.m_root_valobj_name.c_str(); return root_valobj_name ? root_valobj_name : if_fail; } @@ -198,7 +198,7 @@ bool ValueObjectPrinter::ShouldPrintValueObject () { if (m_should_print == eLazyBoolCalculate) -m_should_print = (options.m_flat_output == false || m_type_flags
[Lldb-commits] [lldb] r252012 - Fix __fp16 types so we can display them and use them in expressions.
Author: gclayton Date: Tue Nov 3 17:23:22 2015 New Revision: 252012 URL: http://llvm.org/viewvc/llvm-project?rev=252012&view=rev Log: Fix __fp16 types so we can display them and use them in expressions. I am not adding a test case for this since I don't know how portable the __fp16 type is between compilers and I don't want to break the test suite. Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=252012&r1=252011&r2=252012&view=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Nov 3 17:23:22 2015 @@ -785,6 +785,8 @@ ClangASTContext::GetBuiltinTypeForEncodi return CompilerType (ast, ast->DoubleTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongDoubleTy)) return CompilerType (ast, ast->LongDoubleTy); +if (QualTypeMatchesBitSize (bit_size, ast, ast->HalfTy)) +return CompilerType (ast, ast->HalfTy); break; case eEncodingVector: @@ -1071,6 +1073,8 @@ ClangASTContext::GetBuiltinTypeForDWARFE return CompilerType (ast, ast->DoubleTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongDoubleTy)) return CompilerType (ast, ast->LongDoubleTy); +if (QualTypeMatchesBitSize (bit_size, ast, ast->HalfTy)) +return CompilerType (ast, ast->HalfTy); break; case DW_ATE_signed: @@ -4525,6 +4529,7 @@ ClangASTContext::GetEncoding (lldb::opaq case clang::BuiltinType::ULongLong: case clang::BuiltinType::UInt128: return lldb::eEncodingUint; +case clang::BuiltinType::Half: case clang::BuiltinType::Float: case clang::BuiltinType::Double: case clang::BuiltinType::LongDouble:return lldb::eEncodingIEEE754; @@ -4539,7 +4544,6 @@ ClangASTContext::GetEncoding (lldb::opaq case clang::BuiltinType::Kind::BoundMember: case clang::BuiltinType::Kind::BuiltinFn: case clang::BuiltinType::Kind::Dependent: -case clang::BuiltinType::Kind::Half: case clang::BuiltinType::Kind::OCLClkEvent: case clang::BuiltinType::Kind::OCLEvent: case clang::BuiltinType::Kind::OCLImage1d: @@ -4689,8 +4693,9 @@ ClangASTContext::GetFormat (lldb::opaque case clang::BuiltinType::LongLong: return lldb::eFormatDecimal; case clang::BuiltinType::UInt128: return lldb::eFormatUnsigned; case clang::BuiltinType::Int128:return lldb::eFormatDecimal; -case clang::BuiltinType::Float: return lldb::eFormatFloat; -case clang::BuiltinType::Double:return lldb::eFormatFloat; +case clang::BuiltinType::Half: +case clang::BuiltinType::Float: +case clang::BuiltinType::Double: case clang::BuiltinType::LongDouble:return lldb::eFormatFloat; default: return lldb::eFormatHex; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252018 - Fix an issue where LLDB would truncate summaries for string types without producing any evidence thereof
Author: enrico Date: Tue Nov 3 18:02:08 2015 New Revision: 252018 URL: http://llvm.org/viewvc/llvm-project?rev=252018&view=rev Log: Fix an issue where LLDB would truncate summaries for string types without producing any evidence thereof Modified: lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/include/lldb/DataFormatters/StringPrinter.h lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/main.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/DataFormatters/StringPrinter.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=252018&r1=252017&r2=252018&view=diff == --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Nov 3 18:02:08 2015 @@ -840,7 +840,7 @@ public: bool IsCStringContainer (bool check_pointer = false); -size_t +std::pair ReadPointedString (lldb::DataBufferSP& buffer_sp, Error& error, uint32_t max_length = 0, Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/StringPrinter.h?rev=252018&r1=252017&r2=252018&view=diff == --- lldb/trunk/include/lldb/DataFormatters/StringPrinter.h (original) +++ lldb/trunk/include/lldb/DataFormatters/StringPrinter.h Tue Nov 3 18:02:08 2015 @@ -260,6 +260,7 @@ namespace lldb_private { m_source_size(0), m_escape_non_printables(true), m_zero_is_terminator(true), +m_is_truncated(false), m_language_type(lldb::eLanguageTypeUnknown) { } @@ -387,6 +388,19 @@ namespace lldb_private { } ReadBufferAndDumpToStreamOptions& +SetIsTruncated (bool t) +{ +m_is_truncated = t; +return *this; +} + +bool +GetIsTruncated () const +{ +return m_is_truncated; +} + +ReadBufferAndDumpToStreamOptions& SetLanguage (lldb::LanguageType l) { m_language_type = l; @@ -409,6 +423,7 @@ namespace lldb_private { uint32_t m_source_size; bool m_escape_non_printables; bool m_zero_is_terminator; +bool m_is_truncated; lldb::LanguageType m_language_type; }; Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/main.cpp?rev=252018&r1=252017&r2=252018&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/main.cpp (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/main.cpp Tue Nov 3 18:02:08 2015 @@ -13,9 +13,28 @@ int main (int argc, char const *argv[]) { std::string stdstring("Hello\t\tWorld\nI am here\t\tto say hello\n"); //%self.addTearDownHook(lambda x: x.runCmd("setting set escape-non-printables true")) const char* constcharstar = stdstring.c_str(); -return 0; //% self.assertTrue(self.frame().FindVariable('stdstring').GetSummary() == '"Hello\\t\\tWorld\\nI am here\\t\\tto say hello\\n"') +std::string longstring( +"I am a very long string; in fact I am longer than any reasonable length that a string should be; quite long indeed; oh my, so many words; so many letters; this is kind of like writing a poem; except in real life all that is happening" +" is just me producing a very very long set of words; there is text here, text there, text everywhere; it fills me with glee to see so much text; all around me it's just letters, and symbols, and other pleasant drawings that cause me" +" a large amount of joy upon visually seeing them with my eyes; well, this is now a lot of letters, but it is still not enough for the purpose of the test I want to test, so maybe I should copy and paste this a few times, you know.." +" for science, or something" + "I am a very long string; in fact I am longer than any reasonable length that a string should be; quite long indeed; oh my, so many words; so many letters; this is kind of like writing a poem; except in
[Lldb-commits] [lldb] r252023 - Try a little harder to provide a legit CWD to argdumper if
Author: jingham Date: Tue Nov 3 19:02:06 2015 New Revision: 252023 URL: http://llvm.org/viewvc/llvm-project?rev=252023&view=rev Log: Try a little harder to provide a legit CWD to argdumper if the user hasn't provided one. Modified: lldb/trunk/source/Host/macosx/Host.mm Modified: lldb/trunk/source/Host/macosx/Host.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=252023&r1=252022&r2=252023&view=diff == --- lldb/trunk/source/Host/macosx/Host.mm (original) +++ lldb/trunk/source/Host/macosx/Host.mm Tue Nov 3 19:02:06 2015 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1371,7 +1372,24 @@ Host::ShellExpandArguments (ProcessLaunc int status; std::string output; -RunShellCommand(expand_command, launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10); +FileSpec cwd(launch_info.GetWorkingDirectory()); +if (!cwd.Exists()) +{ +char *wd = getcwd(nullptr, 0); +if (wd == nullptr) +{ +error.SetErrorStringWithFormat("cwd does not exist; cannot launch with shell argument expansion"); +return error; +} +else +{ +FileSpec working_dir(wd, false); +free(wd); +launch_info.SetWorkingDirectory(working_dir); + +} +} +RunShellCommand(expand_command, cwd, &status, nullptr, &output, 10); if (status != 0) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252024 - Actually implement Section::GetSectionData.
Author: jingham Date: Tue Nov 3 19:02:43 2015 New Revision: 252024 URL: http://llvm.org/viewvc/llvm-project?rev=252024&view=rev Log: Actually implement Section::GetSectionData. Modified: lldb/trunk/include/lldb/Core/Section.h lldb/trunk/source/Core/Section.cpp Modified: lldb/trunk/include/lldb/Core/Section.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Section.h?rev=252024&r1=252023&r2=252024&view=diff == --- lldb/trunk/include/lldb/Core/Section.h (original) +++ lldb/trunk/include/lldb/Core/Section.h Tue Nov 3 19:02:43 2015 @@ -64,9 +64,6 @@ public: lldb::SectionSP FindSectionContainingFileAddress (lldb::addr_t addr, uint32_t depth = UINT32_MAX) const; -bool -GetSectionData (const DataExtractor& module_data, DataExtractor& section_data) const; - // Get the number of sections in this list only size_t GetSize () const @@ -288,6 +285,46 @@ public: return m_obj_file; } +//-- +/// Read the section data from the object file that the section +/// resides in. +/// +/// @param[in] dst +/// Where to place the data +/// +/// @param[in] dst_len +/// How many bytes of section data to read +/// +/// @param[in] offset +/// The offset in bytes within this section's data at which to +/// start copying data from. +/// +/// @return +/// The number of bytes read from the section, or zero if the +/// section has no data or \a offset is not a valid offset +/// in this section. +//-- +lldb::offset_t +GetSectionData (void *dst, lldb::offset_t dst_len, lldb::offset_t offset = 0); + +//-- +/// Get the shared reference to the section data from the object +/// file that the section resides in. No copies of the data will be +/// make unless the object file has been read from memory. If the +/// object file is on disk, it will shared the mmap data for the +/// entire object file. +/// +/// @param[in] data +/// Where to place the data, address byte size, and byte order +/// +/// @return +/// The number of bytes read from the section, or zero if the +/// section has no data or \a offset is not a valid offset +/// in this section. +//-- +lldb::offset_t +GetSectionData (DataExtractor& data) const; + uint32_t GetLog2Align() { return m_log2align; Modified: lldb/trunk/source/Core/Section.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Section.cpp?rev=252024&r1=252023&r2=252024&view=diff == --- lldb/trunk/source/Core/Section.cpp (original) +++ lldb/trunk/source/Core/Section.cpp Tue Nov 3 19:02:43 2015 @@ -319,6 +319,25 @@ Section::Slide (addr_t slide_amount, boo return false; } +lldb::offset_t +Section::GetSectionData (void *dst, lldb::offset_t dst_len, lldb::offset_t offset) +{ +if (m_obj_file) +return m_obj_file->ReadSectionData (this, +offset, +dst, +dst_len); +return 0; +} + +lldb::offset_t +Section::GetSectionData (DataExtractor& section_data) const +{ +if (m_obj_file) +return m_obj_file->ReadSectionData (this, section_data); +return 0; +} + #pragma mark SectionList SectionList::SectionList () : ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252026 - Python 3 - Don't add the _d suffix to the symlink on Windows.
Author: zturner Date: Tue Nov 3 19:03:57 2015 New Revision: 252026 URL: http://llvm.org/viewvc/llvm-project?rev=252026&view=rev Log: Python 3 - Don't add the _d suffix to the symlink on Windows. In Python 2, a debug extension module required an _d suffix, so for example the extension module `_lldb` would be backed by the file `_lldb_d.pyd` if built in debug mode, and `_lldb.pyd` if built in release mode. In Python 2, although undocumented, this seems to no longer be the case, and even for a debug extension module, the interpreter will only look for the `_lldb.pyd` name. Added: lldb/trunk/scripts/use_lldb_suite.py Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py lldb/trunk/scripts/buildSwigWrapperClasses.py lldb/trunk/scripts/finishSwigWrapperClasses.py Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=252026&r1=252025&r2=252026&view=diff == --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Tue Nov 3 19:03:57 2015 @@ -350,8 +350,10 @@ def make_symlink_liblldb( vDictArgs, vst if eOSType == utilsOsType.EnumOsType.Windows: # When importing an extension module using a debug version of python, you # write, for example, "import foo", but the interpreter searches for -# "foo_d.pyd" -if is_debug_interpreter(): +# "foo_d.pyd". This only applies for Python 2, however. Python 3 does +# not use the _d suffix for extension modules. +import six +if is_debug_interpreter() and six.PY2: strTarget += "_d"; strTarget += ".pyd"; else: Modified: lldb/trunk/scripts/buildSwigWrapperClasses.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/buildSwigWrapperClasses.py?rev=252026&r1=252025&r2=252026&view=diff == --- lldb/trunk/scripts/buildSwigWrapperClasses.py (original) +++ lldb/trunk/scripts/buildSwigWrapperClasses.py Tue Nov 3 19:03:57 2015 @@ -31,6 +31,8 @@ import os # Provide directory and # Third party modules: # In-house modules: +import use_lldb_suite # Modify sys.path so we can use shared / third-party libraries + import utilsArgsParse # Parse and validate this script's input arguments import utilsOsType # Determine the OS type this script is running on import utilsDebug # Debug Python scripts Modified: lldb/trunk/scripts/finishSwigWrapperClasses.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/finishSwigWrapperClasses.py?rev=252026&r1=252025&r2=252026&view=diff == --- lldb/trunk/scripts/finishSwigWrapperClasses.py (original) +++ lldb/trunk/scripts/finishSwigWrapperClasses.py Tue Nov 3 19:03:57 2015 @@ -29,6 +29,8 @@ import os # Provide directory and # Third party modules: # In-house modules: +import use_lldb_suite # Modify sys.path so we can use shared / third-party libraries + import utilsArgsParse # Parse and validate this script's input arguments import utilsOsType # Determine the OS type this script is running on import utilsDebug # Debug Python scripts Added: lldb/trunk/scripts/use_lldb_suite.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/use_lldb_suite.py?rev=252026&view=auto == --- lldb/trunk/scripts/use_lldb_suite.py (added) +++ lldb/trunk/scripts/use_lldb_suite.py Tue Nov 3 19:03:57 2015 @@ -0,0 +1,22 @@ +import inspect +import os +import sys + +def find_lldb_root(): +lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) +while True: +lldb_root = os.path.dirname(lldb_root) +if lldb_root is None: +return None + +test_path = os.path.join(lldb_root, "lldb.root") +if os.path.isfile(test_path): +return lldb_root +return None + +lldb_root = find_lldb_root() +if lldb_root is not None: +import imp +module = imp.find_module("use_lldb_suite_root", [lldb_root]) +if module is not None: +imp.load_module("use_lldb_suite_root", *module) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252025 - Python 3 - Use universal_newlines when calling subprocess.check_output
Author: zturner Date: Tue Nov 3 19:03:47 2015 New Revision: 252025 URL: http://llvm.org/viewvc/llvm-project?rev=252025&view=rev Log: Python 3 - Use universal_newlines when calling subprocess.check_output By default in Python 3, check_output() returns a program's output as an encoded byte sequence. This means it returns a Py3 `bytes` object, which cannot be compared to a string since it's a different fundamental type. Although it might not be correct from a purist standpoint, from a practical one we can assume that all output is encoded in the default locale, in which case using universal_newlines=True will decode it according to the current locale. Anyway, universal_newlines also has the nice behavior that it converts \r\n to \n on Windows platforms so this makes parsing code easier, should we need that. So it seems like a win/win. Modified: lldb/trunk/packages/Python/lldbsuite/support/seven.py lldb/trunk/packages/Python/lldbsuite/test/dotest.py Modified: lldb/trunk/packages/Python/lldbsuite/support/seven.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/support/seven.py?rev=252025&r1=252024&r2=252025&view=diff == --- lldb/trunk/packages/Python/lldbsuite/support/seven.py (original) +++ lldb/trunk/packages/Python/lldbsuite/support/seven.py Tue Nov 3 19:03:47 2015 @@ -10,7 +10,7 @@ else: def get_command_status_output(command): try: import subprocess -return (0, subprocess.check_output(command, shell=True)) +return (0, subprocess.check_output(command, shell=True, universal_newlines=True)) except subprocess.CalledProcessError as e: return (e.returncode, e.output) Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=252025&r1=252024&r2=252025&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Tue Nov 3 19:03:47 2015 @@ -1147,7 +1147,7 @@ def setupSysPath(): # If our lldb supports the -P option, use it to find the python path: init_in_python_dir = os.path.join('lldb', '__init__.py') -lldb_dash_p_result = subprocess.check_output([lldbtest_config.lldbExec, "-P"], stderr=subprocess.STDOUT) +lldb_dash_p_result = subprocess.check_output([lldbtest_config.lldbExec, "-P"], stderr=subprocess.STDOUT, universal_newlines=True) if lldb_dash_p_result and not lldb_dash_p_result.startswith(("<", "lldb: invalid option:")) \ and not lldb_dash_p_result.startswith("Traceback"): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252029 - Fix a shadowed ivar in SearchFilterByModuleListAndCU.
Author: jingham Date: Tue Nov 3 19:24:04 2015 New Revision: 252029 URL: http://llvm.org/viewvc/llvm-project?rev=252029&view=rev Log: Fix a shadowed ivar in SearchFilterByModuleListAndCU. Modified: lldb/trunk/include/lldb/Core/SearchFilter.h Modified: lldb/trunk/include/lldb/Core/SearchFilter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/SearchFilter.h?rev=252029&r1=252028&r2=252029&view=diff == --- lldb/trunk/include/lldb/Core/SearchFilter.h (original) +++ lldb/trunk/include/lldb/Core/SearchFilter.h Tue Nov 3 19:24:04 2015 @@ -406,7 +406,7 @@ protected: lldb::SearchFilterSP DoCopyForBreakpoint (Breakpoint &breakpoint) override; -private: +protected: FileSpecList m_module_spec_list; }; @@ -462,7 +462,6 @@ protected: DoCopyForBreakpoint (Breakpoint &breakpoint) override; private: -FileSpecList m_module_spec_list; FileSpecList m_cu_spec_list; }; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252030 - Revert "Python 3 - Don't add the _d suffix to the symlink on Windows."
Author: zturner Date: Tue Nov 3 19:26:48 2015 New Revision: 252030 URL: http://llvm.org/viewvc/llvm-project?rev=252030&view=rev Log: Revert "Python 3 - Don't add the _d suffix to the symlink on Windows." This reverts commit e59c95ca936f5a0a8abb987b8605fd8bf82b03b6. This was a mistake on my part. The real problem was with my environment. I was using a release interpreter to try to load my debug extension module. I noticed this after I finally managed to get into my extension module's init method, and then it segfaulted with heap errors due to mismatched CRT (debug vs. release) Removed: lldb/trunk/scripts/use_lldb_suite.py Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py lldb/trunk/scripts/buildSwigWrapperClasses.py lldb/trunk/scripts/finishSwigWrapperClasses.py Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=252030&r1=252029&r2=252030&view=diff == --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Tue Nov 3 19:26:48 2015 @@ -350,10 +350,8 @@ def make_symlink_liblldb( vDictArgs, vst if eOSType == utilsOsType.EnumOsType.Windows: # When importing an extension module using a debug version of python, you # write, for example, "import foo", but the interpreter searches for -# "foo_d.pyd". This only applies for Python 2, however. Python 3 does -# not use the _d suffix for extension modules. -import six -if is_debug_interpreter() and six.PY2: +# "foo_d.pyd" +if is_debug_interpreter(): strTarget += "_d"; strTarget += ".pyd"; else: Modified: lldb/trunk/scripts/buildSwigWrapperClasses.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/buildSwigWrapperClasses.py?rev=252030&r1=252029&r2=252030&view=diff == --- lldb/trunk/scripts/buildSwigWrapperClasses.py (original) +++ lldb/trunk/scripts/buildSwigWrapperClasses.py Tue Nov 3 19:26:48 2015 @@ -31,8 +31,6 @@ import os # Provide directory and # Third party modules: # In-house modules: -import use_lldb_suite # Modify sys.path so we can use shared / third-party libraries - import utilsArgsParse # Parse and validate this script's input arguments import utilsOsType # Determine the OS type this script is running on import utilsDebug # Debug Python scripts Modified: lldb/trunk/scripts/finishSwigWrapperClasses.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/finishSwigWrapperClasses.py?rev=252030&r1=252029&r2=252030&view=diff == --- lldb/trunk/scripts/finishSwigWrapperClasses.py (original) +++ lldb/trunk/scripts/finishSwigWrapperClasses.py Tue Nov 3 19:26:48 2015 @@ -29,8 +29,6 @@ import os # Provide directory and # Third party modules: # In-house modules: -import use_lldb_suite # Modify sys.path so we can use shared / third-party libraries - import utilsArgsParse # Parse and validate this script's input arguments import utilsOsType # Determine the OS type this script is running on import utilsDebug # Debug Python scripts Removed: lldb/trunk/scripts/use_lldb_suite.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/use_lldb_suite.py?rev=252029&view=auto == --- lldb/trunk/scripts/use_lldb_suite.py (original) +++ lldb/trunk/scripts/use_lldb_suite.py (removed) @@ -1,22 +0,0 @@ -import inspect -import os -import sys - -def find_lldb_root(): -lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) -while True: -lldb_root = os.path.dirname(lldb_root) -if lldb_root is None: -return None - -test_path = os.path.join(lldb_root, "lldb.root") -if os.path.isfile(test_path): -return lldb_root -return None - -lldb_root = find_lldb_root() -if lldb_root is not None: -import imp -module = imp.find_module("use_lldb_suite_root", [lldb_root]) -if module is not None: -imp.load_module("use_lldb_suite_root", *module) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252031 - Add a few useful methods to ThreadSafeDense{Map, Set}. Not used yet.
Author: jingham Date: Tue Nov 3 19:39:05 2015 New Revision: 252031 URL: http://llvm.org/viewvc/llvm-project?rev=252031&view=rev Log: Add a few useful methods to ThreadSafeDense{Map,Set}. Not used yet. Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h?rev=252031&r1=252030&r2=252031&view=diff == --- lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h (original) +++ lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h Tue Nov 3 19:39:05 2015 @@ -54,7 +54,27 @@ public: Mutex::Locker locker(m_mutex); return m_map.lookup(k); } - + +bool +Lookup (_KeyType k, +_ValueType& v) +{ +Mutex::Locker locker(m_mutex); +auto iter = m_map.find(k), + end = m_map.end(); +if (iter == end) +return false; +v = iter->second; +return true; +} + +void +Clear () +{ +Mutex::Locker locker(m_mutex); +m_map.clear(); +} + protected: LLVMMapType m_map; Mutex m_mutex; Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h?rev=252031&r1=252030&r2=252031&view=diff == --- lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h (original) +++ lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h Tue Nov 3 19:39:05 2015 @@ -55,6 +55,13 @@ namespace lldb_private { return (m_set.count(e) > 0); } +void +Clear () +{ +Mutex::Locker locker(m_mutex); +m_set.clear(); +} + protected: LLVMSetType m_set; Mutex m_mutex; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r252031 - Add a few useful methods to ThreadSafeDense{Map, Set}. Not used yet.
Seems like this class would be a good candidate for using an RWMutex. Any reason you can think of why that wouldn't work? On Tue, Nov 3, 2015 at 5:41 PM Jim Ingham via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: jingham > Date: Tue Nov 3 19:39:05 2015 > New Revision: 252031 > > URL: http://llvm.org/viewvc/llvm-project?rev=252031&view=rev > Log: > Add a few useful methods to ThreadSafeDense{Map,Set}. Not used yet. > > Modified: > lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h > lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h > > Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h?rev=252031&r1=252030&r2=252031&view=diff > > == > --- lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h (original) > +++ lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h Tue Nov 3 19:39:05 > 2015 > @@ -54,7 +54,27 @@ public: > Mutex::Locker locker(m_mutex); > return m_map.lookup(k); > } > - > + > +bool > +Lookup (_KeyType k, > +_ValueType& v) > +{ > +Mutex::Locker locker(m_mutex); > +auto iter = m_map.find(k), > + end = m_map.end(); > +if (iter == end) > +return false; > +v = iter->second; > +return true; > +} > + > +void > +Clear () > +{ > +Mutex::Locker locker(m_mutex); > +m_map.clear(); > +} > + > protected: > LLVMMapType m_map; > Mutex m_mutex; > > Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h?rev=252031&r1=252030&r2=252031&view=diff > > == > --- lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h (original) > +++ lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h Tue Nov 3 19:39:05 > 2015 > @@ -55,6 +55,13 @@ namespace lldb_private { > return (m_set.count(e) > 0); > } > > +void > +Clear () > +{ > +Mutex::Locker locker(m_mutex); > +m_set.clear(); > +} > + > protected: > LLVMSetType m_set; > Mutex m_mutex; > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r252031 - Add a few useful methods to ThreadSafeDense{Map, Set}. Not used yet.
We had a few uses of it back before it actually had any mutex at all and that only caused very infrequent crashes - usually on teardown. So not very much contended, and probably a RWMutex is overkill. But it might be useful for the general class. I'm in the middle of other things right now, and don't want to get side-tracked. Jim > On Nov 3, 2015, at 5:43 PM, Zachary Turner wrote: > > Seems like this class would be a good candidate for using an RWMutex. Any > reason you can think of why that wouldn't work? > > On Tue, Nov 3, 2015 at 5:41 PM Jim Ingham via lldb-commits > wrote: > Author: jingham > Date: Tue Nov 3 19:39:05 2015 > New Revision: 252031 > > URL: http://llvm.org/viewvc/llvm-project?rev=252031&view=rev > Log: > Add a few useful methods to ThreadSafeDense{Map,Set}. Not used yet. > > Modified: > lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h > lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h > > Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h?rev=252031&r1=252030&r2=252031&view=diff > == > --- lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h (original) > +++ lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h Tue Nov 3 19:39:05 2015 > @@ -54,7 +54,27 @@ public: > Mutex::Locker locker(m_mutex); > return m_map.lookup(k); > } > - > + > +bool > +Lookup (_KeyType k, > +_ValueType& v) > +{ > +Mutex::Locker locker(m_mutex); > +auto iter = m_map.find(k), > + end = m_map.end(); > +if (iter == end) > +return false; > +v = iter->second; > +return true; > +} > + > +void > +Clear () > +{ > +Mutex::Locker locker(m_mutex); > +m_map.clear(); > +} > + > protected: > LLVMMapType m_map; > Mutex m_mutex; > > Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h?rev=252031&r1=252030&r2=252031&view=diff > == > --- lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h (original) > +++ lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h Tue Nov 3 19:39:05 2015 > @@ -55,6 +55,13 @@ namespace lldb_private { > return (m_set.count(e) > 0); > } > > +void > +Clear () > +{ > +Mutex::Locker locker(m_mutex); > +m_set.clear(); > +} > + > protected: > LLVMSetType m_set; > Mutex m_mutex; > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252035 - Option letter o was already in use; use an uppercase E instead
Author: enrico Date: Tue Nov 3 20:12:09 2015 New Revision: 252035 URL: http://llvm.org/viewvc/llvm-project?rev=252035&view=rev Log: Option letter o was already in use; use an uppercase E instead Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=252035&r1=252034&r2=252035&view=diff == --- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Tue Nov 3 20:12:09 2015 @@ -49,7 +49,7 @@ g_option_table[] = { LLDB_OPT_SET_1, false, "num-per-line" ,'l', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeNumberPerLine ,"The number of items per line to display."}, { LLDB_OPT_SET_2, false, "binary" ,'b', OptionParser::eNoArgument , NULL, NULL, 0, eArgTypeNone ,"If true, memory will be saved as binary. If false, the memory is saved save as an ASCII dump that uses the format, size, count and number per line settings."}, { LLDB_OPT_SET_3, true , "type" ,'t', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeNone ,"The name of a type to view memory as."}, -{ LLDB_OPT_SET_3, false , "offset" ,'o', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeCount ,"How many elements of the specified type to skip before starting to display data."}, +{ LLDB_OPT_SET_3, false , "offset" ,'E', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeCount ,"How many elements of the specified type to skip before starting to display data."}, { LLDB_OPT_SET_1| LLDB_OPT_SET_2| LLDB_OPT_SET_3, false, "force",'r', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone ,"Necessary if reading over target.max-memory-read-size bytes."}, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits