Re: [Lldb-commits] [PATCH] D13985: Enable the libc++ tests on linux
This revision was automatically updated to reflect the committed changes. Closed by commit rL251102: Enable the libc++ tests on linux (authored by labath). Changed prior to commit: http://reviews.llvm.org/D13985?vs=38129&id=38221#toc Repository: rL LLVM http://reviews.llvm.org/D13985 Files: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py === --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py @@ -27,12 +27,12 @@ self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) -lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1) self.runCmd("run", RUN_SUCCEEDED) +lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py === --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py @@ -20,12 +20,12 @@ self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) -lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")) self.runCmd("run", RUN_SUCCEEDED) +lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py === --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py @@ -21,12 +21,12 @@ self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) -lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")) self.runCmd("run", RUN_SUCCEEDED) +lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py === --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py @@ -20,12 +20,12 @@ self.build() self.runCmd("fi
[Lldb-commits] [lldb] r251102 - Enable the libc++ tests on linux
Author: labath Date: Fri Oct 23 04:17:30 2015 New Revision: 251102 URL: http://llvm.org/viewvc/llvm-project?rev=251102&view=rev Log: Enable the libc++ tests on linux Summary: The list of loaded modules which skip_if_library_missing is depending on is not available on linux until after we run the target. This causes the tests to be wrongfully skipped. This commit moves the skip call after the run command. Reviewers: granata.enrico, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13985 Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py?rev=251102&r1=251101&r2=251102&view=diff == --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py (original) +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py Fri Oct 23 04:17:30 2015 @@ -21,12 +21,12 @@ class InitializerListTestCase(TestBase): self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) -lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")) self.runCmd("run", RUN_SUCCEEDED) +lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py?rev=251102&r1=251101&r2=251102&view=diff == --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py (original) +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py Fri Oct 23 04:17:30 2015 @@ -26,12 +26,12 @@ class LibcxxIteratorDataFormatterTestCas self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) -lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1) self.runCmd("run", RUN_SUCCEEDED) +lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) + # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['stopped', Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=251102&r1=251101&r2=251102&view=diff == --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py (original) +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py Fri Oct 23 04:17:30 2015 @@ -29,8 +29,6 @@ class LibcxxListDa
Re: [Lldb-commits] [PATCH] D13981: Disable the strict-aliasing warnings produced by gcc
tberghammer added a comment. I created a bug for it as https://llvm.org/bugs/show_bug.cgi?id=25296 I don't see too much value in creating a "janitor" mode because I think when people want to do some cleanup, they will focus on one specific area where they enable the necessary warnings manually. Enabling the "janitor" mode will most likely create too much noise at once to handle it especially if we hide more and more "feature" behind it over the time http://reviews.llvm.org/D13981 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251104 - Fix the build when building with LLDB_DISABLE_PYTHON.
Author: aidandodds Date: Fri Oct 23 05:27:16 2015 New Revision: 251104 URL: http://llvm.org/viewvc/llvm-project?rev=251104&view=rev Log: Fix the build when building with LLDB_DISABLE_PYTHON. Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp?rev=251104&r1=251103&r2=251104&view=diff == --- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp Fri Oct 23 05:27:16 2015 @@ -58,8 +58,12 @@ static inline bool MI_add_summary(lldb::SBTypeCategory category, const char *typeName, lldb::SBTypeSummary::FormatCallback cb, uint32_t options, bool regex = false) { +#if defined(LLDB_DISABLE_PYTHON) +return false; +#else lldb::SBTypeSummary summary = lldb::SBTypeSummary::CreateWithCallback(cb, options); return summary.IsValid() ? category.AddTypeSummary(lldb::SBTypeNameSpecifier(typeName, regex), summary) : false; +#endif } //++ ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13662: Make dwarf parsing multi-threaded
tberghammer added a comment. I decided to go with your approach primarily because I tried it out with lower number of threads and it performed marginally better (~10%) in that case http://reviews.llvm.org/D13662 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251105 - Fix race conditions in Core/Timer
Author: tberghammer Date: Fri Oct 23 05:34:29 2015 New Revision: 251105 URL: http://llvm.org/viewvc/llvm-project?rev=251105&view=rev Log: Fix race conditions in Core/Timer The Timer class already had some support for multi-threaded access but it still contained several race conditions. This CL fixes them in preparation of adding multi-threaded dwarf parsing (and other multi-threaded parts later). Differential revision: http://reviews.llvm.org/D13940 Modified: lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/source/Core/Timer.cpp Modified: lldb/trunk/include/lldb/Core/Timer.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Timer.h?rev=251105&r1=251104&r2=251105&view=diff == --- lldb/trunk/include/lldb/Core/Timer.h (original) +++ lldb/trunk/include/lldb/Core/Timer.h Fri Oct 23 05:34:29 2015 @@ -14,6 +14,7 @@ #include #include #include +#include #include "lldb/lldb-private.h" #include "lldb/Host/TimeValue.h" @@ -84,9 +85,12 @@ protected: TimeValue m_timer_start; uint64_t m_total_ticks; // Total running time for this timer including when other timers below this are running uint64_t m_timer_ticks; // Ticks for this timer that do not include when other timers below this one are running -static uint32_t g_depth; -static uint32_t g_display_depth; -static FILE * g_file; + +static std::atomic_bool g_quiet; +static std::atomic_uint g_display_depth; +static std::mutex g_file_mutex; +static FILE* g_file; + private: Timer(); DISALLOW_COPY_AND_ASSIGN (Timer); Modified: lldb/trunk/source/Core/Timer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Timer.cpp?rev=251105&r1=251104&r2=251105&view=diff == --- lldb/trunk/source/Core/Timer.cpp (original) +++ lldb/trunk/source/Core/Timer.cpp Fri Oct 23 05:34:29 2015 @@ -21,12 +21,27 @@ using namespace lldb_private; #define TIMER_INDENT_AMOUNT 2 -static bool g_quiet = true; -uint32_t Timer::g_depth = 0; -uint32_t Timer::g_display_depth = 0; -FILE * Timer::g_file = NULL; -typedef std::vector TimerStack; -typedef std::map TimerCategoryMap; + +namespace +{ +typedef std::map TimerCategoryMap; + +struct TimerStack +{ +TimerStack() : +m_depth(0) +{} + +uint32_t m_depth; +std::vector m_stack; +}; +} // end of anonymous namespace + +std::atomic_bool Timer::g_quiet(true); +std::atomic_uint Timer::g_display_depth(0); +std::mutex Timer::g_file_mutex; +FILE* Timer::g_file = nullptr; + static lldb::thread_key_t g_key; static Mutex & @@ -82,12 +97,18 @@ Timer::Timer (const char *category, cons m_total_ticks (0), m_timer_ticks (0) { -if (g_depth++ < g_display_depth) +TimerStack *stack = GetTimerStackForCurrentThread (); +if (!stack) +return; + +if (stack->m_depth++ < g_display_depth) { if (g_quiet == false) { +std::lock_guard lock(g_file_mutex); + // Indent -::fprintf (g_file, "%*s", g_depth * TIMER_INDENT_AMOUNT, ""); +::fprintf (g_file, "%*s", stack->m_depth * TIMER_INDENT_AMOUNT, ""); // Print formatted string va_list args; va_start (args, format); @@ -100,19 +121,19 @@ Timer::Timer (const char *category, cons TimeValue start_time(TimeValue::Now()); m_total_start = start_time; m_timer_start = start_time; -TimerStack *stack = GetTimerStackForCurrentThread (); -if (stack) -{ -if (stack->empty() == false) -stack->back()->ChildStarted (start_time); -stack->push_back(this); -} + +if (!stack->m_stack.empty()) +stack->m_stack.back()->ChildStarted (start_time); +stack->m_stack.push_back(this); } } - Timer::~Timer() { +TimerStack *stack = GetTimerStackForCurrentThread (); +if (!stack) +return; + if (m_total_start.IsValid()) { TimeValue stop_time = TimeValue::Now(); @@ -127,14 +148,10 @@ Timer::~Timer() m_timer_start.Clear(); } -TimerStack *stack = GetTimerStackForCurrentThread (); -if (stack) -{ -assert (stack->back() == this); -stack->pop_back(); -if (stack->empty() == false) -stack->back()->ChildStopped(stop_time); -} +assert (stack->m_stack.back() == this); +stack->m_stack.pop_back(); +if (stack->m_stack.empty() == false) +stack->m_stack.back()->ChildStopped(stop_time); const uint64_t total_nsec_uint = GetTotalElapsedNanoSeconds(); const uint64_t timer_nsec_uint = GetTimerElapsedNanoSeconds(); @@ -143,10 +160,10 @@ Timer::~Timer() if (g_quiet == false) { - +
Re: [Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer
This revision was automatically updated to reflect the committed changes. Closed by commit rL251105: Fix race conditions in Core/Timer (authored by tberghammer). Changed prior to commit: http://reviews.llvm.org/D13940?vs=38118&id=38225#toc Repository: rL LLVM http://reviews.llvm.org/D13940 Files: lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/source/Core/Timer.cpp Index: lldb/trunk/include/lldb/Core/Timer.h === --- lldb/trunk/include/lldb/Core/Timer.h +++ lldb/trunk/include/lldb/Core/Timer.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "lldb/lldb-private.h" #include "lldb/Host/TimeValue.h" @@ -84,9 +85,12 @@ TimeValue m_timer_start; uint64_t m_total_ticks; // Total running time for this timer including when other timers below this are running uint64_t m_timer_ticks; // Ticks for this timer that do not include when other timers below this one are running -static uint32_t g_depth; -static uint32_t g_display_depth; -static FILE * g_file; + +static std::atomic_bool g_quiet; +static std::atomic_uint g_display_depth; +static std::mutex g_file_mutex; +static FILE* g_file; + private: Timer(); DISALLOW_COPY_AND_ASSIGN (Timer); Index: lldb/trunk/source/Core/Timer.cpp === --- lldb/trunk/source/Core/Timer.cpp +++ lldb/trunk/source/Core/Timer.cpp @@ -21,12 +21,27 @@ using namespace lldb_private; #define TIMER_INDENT_AMOUNT 2 -static bool g_quiet = true; -uint32_t Timer::g_depth = 0; -uint32_t Timer::g_display_depth = 0; -FILE * Timer::g_file = NULL; -typedef std::vector TimerStack; -typedef std::map TimerCategoryMap; + +namespace +{ +typedef std::map TimerCategoryMap; + +struct TimerStack +{ +TimerStack() : +m_depth(0) +{} + +uint32_t m_depth; +std::vector m_stack; +}; +} // end of anonymous namespace + +std::atomic_bool Timer::g_quiet(true); +std::atomic_uint Timer::g_display_depth(0); +std::mutex Timer::g_file_mutex; +FILE* Timer::g_file = nullptr; + static lldb::thread_key_t g_key; static Mutex & @@ -82,12 +97,18 @@ m_total_ticks (0), m_timer_ticks (0) { -if (g_depth++ < g_display_depth) +TimerStack *stack = GetTimerStackForCurrentThread (); +if (!stack) +return; + +if (stack->m_depth++ < g_display_depth) { if (g_quiet == false) { +std::lock_guard lock(g_file_mutex); + // Indent -::fprintf (g_file, "%*s", g_depth * TIMER_INDENT_AMOUNT, ""); +::fprintf (g_file, "%*s", stack->m_depth * TIMER_INDENT_AMOUNT, ""); // Print formatted string va_list args; va_start (args, format); @@ -100,19 +121,19 @@ TimeValue start_time(TimeValue::Now()); m_total_start = start_time; m_timer_start = start_time; -TimerStack *stack = GetTimerStackForCurrentThread (); -if (stack) -{ -if (stack->empty() == false) -stack->back()->ChildStarted (start_time); -stack->push_back(this); -} + +if (!stack->m_stack.empty()) +stack->m_stack.back()->ChildStarted (start_time); +stack->m_stack.push_back(this); } } - Timer::~Timer() { +TimerStack *stack = GetTimerStackForCurrentThread (); +if (!stack) +return; + if (m_total_start.IsValid()) { TimeValue stop_time = TimeValue::Now(); @@ -127,26 +148,22 @@ m_timer_start.Clear(); } -TimerStack *stack = GetTimerStackForCurrentThread (); -if (stack) -{ -assert (stack->back() == this); -stack->pop_back(); -if (stack->empty() == false) -stack->back()->ChildStopped(stop_time); -} +assert (stack->m_stack.back() == this); +stack->m_stack.pop_back(); +if (stack->m_stack.empty() == false) +stack->m_stack.back()->ChildStopped(stop_time); const uint64_t total_nsec_uint = GetTotalElapsedNanoSeconds(); const uint64_t timer_nsec_uint = GetTimerElapsedNanoSeconds(); const double total_nsec = total_nsec_uint; const double timer_nsec = timer_nsec_uint; if (g_quiet == false) { - +std::lock_guard lock(g_file_mutex); ::fprintf (g_file, "%*s%.9f sec (%.9f sec)\n", - (g_depth - 1) *TIMER_INDENT_AMOUNT, "", + (stack->m_depth - 1) *TIMER_INDENT_AMOUNT, "", total_nsec / 10.0, timer_nsec / 10.0); } @@ -156,8 +173,8 @@ TimerCategoryMap &category_map = GetCategoryMap(); category_map[m_category] += timer_nsec_uint; } -if (g_depth > 0) ---g_dep
[Lldb-commits] [lldb] r251106 - Re-commit "Make dwarf parsing multi-threaded"
Author: tberghammer Date: Fri Oct 23 05:34:49 2015 New Revision: 251106 URL: http://llvm.org/viewvc/llvm-project?rev=251106&view=rev Log: Re-commit "Make dwarf parsing multi-threaded" Re-commit the change after fixing a lot of race condition in LLDB exposed by this change Loading the debug info from a large application is the slowest task LLDB do. This CL makes most of the dwarf parsing code multi-threaded. As a result the speed of "attach; backtrace; exit;" when the inferior is an LLDB with full debug info increased by a factor of 2. Differential revision: http://reviews.llvm.org/D13662 Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp?rev=251106&r1=251105&r2=251106&view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp Fri Oct 23 05:34:49 2015 @@ -83,3 +83,14 @@ NameToDIE::ForEach (std::function http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h?rev=251106&r1=251105&r2=251106&view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h Fri Oct 23 05:34:49 2015 @@ -38,6 +38,9 @@ public: Insert (const lldb_private::ConstString& name, const DIERef& die_ref); void +Append (const NameToDIE& other); + +void Finalize(); size_t Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=251106&r1=251105&r2=251106&view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Oct 23 05:34:49 2015 @@ -50,6 +50,8 @@ #include "lldb/Target/Language.h" +#include "lldb/Utility/TaskPool.h" + #include "DWARFASTParser.h" #include "DWARFCompileUnit.h" #include "DWARFDebugAbbrev.h" @@ -2015,37 +2017,77 @@ SymbolFileDWARF::Index () DWARFDebugInfo* debug_info = DebugInfo(); if (debug_info) { -uint32_t cu_idx = 0; const uint32_t num_compile_units = GetNumCompileUnits(); -for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) +std::vector function_basename_index(num_compile_units); +std::vector function_fullname_index(num_compile_units); +std::vector function_method_index(num_compile_units); +std::vector function_selector_index(num_compile_units); +std::vector objc_class_selectors_index(num_compile_units); +std::vector global_index(num_compile_units); +std::vector type_index(num_compile_units); +std::vector namespace_index(num_compile_units); + +auto parser_fn = [this, + debug_info, + &function_basename_index, + &function_fullname_index, + &function_method_index, + &function_selector_index, + &objc_class_selectors_index, + &global_index, + &type_index, + &namespace_index](uint32_t cu_idx) { DWARFCompileUnit* dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); +bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded(false) > 1; -bool clear_dies = dwarf_cu->ExtractDIEsIfNeeded (false) > 1; +dwarf_cu->Index(function_basename_index[cu_idx], +function_fullname_index[cu_idx], +function_method_index[cu_idx], +function_selector_index[cu_idx], +objc_class_selectors_index[cu_idx], +global_index[cu_idx], +type_index[cu_idx], +namespace_index[cu_idx]); -dwarf_cu->Index (m_function_basename_index, - m_function_fullname_index, - m_function_method_index, - m_function_selector_index, - m_objc_class_selectors_index, - m_global_index, - m_type_index, - m_namespace_index); - // Keep memory down by clearing DIEs if this genera
Re: [Lldb-commits] [PATCH] D13981: Disable the strict-aliasing warnings produced by gcc
This revision was automatically updated to reflect the committed changes. Closed by commit rL251107: Disable the strict-aliasing warnings produced by gcc (authored by tberghammer). Changed prior to commit: http://reviews.llvm.org/D13981?vs=38115&id=38226#toc Repository: rL LLVM http://reviews.llvm.org/D13981 Files: lldb/trunk/cmake/modules/LLDBConfig.cmake Index: lldb/trunk/cmake/modules/LLDBConfig.cmake === --- lldb/trunk/cmake/modules/LLDBConfig.cmake +++ lldb/trunk/cmake/modules/LLDBConfig.cmake @@ -210,6 +210,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") endif () +check_cxx_compiler_flag("-Wno-strict-aliasing" +CXX_SUPPORTS_NO_STRICT_ALIASING) +if (CXX_SUPPORTS_NO_STRICT_ALIASING) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing") +endif () + # Disable Clang warnings check_cxx_compiler_flag("-Wno-deprecated-register" CXX_SUPPORTS_NO_DEPRECATED_REGISTER) Index: lldb/trunk/cmake/modules/LLDBConfig.cmake === --- lldb/trunk/cmake/modules/LLDBConfig.cmake +++ lldb/trunk/cmake/modules/LLDBConfig.cmake @@ -210,6 +210,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") endif () +check_cxx_compiler_flag("-Wno-strict-aliasing" +CXX_SUPPORTS_NO_STRICT_ALIASING) +if (CXX_SUPPORTS_NO_STRICT_ALIASING) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing") +endif () + # Disable Clang warnings check_cxx_compiler_flag("-Wno-deprecated-register" CXX_SUPPORTS_NO_DEPRECATED_REGISTER) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251107 - Disable the strict-aliasing warnings produced by gcc
Author: tberghammer Date: Fri Oct 23 05:34:53 2015 New Revision: 251107 URL: http://llvm.org/viewvc/llvm-project?rev=251107&view=rev Log: Disable the strict-aliasing warnings produced by gcc GCC produce a lot of strict-aliasing warning for the LLDB codebase what makes reading the compile output very difficult. This change disable these warnings to reduce the noise as we already ignore them. We should consider re-enabling the warning if we fix all (or most) strict-aliasing violation first. Differential revision: http://reviews.llvm.org/D13981 Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=251107&r1=251106&r2=251107&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Fri Oct 23 05:34:53 2015 @@ -210,6 +210,12 @@ if (CXX_SUPPORTS_NO_UNKNOWN_PRAGMAS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") endif () +check_cxx_compiler_flag("-Wno-strict-aliasing" +CXX_SUPPORTS_NO_STRICT_ALIASING) +if (CXX_SUPPORTS_NO_STRICT_ALIASING) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing") +endif () + # Disable Clang warnings check_cxx_compiler_flag("-Wno-deprecated-register" CXX_SUPPORTS_NO_DEPRECATED_REGISTER) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251109 - Try to fix MSVC build after r251105
Author: tberghammer Date: Fri Oct 23 05:53:31 2015 New Revision: 251109 URL: http://llvm.org/viewvc/llvm-project?rev=251109&view=rev Log: Try to fix MSVC build after r251105 Modified: lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/source/Core/Timer.cpp Modified: lldb/trunk/include/lldb/Core/Timer.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Timer.h?rev=251109&r1=251108&r2=251109&view=diff == --- lldb/trunk/include/lldb/Core/Timer.h (original) +++ lldb/trunk/include/lldb/Core/Timer.h Fri Oct 23 05:53:31 2015 @@ -13,8 +13,11 @@ #include #include -#include + +#include #include +#include + #include "lldb/lldb-private.h" #include "lldb/Host/TimeValue.h" @@ -86,8 +89,8 @@ protected: uint64_t m_total_ticks; // Total running time for this timer including when other timers below this are running uint64_t m_timer_ticks; // Ticks for this timer that do not include when other timers below this one are running -static std::atomic_bool g_quiet; -static std::atomic_uint g_display_depth; +static std::atomic g_quiet; +static std::atomic g_display_depth; static std::mutex g_file_mutex; static FILE* g_file; Modified: lldb/trunk/source/Core/Timer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Timer.cpp?rev=251109&r1=251108&r2=251109&view=diff == --- lldb/trunk/source/Core/Timer.cpp (original) +++ lldb/trunk/source/Core/Timer.cpp Fri Oct 23 05:53:31 2015 @@ -37,8 +37,8 @@ namespace }; } // end of anonymous namespace -std::atomic_bool Timer::g_quiet(true); -std::atomic_uint Timer::g_display_depth(0); +std::atomic Timer::g_quiet(true); +std::atomic Timer::g_display_depth(0); std::mutex Timer::g_file_mutex; FILE* Timer::g_file = nullptr; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r251107 - Disable the strict-aliasing warnings produced by gcc
On Fri, Oct 23, 2015 at 10:34:54AM -, Tamas Berghammer via lldb-commits wrote: > Author: tberghammer > Date: Fri Oct 23 05:34:53 2015 > New Revision: 251107 > > URL: http://llvm.org/viewvc/llvm-project?rev=251107&view=rev > Log: > Disable the strict-aliasing warnings produced by gcc > > GCC produce a lot of strict-aliasing warning for the LLDB codebase > what makes reading the compile output very difficult. This change > disable these warnings to reduce the noise as we already ignore them. > > We should consider re-enabling the warning if we fix all (or most) > strict-aliasing violation first. This feels very wrong. If you want to disable the warnings, at least also disable the codegen dependency with -fno-strict-aliasing. Joerg ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r251107 - Disable the strict-aliasing warnings produced by gcc
I agree that this isn't the perfect approach, but I don't think we want to take the performance penalty "-fno-strict-aliasing" will cause (we are using LLDB like this for a long time without any known issue caused by strict aliasing violations). The best solution would be to fix the strict aliasing violations or validate that they are actually false positives (and work them around) but it haven't happened in the last ~1 year and I don't expect it to happen in the near future either. My primary reason to disable these warnings is to make the other (less noisy) gcc warnings more visible so we can detect possible real problems from them. Having this warning enabled at the current state have almost zero value as AFAIK nobody cares about then and nobody would notice if a new one appear because of the general noise level. Tamas On Fri, Oct 23, 2015 at 1:24 PM Joerg Sonnenberger wrote: > On Fri, Oct 23, 2015 at 10:34:54AM -, Tamas Berghammer via > lldb-commits wrote: > > Author: tberghammer > > Date: Fri Oct 23 05:34:53 2015 > > New Revision: 251107 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=251107&view=rev > > Log: > > Disable the strict-aliasing warnings produced by gcc > > > > GCC produce a lot of strict-aliasing warning for the LLDB codebase > > what makes reading the compile output very difficult. This change > > disable these warnings to reduce the noise as we already ignore them. > > > > We should consider re-enabling the warning if we fix all (or most) > > strict-aliasing violation first. > > This feels very wrong. If you want to disable the warnings, at least > also disable the codegen dependency with -fno-strict-aliasing. > > Joerg > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251111 - Fix arm lldb-server on aarch64 device
Author: tberghammer Date: Fri Oct 23 08:36:31 2015 New Revision: 25 URL: http://llvm.org/viewvc/llvm-project?rev=25&view=rev Log: Fix arm lldb-server on aarch64 device * Use PTRACE_GETVFPREGS/PTRACE_SETVFPREGS to access the floating point registers instead of the old PTRACE_GETFPREGS/PTRACE_SETFPREGS. The new call is available since armv5. * Work around a kernel issue in PTRACE_POKEUSER with reading out the full register set, modifying the neccessary value and then writing it back. Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp?rev=25&r1=251110&r2=25&view=diff == --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp (original) +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp Fri Oct 23 08:36:31 2015 @@ -20,6 +20,10 @@ #define REG_CONTEXT_SIZE (GetGPRSize() + sizeof (m_fpr)) +#ifndef PTRACE_GETVFPREGS + #define PTRACE_GETVFPREGS 27 + #define PTRACE_SETVFPREGS 28 +#endif #ifndef PTRACE_GETHBPREGS #define PTRACE_GETHBPREGS 29 #define PTRACE_SETHBPREGS 30 @@ -853,4 +857,45 @@ NativeRegisterContextLinux_arm::Calculat return reg_info->byte_offset - GetRegisterInfoAtIndex(m_reg_info.first_fpr)->byte_offset; } +Error +NativeRegisterContextLinux_arm::DoWriteRegisterValue(uint32_t offset, + const char* reg_name, + const RegisterValue &value) +{ +// PTRACE_POKEUSER don't work in the aarch64 liux kernel used on android devices (always return +// "Bad address"). To avoid using PTRACE_POKEUSER we read out the full GPR register set, modify +// the requested register and write it back. This approach is about 4 times slower but the +// performance overhead is negligible in comparision to processing time in lldb-server. +assert(offset % 4 == 0 && "Try to write a register with unaligned offset"); +if (offset + sizeof(uint32_t) > sizeof(m_gpr_arm)) +return Error("Register isn't fit into the size of the GPR area"); + +Error error = DoReadGPR(m_gpr_arm, sizeof(m_gpr_arm)); +if (error.Fail()) +return error; + +m_gpr_arm[offset / sizeof(uint32_t)] = value.GetAsUInt32(); +return DoWriteGPR(m_gpr_arm, sizeof(m_gpr_arm)); +} + +Error +NativeRegisterContextLinux_arm::DoReadFPR(void *buf, size_t buf_size) +{ +return NativeProcessLinux::PtraceWrapper(PTRACE_GETVFPREGS, + m_thread.GetID(), + nullptr, + buf, + buf_size); +} + +Error +NativeRegisterContextLinux_arm::DoWriteFPR(void *buf, size_t buf_size) +{ +return NativeProcessLinux::PtraceWrapper(PTRACE_SETVFPREGS, + m_thread.GetID(), + nullptr, + buf, + buf_size); +} + #endif // defined(__arm__) Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h?rev=25&r1=251110&r2=25&view=diff == --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h (original) +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h Fri Oct 23 08:36:31 2015 @@ -90,6 +90,17 @@ namespace process_linux { }; protected: +Error +DoWriteRegisterValue(uint32_t offset, + const char* reg_name, + const RegisterValue &value) override; + +Error +DoReadFPR(void *buf, size_t buf_size) override; + +Error +DoWriteFPR(void *buf, size_t buf_size) override; + void* GetGPRBuffer() override { return &m_gpr_arm; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D14020: Port the python api decorator to use test categories
labath created this revision. labath added reviewers: tberghammer, tfiala, granata.enrico, zturner. labath added a subscriber: lldb-commits. Per discussions on the mailing list, I have implemented a decorator which annotates individual test methods with categories. I have used this framework to replace the '-a' and '+a' command-line switches (now '-G pyapi' and '--skip-category pyapi') and the @python_api_test decorator (now @categories('pyapi')). The test suite now gives an error message suggesting the new options if the user specifies the deprecated +/-a switches. If the general direction is good, I will follow this up with other switches. http://reviews.llvm.org/D14020 Files: test/dotest.py test/dotest_args.py test/expression_command/test/TestExprs.py test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py test/functionalities/command_script/import/TestImport.py test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py test/functionalities/conditional_break/TestConditionalBreak.py test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py test/functionalities/inferior-assert/TestInferiorAssert.py test/functionalities/inferior-crashing/TestInferiorCrashing.py test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py test/functionalities/inline-stepping/TestInlineStepping.py test/functionalities/return-value/TestReturnValue.py test/functionalities/step-avoids-no-debug/TestStepNoDebug.py test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py test/lang/c/array_types/TestArrayTypes.py test/lang/c/bitfields/TestBitfields.py test/lang/c/stepping/TestStepAndBreakpoints.py test/lang/cpp/class_static/TestStaticVariables.py test/lang/cpp/class_types/TestClassTypes.py test/lang/cpp/class_types/TestClassTypesDisassembly.py test/lang/cpp/dynamic-value/TestCppValueCast.py test/lang/cpp/dynamic-value/TestDynamicValue.py test/lang/cpp/stl/TestSTL.py test/lang/go/goroutines/TestGoroutines.py test/lang/go/types/TestGoASTContext.py test/lang/objc/blocks/TestObjCIvarsInBlocks.py test/lang/objc/foundation/TestObjCMethods.py test/lang/objc/foundation/TestObjectDescriptionAPI.py test/lang/objc/foundation/TestSymbolTable.py test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py test/lang/objc/objc-checker/TestObjCCheckers.py test/lang/objc/objc-class-method/TestObjCClassMethod.py test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py test/lang/objc/objc-property/TestObjCProperty.py test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py test/lang/objc/objc-static-method/TestObjCStaticMethod.py test/lang/objc/objc-stepping/TestObjCStepping.py test/lang/objc/objc-struct-argument/TestObjCStructArgument.py test/lang/objc/objc-struct-return/TestObjCStructReturn.py test/lang/objc/objc-super/TestObjCSuper.py test/lldbtest.py test/macosx/indirect_symbol/TestIndirectSymbols.py test/macosx/queues/TestQueues.py test/macosx/safe-to-func-call/TestSafeFuncCalls.py test/macosx/universal/TestUniversal.py test/python_api/breakpoint/TestBreakpointAPI.py test/python_api/class_members/TestSBTypeClassMembers.py test/python_api/debugger/TestDebuggerAPI.py test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py test/python_api/disassemble-raw-data/TestDisassembleRawData.py test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py test/python_api/event/TestEvents.py test/python_api/findvalue_duplist/TestSBFrameFindValue.py test/python_api/formatters/TestFormattersSBAPI.py test/python_api/frame/TestFrames.py test/python_api/frame/inlines/TestInlinedFrame.py test/python_api/function_symbol/TestDisasmAPI.py test/python_api/function_symbol/TestSymbolAPI.py test/python_api/hello_world/TestHelloWorld.py test/python_api/interpreter/TestCommandInterpreterAPI.py test/python_api/lldbutil/frame/TestFrameUtils.py test/python_api/lldbutil/iter/TestLLDBIterator.py test/python_api/lldbutil/iter/TestRegistersIterator.py test/python_api/lldbutil/process/TestPrintStackTraces.py test/python_api/module_section/TestModuleAndSection.py test/python_api/objc_type/TestObjCType.py test/python_api/process/TestProcessAPI.py test/python_api/process/io/TestPr
Re: [Lldb-commits] [PATCH] D14020: Port the python api decorator to use test categories
zturner added a comment. Could you call this something less generic than `categories`? The name of the decorator should be descriptive enough to hint that it can only be applied to test methods. `test_categories` even. http://reviews.llvm.org/D14020 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251119 - Fix Clang-tidy modernize-use-override warnings in source/Plugins/ObjectContainer and ObjectFile; other minor fixes.
Author: eugenezelenko Date: Fri Oct 23 11:56:07 2015 New Revision: 251119 URL: http://llvm.org/viewvc/llvm-project?rev=251119&view=rev Log: Fix Clang-tidy modernize-use-override warnings in source/Plugins/ObjectContainer and ObjectFile; other minor fixes. Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h?rev=251119&r1=251118&r2=251119&view=diff == --- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h (original) +++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h Fri Oct 23 11:56:07 2015 @@ -10,8 +10,11 @@ #ifndef liblldb_ObjectContainerBSDArchive_h_ #define liblldb_ObjectContainerBSDArchive_h_ +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/Symbol/ObjectContainer.h" - #include "lldb/Core/ArchSpec.h" #include "lldb/Core/ConstString.h" #include "lldb/Host/FileSpec.h" @@ -22,6 +25,14 @@ class ObjectContainerBSDArchive : public lldb_private::ObjectContainer { public: +ObjectContainerBSDArchive(const lldb::ModuleSP &module_sp, + lldb::DataBufferSP& data_sp, + lldb::offset_t data_offset, + const lldb_private::FileSpec *file, + lldb::offset_t offset, + lldb::offset_t length); + +~ObjectContainerBSDArchive() override; //-- // Static Functions @@ -60,43 +71,33 @@ public: //-- // Member Functions //-- -ObjectContainerBSDArchive (const lldb::ModuleSP &module_sp, - lldb::DataBufferSP& data_sp, - lldb::offset_t data_offset, - const lldb_private::FileSpec *file, - lldb::offset_t offset, - lldb::offset_t length); - -virtual -~ObjectContainerBSDArchive(); +bool +ParseHeader() override; -virtual bool -ParseHeader (); - -virtual size_t -GetNumObjects () const +size_t +GetNumObjects() const override { if (m_archive_sp) return m_archive_sp->GetNumObjects(); return 0; } -virtual void -Dump (lldb_private::Stream *s) const; -virtual lldb::ObjectFileSP -GetObjectFile (const lldb_private::FileSpec *file); +void +Dump(lldb_private::Stream *s) const override; + +lldb::ObjectFileSP +GetObjectFile(const lldb_private::FileSpec *file) override; //-- // PluginInterface protocol //-- -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; -virtual uint32_t -GetPluginVersion(); +uint32_t +GetPluginVersion() override; protected: - struct Object { Object(); @@ -127,6 +128,13 @@ protected: typedef std::shared_ptr shared_ptr; typedef std::multimap Map; +Archive(const lldb_private::ArchSpec &arch, +const lldb_private::TimeValue &mod_time, +lldb::offset_t file_offset, +lldb_private::DataExtractor &data); + +~Archive(); + static Map & GetArchiveCache (); @@ -146,13 +154,6 @@ protected: lldb::offset_t file_offset, lldb_private::DataExtractor &data); -Archive (const lldb_private::ArchSpec &arch, - const lldb_private::TimeValue &mod_time, - lldb::offset_t file_offset, - lldb_private::DataExtractor &data); - -~Archive (); - size_t GetNumObjects () const { @@ -226,4 +227,4 @@ protected: Archive::shared_ptr m_archive_sp; }; -#endif // liblldb_ObjectContainerBSDArchive_h_ +#endif // liblldb_ObjectContainer
Re: [Lldb-commits] [PATCH] D14020: Port the python api decorator to use test categories
labath added a comment. test_categories is the name of .py file. :/ How about `add_test_categories` ? http://reviews.llvm.org/D14020 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14020: Port the python api decorator to use test categories
Yea that sounds good too. On Fri, Oct 23, 2015 at 10:12 AM Pavel Labath wrote: > labath added a comment. > > test_categories is the name of .py file. :/ How about > `add_test_categories` ? > > > http://reviews.llvm.org/D14020 > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251128 - Remove argparse_compat.
Author: zturner Date: Fri Oct 23 12:53:30 2015 New Revision: 251128 URL: http://llvm.org/viewvc/llvm-project?rev=251128&view=rev Log: Remove argparse_compat. We don't support versions of Python less than 2.7 Removed: lldb/trunk/test/argparse_compat.py Modified: lldb/trunk/test/dotest_args.py Removed: lldb/trunk/test/argparse_compat.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/argparse_compat.py?rev=251127&view=auto == --- lldb/trunk/test/argparse_compat.py (original) +++ lldb/trunk/test/argparse_compat.py (removed) @@ -1,80 +0,0 @@ -#!/usr/bin/env python - -""" -Compatibility module to use the lldb test-suite with Python 2.6. - -Warning: This may be buggy. It has not been extensively tested and should only -be used when it is impossible to use a newer Python version. -It is also a special-purpose class for lldb's test-suite. -""" - -import sys - -if sys.version_info >= (2, 7): -raise "This module shouldn't be used when argparse is available (Python >= 2.7)" -else: -print "Using Python 2.6 compatibility layer. Some command line options may not be supported" - - -import optparse - - -class ArgumentParser(object): -def __init__(self, description="My program's description", prefix_chars='-', add_help=True): -self.groups = [] -self.parser = optparse.OptionParser(description=description, add_help_option=add_help) -self.prefix_chars = prefix_chars - -def add_argument_group(self, name): -group = optparse.OptionGroup(self.parser, name) -# Hack around our test directories argument (what's left after the -# options) -if name != 'Test directories': -self.groups.append(group) -return ArgumentGroup(group) - -def add_argument(self, *opt_strs, **kwargs): -self.parser.add_option(*opt_strs, **kwargs) -# def add_argument(self, opt_str, action='store', dest=None, metavar=None, help=''): -# if dest is None and metavar is None: -# self.parser.add_argument(opt_str, action=action, help=help) - -def parse_args(self, arguments=sys.argv[1:]): -map(lambda g: self.parser.add_option_group(g), self.groups) -(options, args) = self.parser.parse_args(arguments) -d = vars(options) -d['args'] = args -return Namespace(d) - -def print_help(self): -self.parser.print_help() - - -class ArgumentGroup(object): -def __init__(self, option_group): -self.option_group = option_group - -def add_argument(self, *opt_strs, **kwargs): -# Hack around our positional argument (the test directories) -if opt_strs == ('args',): -return - -# Hack around the options that start with '+' -if len(opt_strs) == 1 and opt_strs[0] == '+a': -opt_strs = ('--plus_a',) -if len(opt_strs) == 1 and opt_strs[0] == '+b': -opt_strs = ('--plus_b',) -self.option_group.add_option(*opt_strs, **kwargs) - - -class Namespace(object): -def __init__(self, d): -self.__dict__ = d - -def __str__(self): -strings = [] -for (k, v) in self.__dict__.iteritems(): -strings.append(str(k) + '=' + str(v)) -strings.sort() - -return self.__class__.__name__ + '(' + ', '.join(strings) + ')' Modified: lldb/trunk/test/dotest_args.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest_args.py?rev=251128&r1=251127&r2=251128&view=diff == --- lldb/trunk/test/dotest_args.py (original) +++ lldb/trunk/test/dotest_args.py Fri Oct 23 12:53:30 2015 @@ -1,33 +1,25 @@ from __future__ import print_function +import argparse import sys import multiprocessing import os import textwrap -if sys.version_info >= (2, 7): -argparse = __import__('argparse') -else: -argparse = __import__('argparse_compat') - class ArgParseNamespace(object): pass def parse_args(parser, argv): """ Returns an argument object. LLDB_TEST_ARGUMENTS environment variable can -be used to pass additional arguments if a compatible (>=2.7) argparse -library is available. +be used to pass additional arguments. """ -if sys.version_info >= (2, 7): -args = ArgParseNamespace() +args = ArgParseNamespace() + +if ('LLDB_TEST_ARGUMENTS' in os.environ): +print("Arguments passed through environment: '%s'" % os.environ['LLDB_TEST_ARGUMENTS']) +args = parser.parse_args([sys.argv[0]].__add__(os.environ['LLDB_TEST_ARGUMENTS'].split()),namespace=args) -if ('LLDB_TEST_ARGUMENTS' in os.environ): -print("Arguments passed through environment: '%s'" % os.environ['LLDB_TEST_ARGUMENTS']) -args = parser.parse_args([sys.argv[0]].__add__(os.environ['LLDB_TEST_ARGUMENTS'].split()),namespace=args) - -return parser.pa
[Lldb-commits] [lldb] r251129 - Python3 - Wrap more statements in calls to list()
Author: zturner Date: Fri Oct 23 12:53:51 2015 New Revision: 251129 URL: http://llvm.org/viewvc/llvm-project?rev=251129&view=rev Log: Python3 - Wrap more statements in calls to list() Modified: lldb/trunk/test/attic/tester.py lldb/trunk/test/dosep.py lldb/trunk/test/dotest.py lldb/trunk/test/lldbinline.py lldb/trunk/test/lldbtest.py lldb/trunk/test/plugins/builder_base.py lldb/trunk/test/progress.py lldb/trunk/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py lldb/trunk/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py lldb/trunk/test/tools/lldb-server/lldbgdbserverutils.py Modified: lldb/trunk/test/attic/tester.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/attic/tester.py?rev=251129&r1=251128&r2=251129&view=diff == --- lldb/trunk/test/attic/tester.py (original) +++ lldb/trunk/test/attic/tester.py Fri Oct 23 12:53:51 2015 @@ -55,7 +55,7 @@ class ExecutionTimes: self.m_times[component] = list() self.m_times[component].append(e - self.m_start) def dumpStats(self): -for key in self.m_times.keys(): +for key in list(self.m_times.keys()): if len(self.m_times[key]): sampleMin = float('inf') sampleMax = float('-inf') Modified: lldb/trunk/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=251129&r1=251128&r2=251129&view=diff == --- lldb/trunk/test/dosep.py (original) +++ lldb/trunk/test/dosep.py Fri Oct 23 12:53:51 2015 @@ -1355,7 +1355,7 @@ def main(print_details_on_success, num_t raise Exception( "specified testrunner name '{}' unknown. Valid choices: {}".format( test_runner_name, -runner_strategies_by_name.keys())) +list(runner_strategies_by_name.keys( test_runner_func = runner_strategies_by_name[test_runner_name] summary_results = walk_and_invoke( Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=251129&r1=251128&r2=251129&view=diff == --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Fri Oct 23 12:53:51 2015 @@ -413,7 +413,7 @@ def validate_categories(categories): if (category not in validCategories) or category == None: print("fatal error: category '" + origCategory + "' is not a valid category") print("if you have added a new category, please edit dotest.py, adding your new category to validCategories") -print("else, please specify one or more of the following: " + str(validCategories.keys())) +print("else, please specify one or more of the following: " + str(list(validCategories.keys( sys.exit(1) result.append(category) return result Modified: lldb/trunk/test/lldbinline.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbinline.py?rev=251129&r1=251128&r2=251129&view=diff == --- lldb/trunk/test/lldbinline.py (original) +++ lldb/trunk/test/lldbinline.py Fri Oct 23 12:53:51 2015 @@ -89,7 +89,7 @@ class InlineTest(TestBase): for f in os.listdir(os.getcwd()): t = source_type(f) if t: -if t in categories.keys(): +if t in list(categories.keys()): categories[t].append(f) else: categories[t] = [f] @@ -100,14 +100,14 @@ class InlineTest(TestBase): makefile.write("LEVEL = " + level + "\n") -for t in categories.keys(): +for t in list(categories.keys()): line = t + " := " + " ".join(categories[t]) makefile.write(line + "\n") -if ('OBJCXX_SOURCES' in categories.keys()) or ('OBJC_SOURCES' in categories.keys()): +if ('OBJCXX_SOURCES' in list(categories.keys())) or ('OBJC_SOURCES' in list(categories.keys())): makefile.write("LDFLAGS = $(CFLAGS) -lobjc -framework Foundation\n") -if ('CXX_SOURCES' in categories.keys()): +if ('CXX_SOURCES' in list(categories.keys())): makefile.write("CXXFLAGS += -std=c++11\n") makefile.write("include $(LEVEL)/Makefile.rules\n") Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=251129&r1=251128&r2=251129&view=diff == --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Fri Oct 23 12:53:51 2015 @@ -186,7 +186,7 @@ def SETTING_MSG(setting): def EnvArray(): """Returns an env variable array from the os
[Lldb-commits] [lldb] r251130 - Disable a compiler warning on MSVC.
Author: zturner Date: Fri Oct 23 12:54:00 2015 New Revision: 251130 URL: http://llvm.org/viewvc/llvm-project?rev=251130&view=rev Log: Disable a compiler warning on MSVC. This is caused by a bug in MSVC's library implementation. It's fixed in the next version of the compiler, but for now the only way to silence this is to disable the warning. 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=251130&r1=251129&r2=251130&view=diff == --- lldb/trunk/include/lldb/Utility/TaskPool.h (original) +++ lldb/trunk/include/lldb/Utility/TaskPool.h Fri Oct 23 12:54:00 2015 @@ -18,6 +18,14 @@ #include #endif +#if defined(_MSC_VER) +// Due to another bug in MSVC 2013, including will generate hundreds of +// warnings in the Concurrency Runtime. This can be removed when we switch to +// MSVC 2015 +#pragma warning(push) +#pragma warning(disable:4062) +#endif + #include #include #include @@ -206,4 +214,9 @@ TaskRunner::WaitForAllTasks() while (WaitForNextCompletedTask().valid()); } + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + #endif // #ifndef utility_TaskPool_h_ ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D14023: Fix uses of range / xrange for Python 3
zturner created this revision. zturner added a reviewer: tfiala. zturner added a subscriber: lldb-commits. Herald added subscribers: srhines, danalbert, tberghammer. Hi Todd, I've been putting most of this stuff in withouty review, but I figure every once in a while I should pass one your way as a sanity check to make sure I'm still on the right path. Anyway, for this one. `xrange()` is removed from Python 3, and `range()` is no longer a function but a "sequence object" which must be converted to a list. In theory I could have used `six.moves.xrange`, but I decided that the efficiency provided by `xrange` wasn't important in the code, so I changed it all to use `range` instead. http://reviews.llvm.org/D14023 Files: test/example/TestSequenceFunctions.py test/functionalities/inferior-assert/TestInferiorAssert.py test/functionalities/inferior-crashing/TestInferiorCrashing.py test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py test/lang/go/goroutines/TestGoroutines.py test/lang/go/types/TestGoASTContext.py test/lldbutil.py test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py Index: test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py === --- test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py +++ test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py @@ -34,7 +34,7 @@ @llgs_test # std::abort() on <= API 16 raises SIGSEGV - b.android.com/179836 -@expectedFailureAndroid(api_levels=range(16 + 1)) +@expectedFailureAndroid(api_levels=list(range(16 + 1))) def test_inferior_abort_received_llgs(self): self.init_llgs_test() self.build() Index: test/lldbutil.py === --- test/lldbutil.py +++ test/lldbutil.py @@ -607,7 +607,7 @@ def GetFuncName(i): return thread.GetFrameAtIndex(i).GetFunctionName() -return list(map(GetFuncName, range(thread.GetNumFrames( +return list(map(GetFuncName, list(range(thread.GetNumFrames() def get_symbol_names(thread): @@ -617,7 +617,7 @@ def GetSymbol(i): return thread.GetFrameAtIndex(i).GetSymbol().GetName() -return list(map(GetSymbol, range(thread.GetNumFrames( +return list(map(GetSymbol, list(range(thread.GetNumFrames() def get_pc_addresses(thread): @@ -627,7 +627,7 @@ def GetPCAddress(i): return thread.GetFrameAtIndex(i).GetPCAddress() -return list(map(GetPCAddress, range(thread.GetNumFrames( +return list(map(GetPCAddress, list(range(thread.GetNumFrames() def get_filenames(thread): @@ -637,7 +637,7 @@ def GetFilename(i): return thread.GetFrameAtIndex(i).GetLineEntry().GetFileSpec().GetFilename() -return list(map(GetFilename, range(thread.GetNumFrames( +return list(map(GetFilename, list(range(thread.GetNumFrames() def get_line_numbers(thread): @@ -647,7 +647,7 @@ def GetLineNumber(i): return thread.GetFrameAtIndex(i).GetLineEntry().GetLine() -return list(map(GetLineNumber, range(thread.GetNumFrames( +return list(map(GetLineNumber, list(range(thread.GetNumFrames() def get_module_names(thread): @@ -657,7 +657,7 @@ def GetModuleName(i): return thread.GetFrameAtIndex(i).GetModule().GetFileSpec().GetFilename() -return list(map(GetModuleName, range(thread.GetNumFrames( +return list(map(GetModuleName, list(range(thread.GetNumFrames() def get_stack_frames(thread): @@ -667,7 +667,7 @@ def GetStackFrame(i): return thread.GetFrameAtIndex(i) -return list(map(GetStackFrame, range(thread.GetNumFrames( +return list(map(GetStackFrame, list(range(thread.GetNumFrames() def print_stacktrace(thread, string_buffer = False): Index: test/lang/go/types/TestGoASTContext.py === --- test/lang/go/types/TestGoASTContext.py +++ test/lang/go/types/TestGoASTContext.py @@ -9,6 +9,8 @@ import lldbutil from lldbtest import * +import six.moves + class TestGoASTContext(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -129,5 +131,5 @@ v = self.var('theArray') self.assertEqual(5, v.GetNumChildren()) -for i in xrange(5): +for i in six.moves.xrange(5): self.assertEqual(str(i + 1), v.GetChildAtIndex(i).value) Index: test/lang/go/goroutines/TestGoroutines.py === --- test/lang/go/goroutines/TestGoroutines.py +++ test/lang/go/goroutines/TestGoroutines.py @@ -9,6 +9,8 @@ import lldbutil from lldbtest import * +import six.moves + class TestGoASTContext(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -75,7 +77,7 @@ # self.dbg.HandleCommand("log enable lldb os") # Now test that stepping works if the me
Re: [Lldb-commits] [PATCH] D14023: Fix uses of range / xrange for Python 3
zturner added inline comments. Comment at: test/lang/go/types/TestGoASTContext.py:134 @@ -131,3 +133,3 @@ self.assertEqual(5, v.GetNumChildren()) -for i in xrange(5): +for i in six.moves.xrange(5): self.assertEqual(str(i + 1), v.GetChildAtIndex(i).value) Looks like I missed this one. I'll put this one back to `list(range(5))` before comitting. http://reviews.llvm.org/D14023 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251134 - Fix Clang-tidy modernize-use-override warnings in source/Target; other minor fixes.
Author: eugenezelenko Date: Fri Oct 23 13:39:37 2015 New Revision: 251134 URL: http://llvm.org/viewvc/llvm-project?rev=251134&view=rev Log: Fix Clang-tidy modernize-use-override warnings in source/Target; other minor fixes. Modified: lldb/trunk/source/Target/LanguageRuntime.cpp lldb/trunk/source/Target/Process.cpp lldb/trunk/source/Target/StopInfo.cpp lldb/trunk/source/Target/Target.cpp lldb/trunk/source/Target/Thread.cpp Modified: lldb/trunk/source/Target/LanguageRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/LanguageRuntime.cpp?rev=251134&r1=251133&r2=251134&view=diff == --- lldb/trunk/source/Target/LanguageRuntime.cpp (original) +++ lldb/trunk/source/Target/LanguageRuntime.cpp Fri Oct 23 13:39:37 2015 @@ -1,4 +1,4 @@ -//===-- LanguageRuntime.cpp -*- C++ -*-===// +//===-- LanguageRuntime.cpp -*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,6 +7,10 @@ // //===--===// +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/Target/LanguageRuntime.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" @@ -17,7 +21,6 @@ using namespace lldb; using namespace lldb_private; - class ExceptionSearchFilter : public SearchFilter { public: @@ -33,8 +36,7 @@ public: UpdateModuleListIfNeeded (); } -virtual -~ExceptionSearchFilter() {} +~ExceptionSearchFilter() override = default; bool ModulePasses (const lldb::ModuleSP &module_sp) override @@ -52,7 +54,6 @@ public: if (m_filter_sp) return m_filter_sp->ModulePasses (spec); return false; - } void @@ -133,11 +134,8 @@ public: { } -virtual -~ExceptionBreakpointResolver() -{ -} - +~ExceptionBreakpointResolver() override = default; + Searcher::CallbackReturn SearchCallback (SearchFilter &filter, SymbolContext &context, @@ -187,6 +185,7 @@ public: static inline bool classof(const BreakpointResolver *V) { return V->getResolverID() == BreakpointResolver::ExceptionResolver; } + protected: BreakpointResolverSP CopyForBreakpoint (Breakpoint &breakpoint) override @@ -244,7 +243,6 @@ protected: bool m_throw_bp; }; - LanguageRuntime* LanguageRuntime::FindPlugin (Process *process, lldb::LanguageType language) { @@ -264,20 +262,12 @@ LanguageRuntime::FindPlugin (Process *pr return NULL; } -//-- -// Constructor -//-- LanguageRuntime::LanguageRuntime(Process *process) : m_process (process) { } -//-- -// Destructor -//-- -LanguageRuntime::~LanguageRuntime() -{ -} +LanguageRuntime::~LanguageRuntime() = default; Breakpoint::BreakpointPreconditionSP LanguageRuntime::CreateExceptionPrecondition (lldb::LanguageType language, Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=251134&r1=251133&r2=251134&view=diff == --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Fri Oct 23 13:39:37 2015 @@ -7,6 +7,10 @@ // //===--===// +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/Target/Process.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Breakpoint/BreakpointLocation.h" @@ -58,7 +62,6 @@ using namespace lldb; using namespace lldb_private; - // Comment out line below to disable memory caching, overriding the process setting // target.process.disable-memory-cache #define ENABLE_MEMORY_CACHING @@ -85,8 +88,8 @@ public: { } -virtual const Property * -GetPropertyAtIndex (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const +const Property * +GetPropertyAtIndex(const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const override { // When getting the value for a key from the process options, we will always // try and grab the setting from the current process if there is one. Else we just @@ -154,9 +157,7 @@ ProcessProperties::ProcessProperties (ll } } -ProcessProperties::~ProcessProperties() -{ -} +ProcessProperties::~ProcessProperties() = default;
[Lldb-commits] [PATCH] D14025: [LLDB] Fix Clang-tidy modernize-use-nullptr warnings in some files in include/lldb/Interpreter; other minor fixes.
Eugene.Zelenko created this revision. Eugene.Zelenko added reviewers: labath, clayborg. Eugene.Zelenko added a subscriber: lldb-commits. Eugene.Zelenko set the repository for this revision to rL LLVM. This is new Clang-tidy check which I run through LLDB code base, so I think will be good idea to review at least one set of changes before applying check to other places. I checked this patch on my own build on RHEL 6. Repository: rL LLVM http://reviews.llvm.org/D14025 Files: include/lldb/Interpreter/CommandInterpreter.h include/lldb/Interpreter/CommandObject.h include/lldb/Interpreter/CommandObjectMultiword.h include/lldb/Interpreter/CommandReturnObject.h include/lldb/Interpreter/OptionGroupArchitecture.h include/lldb/Interpreter/OptionValue.h include/lldb/Interpreter/OptionValueProperties.h include/lldb/Interpreter/OptionValueRegex.h include/lldb/Interpreter/OptionValueString.h include/lldb/Interpreter/Options.h include/lldb/Interpreter/ScriptInterpreter.h Index: include/lldb/Interpreter/ScriptInterpreter.h === --- include/lldb/Interpreter/ScriptInterpreter.h +++ include/lldb/Interpreter/ScriptInterpreter.h @@ -173,13 +173,13 @@ } virtual bool -GenerateTypeScriptFunction (const char* oneliner, std::string& output, const void* name_token = NULL) +GenerateTypeScriptFunction(const char* oneliner, std::string& output, const void* name_token = nullptr) { return false; } virtual bool -GenerateTypeScriptFunction (StringList &input, std::string& output, const void* name_token = NULL) +GenerateTypeScriptFunction(StringList &input, std::string& output, const void* name_token = nullptr) { return false; } @@ -191,13 +191,13 @@ } virtual bool -GenerateTypeSynthClass (StringList &input, std::string& output, const void* name_token = NULL) +GenerateTypeSynthClass(StringList &input, std::string& output, const void* name_token = nullptr) { return false; } virtual bool -GenerateTypeSynthClass (const char* oneliner, std::string& output, const void* name_token = NULL) +GenerateTypeSynthClass(const char* oneliner, std::string& output, const void* name_token = nullptr) { return false; } Index: include/lldb/Interpreter/OptionGroupArchitecture.h === --- include/lldb/Interpreter/OptionGroupArchitecture.h +++ include/lldb/Interpreter/OptionGroupArchitecture.h @@ -26,7 +26,6 @@ class OptionGroupArchitecture : public OptionGroup { public: - OptionGroupArchitecture (); ~OptionGroupArchitecture() override; @@ -55,15 +54,12 @@ } const char * -GetArchitectureName () +GetArchitectureName() { -if (m_arch_str.empty()) -return NULL; -return m_arch_str.c_str(); +return (m_arch_str.empty() ? nullptr : m_arch_str.c_str()); } protected: - std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture }; Index: include/lldb/Interpreter/OptionValueProperties.h === --- include/lldb/Interpreter/OptionValueProperties.h +++ include/lldb/Interpreter/OptionValueProperties.h @@ -1,4 +1,4 @@ -//===-- OptionValueProperties.h --*- C++ -*-===// +//===-- OptionValueProperties.h -*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,6 +12,8 @@ // C Includes // C++ Includes +#include + // Other libraries and framework includes // Project includes #include "lldb/Core/ConstString.h" @@ -27,10 +29,6 @@ public std::enable_shared_from_this { public: - -//- -// OptionValueProperties -//- OptionValueProperties () : OptionValue(), m_name (), @@ -42,11 +40,9 @@ OptionValueProperties (const ConstString &name); OptionValueProperties (const OptionValueProperties &global_properties); - -~OptionValueProperties() override -{ -} - + +~OptionValueProperties() override = default; + Type GetType() const override { @@ -256,21 +252,16 @@ void *baton); protected: - Property * -ProtectedGetPropertyAtIndex (uint32_t idx) +ProtectedGetPropertyAtIndex(uint32_t idx) { -if (idx < m_properties.size()) -return &m_properties[idx]; -return NULL; +return ((idx < m_properties.size()) ? &m_properties[idx] : nullptr); } const Property * -ProtectedGetPropertyAtIndex (uint32_t idx) const +ProtectedGetPropertyAtIndex(uint32_t idx) const { -
[Lldb-commits] [lldb] r251139 - Make uses of unicode literals portable.
Author: zturner Date: Fri Oct 23 14:52:36 2015 New Revision: 251139 URL: http://llvm.org/viewvc/llvm-project?rev=251139&view=rev Log: Make uses of unicode literals portable. Six provides six.u() which resolves to either u"" or "" depending on Python version, and and six.unichr() which resolves to either unichr() or chr() depending on Python version. Use these functions anywhere where we were relying on u"" or unichr(). Modified: lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitA.py lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitB.py lldb/trunk/test/progress.py lldb/trunk/test/test_results.py Modified: lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitA.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitA.py?rev=251139&r1=251138&r2=251139&view=diff == --- lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitA.py (original) +++ lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitA.py Fri Oct 23 14:52:36 2015 @@ -1,3 +1,6 @@ +import lldb_shared +import six + def command(debugger, command, result, internal_dict): - result.PutCString(u"hello world A") + result.PutCString(six.u("hello world A")) return None Modified: lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitB.py?rev=251139&r1=251138&r2=251139&view=diff == --- lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitB.py (original) +++ lldb/trunk/test/functionalities/command_script/import/thepackage/TPunitB.py Fri Oct 23 14:52:36 2015 @@ -1,3 +1,6 @@ +import lldb_shared +import six + def command(debugger, command, result, internal_dict): - result.PutCString(u"hello world B") + result.PutCString(six.u("hello world B")) return None Modified: lldb/trunk/test/progress.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/progress.py?rev=251139&r1=251138&r2=251139&view=diff == --- lldb/trunk/test/progress.py (original) +++ lldb/trunk/test/progress.py Fri Oct 23 14:52:36 2015 @@ -2,6 +2,9 @@ from __future__ import print_function +import lldb_shared +import six + import sys import time @@ -17,17 +20,17 @@ class ProgressBar(object): format Format incremental """ -light_block = unichr(0x2591).encode("utf-8") -solid_block = unichr(0x2588).encode("utf-8") -solid_right_arrow = unichr(0x25BA).encode("utf-8") +light_block = six.unichr(0x2591).encode("utf-8") +solid_block = six.unichr(0x2588).encode("utf-8") +solid_right_arrow = six.unichr(0x25BA).encode("utf-8") def __init__(self, start=0, end=10, width=12, - fill=unichr(0x25C9).encode("utf-8"), - blank=unichr(0x25CC).encode("utf-8"), - marker=unichr(0x25CE).encode("utf-8"), + fill=six.unichr(0x25C9).encode("utf-8"), + blank=six.unichr(0x25CC).encode("utf-8"), + marker=six.unichr(0x25CE).encode("utf-8"), format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', incremental=True): super(ProgressBar, self).__init__() @@ -81,9 +84,9 @@ class AnimatedProgressBar(ProgressBar): start=0, end=10, width=12, - fill=unichr(0x25C9).encode("utf-8"), - blank=unichr(0x25CC).encode("utf-8"), - marker=unichr(0x25CE).encode("utf-8"), + fill=six.unichr(0x25C9).encode("utf-8"), + blank=six.unichr(0x25CC).encode("utf-8"), + marker=six.unichr(0x25CE).encode("utf-8"), format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', incremental=True, stdout=sys.stdout): @@ -107,9 +110,9 @@ class ProgressWithEvents(AnimatedProgres start=0, end=10, width=12, - fill=unichr(0x25C9).encode("utf-8"), - blank=unichr(0x25CC).encode("utf-8"), - marker=unichr(0x25CE).encode("utf-8"), + fill=six.unichr(0x25C9).encode("utf-8"), + blank=six.unichr(0x25CC).encode("utf-8"), + marker=six.unichr(0x25CE).encode("utf-8"), format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', incremental=True, stdout=sys.stdout): Modified: lldb/trunk/test/test_results.py URL: http://
[Lldb-commits] [PATCH] Fix for PR25300
Hi, I decided to take a quick look at PR25300 (roughly, an '*' at the end of an environment variable crashes lldb-server). The issue is that during packet decompression (apparently even for uncompressed packets) there is basic RLE, triggered by '*', so it needs to be quoted in some way before being sent. I came up with patches doing it in two different places (both attached here): 1. Switch to QEnvironmentHexEncoded if the string has these chars. 2. Safely escape these chars in SendPackedNoLock. The second seems more robust and semantically correct (viewing only '$' and '#' as characters that are actually special in a non transport-dependent way). But it does have a performance overhead for each packet sent (a likely not very optimised extra strcpy). Which would be preferred, and does anyone have any hints on writing a test for it? I can't see any existing QEnvironment tests to base mine on. Cheers. Tim. diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index ea95298..9392af7 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -238,12 +238,29 @@ GDBRemoteCommunication::SendPacketNoLock (const char *payload, size_t payload_le { if (IsConnected()) { -StreamString packet(0, 4, eByteOrderBig); +std::string safe_payload; +safe_payload.reserve(payload_length); +for (const char *c = payload; c != payload + payload_length; ++c) +{ +if (*c == '*' || *c == '}') +{ +// These have special meaning even for nominally uncompressed +// strings, so we must escape them. Fortunately, the special +// meaning of '}' is precisely an escape of the next char (^ +// 0x20). +safe_payload.push_back('}'); +safe_payload.push_back(*c ^ 0x20); +} +else +safe_payload.push_back(*c); +} +payload_length = safe_payload.size(); +StreamString packet(0, 4, eByteOrderBig); packet.PutChar('$'); -packet.Write (payload, payload_length); +packet.Write (safe_payload.data(), payload_length); packet.PutChar('#'); -packet.PutHex8(CalculcateChecksum (payload, payload_length)); +packet.PutHex8(CalculcateChecksum (safe_payload.data(), payload_length)); Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS)); ConnectionStatus status = eConnectionStatusSuccess; diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index a6fcd14..5e0964b 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1577,6 +1577,8 @@ GDBRemoteCommunicationClient::SendEnvironmentPacket (char const *name_equal_valu { case '$': case '#': +case '*': +case '}': send_hex_encoding = true; break; default: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D14028: Convert long to int and portably detect integral types
zturner created this revision. zturner added a reviewer: tfiala. zturner added a subscriber: lldb-commits. In a few of the examples fixed up here, the distinction between long and int was not important here. As a result, I converted those to use int instead of long everywhere to make the code simpler since six doesn't have something like `six.long` that resolves to int in py3 and long in py2. So we just use int everywhere. The other fixes are fairly straightforward. http://reviews.llvm.org/D14028 Files: test/functionalities/abbreviation/TestCommonShortSpellings.py test/lang/c/array_types/TestArrayTypes.py test/lldbcurses.py test/python_api/sbdata/TestSBData.py test/tools/lldb-server/lldbgdbserverutils.py Index: test/tools/lldb-server/lldbgdbserverutils.py === --- test/tools/lldb-server/lldbgdbserverutils.py +++ test/tools/lldb-server/lldbgdbserverutils.py @@ -9,6 +9,7 @@ import os.path import platform import re +import six import socket_packet_pump import subprocess import time @@ -808,8 +809,8 @@ If we don't know how to check running process ids on the given OS: return the value provided by the unknown_value arg. """ -if type(pid) not in [int, long]: -raise Exception("pid must be of type int (actual type: %s)" % str(type(pid))) +if not isinstance(pid, six.integer_types): +raise Exception("pid must be an integral type (actual type: %s)" % str(type(pid))) process_ids = [] Index: test/python_api/sbdata/TestSBData.py === --- test/python_api/sbdata/TestSBData.py +++ test/python_api/sbdata/TestSBData.py @@ -220,8 +220,8 @@ self.assertTrue(data2.uint8[4] == 111, 'o == 111') self.assert_data(data2.GetUnsignedInt8, 5, 33) # ! -uint_lists = [ [1,2,3,4,5], [long(i) for i in [1, 2, 3, 4, 5]] ] -int_lists = [ [2, -2], [long(i) for i in [2, -2]] ] +uint_lists = [ [1,2,3,4,5], [int(i) for i in [1, 2, 3, 4, 5]] ] +int_lists = [ [2, -2], [int(i) for i in [2, -2]] ] for l in uint_lists: data2 = lldb.SBData.CreateDataFromUInt64Array(process.GetByteOrder(), process.GetAddressByteSize(), l) Index: test/lldbcurses.py === --- test/lldbcurses.py +++ test/lldbcurses.py @@ -1,5 +1,8 @@ +import lldb_shared + import curses, curses.panel import sys +import six import time class Point(object): @@ -138,7 +141,7 @@ for key in arg: self.add_key_action(key, callback, description) else: -if isinstance(arg, ( int, long )): +if isinstance(arg, six.integer_types): key_action_dict = { 'key' : arg, 'callback': callback, 'description' : decription } Index: test/lang/c/array_types/TestArrayTypes.py === --- test/lang/c/array_types/TestArrayTypes.py +++ test/lang/c/array_types/TestArrayTypes.py @@ -182,7 +182,7 @@ "Variable 'long_6' should have 6 children") child5 = variable.GetChildAtIndex(5) self.DebugSBValue(child5) -self.assertTrue(long(child5.GetValue(), 0) == 6, +self.assertTrue(int(child5.GetValue(), 0) == 6, "long_6[5] == 6") # Last, check that "long_6" has a value type of eValueTypeVariableLocal Index: test/functionalities/abbreviation/TestCommonShortSpellings.py === --- test/functionalities/abbreviation/TestCommonShortSpellings.py +++ test/functionalities/abbreviation/TestCommonShortSpellings.py @@ -32,7 +32,7 @@ ('ta st li', 'target stop-hook list'), ] -for (short, long) in abbrevs: -command_interpreter.ResolveCommand(short, result) +for (short_val, long_val) in abbrevs: +command_interpreter.ResolveCommand(short_val, result) self.assertTrue(result.Succeeded()) -self.assertEqual(long, result.GetOutput()) +self.assertEqual(long_val, result.GetOutput()) Index: test/tools/lldb-server/lldbgdbserverutils.py === --- test/tools/lldb-server/lldbgdbserverutils.py +++ test/tools/lldb-server/lldbgdbserverutils.py @@ -9,6 +9,7 @@ import os.path import platform import re +import six import socket_packet_pump import subprocess import time @@ -808,8 +809,8 @@ If we don't know how to check running process ids on the given OS: return the value provided by the unknown_value arg. """ -if type(pid) not in [int, long]: -raise Exception("pid must be of type int (actual type: %s)" % str(type(pid))) +if not isinstanc
[Lldb-commits] [PATCH] D14029: [TestBreakpointCommand] Fix after r251121
sivachandra created this revision. sivachandra added a reviewer: zturner. sivachandra added a subscriber: lldb-commits. "from __future__ import print_function" was added to the test file but not to the embedded interpreter. This change uses file.write instead to avoid all problems with print. http://reviews.llvm.org/D14029 Files: test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Index: test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py === --- test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -2,8 +2,6 @@ Test lldb breakpoint command add/list/delete. """ -from __future__ import print_function - import lldb_shared import os, time @@ -52,7 +50,7 @@ # Now add callbacks for the breakpoints just created. self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4") -self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2") self.runCmd("breakpoint command add --python-function bktptcmd.function 3") # Check that the breakpoint commands are correctly set. @@ -74,7 +72,7 @@ self.expect("breakpoint command list 2", "Breakpoint 2 command ok", substrs = ["Breakpoint commands:", "here = open", - "print(file=here)", + "here.write", "here.close()"]) self.expect("breakpoint command list 3", "Breakpoint 3 command ok", substrs = ["Breakpoint commands:", @@ -178,7 +176,7 @@ lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True) # Now add callbacks for the breakpoints just created. -self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); here.write(str(bp_loc) + \"\\n\"); here.close()' 1") # Remove 'output-2.txt' if it already exists. Index: test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py === --- test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -2,8 +2,6 @@ Test lldb breakpoint command add/list/delete. """ -from __future__ import print_function - import lldb_shared import os, time @@ -52,7 +50,7 @@ # Now add callbacks for the breakpoints just created. self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4") -self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2") self.runCmd("breakpoint command add --python-function bktptcmd.function 3") # Check that the breakpoint commands are correctly set. @@ -74,7 +72,7 @@ self.expect("breakpoint command list 2", "Breakpoint 2 command ok", substrs = ["Breakpoint commands:", "here = open", - "print(file=here)", + "here.write", "here.close()"]) self.expect("breakpoint command list 3", "Breakpoint 3 command ok", substrs = ["Breakpoint commands:", @@ -178,7 +176,7 @@ lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True) # Now add callbacks for the breakpoints just created. -self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); here.write(str(bp_loc) + \"\\n\"); here.close()' 1") # Remove 'output-2.txt' if it already exists. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14029: [TestBreakpointCommand] Fix after r251121
Can you leave the from __future__ import print_function at the top? That's orthogonal to changing the dynamically executed code. I can reproduce this problem by running LLDB in 2.7 and entering the embedded interpreter and typing print("foo", file=sys.stdout). So I can probably fix that and this is an ok workaround for now, but people still need to be using print function instead of print statement on statically generated python code, so I think the future statement should stay. On Fri, Oct 23, 2015 at 2:22 PM Siva Chandra wrote: > sivachandra created this revision. > sivachandra added a reviewer: zturner. > sivachandra added a subscriber: lldb-commits. > > "from __future__ import print_function" was added to the test file but > not to the embedded interpreter. This change uses file.write instead to > avoid all problems with print. > > http://reviews.llvm.org/D14029 > > Files: > > test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py > > Index: > test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py > === > --- > test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py > +++ > test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py > @@ -2,8 +2,6 @@ > Test lldb breakpoint command add/list/delete. > """ > > -from __future__ import print_function > - > import lldb_shared > > import os, time > @@ -52,7 +50,7 @@ > > # Now add callbacks for the breakpoints just created. > self.runCmd("breakpoint command add -s command -o 'frame variable > --show-types --scope' 1 4") > -self.runCmd("breakpoint command add -s python -o 'here = > open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") > +self.runCmd("breakpoint command add -s python -o 'here = > open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2") > self.runCmd("breakpoint command add --python-function > bktptcmd.function 3") > > # Check that the breakpoint commands are correctly set. > @@ -74,7 +72,7 @@ > self.expect("breakpoint command list 2", "Breakpoint 2 command > ok", > substrs = ["Breakpoint commands:", >"here = open", > - "print(file=here)", > + "here.write", >"here.close()"]) > self.expect("breakpoint command list 3", "Breakpoint 3 command > ok", > substrs = ["Breakpoint commands:", > @@ -178,7 +176,7 @@ > lldbutil.run_break_set_by_file_and_line (self, "main.c", > self.line, num_expected_locations=1, loc_exact=True) > > # Now add callbacks for the breakpoints just created. > -self.runCmd("breakpoint command add -s python -o 'here = > open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, > file=here); here.close()' 1") > +self.runCmd("breakpoint command add -s python -o 'here = > open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); > here.write(str(bp_loc) + \"\\n\"); here.close()' 1") > > # Remove 'output-2.txt' if it already exists. > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14029: [TestBreakpointCommand] Fix after r251121
sivachandra updated this revision to Diff 38265. sivachandra added a comment. Put back the import of print_function from __future__. http://reviews.llvm.org/D14029 Files: test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Index: test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py === --- test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -52,7 +52,7 @@ # Now add callbacks for the breakpoints just created. self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4") -self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2") self.runCmd("breakpoint command add --python-function bktptcmd.function 3") # Check that the breakpoint commands are correctly set. @@ -74,7 +74,7 @@ self.expect("breakpoint command list 2", "Breakpoint 2 command ok", substrs = ["Breakpoint commands:", "here = open", - "print(file=here)", + "here.write", "here.close()"]) self.expect("breakpoint command list 3", "Breakpoint 3 command ok", substrs = ["Breakpoint commands:", @@ -178,7 +178,7 @@ lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True) # Now add callbacks for the breakpoints just created. -self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); here.write(str(bp_loc) + \"\\n\"); here.close()' 1") # Remove 'output-2.txt' if it already exists. Index: test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py === --- test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -52,7 +52,7 @@ # Now add callbacks for the breakpoints just created. self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4") -self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2") self.runCmd("breakpoint command add --python-function bktptcmd.function 3") # Check that the breakpoint commands are correctly set. @@ -74,7 +74,7 @@ self.expect("breakpoint command list 2", "Breakpoint 2 command ok", substrs = ["Breakpoint commands:", "here = open", - "print(file=here)", + "here.write", "here.close()"]) self.expect("breakpoint command list 3", "Breakpoint 3 command ok", substrs = ["Breakpoint commands:", @@ -178,7 +178,7 @@ lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True) # Now add callbacks for the breakpoints just created. -self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); here.write(str(bp_loc) + \"\\n\"); here.close()' 1") # Remove 'output-2.txt' if it already exists. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251150 - [TestBreakpointCommand] Fix after r251121
Author: sivachandra Date: Fri Oct 23 16:38:04 2015 New Revision: 251150 URL: http://llvm.org/viewvc/llvm-project?rev=251150&view=rev Log: [TestBreakpointCommand] Fix after r251121 Summary: "from __future__ import print_function" was added to the test file but not to the embedded interpreter. This change uses file.write instead to avoid all problems with print. Reviewers: zturner Subscribers: zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D14029 Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=251150&r1=251149&r2=251150&view=diff == --- lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Fri Oct 23 16:38:04 2015 @@ -52,7 +52,7 @@ class BreakpointCommandTestCase(TestBase # Now add callbacks for the breakpoints just created. self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4") -self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2") self.runCmd("breakpoint command add --python-function bktptcmd.function 3") # Check that the breakpoint commands are correctly set. @@ -74,7 +74,7 @@ class BreakpointCommandTestCase(TestBase self.expect("breakpoint command list 2", "Breakpoint 2 command ok", substrs = ["Breakpoint commands:", "here = open", - "print(file=here)", + "here.write", "here.close()"]) self.expect("breakpoint command list 3", "Breakpoint 3 command ok", substrs = ["Breakpoint commands:", @@ -178,7 +178,7 @@ class BreakpointCommandTestCase(TestBase lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True) # Now add callbacks for the breakpoints just created. -self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1") +self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); here.write(str(bp_loc) + \"\\n\"); here.close()' 1") # Remove 'output-2.txt' if it already exists. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251151 - Fixed some issues with reporting "this" when the current function is not listed
Author: spyffe Date: Fri Oct 23 16:45:02 2015 New Revision: 251151 URL: http://llvm.org/viewvc/llvm-project?rev=251151&view=rev Log: Fixed some issues with reporting "this" when the current function is not listed in DWARF as a member of a class, but it has a "this" parameter. Specifically, *this needs to have the LLDB expression added as a method. This fixes TestWithLimitDebugInfo. Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp?rev=251151&r1=251150&r2=251151&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp Fri Oct 23 16:45:02 2015 @@ -1086,28 +1086,7 @@ ClangExpressionDeclMap::FindExternalVisi log->Printf(" CEDM::FEVD[%u] Adding type for $__lldb_class: %s", current_id, ast_dumper.GetCString()); } -TypeFromParser class_type = CopyClassType(class_user_type, current_id); - -if (!class_type.IsValid()) -return; - -TypeSourceInfo *type_source_info = m_ast_context->getTrivialTypeSourceInfo(QualType::getFromOpaquePtr(class_type.GetOpaqueQualType())); - -if (!type_source_info) -return; - -TypedefDecl *typedef_decl = TypedefDecl::Create(*m_ast_context, - m_ast_context->getTranslationUnitDecl(), - SourceLocation(), - SourceLocation(), - context.m_decl_name.getAsIdentifierInfo(), - type_source_info); - - -if (!typedef_decl) -return; - -context.AddNamedDecl(typedef_decl); +AddThisType(context, class_user_type, current_id); if (method_decl->isInstance()) { @@ -1143,20 +1122,17 @@ ClangExpressionDeclMap::FindExternalVisi if (!this_type) return; -CompilerType pointee_type = this_type->GetForwardCompilerType ().GetPointeeType(); +TypeFromUser pointee_type = this_type->GetForwardCompilerType ().GetPointeeType(); if (pointee_type.IsValid()) { if (log) { -ASTDumper ast_dumper(this_type->GetFullCompilerType ()); -log->Printf(" FEVD[%u] Adding type for $__lldb_objc_class: %s", current_id, ast_dumper.GetCString()); +ASTDumper ast_dumper(pointee_type); +log->Printf(" FEVD[%u] Adding type for $__lldb_class: %s", current_id, ast_dumper.GetCString()); } - -TypeFromUser class_user_type(pointee_type); -AddOneType(context, class_user_type, current_id); - - + +AddThisType(context, pointee_type, current_id); TypeFromUser this_user_type(this_type->GetFullCompilerType ()); m_struct_vars->m_object_pointer_type = this_user_type; return; @@ -2156,9 +2132,10 @@ ClangExpressionDeclMap::AddOneFunction ( } } -TypeFromParser -ClangExpressionDeclMap::CopyClassType(TypeFromUser &ut, - unsigned int current_id) +void +ClangExpressionDeclMap::AddThisType(NameSearchContext &context, +TypeFromUser &ut, +unsigned int current_id) { CompilerType copied_clang_type = GuardedCopyType(ut); @@ -2167,9 +2144,9 @@ ClangExpressionDeclMap::CopyClassType(Ty Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); if (log) -log->Printf("ClangExpressionDeclMap::CopyClassType - Couldn't import the type"); +log->Printf("ClangExpressionDeclMap::AddThisType - Couldn't import the type"); -return TypeFromParser(); +return; } if (copied_clang_type.IsAggregateType() && copied_clang_type.GetCompleteType ()) @@ -2204,7 +2181,31 @@ ClangExpressionDeclMap::CopyClassType(Ty is_artificial); } -return TypeFromParser(co
[Lldb-commits] [lldb] r251161 - Lower the depth of the recursion in this test since it would on occasion timeout and add noise to test runs
Author: enrico Date: Fri Oct 23 19:15:57 2015 New Revision: 251161 URL: http://llvm.org/viewvc/llvm-project?rev=251161&view=rev Log: Lower the depth of the recursion in this test since it would on occasion timeout and add noise to test runs Modified: lldb/trunk/test/functionalities/recursion/TestValueObjectRecursion.py Modified: lldb/trunk/test/functionalities/recursion/TestValueObjectRecursion.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/recursion/TestValueObjectRecursion.py?rev=251161&r1=251160&r2=251161&view=diff == --- lldb/trunk/test/functionalities/recursion/TestValueObjectRecursion.py (original) +++ lldb/trunk/test/functionalities/recursion/TestValueObjectRecursion.py Fri Oct 23 19:15:57 2015 @@ -49,7 +49,7 @@ class ValueObjectRecursionTestCase(TestB if self.TraceOn(): print(root) print(child) -for i in range(0,24500): +for i in range(0,15000): child = child.GetChildAtIndex(1) if self.TraceOn(): print(child) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251162 - Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/Interpreter; other minor fixes.
Author: eugenezelenko Date: Fri Oct 23 19:20:14 2015 New Revision: 251162 URL: http://llvm.org/viewvc/llvm-project?rev=251162&view=rev Log: Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/Interpreter; other minor fixes. Differential Revision: http://reviews.llvm.org/D14025 Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h lldb/trunk/include/lldb/Interpreter/CommandObject.h lldb/trunk/include/lldb/Interpreter/CommandObjectMultiword.h lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h lldb/trunk/include/lldb/Interpreter/OptionValue.h lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h lldb/trunk/include/lldb/Interpreter/OptionValueString.h lldb/trunk/include/lldb/Interpreter/Options.h lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h?rev=251162&r1=251161&r2=251162&view=diff == --- lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h (original) +++ lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h Fri Oct 23 19:20:14 2015 @@ -265,8 +265,8 @@ public: bool include_aliases); CommandObject * -GetCommandObject (const char *cmd, - StringList *matches = NULL); +GetCommandObject(const char *cmd, + StringList *matches = nullptr); bool CommandExists (const char *cmd); @@ -322,12 +322,12 @@ public: CommandReturnObject &result); bool -HandleCommand (const char *command_line, - LazyBool add_to_history, - CommandReturnObject &result, - ExecutionContext *override_context = NULL, - bool repeat_on_empty_command = true, - bool no_context_switching = false); +HandleCommand(const char *command_line, + LazyBool add_to_history, + CommandReturnObject &result, + ExecutionContext *override_context = nullptr, + bool repeat_on_empty_command = true, + bool no_context_switching = false); //-- /// Execute a list of commands in sequence. @@ -335,7 +335,7 @@ public: /// @param[in] commands ///The list of commands to execute. /// @param[in,out] context -///The execution context in which to run the commands. Can be NULL in which case the default +///The execution context in which to run the commands. Can be nullptr in which case the default ///context will be used. /// @param[in] options ///This object holds the options used to control when to stop, whether to execute commands, @@ -356,7 +356,7 @@ public: /// @param[in] file ///The file from which to read in commands. /// @param[in,out] context -///The execution context in which to run the commands. Can be NULL in which case the default +///The execution context in which to run the commands. Can be nullptr in which case the default ///context will be used. /// @param[in] options ///This object holds the options used to control when to stop, whether to execute commands, @@ -643,7 +643,7 @@ public: } lldb::IOHandlerSP -GetIOHandler(bool force_create = false, CommandInterpreterRunOptions *options = NULL); +GetIOHandler(bool force_create = false, CommandInterpreterRunOptions *options = nullptr); bool GetStoppedForCrash () const @@ -682,7 +682,7 @@ protected: SetSynchronous (bool value); lldb::CommandObjectSP -GetCommandSP (const char *cmd, bool include_aliases = true, bool exact = true, StringList *matches = NULL); +GetCommandSP(const char *cmd, bool include_aliases = true, bool exact = true, StringList *matches = nullptr); private: Error Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=251162&r1=251161&r2=251162&view=diff == --- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original) +++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Fri Oct 23 19:20:14 2015 @@ -46,7 +46,7 @@ public: explicit operator bool() const { -return (help_callback != NULL); +return (help_callback != nullptr); } }; @@ -77,11 +77,11 @@ public: typedef std::map CommandMap; -CommandObject (CommandInterpreter &
Re: [Lldb-commits] [PATCH] D14025: [LLDB] Fix Clang-tidy modernize-use-nullptr warnings in some files in include/lldb/Interpreter; other minor fixes.
This revision was automatically updated to reflect the committed changes. Closed by commit rL251162: Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/Interpreter… (authored by eugenezelenko). Changed prior to commit: http://reviews.llvm.org/D14025?vs=38247&id=38283#toc Repository: rL LLVM http://reviews.llvm.org/D14025 Files: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h lldb/trunk/include/lldb/Interpreter/CommandObject.h lldb/trunk/include/lldb/Interpreter/CommandObjectMultiword.h lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h lldb/trunk/include/lldb/Interpreter/OptionValue.h lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h lldb/trunk/include/lldb/Interpreter/OptionValueString.h lldb/trunk/include/lldb/Interpreter/Options.h lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h Index: lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h === --- lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h +++ lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h @@ -22,11 +22,9 @@ namespace lldb_private { - class CommandReturnObject { public: - CommandReturnObject (); ~CommandReturnObject (); @@ -142,8 +140,8 @@ AppendErrorWithFormat (const char *format, ...) __attribute__ ((format (printf, 2, 3))); void -SetError (const Error &error, - const char *fallback_error_cstr = NULL); +SetError(const Error &error, + const char *fallback_error_cstr = nullptr); void SetError (const char *error_cstr); @@ -189,4 +187,4 @@ } // namespace lldb_private -#endif // liblldb_CommandReturnObject_h_ +#endif // liblldb_CommandReturnObject_h_ Index: lldb/trunk/include/lldb/Interpreter/CommandObject.h === --- lldb/trunk/include/lldb/Interpreter/CommandObject.h +++ lldb/trunk/include/lldb/Interpreter/CommandObject.h @@ -46,7 +46,7 @@ explicit operator bool() const { -return (help_callback != NULL); +return (help_callback != nullptr); } }; @@ -77,11 +77,11 @@ typedef std::map CommandMap; -CommandObject (CommandInterpreter &interpreter, - const char *name, - const char *help = NULL, - const char *syntax = NULL, - uint32_t flags = 0); +CommandObject(CommandInterpreter &interpreter, + const char *name, + const char *help = nullptr, + const char *syntax = nullptr, + uint32_t flags = 0); virtual ~CommandObject (); @@ -141,15 +141,15 @@ IsMultiwordObject () { return false; } virtual lldb::CommandObjectSP -GetSubcommandSP (const char *sub_cmd, StringList *matches = NULL) +GetSubcommandSP(const char *sub_cmd, StringList *matches = nullptr) { return lldb::CommandObjectSP(); } virtual CommandObject * -GetSubcommandObject (const char *sub_cmd, StringList *matches = NULL) +GetSubcommandObject(const char *sub_cmd, StringList *matches = nullptr) { -return NULL; +return nullptr; } virtual void @@ -373,13 +373,13 @@ ///The complete current command line. /// /// @return -/// NULL if there is no special repeat command - it will use the current command line. +/// nullptr if there is no special repeat command - it will use the current command line. /// Otherwise a pointer to the command to be repeated. /// If the returned string is the empty string, the command won't be repeated. //-- virtual const char *GetRepeatCommand (Args ¤t_command_args, uint32_t index) { -return NULL; +return nullptr; } bool @@ -492,11 +492,11 @@ class CommandObjectParsed : public CommandObject { public: -CommandObjectParsed (CommandInterpreter &interpreter, - const char *name, - const char *help = NULL, - const char *syntax = NULL, - uint32_t flags = 0) : +CommandObjectParsed(CommandInterpreter &interpreter, +const char *name, +const char *help = nullptr, +const char *syntax = nullptr, +uint32_t flags = 0) : CommandObject (interpreter, name, help, syntax, flags) {} ~CommandObjectParsed() override = default; @@ -519,11 +519,11 @@ class CommandObjectRaw : public CommandObject { public: -CommandObjectRaw (CommandInterpreter &interpreter, -
Re: [Lldb-commits] [PATCH] D13711: Add initial CMake glue for the NetBSD platform
This revision was automatically updated to reflect the committed changes. Closed by commit rL251164: Add initial CMake glue for the NetBSD platform (authored by brucem). Changed prior to commit: http://reviews.llvm.org/D13711?vs=37300&id=38286#toc Repository: rL LLVM http://reviews.llvm.org/D13711 Files: lldb/trunk/source/CMakeLists.txt lldb/trunk/source/Host/CMakeLists.txt lldb/trunk/source/Plugins/Platform/CMakeLists.txt lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt lldb/trunk/source/Plugins/Process/CMakeLists.txt lldb/trunk/tools/lldb-server/CMakeLists.txt Index: lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt === --- lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt +++ lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt @@ -0,0 +1,3 @@ +add_lldb_library(lldbPluginPlatformNetBSD + PlatformNetBSD.cpp + ) Index: lldb/trunk/source/Plugins/Platform/CMakeLists.txt === --- lldb/trunk/source/Plugins/Platform/CMakeLists.txt +++ lldb/trunk/source/Plugins/Platform/CMakeLists.txt @@ -2,6 +2,8 @@ add_subdirectory(Linux) #elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_subdirectory(FreeBSD) +#elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + add_subdirectory(NetBSD) #elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") add_subdirectory(MacOSX) #elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") Index: lldb/trunk/source/Plugins/Process/CMakeLists.txt === --- lldb/trunk/source/Plugins/Process/CMakeLists.txt +++ lldb/trunk/source/Plugins/Process/CMakeLists.txt @@ -4,6 +4,8 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_subdirectory(FreeBSD) add_subdirectory(POSIX) +elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + add_subdirectory(POSIX) elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") add_subdirectory(Windows/Live) add_subdirectory(Windows/MiniDump) Index: lldb/trunk/source/Host/CMakeLists.txt === --- lldb/trunk/source/Host/CMakeLists.txt +++ lldb/trunk/source/Host/CMakeLists.txt @@ -138,13 +138,22 @@ linux/ThisThread.cpp ) endif() + elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_host_subdirectory(freebsd freebsd/Host.cpp freebsd/HostInfoFreeBSD.cpp freebsd/HostThreadFreeBSD.cpp freebsd/ThisThread.cpp ) + + elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") +add_host_subdirectory(netbsd + netbsd/Host.cpp + netbsd/HostInfoNetBSD.cpp + netbsd/HostThreadNetBSD.cpp + netbsd/ThisThread.cpp + ) endif() endif() @@ -162,3 +171,7 @@ endif() add_lldb_library(lldbHost ${HOST_SOURCES}) + +if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") +target_link_libraries(lldbHost kvm) +endif () Index: lldb/trunk/source/CMakeLists.txt === --- lldb/trunk/source/CMakeLists.txt +++ lldb/trunk/source/CMakeLists.txt @@ -14,6 +14,13 @@ ) endif () +if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) +include_directories( + Plugins/Process/POSIX + ) +endif () + + set(lldbBase_SOURCES lldb.cpp ) @@ -83,4 +90,3 @@ endif () # FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only #revision parsing solution in tools/clang/lib/Basic/CMakelists.txt. - Index: lldb/trunk/tools/lldb-server/CMakeLists.txt === --- lldb/trunk/tools/lldb-server/CMakeLists.txt +++ lldb/trunk/tools/lldb-server/CMakeLists.txt @@ -14,6 +14,13 @@ ) endif () +if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) +include_directories( + ../../../../llvm/include + ../../source/Plugins/Process/POSIX + ) +endif () + include_directories(../../source) include(../../cmake/LLDBDependencies.cmake) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251164 - Add initial CMake glue for the NetBSD platform
Author: brucem Date: Fri Oct 23 19:27:04 2015 New Revision: 251164 URL: http://llvm.org/viewvc/llvm-project?rev=251164&view=rev Log: Add initial CMake glue for the NetBSD platform Summary: These changes aren't everything what is needed for the CMake target, but it's significantly approaching it. These changes shouldn't effect the build process on other platforms. Patch by Kamil Rytarowski, thanks! Reviewers: joerg, brucem Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13711 Added: lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt Modified: lldb/trunk/source/CMakeLists.txt lldb/trunk/source/Host/CMakeLists.txt lldb/trunk/source/Plugins/Platform/CMakeLists.txt lldb/trunk/source/Plugins/Process/CMakeLists.txt lldb/trunk/tools/lldb-server/CMakeLists.txt Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=251164&r1=251163&r2=251164&view=diff == --- lldb/trunk/source/CMakeLists.txt (original) +++ lldb/trunk/source/CMakeLists.txt Fri Oct 23 19:27:04 2015 @@ -14,6 +14,13 @@ include_directories( ) endif () +if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) +include_directories( + Plugins/Process/POSIX + ) +endif () + + set(lldbBase_SOURCES lldb.cpp ) @@ -83,4 +90,3 @@ if ( NOT CMAKE_SYSTEM_NAME MATCHES "Wind endif () # FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only #revision parsing solution in tools/clang/lib/Basic/CMakelists.txt. - Modified: lldb/trunk/source/Host/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=251164&r1=251163&r2=251164&view=diff == --- lldb/trunk/source/Host/CMakeLists.txt (original) +++ lldb/trunk/source/Host/CMakeLists.txt Fri Oct 23 19:27:04 2015 @@ -138,6 +138,7 @@ else() linux/ThisThread.cpp ) endif() + elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_host_subdirectory(freebsd freebsd/Host.cpp @@ -145,6 +146,14 @@ else() freebsd/HostThreadFreeBSD.cpp freebsd/ThisThread.cpp ) + + elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") +add_host_subdirectory(netbsd + netbsd/Host.cpp + netbsd/HostInfoNetBSD.cpp + netbsd/HostThreadNetBSD.cpp + netbsd/ThisThread.cpp + ) endif() endif() @@ -162,3 +171,7 @@ if (${get_python_libdir}) endif() add_lldb_library(lldbHost ${HOST_SOURCES}) + +if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") +target_link_libraries(lldbHost kvm) +endif () Modified: lldb/trunk/source/Plugins/Platform/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/CMakeLists.txt?rev=251164&r1=251163&r2=251164&view=diff == --- lldb/trunk/source/Plugins/Platform/CMakeLists.txt (original) +++ lldb/trunk/source/Plugins/Platform/CMakeLists.txt Fri Oct 23 19:27:04 2015 @@ -2,6 +2,8 @@ add_subdirectory(Linux) #elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_subdirectory(FreeBSD) +#elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + add_subdirectory(NetBSD) #elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") add_subdirectory(MacOSX) #elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") Added: lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt?rev=251164&view=auto == --- lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt (added) +++ lldb/trunk/source/Plugins/Platform/NetBSD/CMakeLists.txt Fri Oct 23 19:27:04 2015 @@ -0,0 +1,3 @@ +add_lldb_library(lldbPluginPlatformNetBSD + PlatformNetBSD.cpp + ) Modified: lldb/trunk/source/Plugins/Process/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/CMakeLists.txt?rev=251164&r1=251163&r2=251164&view=diff == --- lldb/trunk/source/Plugins/Process/CMakeLists.txt (original) +++ lldb/trunk/source/Plugins/Process/CMakeLists.txt Fri Oct 23 19:27:04 2015 @@ -4,6 +4,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_subdirectory(FreeBSD) add_subdirectory(POSIX) +elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + add_subdirectory(POSIX) elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") add_subdirectory(Windows/Live) add_subdirectory(Windows/MiniDump) Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=251164&r1=251163&r2=251164&view=diff == --- lldb/trunk/tool
[Lldb-commits] [lldb] r251166 - [lldb-mi] Fix unused variable warning.
Author: brucem Date: Fri Oct 23 19:30:18 2015 New Revision: 251166 URL: http://llvm.org/viewvc/llvm-project?rev=251166&view=rev Log: [lldb-mi] Fix unused variable warning. Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp?rev=251166&r1=251165&r2=251166&view=diff == --- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp Fri Oct 23 19:30:18 2015 @@ -33,7 +33,6 @@ static inline bool MI_char_summary_provider(lldb::SBValue value, lldb::SBTypeSummaryOptions options, lldb::SBStream &stream) { -bool is_signed; if (!value.IsValid()) return false; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251167 - Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.
Author: eugenezelenko Date: Fri Oct 23 20:08:35 2015 New Revision: 251167 URL: http://llvm.org/viewvc/llvm-project?rev=251167&view=rev Log: Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes. Modified: lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h Modified: lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.h?rev=251167&r1=251166&r2=251167&view=diff == --- lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.h (original) +++ lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.h Fri Oct 23 20:08:35 2015 @@ -1,4 +1,4 @@ -//===-- MemoryHistoryASan.h *- C++ -*-===// +//===-- MemoryHistoryASan.h -*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -24,7 +24,8 @@ namespace lldb_private { class MemoryHistoryASan : public lldb_private::MemoryHistory { public: - +~MemoryHistoryASan() override = default; + static lldb::MemoryHistorySP CreateInstance (const lldb::ProcessSP &process_sp); @@ -36,27 +37,28 @@ public: static lldb_private::ConstString GetPluginNameStatic(); + +lldb_private::ConstString +GetPluginName() override +{ +return GetPluginNameStatic(); +} + +uint32_t +GetPluginVersion() override +{ +return 1; +} -virtual -~MemoryHistoryASan () {} - -virtual lldb_private::ConstString -GetPluginName() { return GetPluginNameStatic(); } - -virtual uint32_t -GetPluginVersion() { return 1; } - -virtual lldb_private::HistoryThreads -GetHistoryThreads(lldb::addr_t address); +lldb_private::HistoryThreads +GetHistoryThreads(lldb::addr_t address) override; private: - MemoryHistoryASan(const lldb::ProcessSP &process_sp); lldb::ProcessWP m_process_wp; - }; } // namespace lldb_private -#endif // liblldb_MemoryHistoryASan_h_ +#endif // liblldb_MemoryHistoryASan_h_ Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h?rev=251167&r1=251166&r2=251167&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h Fri Oct 23 20:08:35 2015 @@ -12,9 +12,9 @@ // C Includes // C++ Includes -#include #include #include +#include // Other libraries and framework includes // Project includes @@ -94,14 +94,10 @@ public: uint32_t m_saved_timeout; }; -//-- -// Constructors and Destructors -//-- GDBRemoteCommunication(const char *comm_name, const char *listener_name); -virtual -~GDBRemoteCommunication(); +~GDBRemoteCommunication() override; PacketResult GetAck (); @@ -117,12 +113,13 @@ public: size_t payload_length); bool -GetSequenceMutex (Mutex::Locker& locker, const char *failure_message = NULL); +GetSequenceMutex(Mutex::Locker& locker, const char *failure_message = nullptr); PacketType CheckForPacket (const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet); + bool IsRunning() const { @@ -162,21 +159,21 @@ public: { return m_packet_timeout * TimeValue::MicroSecPerSec; } + //-- // Start a debugserver instance on the current host using the // supplied connection
[Lldb-commits] [PATCH] D14036: [debugserver] Fix OSX build for older XCode versions after r251091.
dawn created this revision. dawn added reviewers: jasonmolenda, clayborg. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. svn r251091 introduced references to LC_VERSION_MIN_TVOS and LC_VERSION_MIN_WATCHOS which aren't defined in XCode versions older than 7. This patch fixes the build by skipping the code if TARGET_OS_TV or TARGET_OS_WATCH aren't defined. Repository: rL LLVM http://reviews.llvm.org/D14036 Files: tools/debugserver/source/RNBRemote.cpp Index: tools/debugserver/source/RNBRemote.cpp === --- tools/debugserver/source/RNBRemote.cpp +++ tools/debugserver/source/RNBRemote.cpp @@ -5846,17 +5846,21 @@ DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_MACOSX -> 'ostype:macosx;'"); break; +#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 case LC_VERSION_MIN_TVOS: os_handled = true; rep << "ostype:tvos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_TVOS -> 'ostype:tvos;'"); break; +#endif +#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 case LC_VERSION_MIN_WATCHOS: os_handled = true; rep << "ostype:watchos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_WATCHOS -> 'ostype:watchos;'"); break; +#endif default: break; Index: tools/debugserver/source/RNBRemote.cpp === --- tools/debugserver/source/RNBRemote.cpp +++ tools/debugserver/source/RNBRemote.cpp @@ -5846,17 +5846,21 @@ DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_MACOSX -> 'ostype:macosx;'"); break; +#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 case LC_VERSION_MIN_TVOS: os_handled = true; rep << "ostype:tvos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_TVOS -> 'ostype:tvos;'"); break; +#endif +#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 case LC_VERSION_MIN_WATCHOS: os_handled = true; rep << "ostype:watchos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_WATCHOS -> 'ostype:watchos;'"); break; +#endif default: break; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14036: [debugserver] Fix OSX build for older XCode versions after r251091.
jasonmolenda accepted this revision. jasonmolenda added a comment. This revision is now accepted and ready to land. Thanks, I was trying to spot problems like this but missed this one. Repository: rL LLVM http://reviews.llvm.org/D14036 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251169 - [debugserver] Fix indentation in RNBRemote.cpp.
Author: dperchik Date: Fri Oct 23 20:24:00 2015 New Revision: 251169 URL: http://llvm.org/viewvc/llvm-project?rev=251169&view=rev Log: [debugserver] Fix indentation in RNBRemote.cpp. Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=251169&r1=251168&r2=251169&view=diff == --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Oct 23 20:24:00 2015 @@ -5871,83 +5871,83 @@ RNBRemote::HandlePacket_qProcessInfo (co // to set it correctly by using the cpu type and other tricks if (!os_handled) { -// The OS in the triple should be "ios" or "macosx" which doesn't match our -// "Darwin" which gets returned from "kern.ostype", so we need to hardcode -// this for now. -if (cputype == CPU_TYPE_ARM || cputype == CPU_TYPE_ARM64) +// The OS in the triple should be "ios" or "macosx" which doesn't match our +// "Darwin" which gets returned from "kern.ostype", so we need to hardcode +// this for now. +if (cputype == CPU_TYPE_ARM || cputype == CPU_TYPE_ARM64) { #if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 rep << "ostype:tvos;"; #elif defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 rep << "ostype:watchos;"; #else -rep << "ostype:ios;"; +rep << "ostype:ios;"; #endif } -else -{ -bool is_ios_simulator = false; -if (cputype == CPU_TYPE_X86 || cputype == CPU_TYPE_X86_64) +else { -// Check for iOS simulator binaries by getting the process argument -// and environment and checking for SIMULATOR_UDID in the environment -int proc_args_mib[3] = { CTL_KERN, KERN_PROCARGS2, (int)pid }; - -uint8_t arg_data[8192]; -size_t arg_data_size = sizeof(arg_data); -if (::sysctl (proc_args_mib, 3, arg_data, &arg_data_size , NULL, 0) == 0) +bool is_ios_simulator = false; +if (cputype == CPU_TYPE_X86 || cputype == CPU_TYPE_X86_64) { -DNBDataRef data (arg_data, arg_data_size, false); -DNBDataRef::offset_t offset = 0; -uint32_t argc = data.Get32 (&offset); -const char *cstr; +// Check for iOS simulator binaries by getting the process argument +// and environment and checking for SIMULATOR_UDID in the environment +int proc_args_mib[3] = { CTL_KERN, KERN_PROCARGS2, (int)pid }; -cstr = data.GetCStr (&offset); -if (cstr) +uint8_t arg_data[8192]; +size_t arg_data_size = sizeof(arg_data); +if (::sysctl (proc_args_mib, 3, arg_data, &arg_data_size , NULL, 0) == 0) { -// Skip NULLs -while (1) -{ -const char *p = data.PeekCStr(offset); -if ((p == NULL) || (*p != '\0')) -break; -++offset; -} -// Now skip all arguments -for (uint32_t i = 0; i < argc; ++i) -{ -data.GetCStr(&offset); -} +DNBDataRef data (arg_data, arg_data_size, false); +DNBDataRef::offset_t offset = 0; +uint32_t argc = data.Get32 (&offset); +const char *cstr; -// Now iterate across all environment variables -while ((cstr = data.GetCStr(&offset))) +cstr = data.GetCStr (&offset); +if (cstr) { -if (strncmp(cstr, "SIMULATOR_UDID=", strlen("SIMULATOR_UDID=")) == 0) +// Skip NULLs +while (1) { -is_ios_simulator = true; -break; +const char *p = data.PeekCStr(offset); +if ((p == NULL) || (*p != '\0')) +break; +++offset; +} +// Now skip all arguments +for (uint32_t i = 0; i < argc; ++i) +{ +data.GetCStr(&offset); } -if (cstr[0] == '\0') -break; +// Now iterate across all environment vari
[Lldb-commits] [lldb] r251170 - Revert r251167 in source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp to fix MSVC builds failures.
Author: eugenezelenko Date: Fri Oct 23 20:28:05 2015 New Revision: 251170 URL: http://llvm.org/viewvc/llvm-project?rev=251170&view=rev Log: Revert r251167 in source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp to fix MSVC builds failures. 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=251170&r1=251169&r2=251170&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Fri Oct 23 20:28:05 2015 @@ -7,6 +7,8 @@ // //===--===// +#include "lldb/Host/Config.h" + // C Includes #include #include @@ -23,9 +25,6 @@ #include #include -// Other libraries and framework includes -// Project includes -#include "lldb/Host/Config.h" #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Interpreter/Args.h" #include "lldb/Core/ArchSpec.h" @@ -66,6 +65,7 @@ #include "lldb/Target/SystemRuntime.h" #include "lldb/Utility/PseudoTerminal.h" +// Project includes #include "lldb/Host/Host.h" #include "Plugins/Process/Utility/GDBRemoteSignals.h" #include "Plugins/Process/Utility/InferiorCallPOSIX.h" @@ -78,7 +78,6 @@ #include "ThreadGDBRemote.h" #define DEBUGSERVER_BASENAME"debugserver" - using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; @@ -99,7 +98,7 @@ namespace lldb if (error.Success()) ((ProcessGDBRemote *)p)->GetGDBRemote().DumpHistory (strm); } -} // namespace lldb +} namespace { @@ -120,6 +119,7 @@ namespace { class PluginProperties : public Properties { public: + static ConstString GetSettingName () { @@ -132,9 +132,12 @@ namespace { m_collection_sp.reset (new OptionValueProperties(GetSettingName())); m_collection_sp->Initialize(g_properties); } - -~PluginProperties() override = default; - + +virtual +~PluginProperties() +{ +} + uint64_t GetPacketTimeout() { @@ -168,14 +171,16 @@ namespace { return g_settings_sp; } -} // anonymous namespace +} // anonymous namespace end class ProcessGDBRemote::GDBLoadedModuleInfoList { public: + class LoadedModuleInfo { public: + enum e_data_point { e_has_name = 0, @@ -196,7 +201,6 @@ public: m_name = name; m_has[e_has_name] = true; } - bool get_name (std::string & out) const { out = m_name; @@ -208,7 +212,6 @@ public: m_base = base; m_has[e_has_base] = true; } - bool get_base (lldb::addr_t & out) const { out = m_base; @@ -219,7 +222,6 @@ public: { m_base_is_offset = is_offset; } - bool get_base_is_offset(bool & out) const { out = m_base_is_offset; @@ -231,7 +233,6 @@ public: m_link_map = addr; m_has[e_has_link_map] = true; } - bool get_link_map (lldb::addr_t & out) const { out = m_link_map; @@ -243,7 +244,6 @@ public: m_dynamic = addr; m_has[e_has_dynamic] = true; } - bool get_dynamic (lldb::addr_t & out) const { out = m_dynamic; @@ -257,6 +257,7 @@ public: } protected: + bool m_has[e_num]; std::string m_name; lldb::addr_t m_link_map; @@ -332,6 +333,7 @@ ProcessGDBRemote::Terminate() PluginManager::UnregisterPlugin (ProcessGDBRemote::CreateInstance); } + lldb::ProcessSP ProcessGDBRemote::CreateInstance (lldb::TargetSP target_sp, Listener &listener, const FileSpec *crash_file_path) { @@ -374,6 +376,9 @@ ProcessGDBRemote::CanDebug (lldb::Target return true; } +//-- +// ProcessGDBRemote constructor +//-- ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp, Listener &listener) : Process (target_sp, listener), m_flags (0), @@ -428,6 +433,9 @@ ProcessGDBRemote::ProcessGDBRemote(lldb: m_gdb_comm.SetPacketTimeout(timeout_seconds); } +//-- +// Destructor +//-- ProcessGDBRemote::~ProcessGDBRemote() { // m_mach_process.UnregisterNotificationCallbacks (this); @@ -555,6 +563,7 @@ SplitCo
[Lldb-commits] [lldb] r251171 - Add initial gmake glue for the NetBSD platform
Author: brucem Date: Fri Oct 23 20:28:24 2015 New Revision: 251171 URL: http://llvm.org/viewvc/llvm-project?rev=251171&view=rev Log: Add initial gmake glue for the NetBSD platform Summary: These changes aren't everything what is needed for the autotools target, but it's significantly approaching it. These changes shouldn't effect the build process on other platforms. Patch by Kamil Rytarowski, thanks! Reviewers: joerg, brucem Subscribers: brucem, tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D13715 Added: lldb/trunk/source/Host/netbsd/Makefile lldb/trunk/source/Plugins/Platform/NetBSD/Makefile Modified: lldb/trunk/lib/Makefile lldb/trunk/source/Host/Makefile lldb/trunk/source/Plugins/Makefile lldb/trunk/source/Plugins/Platform/Makefile Modified: lldb/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=251171&r1=251170&r2=251171&view=diff == --- lldb/trunk/lib/Makefile (original) +++ lldb/trunk/lib/Makefile Fri Oct 23 20:28:24 2015 @@ -102,6 +102,7 @@ USEDLIBS = lldbAPI.a \ lldbPluginPlatformLinux.a \ lldbPluginPlatformWindows.a \ lldbPluginPlatformFreeBSD.a \ + lldbPluginPlatformNetBSD.a \ lldbPluginPlatformPOSIX.a \ lldbPluginPlatformKalimba.a \ lldbPluginPlatformAndroid.a \ @@ -141,6 +142,10 @@ ifneq (,$(filter $(HOST_OS), FreeBSD GNU lldbPluginProcessFreeBSD.a endif +ifeq ($(HOST_OS),NetBSD) + USEDLIBS += lldbPluginProcessPOSIX.a +endif + include $(LEVEL)/Makefile.common ifeq ($(HOST_OS),MingW) Modified: lldb/trunk/source/Host/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/Makefile?rev=251171&r1=251170&r2=251171&view=diff == --- lldb/trunk/source/Host/Makefile (original) +++ lldb/trunk/source/Host/Makefile Fri Oct 23 20:28:24 2015 @@ -43,6 +43,11 @@ $(eval $(call DIR_SOURCES,posix)) $(eval $(call DIR_SOURCES,freebsd)) endif +ifeq ($(HOST_OS),NetBSD) +$(eval $(call DIR_SOURCES,posix)) +$(eval $(call DIR_SOURCES,netbsd)) +endif + ifeq ($(HOST_OS),MingW) $(eval $(call DIR_SOURCES,windows)) endif Added: lldb/trunk/source/Host/netbsd/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/Makefile?rev=251171&view=auto == --- lldb/trunk/source/Host/netbsd/Makefile (added) +++ lldb/trunk/source/Host/netbsd/Makefile Fri Oct 23 20:28:24 2015 @@ -0,0 +1,14 @@ +##===- source/Host/netbsd/Makefile --*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===--===## + +LLDB_LEVEL := ../../.. +LIBRARYNAME := lldbHostNetBSD +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile Modified: lldb/trunk/source/Plugins/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Makefile?rev=251171&r1=251170&r2=251171&view=diff == --- lldb/trunk/source/Plugins/Makefile (original) +++ lldb/trunk/source/Plugins/Makefile Fri Oct 23 20:28:24 2015 @@ -58,4 +58,8 @@ ifneq (,$(filter $(HOST_OS), FreeBSD GNU PARALLEL_DIRS += Process/FreeBSD Process/POSIX endif +ifeq ($(HOST_OS),NetBSD) +PARALLEL_DIRS += Process/POSIX +endif + include $(LLDB_LEVEL)/Makefile Modified: lldb/trunk/source/Plugins/Platform/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Makefile?rev=251171&r1=251170&r2=251171&view=diff == --- lldb/trunk/source/Plugins/Platform/Makefile (original) +++ lldb/trunk/source/Plugins/Platform/Makefile Fri Oct 23 20:28:24 2015 @@ -11,7 +11,7 @@ LLDB_LEVEL := ../../.. include $(LLDB_LEVEL)/../../Makefile.config -PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD POSIX Windows Kalimba Android +PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD NetBSD POSIX Windows Kalimba Android # ifeq ($(HOST_OS),Darwin) # DIRS += MacOSX @@ -24,9 +24,13 @@ PARALLEL_DIRS := gdb-server MacOSX Linux # ifeq ($(HOST_OS),FreeBSD) # DIRS += FreeBSD # endif -# +# # ifeq ($(HOST_OS),GNU/kFreeBSD) # DIRS += FreeBSD # endif +# +# ifeq ($(HOST_OS),NetBSD) +# DIRS += NetBSD +# endif include $(LLDB_LEVEL)/Makefile Added: lldb/trunk/source/Plugins/Platform/NetBSD/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/NetBSD/Makefile?rev=251171&view=auto == --- lldb/trunk/source/Plugins/Platform/NetBSD/Makefile (adde
Re: [Lldb-commits] [PATCH] D13715: Add initial gmake glue for the NetBSD platform
This revision was automatically updated to reflect the committed changes. Closed by commit rL251171: Add initial gmake glue for the NetBSD platform (authored by brucem). Changed prior to commit: http://reviews.llvm.org/D13715?vs=37957&id=38289#toc Repository: rL LLVM http://reviews.llvm.org/D13715 Files: lldb/trunk/lib/Makefile lldb/trunk/source/Host/Makefile lldb/trunk/source/Host/netbsd/Makefile lldb/trunk/source/Plugins/Makefile lldb/trunk/source/Plugins/Platform/Makefile lldb/trunk/source/Plugins/Platform/NetBSD/Makefile Index: lldb/trunk/lib/Makefile === --- lldb/trunk/lib/Makefile +++ lldb/trunk/lib/Makefile @@ -102,6 +102,7 @@ lldbPluginPlatformLinux.a \ lldbPluginPlatformWindows.a \ lldbPluginPlatformFreeBSD.a \ + lldbPluginPlatformNetBSD.a \ lldbPluginPlatformPOSIX.a \ lldbPluginPlatformKalimba.a \ lldbPluginPlatformAndroid.a \ @@ -141,6 +142,10 @@ lldbPluginProcessFreeBSD.a endif +ifeq ($(HOST_OS),NetBSD) + USEDLIBS += lldbPluginProcessPOSIX.a +endif + include $(LEVEL)/Makefile.common ifeq ($(HOST_OS),MingW) Index: lldb/trunk/source/Plugins/Makefile === --- lldb/trunk/source/Plugins/Makefile +++ lldb/trunk/source/Plugins/Makefile @@ -58,4 +58,8 @@ PARALLEL_DIRS += Process/FreeBSD Process/POSIX endif +ifeq ($(HOST_OS),NetBSD) +PARALLEL_DIRS += Process/POSIX +endif + include $(LLDB_LEVEL)/Makefile Index: lldb/trunk/source/Plugins/Platform/NetBSD/Makefile === --- lldb/trunk/source/Plugins/Platform/NetBSD/Makefile +++ lldb/trunk/source/Plugins/Platform/NetBSD/Makefile @@ -0,0 +1,14 @@ +##===- source/Plugins/Platform/NetBSD/Makefile *- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===--===## + +LLDB_LEVEL := ../../../.. +LIBRARYNAME := lldbPluginPlatformNetBSD +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile Index: lldb/trunk/source/Plugins/Platform/Makefile === --- lldb/trunk/source/Plugins/Platform/Makefile +++ lldb/trunk/source/Plugins/Platform/Makefile @@ -11,7 +11,7 @@ include $(LLDB_LEVEL)/../../Makefile.config -PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD POSIX Windows Kalimba Android +PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD NetBSD POSIX Windows Kalimba Android # ifeq ($(HOST_OS),Darwin) # DIRS += MacOSX @@ -24,9 +24,13 @@ # ifeq ($(HOST_OS),FreeBSD) # DIRS += FreeBSD # endif -# +# # ifeq ($(HOST_OS),GNU/kFreeBSD) # DIRS += FreeBSD # endif +# +# ifeq ($(HOST_OS),NetBSD) +# DIRS += NetBSD +# endif include $(LLDB_LEVEL)/Makefile Index: lldb/trunk/source/Host/netbsd/Makefile === --- lldb/trunk/source/Host/netbsd/Makefile +++ lldb/trunk/source/Host/netbsd/Makefile @@ -0,0 +1,14 @@ +##===- source/Host/netbsd/Makefile --*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===--===## + +LLDB_LEVEL := ../../.. +LIBRARYNAME := lldbHostNetBSD +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile Index: lldb/trunk/source/Host/Makefile === --- lldb/trunk/source/Host/Makefile +++ lldb/trunk/source/Host/Makefile @@ -43,6 +43,11 @@ $(eval $(call DIR_SOURCES,freebsd)) endif +ifeq ($(HOST_OS),NetBSD) +$(eval $(call DIR_SOURCES,posix)) +$(eval $(call DIR_SOURCES,netbsd)) +endif + ifeq ($(HOST_OS),MingW) $(eval $(call DIR_SOURCES,windows)) endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251172 - [debugserver] Fix OSX build for older XCode versions after r251091.
Author: dperchik Date: Fri Oct 23 20:31:12 2015 New Revision: 251172 URL: http://llvm.org/viewvc/llvm-project?rev=251172&view=rev Log: [debugserver] Fix OSX build for older XCode versions after r251091. This fixes the OSX build for XCode versions older than 7 by skipping references to LC_VERSION_MIN_TVOS and LC_VERSION_MIN_WATCHOS if TARGET_OS_TV or TARGET_OS_WATCH aren't defined. Reviewed by: jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14036 Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=251172&r1=251171&r2=251172&view=diff == --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Oct 23 20:31:12 2015 @@ -5846,17 +5846,21 @@ RNBRemote::HandlePacket_qProcessInfo (co DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_MACOSX -> 'ostype:macosx;'"); break; +#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 case LC_VERSION_MIN_TVOS: os_handled = true; rep << "ostype:tvos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_TVOS -> 'ostype:tvos;'"); break; +#endif +#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 case LC_VERSION_MIN_WATCHOS: os_handled = true; rep << "ostype:watchos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_WATCHOS -> 'ostype:watchos;'"); break; +#endif default: break; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14036: [debugserver] Fix OSX build for older XCode versions after r251091.
This revision was automatically updated to reflect the committed changes. Closed by commit rL251172: [debugserver] Fix OSX build for older XCode versions after r251091. (authored by dperchik). Changed prior to commit: http://reviews.llvm.org/D14036?vs=38288&id=38290#toc Repository: rL LLVM http://reviews.llvm.org/D14036 Files: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Index: lldb/trunk/tools/debugserver/source/RNBRemote.cpp === --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp @@ -5846,17 +5846,21 @@ DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_MACOSX -> 'ostype:macosx;'"); break; +#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 case LC_VERSION_MIN_TVOS: os_handled = true; rep << "ostype:tvos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_TVOS -> 'ostype:tvos;'"); break; +#endif +#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 case LC_VERSION_MIN_WATCHOS: os_handled = true; rep << "ostype:watchos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_WATCHOS -> 'ostype:watchos;'"); break; +#endif default: break; Index: lldb/trunk/tools/debugserver/source/RNBRemote.cpp === --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp @@ -5846,17 +5846,21 @@ DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_MACOSX -> 'ostype:macosx;'"); break; +#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 case LC_VERSION_MIN_TVOS: os_handled = true; rep << "ostype:tvos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_TVOS -> 'ostype:tvos;'"); break; +#endif +#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 case LC_VERSION_MIN_WATCHOS: os_handled = true; rep << "ostype:watchos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_WATCHOS -> 'ostype:watchos;'"); break; +#endif default: break; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r251091 - Upstreaming the apple internal changes that accumulated during the
Yeah, sorry for not getting to this earlier. Dawn fixed the issue in r251172; Xcode 7.2 was needed to build it. > On Oct 23, 2015, at 11:59 AM, Adrian Prantl wrote: > > Hi Jason, > > It looks like this might have broken the lldb builder on lab.llvm.org: > > http://lab.llvm.org:8080/green/job/lldb_build_test/13571/consoleFull#131781548749ba4694-19c4-4d7e-bec5-911270d8a58c > > -- adrian > >> On Oct 22, 2015, at 7:49 PM, Jason Molenda via lldb-commits >> wrote: >> >> Author: jmolenda >> Date: Thu Oct 22 21:49:51 2015 >> New Revision: 251091 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=251091&view=rev >> Log: >> Upstreaming the apple internal changes that accumulated during the >> previous release. Most of the diffs are duplication in the xcode >> project file caused by adding a "debugserver-mini" target. Jim >> Ingham added support for a new SPI needed to request app launches >> on iOS. Greg Clayton added code to indicate the platform of the >> binary (macosx, ios, watchos, tvos) based on Mach-O load commands. >> Jason Molenda added code so debugserver will identify when it is >> running on a tvos/watchos device to lldb. >> >> Modified: >> lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj >> lldb/trunk/tools/debugserver/source/DNB.cpp >> lldb/trunk/tools/debugserver/source/DNBDefs.h >> lldb/trunk/tools/debugserver/source/DNBError.cpp >> lldb/trunk/tools/debugserver/source/DNBError.h >> lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h >> lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm >> lldb/trunk/tools/debugserver/source/RNBRemote.cpp >> >> lldb/trunk/tools/debugserver/source/com.apple.debugserver.applist.internal.plist >> lldb/trunk/tools/debugserver/source/com.apple.debugserver.applist.plist >> lldb/trunk/tools/debugserver/source/com.apple.debugserver.internal.plist >> lldb/trunk/tools/debugserver/source/com.apple.debugserver.plist >> lldb/trunk/tools/debugserver/source/com.apple.debugserver.posix.plist >> lldb/trunk/tools/debugserver/source/debugserver-entitlements.plist >> lldb/trunk/tools/debugserver/source/debugserver.cpp ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13947: [lldb-mi] Fix expansion of anonymous structures and unions
This revision was automatically updated to reflect the committed changes. Closed by commit rL251176: [lldb-mi] Fix expansion of anonymous structures and unions (authored by dperchik). Changed prior to commit: http://reviews.llvm.org/D13947?vs=38017&id=38291#toc Repository: rL LLVM http://reviews.llvm.org/D13947 Files: lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py lldb/trunk/test/tools/lldb-mi/variable/main.cpp lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp Index: lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp === --- lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp +++ lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp @@ -61,7 +61,7 @@ CMICmnLLDBUtilSBValue::GetName() const { const char *pName = m_bValidSBValue ? m_rValue.GetName() : nullptr; -const CMIUtilString text((pName != nullptr) ? pName : m_pUnkwn); +const CMIUtilString text((pName != nullptr) ? pName : CMIUtilString()); return text; } Index: lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp === --- lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp +++ lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp @@ -1015,7 +1015,9 @@ lldb::SBValue member = rValue.GetChildAtIndex(i); const CMICmnLLDBUtilSBValue utilValue(member); const CMIUtilString strExp = utilValue.GetName(); -const CMIUtilString name(CMIUtilString::Format("%s.%s", rVarObjName.c_str(), strExp.c_str())); +const CMIUtilString name(strExp.empty() ? +CMIUtilString::Format("%s.$%u", rVarObjName.c_str(), i) : +CMIUtilString::Format("%s.%s", rVarObjName.c_str(), strExp.c_str())); const MIuint nChildren = member.GetNumChildren(); const CMIUtilString strThreadId(CMIUtilString::Format("%u", member.GetThread().GetIndexID())); Index: lldb/trunk/test/tools/lldb-mi/variable/main.cpp === --- lldb/trunk/test/tools/lldb-mi/variable/main.cpp +++ lldb/trunk/test/tools/lldb-mi/variable/main.cpp @@ -27,6 +27,25 @@ int pcomplex_type::si; +struct struct_with_unions +{ +struct_with_unions(): u_i(1), u1(-1) {} +union +{ +int u_i; +int u_j; +}; +union +{ +int u1; +struct +{ +short s1; +short s2; +}; +}; +}; + void var_update_test(void) { @@ -80,6 +99,13 @@ // BP_cpp_stl_types_test } +void +unnamed_objects_test(void) +{ +struct_with_unions swu; +// BP_unnamed_objects_test +} + struct not_str { not_str(char _c, int _f) @@ -119,6 +145,7 @@ var_list_children_test(); gdb_set_show_print_char_array_as_string_test(); cpp_stl_types_test(); +unnamed_objects_test(); gdb_set_show_print_expand_aggregates(); gdb_set_show_print_aggregate_field_names(); return 0; // BP_return Index: lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py === --- lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py +++ lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py @@ -356,3 +356,45 @@ # Test for std::string self.runCmd("-var-create - * std_string") self.expect('\^done,name="var\d+",numchild="[0-9]+",value=""hello"",type="std::[\S]*?string",thread-id="1",has_more="0"') + +@lldbmi_test +@skipIfWindows #llvm.org/pr24452: Get lldb-mi working on Windows +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots +def test_lldbmi_var_create_for_unnamed_objects(self): +"""Test that 'lldb-mi --interpreter' can expand unnamed structures and unions.""" + +self.spawnLldbMi(args = None) + +# Load executable +self.runCmd("-file-exec-and-symbols %s" % self.myexe) +self.expect("\^done") + +# Run to breakpoint +line = line_number('main.cpp', '// BP_unnamed_objects_test') +self.runCmd("-break-insert main.cpp:%d" % line) +self.expect("\^done,bkpt={number=\"1\"") +self.runCmd("-exec-run") +self.expect("\^running") +self.expect("\*stopped,reason=\"breakpoint-hit\"") + +# Evaluate struct_with_unions type and its children +self.runCmd("-var-create v0 * swu") +self.expect('\^done,name="v0",numchild="2",value="\{\.\.\.\}",type="struct_with_unions",thread-id="1",has_more="0"') + +self.runCmd("-var-list-children v0") + +# inspect the first unnamed union +self.runCmd("-var-list-children v0.$0") +self.runCmd("-var-evaluate-expression v0.$0.u_i") +self.expect('\^done,value="1"') + +# inspect the second unnamed union +self.runCmd("-var-list-children v0.$1") +
[Lldb-commits] [lldb] r251176 - [lldb-mi] Fix expansion of anonymous structures and unions
Author: dperchik Date: Fri Oct 23 21:01:28 2015 New Revision: 251176 URL: http://llvm.org/viewvc/llvm-project?rev=251176&view=rev Log: [lldb-mi] Fix expansion of anonymous structures and unions A variable of type: struct S { union { inti1; unsigned u1; }; union { inti2; unsigned u2; }; }; had been impossible to evaluate in lldb-mi, because MI assigns '??' as the variable name to each of the unnamed unions after "-var-list-children" command. Also '??' incorrectly goes to 'exp' field which is treated by IDE as a structure field name and is displayed in watch window. The patch fixes this returning empty string as type name for unnamed union and assigning $N to variable name, where N is the field number in the parent entity. Patch from evgeny.levi...@gmail.com Reviewed by: clayborg, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13947 Modified: lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py lldb/trunk/test/tools/lldb-mi/variable/main.cpp lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp Modified: lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py?rev=251176&r1=251175&r2=251176&view=diff == --- lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py (original) +++ lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py Fri Oct 23 21:01:28 2015 @@ -356,3 +356,45 @@ class MiVarTestCase(lldbmi_testcase.MiTe # Test for std::string self.runCmd("-var-create - * std_string") self.expect('\^done,name="var\d+",numchild="[0-9]+",value=""hello"",type="std::[\S]*?string",thread-id="1",has_more="0"') + +@lldbmi_test +@skipIfWindows #llvm.org/pr24452: Get lldb-mi working on Windows +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots +def test_lldbmi_var_create_for_unnamed_objects(self): +"""Test that 'lldb-mi --interpreter' can expand unnamed structures and unions.""" + +self.spawnLldbMi(args = None) + +# Load executable +self.runCmd("-file-exec-and-symbols %s" % self.myexe) +self.expect("\^done") + +# Run to breakpoint +line = line_number('main.cpp', '// BP_unnamed_objects_test') +self.runCmd("-break-insert main.cpp:%d" % line) +self.expect("\^done,bkpt={number=\"1\"") +self.runCmd("-exec-run") +self.expect("\^running") +self.expect("\*stopped,reason=\"breakpoint-hit\"") + +# Evaluate struct_with_unions type and its children +self.runCmd("-var-create v0 * swu") + self.expect('\^done,name="v0",numchild="2",value="\{\.\.\.\}",type="struct_with_unions",thread-id="1",has_more="0"') + +self.runCmd("-var-list-children v0") + +# inspect the first unnamed union +self.runCmd("-var-list-children v0.$0") +self.runCmd("-var-evaluate-expression v0.$0.u_i") +self.expect('\^done,value="1"') + +# inspect the second unnamed union +self.runCmd("-var-list-children v0.$1") +self.runCmd("-var-evaluate-expression v0.$1.u1") +self.expect('\^done,value="-1"') +# inspect unnamed structure +self.runCmd("-var-list-children v0.$1.$1") +self.runCmd("-var-evaluate-expression v0.$1.$1.s1") +self.expect('\^done,value="-1"') + Modified: lldb/trunk/test/tools/lldb-mi/variable/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/variable/main.cpp?rev=251176&r1=251175&r2=251176&view=diff == --- lldb/trunk/test/tools/lldb-mi/variable/main.cpp (original) +++ lldb/trunk/test/tools/lldb-mi/variable/main.cpp Fri Oct 23 21:01:28 2015 @@ -27,6 +27,25 @@ struct pcomplex_type : complex_type int pcomplex_type::si; +struct struct_with_unions +{ +struct_with_unions(): u_i(1), u1(-1) {} +union +{ +int u_i; +int u_j; +}; +union +{ +int u1; +struct +{ +short s1; +short s2; +}; +}; +}; + void var_update_test(void) { @@ -80,6 +99,13 @@ cpp_stl_types_test(void) // BP_cpp_stl_types_test } +void +unnamed_objects_test(void) +{ +struct_with_unions swu; +// BP_unnamed_objects_test +} + struct not_str { not_str(char _c, int _f) @@ -119,6 +145,7 @@ main(int argc, char const *argv[]) var_list_children_test(); gdb_set_show_print_char_array_as_string_test(); cpp_stl_types_test(); +unnamed_objects_test(); gdb_set_show_print_expand_aggregates(); gdb_set_show_p
Re: [Lldb-commits] [PATCH] D12994: Improve support of the ncurses dependency on NetBSD
krytarowski abandoned this revision. krytarowski added a comment. Closing. We are going for reuse of the NetBSD native curses(8) library. The reason for it is limit of detecting ncurses on various systems. For example, Ubuntu ships with `` and linkage from ``, `ncurses.h` isn't detected by CMake. Detecting `` on NetBSD is reusing conflicting header from the host curses(8) and pkgsrc's ncurses library. Repository: rL LLVM http://reviews.llvm.org/D12994 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12995: Add support for lldb config.h and detect ncurses' include path
krytarowski abandoned this revision. krytarowski added a comment. Closing. We are going for reuse of the NetBSD native curses(8) library. The reason for it is limit of detecting ncurses on various systems. For example, Ubuntu ships with `` and linkage from ``, `ncurses.h` isn't detected by CMake. Detecting `` on NetBSD is reusing conflicting header from the host curses(8) and pkgsrc's ncurses library. Repository: rL LLVM http://reviews.llvm.org/D12995 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D14037: Reuse native curses(8) library on NetBSD
krytarowski created this revision. krytarowski added subscribers: lldb-commits, joerg. krytarowski set the repository for this revision to rL LLVM. The reason for it is limit of detecting ncurses on various systems. For example, Ubuntu ships with and linkage from , isn't detected by CMake. Detecting `` on NetBSD is reusing conflicting header from the host curses(8) and pkgsrc's ncurses library. ncurses ships on most (till conflicting) systems with curses.h. On NetBSD it might be conflicting, so the ncurses headers are installed with pkgsrc to a subdirectory "ncurses/". Repository: rL LLVM http://reviews.llvm.org/D14037 Files: source/Core/IOHandler.cpp Index: source/Core/IOHandler.cpp === --- source/Core/IOHandler.cpp +++ source/Core/IOHandler.cpp @@ -29,7 +29,7 @@ #include "lldb/Target/ThreadPlan.h" #ifndef LLDB_DISABLE_CURSES -#include +#include #include #endif @@ -4133,7 +4133,9 @@ case KEY_UNDO: return "undo key"; case KEY_MOUSE: return "Mouse event has occurred"; case KEY_RESIZE:return "Terminal resize event"; +#ifdef KEY_EVENT case KEY_EVENT: return "We were interrupted by an event"; +#endif case KEY_RETURN:return "return"; case ' ': return "space"; case '\t': return "tab"; Index: source/Core/IOHandler.cpp === --- source/Core/IOHandler.cpp +++ source/Core/IOHandler.cpp @@ -29,7 +29,7 @@ #include "lldb/Target/ThreadPlan.h" #ifndef LLDB_DISABLE_CURSES -#include +#include #include #endif @@ -4133,7 +4133,9 @@ case KEY_UNDO: return "undo key"; case KEY_MOUSE: return "Mouse event has occurred"; case KEY_RESIZE:return "Terminal resize event"; +#ifdef KEY_EVENT case KEY_EVENT: return "We were interrupted by an event"; +#endif case KEY_RETURN:return "return"; case ' ': return "space"; case '\t': return "tab"; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14037: Reuse native curses(8) library on NetBSD
krytarowski added a subscriber: brucem. krytarowski added a comment. Bruce was involved in the older version with `config.h`. Repository: rL LLVM http://reviews.llvm.org/D14037 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits