[Lldb-commits] [lldb] r250886 - [RenderScript] New commands to save/load RS allocations to file.
Author: ewancrawford Date: Wed Oct 21 03:50:42 2015 New Revision: 250886 URL: http://llvm.org/viewvc/llvm-project?rev=250886&view=rev Log: [RenderScript] New commands to save/load RS allocations to file. Patch adds command 'language renderscript allocation save' to store the contents of an allocation in a binary file. And 'language renderscript allocation load' to restore an allocation with the saved data from a binary file. Binary file format contains a header FileHeader with meta information preceding the raw data. Reviewed by: jingham, clayborg Subscribers: lldb-commits, domipheus Differential Revision: http://reviews.llvm.org/D13903 Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=250886&r1=250885&r2=250886&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Wed Oct 21 03:50:42 2015 @@ -179,6 +179,18 @@ struct RenderScriptRuntime::AllocationDe } }; +// Header for reading and writing allocation contents +// to a binary file. +struct FileHeader +{ +uint8_t ident[4]; // ASCII 'RSAD' identifying the file +uint16_t hdr_size; // Header size in bytes, for backwards compatability +uint16_t type; // DataType enum +uint32_t kind; // DataKind enum +uint32_t dims[3]; // Dimensions +uint32_t element_size; // Size of a single element, including padding +}; + // Monotonically increasing from 1 static unsigned int ID; @@ -1365,6 +1377,283 @@ RenderScriptRuntime::RefreshAllocation(A if (!JITElementPacked(allocation, frame_ptr)) return false; +// Use GetOffsetPointer() to infer size of the allocation +const unsigned int element_size = GetElementSize(allocation); +if (!JITAllocationSize(allocation, frame_ptr, element_size)) +return false; + +return true; +} + +// Returns the size of a single allocation element including padding. +// Assumes the relevant allocation information has already been jitted. +unsigned int +RenderScriptRuntime::GetElementSize(const AllocationDetails* allocation) +{ +const AllocationDetails::DataType type = *allocation->type.get(); +assert(type >= AllocationDetails::RS_TYPE_NONE && type <= AllocationDetails::RS_TYPE_BOOLEAN + && "Invalid allocation type"); + +const unsigned int vec_size = *allocation->type_vec_size.get(); +const unsigned int data_size = vec_size * AllocationDetails::RSTypeToFormat[type][eElementSize]; +const unsigned int padding = vec_size == 3 ? AllocationDetails::RSTypeToFormat[type][eElementSize] : 0; + +return data_size + padding; +} + +// Given an allocation, this function copies the allocation contents from device into a buffer on the heap. +// Returning a shared pointer to the buffer containing the data. +std::shared_ptr +RenderScriptRuntime::GetAllocationData(AllocationDetails* allocation, StackFrame* frame_ptr) +{ +Log* log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE)); + +// JIT all the allocation details +if (!allocation->data_ptr.isValid() || !allocation->type.isValid() || !allocation->type_vec_size.isValid() +|| !allocation->size.isValid()) +{ +if (log) +log->Printf("RenderScriptRuntime::GetAllocationData - Allocation details not calculated yet, jitting info"); + +if (!RefreshAllocation(allocation, frame_ptr)) +{ +if (log) +log->Printf("RenderScriptRuntime::GetAllocationData - Couldn't JIT allocation details"); +return nullptr; +} +} + +assert(allocation->data_ptr.isValid() && allocation->type.isValid() && allocation->type_vec_size.isValid() + && allocation->size.isValid() && "Allocation information not available"); + +// Allocate a buffer to copy data into +const unsigned int size = *allocation->size.get(); +std::shared_ptr buffer(new uint8_t[size]); +if (!buffer) +{ +if (log) +log->Printf("RenderScriptRuntime::GetAllocationData - Couldn't allocate a %u byte buffer", size); +return nullptr; +} + +// Read the inferior memory +Error error; +lldb::addr_t data_ptr = *allocation->data_ptr.get(); +GetProcess()->ReadMemory(data_ptr, buffer.get(), size, erro
Re: [Lldb-commits] [PATCH] D13903: [RenderScript] New commands to save/load RS allocations to file.
This revision was automatically updated to reflect the committed changes. Closed by commit rL250886: [RenderScript] New commands to save/load RS allocations to file. (authored by EwanCrawford). Changed prior to commit: http://reviews.llvm.org/D13903?vs=37889&id=37972#toc Repository: rL LLVM http://reviews.llvm.org/D13903 Files: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h === --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -218,6 +218,10 @@ virtual void ModulesDidLoad(const ModuleList &module_list ); +bool LoadAllocation(Stream &strm, const uint32_t alloc_id, const char* filename, StackFrame* frame_ptr); + +bool SaveAllocation(Stream &strm, const uint32_t alloc_id, const char* filename, StackFrame* frame_ptr); + void Update(); void Initiate(); @@ -264,7 +268,7 @@ const HookDefn *defn; lldb::BreakpointSP bp_sp; }; - + typedef std::shared_ptr RuntimeHookSP; lldb::ModuleSP m_libRS; @@ -301,6 +305,8 @@ void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context); AllocationDetails* FindAllocByID(Stream &strm, const uint32_t alloc_id); +std::shared_ptr GetAllocationData(AllocationDetails* allocation, StackFrame* frame_ptr); +unsigned int GetElementSize(const AllocationDetails* allocation); // // Helper functions for jitting the runtime Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp === --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -179,6 +179,18 @@ } }; +// Header for reading and writing allocation contents +// to a binary file. +struct FileHeader +{ +uint8_t ident[4]; // ASCII 'RSAD' identifying the file +uint16_t hdr_size; // Header size in bytes, for backwards compatability +uint16_t type; // DataType enum +uint32_t kind; // DataKind enum +uint32_t dims[3]; // Dimensions +uint32_t element_size; // Size of a single element, including padding +}; + // Monotonically increasing from 1 static unsigned int ID; @@ -1365,6 +1377,283 @@ if (!JITElementPacked(allocation, frame_ptr)) return false; +// Use GetOffsetPointer() to infer size of the allocation +const unsigned int element_size = GetElementSize(allocation); +if (!JITAllocationSize(allocation, frame_ptr, element_size)) +return false; + +return true; +} + +// Returns the size of a single allocation element including padding. +// Assumes the relevant allocation information has already been jitted. +unsigned int +RenderScriptRuntime::GetElementSize(const AllocationDetails* allocation) +{ +const AllocationDetails::DataType type = *allocation->type.get(); +assert(type >= AllocationDetails::RS_TYPE_NONE && type <= AllocationDetails::RS_TYPE_BOOLEAN + && "Invalid allocation type"); + +const unsigned int vec_size = *allocation->type_vec_size.get(); +const unsigned int data_size = vec_size * AllocationDetails::RSTypeToFormat[type][eElementSize]; +const unsigned int padding = vec_size == 3 ? AllocationDetails::RSTypeToFormat[type][eElementSize] : 0; + +return data_size + padding; +} + +// Given an allocation, this function copies the allocation contents from device into a buffer on the heap. +// Returning a shared pointer to the buffer containing the data. +std::shared_ptr +RenderScriptRuntime::GetAllocationData(AllocationDetails* allocation, StackFrame* frame_ptr) +{ +Log* log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE)); + +// JIT all the allocation details +if (!allocation->data_ptr.isValid() || !allocation->type.isValid() || !allocation->type_vec_size.isValid() +|| !allocation->size.isValid()) +{ +if (log) +log->Printf("RenderScriptRuntime::GetAllocationData - Allocation details not calculated yet, jitting info"); + +if (!RefreshAllocation(allocation, frame_ptr)) +{ +if (log) +log->Printf("RenderScriptRuntime::GetAllocationData - Couldn't JIT allocation details"); +return nullptr; +} +} + +assert(allocation->data_ptr.isValid() && alloca
Re: [Lldb-commits] [PATCH] D13881: Add domain socket support to gdb-remote protocol and lldb-server.
labath accepted this revision. labath added a comment. looks good, thanks. Comment at: source/Plugins/Platform/Android/AdbClient.cpp:151 @@ +150,3 @@ +char message[PATH_MAX]; +snprintf (message, sizeof (message), "forward:tcp:%d;localfilesystem:%s", local_port, remote_socket_name); + ovyalov wrote: > I suspect adb fails in such situation. > Let me verify it once lldb-server/Acceptor will support protocol-based URL > like unix:///tmp/platform.sock. Now it's somewhat problematic because we > cannot pass colon as a part of > URL - if colon is found it's treated as $host:$port pattern and TCPSocket is > created. Ok, makes sense. http://reviews.llvm.org/D13881 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13881: Add domain socket support to gdb-remote protocol and lldb-server.
tberghammer accepted this revision. Comment at: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp:39 @@ +38,3 @@ +#include +#include + Please don't include here if it isn't absolutely necessary as there is a bug on windows in the header. If you need it then you will most likely have to add the same workaround I added in rL250833 to make it compile on Windows http://reviews.llvm.org/D13881 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13902: [DataFormatters] Make libc++ list loop detection linear
This revision was automatically updated to reflect the committed changes. Closed by commit rL250890: [DataFormatters] Make libc++ list loop detection linear (authored by labath). Changed prior to commit: http://reviews.llvm.org/D13902?vs=37891&id=37981#toc Repository: rL LLVM http://reviews.llvm.org/D13902 Files: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/Makefile lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp === --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp @@ -0,0 +1,28 @@ +// Evil hack: To simulate memory corruption, we want to fiddle with some internals of std::list. +// Make those accessible to us. +#define private public +#define protected public + +#ifdef _LIBCPP_INLINE_VISIBILITY +#undef _LIBCPP_INLINE_VISIBILITY +#endif +#define _LIBCPP_INLINE_VISIBILITY +#include + +#include + +typedef std::list int_list; + +int main() +{ +int_list *numbers_list = new int_list{1,2,3,4,5,6,7,8,9,10}; + +auto *third_elem = numbers_list->__end_.__next_->__next_->__next_; // Set break point at this line. +assert(third_elem->__value_ == 3); +auto *fifth_elem = third_elem->__next_->__next_; +assert(fifth_elem->__value_ == 5); +fifth_elem->__next_ = third_elem; + +// Any attempt to free the list will probably crash the program. Let's just leak it. +return 0; // Set second break point at this line. +} Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py === --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py @@ -0,0 +1,56 @@ +""" +Test that the debugger handles loops in std::list (which can appear as a result of e.g. memory +corruption). +""" + +import os, time, re +import unittest2 +import lldb +from lldbtest import * +import lldbutil + +class LibcxxListDataFormatterTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +@skipIfGcc +@skipIfWindows # libc++ not ported to Windows yet +def test_with_run_command(self): +self.build() +exe = os.path.join(os.getcwd(), "a.out") +target = self.dbg.CreateTarget(exe) +self.assertTrue(target and target.IsValid(), "Target is valid") + +file_spec = lldb.SBFileSpec ("main.cpp", False) +breakpoint1 = target.BreakpointCreateBySourceRegex('// Set break point at this line.', file_spec) +self.assertTrue(breakpoint1 and breakpoint1.IsValid()) +breakpoint2 = target.BreakpointCreateBySourceRegex('// Set second break point at this line.', file_spec) +self.assertTrue(breakpoint2 and breakpoint2.IsValid()) + +# Run the program, it should stop at breakpoint 1. +process = target.LaunchSimple(None, None, self.get_process_working_directory()) +lldbutil.skip_if_library_missing(self, target, lldbutil.PrintableRegex("libc\+\+")) +self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID) +self.assertEquals(len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)), 1) + +# verify our list is displayed correctly +self.expect("frame variable *numbers_list", substrs=['[0] = 1', '[1] = 2', '[2] = 3', '[3] = 4', '[5] = 6']) + +# Continue to breakpoint 2. +process.Continue() +self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID) +self.assertEquals(len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint2)), 1) + +# The list is now inconsistent. However, we should be able to get the first three +# elements at least (and most importantly, not crash). +self.expect("frame variable *numbers_list", substrs=['[0] = 1', '[1] = 2', '[2] = 3']) + +# Run to completion. +process.Continue() +self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED) + +if __name__ == '__main__': +import atexit +lldb.SBDebugger.Initialize() +atexit.register(lambda: lldb.SBDebugger.Terminate()) +unittest2.main() Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/Makefile === --- lldb/trunk/test/functional
[Lldb-commits] [lldb] r250890 - [DataFormatters] Make libc++ list loop detection linear
Author: labath Date: Wed Oct 21 05:17:21 2015 New Revision: 250890 URL: http://llvm.org/viewvc/llvm-project?rev=250890&view=rev Log: [DataFormatters] Make libc++ list loop detection linear Summary: Loop detection code is being called before every element access. Although it tries to cache some of the data by remembering the loop-free initial segment, every time it needs to increase this segment, it will start from scratch. For the typical usage pattern, where one accesses the elements in order, the loop detection will need to be run after every access, resulting in quadratic behavior. This behavior is noticable even for the default 255 element limit. In this commit, I rewrite the algorithm to be truly incremental -- it maintains the state of its loop-detection runners between calls, and reuses them when it needs to check another segment. This way, each part of the list is scanned only once, resulting in linear behavior. Also note that I have changed the operator== of ListEntry to do the comparison based on the value() function (instead of relying on ValueObjectSP equality). In my experiments, I kept getting different ValueObjectSPs when going through the same element twice. Reviewers: granata.enrico Subscribers: lldb-commits, sivachandra Differential Revision: http://reviews.llvm.org/D13902 Added: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/Makefile lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp?rev=250890&r1=250889&r2=250890&view=diff == --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp (original) +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp Wed Oct 21 05:17:21 2015 @@ -27,6 +27,81 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; +namespace { + +class ListEntry +{ +public: +ListEntry() = default; +ListEntry (ValueObjectSP entry_sp) : m_entry_sp(entry_sp) {} +ListEntry (const ListEntry& rhs) : m_entry_sp(rhs.m_entry_sp) {} +ListEntry (ValueObject* entry) : m_entry_sp(entry ? entry->GetSP() : ValueObjectSP()) {} + +ListEntry +next () +{ +if (!m_entry_sp) +return ListEntry(); +return ListEntry(m_entry_sp->GetChildMemberWithName(ConstString("__next_"), true)); +} + +ListEntry +prev () +{ +if (!m_entry_sp) +return ListEntry(); +return ListEntry(m_entry_sp->GetChildMemberWithName(ConstString("__prev_"), true)); +} + +uint64_t +value () const +{ +if (!m_entry_sp) +return 0; +return m_entry_sp->GetValueAsUnsigned(0); +} + +bool +null() +{ +return (value() == 0); +} + +explicit operator bool () +{ +return GetEntry().get() != nullptr && null() == false; +} + +ValueObjectSP +GetEntry () +{ +return m_entry_sp; +} + +void +SetEntry (ValueObjectSP entry) +{ +m_entry_sp = entry; +} + +bool +operator == (const ListEntry& rhs) const +{ +return value() == rhs.value(); +} + +bool +operator != (const ListEntry& rhs) const +{ +return !(*this == rhs); +} + +private: +ValueObjectSP m_entry_sp; +}; + +} // end anonymous namespace + namespace lldb_private { namespace formatters { class LibcxxStdListSyntheticFrontEnd : public SyntheticChildrenFrontEnd @@ -53,11 +128,15 @@ namespace lldb_private { private: bool -HasLoop(size_t); +HasLoop(size_t count); size_t m_list_capping_size; static const bool g_use_loop_detect = true; -size_t m_loop_detected; + +size_t m_loop_detected; // The number of elements that have had loop detection run over them. +ListEntry m_slow_runner; // Used for loop detection +ListEntry m_fast_runner; // Used for loop detection + lldb::addr_t m_node_address; ValueObject* m_head; ValueObject* m_tail; @@ -68,71 +147,6 @@ namespace lldb_private { } // namespace formatt
Re: [Lldb-commits] [PATCH] D13903: [RenderScript] New commands to save/load RS allocations to file.
labath added a subscriber: labath. labath added a comment. Hi, you seem to have an out-of-bounds access here: /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp:1629:5: warning: array index 3 is past the end of the array (which contains 3 elements) [-Warray-bounds] head.dims[3] = static_cast(alloc->dimension.get()->dim_3); ^ ~ /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp:190:9: note: array 'dims' declared here uint32_t dims[3]; // Dimensions Repository: rL LLVM http://reviews.llvm.org/D13903 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250891 - [RenderScript] Fix out of bounds warning.
Author: ewancrawford Date: Wed Oct 21 05:27:10 2015 New Revision: 250891 URL: http://llvm.org/viewvc/llvm-project?rev=250891&view=rev Log: [RenderScript] Fix out of bounds warning. Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=250891&r1=250890&r2=250891&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Wed Oct 21 05:27:10 2015 @@ -1624,9 +1624,9 @@ RenderScriptRuntime::SaveAllocation(Stre head.hdr_size = static_cast(sizeof(AllocationDetails::FileHeader)); head.type = static_cast(*alloc->type.get()); head.kind = static_cast(*alloc->type_kind.get()); -head.dims[1] = static_cast(alloc->dimension.get()->dim_1); -head.dims[2] = static_cast(alloc->dimension.get()->dim_2); -head.dims[3] = static_cast(alloc->dimension.get()->dim_3); +head.dims[0] = static_cast(alloc->dimension.get()->dim_1); +head.dims[1] = static_cast(alloc->dimension.get()->dim_2); +head.dims[2] = static_cast(alloc->dimension.get()->dim_3); head.element_size = static_cast(GetElementSize(alloc)); // Write the file header ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13903: [RenderScript] New commands to save/load RS allocations to file.
EwanCrawford added a comment. Thanks for spotting, comitted a quick fix Repository: rL LLVM http://reviews.llvm.org/D13903 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250896 - Clean up more .dwo files after the tests run
Author: labath Date: Wed Oct 21 07:56:37 2015 New Revision: 250896 URL: http://llvm.org/viewvc/llvm-project?rev=250896&view=rev Log: Clean up more .dwo files after the tests run Modified: lldb/trunk/test/lang/cpp/incomplete-types/Makefile lldb/trunk/test/make/Makefile.rules lldb/trunk/test/types/AbstractBase.py lldb/trunk/test/types/TestRecursiveTypes.py Modified: lldb/trunk/test/lang/cpp/incomplete-types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/Makefile?rev=250896&r1=250895&r2=250896&view=diff == --- lldb/trunk/test/lang/cpp/incomplete-types/Makefile (original) +++ lldb/trunk/test/lang/cpp/incomplete-types/Makefile Wed Oct 21 07:56:37 2015 @@ -30,6 +30,6 @@ length_nolimit.o: length.cpp a.o: a.cpp $(CXX) $(CFLAGS_NO_DEBUG) -c a.cpp -o a.o -clean: OBJECTS += limit nolimit length_limit.o length_nolimit.o +clean: OBJECTS += limit nolimit length_limit.o length_nolimit.o length_limit.dwo length_nolimit.dwo include $(LEVEL)/Makefile.rules Modified: lldb/trunk/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=250896&r1=250895&r2=250896&view=diff == --- lldb/trunk/test/make/Makefile.rules (original) +++ lldb/trunk/test/make/Makefile.rules Wed Oct 21 07:56:37 2015 @@ -489,7 +489,7 @@ endif # files by replacing all .c files with .d. #-- PREREQS := $(OBJECTS:.o=.d) -DWOS := $(OBJECTS:.o=.dwo) +DWOS := $(OBJECTS:.o=.dwo) $(ARCHIVE_OBJECTS:.o=.dwo) ifneq "$(DYLIB_NAME)" "" DYLIB_PREREQS := $(DYLIB_OBJECTS:.o=.d) DYLIB_DWOS := $(DYLIB_OBJECTS:.o=.dwo) Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=250896&r1=250895&r2=250896&view=diff == --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Wed Oct 21 07:56:37 2015 @@ -46,9 +46,6 @@ class GenericTester(TestBase): # functions. There are also three optional keyword arguments of interest, # # as follows: # # # -# dsym -> build for dSYM (defaulted to True) # -# True: build dSYM file # -# False: build DWARF map # # bc -> blockCaptured (defaulted to False) # # True: testing vars of various basic types from inside a block # # False: testing vars of various basic types from a function # Modified: lldb/trunk/test/types/TestRecursiveTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestRecursiveTypes.py?rev=250896&r1=250895&r2=250896&view=diff == --- lldb/trunk/test/types/TestRecursiveTypes.py (original) +++ lldb/trunk/test/types/TestRecursiveTypes.py Wed Oct 21 07:56:37 2015 @@ -33,7 +33,7 @@ class RecursiveTypesTestCase(TestBase): def test_recursive_type_2(self): """Test that recursive structs are displayed correctly.""" -self.build(dictionary=self.d1) +self.build(dictionary=self.d2) self.setTearDownCleanup(dictionary=self.d2) self.print_struct() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13715: Add initial gmake glue for the NetBSD platform
brucem added a comment. I think this looks good to me if no one disagrees. Repository: rL LLVM http://reviews.llvm.org/D13715 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer
tberghammer created this revision. tberghammer added reviewers: labath, clayborg. tberghammer added a subscriber: lldb-commits. 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). http://reviews.llvm.org/D13940 Files: include/lldb/Core/Timer.h source/Core/Timer.cpp Index: source/Core/Timer.cpp === --- source/Core/Timer.cpp +++ source/Core/Timer.cpp @@ -21,12 +21,16 @@ 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; + +thread_local unsigned Timer::g_depth(0); + +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 & @@ -86,6 +90,8 @@ { if (g_quiet == false) { +std::lock_guard lock(g_file_mutex); + // Indent ::fprintf (g_file, "%*s", g_depth * TIMER_INDENT_AMOUNT, ""); // Print formatted string @@ -143,7 +149,7 @@ 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, "", Index: include/lldb/Core/Timer.h === --- include/lldb/Core/Timer.h +++ 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,14 @@ 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 thread_local unsigned g_depth; + +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: source/Core/Timer.cpp === --- source/Core/Timer.cpp +++ source/Core/Timer.cpp @@ -21,12 +21,16 @@ 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; + +thread_local unsigned Timer::g_depth(0); + +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 & @@ -86,6 +90,8 @@ { if (g_quiet == false) { +std::lock_guard lock(g_file_mutex); + // Indent ::fprintf (g_file, "%*s", g_depth * TIMER_INDENT_AMOUNT, ""); // Print formatted string @@ -143,7 +149,7 @@ 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, "", Index: include/lldb/Core/Timer.h === --- include/lldb/Core/Timer.h +++ 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,14 @@ 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 thread_local unsigned g_depth; + +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); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D13941: Fix some race condition in ConstString around Mangled name handling
tberghammer created this revision. tberghammer added reviewers: labath, clayborg. tberghammer added a subscriber: lldb-commits. Fix some race condition in ConstString around Mangled name handling http://reviews.llvm.org/D13941 Files: source/Core/ConstString.cpp Index: source/Core/ConstString.cpp === --- source/Core/ConstString.cpp +++ source/Core/ConstString.cpp @@ -36,7 +36,9 @@ { if (ccstr) { -const StringPoolEntryType&entry = GetStringMapEntryFromKeyData (ccstr); +uint8_t h = hash (llvm::StringRef(ccstr)); +llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); +const StringPoolEntryType& entry = GetStringMapEntryFromKeyData (ccstr); return entry.getKey().size(); } return 0; @@ -46,17 +48,29 @@ GetMangledCounterpart (const char *ccstr) const { if (ccstr) +{ +uint8_t h = hash (llvm::StringRef(ccstr)); +llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); return GetStringMapEntryFromKeyData (ccstr).getValue(); +} return 0; } bool SetMangledCounterparts (const char *key_ccstr, const char *value_ccstr) { if (key_ccstr && value_ccstr) { -GetStringMapEntryFromKeyData (key_ccstr).setValue(value_ccstr); -GetStringMapEntryFromKeyData (value_ccstr).setValue(key_ccstr); +{ +uint8_t h = hash (llvm::StringRef(key_ccstr)); +llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); +GetStringMapEntryFromKeyData (key_ccstr).setValue(value_ccstr); +} +{ +uint8_t h = hash (llvm::StringRef(value_ccstr)); +llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); +GetStringMapEntryFromKeyData (value_ccstr).setValue(key_ccstr); +} return true; } return false; @@ -104,18 +118,29 @@ { if (demangled_cstr) { -llvm::StringRef string_ref (demangled_cstr); -uint8_t h = hash (string_ref); -llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); +const char *demangled_ccstr = nullptr; -// Make string pool entry with the mangled counterpart already set -StringPoolEntryType& entry = *m_string_pools[h].m_string_map.insert (std::make_pair (string_ref, mangled_ccstr)).first; +{ +llvm::StringRef string_ref (demangled_cstr); +uint8_t h = hash (string_ref); +llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); + +// Make string pool entry with the mangled counterpart already set +StringPoolEntryType& entry = *m_string_pools[h].m_string_map.insert ( +std::make_pair (string_ref, mangled_ccstr)).first; + +// Extract the const version of the demangled_cstr +demangled_ccstr = entry.getKeyData(); +} + +{ +// Now assign the demangled const string as the counterpart of the +// mangled const string... +uint8_t h = hash (llvm::StringRef(mangled_ccstr)); +llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); +GetStringMapEntryFromKeyData (mangled_ccstr).setValue(demangled_ccstr); +} -// Extract the const version of the demangled_cstr -const char *demangled_ccstr = entry.getKeyData(); -// Now assign the demangled const string as the counterpart of the -// mangled const string... -GetStringMapEntryFromKeyData (mangled_ccstr).setValue(demangled_ccstr); // Return the constant demangled C string return demangled_ccstr; } @@ -153,7 +178,7 @@ protected: uint8_t -hash(const llvm::StringRef &s) +hash(const llvm::StringRef &s) const { uint32_t h = llvm::HashString(s); return ((h >> 24) ^ (h >> 16) ^ (h >> 8) ^ h) & 0xff; Index: source/Core/ConstString.cpp === --- source/Core/ConstString.cpp +++ source/Core/ConstString.cpp @@ -36,7 +36,9 @@ { if (ccstr) { -const StringPoolEntryType&entry = GetStringMapEntryFromKeyData (ccstr); +uint8_t h = hash (llvm::StringRef(ccstr)); +llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); +const StringPoolEntryType& entry = GetStringMapEntryFromKeyData (ccstr); return entry.getKey().size(); } return 0; @@ -46,17 +48,29 @@ GetMangledCounterpart (const char *ccstr) const { if (ccstr) +{ +
[Lldb-commits] [PATCH] D13942: Make SymbolFileDWARF::GetCachedSectionData thread safe
tberghammer created this revision. tberghammer added reviewers: labath, clayborg. tberghammer added a subscriber: lldb-commits. Make SymbolFileDWARF::GetCachedSectionData thread safe http://reviews.llvm.org/D13942 Files: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h @@ -23,11 +23,6 @@ ~SymbolFileDWARFDwo() override = default; -const lldb_private::DWARFDataExtractor& -GetCachedSectionData(uint32_t got_flag, - lldb::SectionType sect_type, - lldb_private::DWARFDataExtractor &data) override; - lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit* dwarf_cu, uint32_t cu_idx) override; @@ -44,6 +39,9 @@ GetTypeSystemForLanguage(lldb::LanguageType language) override; protected: +const lldb_private::DWARFDataExtractor& +GetSectionDataNoLock(lldb::SectionType sect_type, DWARFDataSegment& data_segment) override; + DIEToTypePtr& GetDIEToType() override; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp @@ -28,37 +28,37 @@ } const lldb_private::DWARFDataExtractor& -SymbolFileDWARFDwo::GetCachedSectionData(uint32_t got_flag, - lldb::SectionType sect_type, - lldb_private::DWARFDataExtractor &data) +SymbolFileDWARFDwo::GetSectionDataNoLock(lldb::SectionType sect_type, + DWARFDataSegment& data_segment) { -if (!m_flags.IsClear (got_flag)) -return data; - const SectionList* section_list = m_obj_file->GetSectionList(false /* update_module_section_list */); if (section_list) { SectionSP section_sp (section_list->FindSectionByType(sect_type, true)); if (section_sp) { // See if we memory mapped the DWARF segment? -if (m_dwarf_data.GetByteSize()) +std::lock_guard dwarf_data_lock(m_dwarf_data.m_mutex); +if (m_dwarf_data.m_data.GetByteSize()) { -data.SetData(m_dwarf_data, section_sp->GetOffset(), section_sp->GetFileSize()); -m_flags.Set (got_flag); -return data; +data_segment.m_data.SetData(m_dwarf_data.m_data, +section_sp->GetOffset (), +section_sp->GetFileSize()); +data_segment.m_is_set.store(true); +return data_segment.m_data; } -if (m_obj_file->ReadSectionData(section_sp.get(), data) != 0) +if (m_obj_file->ReadSectionData(section_sp.get(), data_segment.m_data) != 0) { -m_flags.Set (got_flag); -return data; +data_segment.m_is_set.store(true); +return data_segment.m_data; } -data.Clear(); +data_segment.m_data.Clear(); } } -return SymbolFileDWARF::GetCachedSectionData(got_flag, sect_type, data); + +return SymbolFileDWARF::GetSectionDataNoLock(sect_type, data_segment); } lldb::CompUnitSP Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -14,6 +14,7 @@ // C++ Includes #include #include +#include #include #include @@ -265,32 +266,16 @@ DWARFDebugRanges* DebugRanges(); + const DWARFDebugRanges* DebugRanges() const; -virtual const lldb_private::DWARFDataExtractor& -GetCachedSectionData (uint32_t got_flag, - lldb::SectionType sect_type, - lldb_private::DWARFDataExtractor &data); - static bool SupportedVersion(uint16_t version); DWARFDIE GetDeclContextDIEContainingDIE (const DWARFDIE &die); -lldb_private::Flags& -GetFlags () -{ -return m_flags; -} - -const lldb_private::Flags& -GetFlags () const -{ -return m_flags; -} - bool HasForwardDeclForClangType (const lldb_private::CompilerType &compiler_type); @@ -326,36 +311,32 @@ typedef llvm::DenseMap DIEToClangType; typedef llvm::DenseMap ClangTypeToDIE; -enum +struct DWARFDataSegment { -flagsG
Re: [Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. lgtm http://reviews.llvm.org/D13940 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250899 - Skip TestMultithreaded on Windows.
Author: amccarth Date: Wed Oct 21 09:42:10 2015 New Revision: 250899 URL: http://llvm.org/viewvc/llvm-project?rev=250899&view=rev Log: Skip TestMultithreaded on Windows. Differential Revision: http://reviews.llvm.org/D13923 Modified: lldb/trunk/test/api/multithreaded/TestMultithreaded.py Modified: lldb/trunk/test/api/multithreaded/TestMultithreaded.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/multithreaded/TestMultithreaded.py?rev=250899&r1=250898&r2=250899&view=diff == --- lldb/trunk/test/api/multithreaded/TestMultithreaded.py (original) +++ lldb/trunk/test/api/multithreaded/TestMultithreaded.py Wed Oct 21 09:42:10 2015 @@ -1,4 +1,4 @@ -"""Test the lldb public C++ api breakpoint callbacks. """ +"""Test the lldb public C++ api breakpoint callbacks.""" import os, re, StringIO import unittest2 @@ -10,19 +10,10 @@ class SBBreakpointCallbackCase(TestBase) mydir = TestBase.compute_mydir(__file__) -def setUp(self): -TestBase.setUp(self) -self.lib_dir = os.environ["LLDB_LIB_DIR"] -self.implib_dir = os.environ["LLDB_IMPLIB_DIR"] -self.inferior = 'inferior_program' -if self.getLldbArchitecture() == self.getArchitecture(): -self.buildProgram('inferior.cpp', self.inferior) -self.addTearDownHook(lambda: os.remove(self.inferior)) - @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_breakpoint_callback(self): """Test the that SBBreakpoint callback is invoked when a breakpoint is hit. """ self.build_and_test('driver.cpp test_breakpoint_callback.cpp', @@ -30,9 +21,9 @@ class SBBreakpointCallbackCase(TestBase) @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_sb_api_listener_event_description(self): """ Test the description of an SBListener breakpoint event is valid.""" self.build_and_test('driver.cpp listener_test.cpp test_listener_event_description.cpp', @@ -41,10 +32,10 @@ class SBBreakpointCallbackCase(TestBase) @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD @expectedFlakeyLinux # Driver occasionally returns '1' as exit status @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_sb_api_listener_event_process_state(self): """ Test that a registered SBListener receives events when a process changes state. @@ -56,9 +47,9 @@ class SBBreakpointCallbackCase(TestBase) @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.8"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_sb_api_listener_resume(self): """ Test that a process can be resumed from a non-main thread. """ self.build_and_test('driver.cpp listener_test.cpp test_listener_resume.cpp', @@ -75,6 +66,12 @@ class SBBreakpointCallbackCase(TestBase) if self.getLldbArchitecture() != self.getArchitecture(): self.skipTest("This test is only run if the target arch is the same as the lldb binary arch") +self.lib_dir = os.environ["LLDB_LIB_DIR"] +self.implib_dir = os.environ["LLDB_IMPLIB_DIR"] +self.inferior = 'inferior_program' +self.buildProgram('inferior.cpp', self.inferior) +self.addTearDownHook(lambda: os.remove(self.inferior)) + self.buildDriver(sources, test_name) self.addTearDownHook(lambda: os.remove(test_name)) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13923: Skip TestMultithread.py on Windows because it times out (and they'd fail anyway)
This revision was automatically updated to reflect the committed changes. Closed by commit rL250899: Skip TestMultithreaded on Windows. (authored by amccarth). Changed prior to commit: http://reviews.llvm.org/D13923?vs=37953&id=38012#toc Repository: rL LLVM http://reviews.llvm.org/D13923 Files: lldb/trunk/test/api/multithreaded/TestMultithreaded.py Index: lldb/trunk/test/api/multithreaded/TestMultithreaded.py === --- lldb/trunk/test/api/multithreaded/TestMultithreaded.py +++ lldb/trunk/test/api/multithreaded/TestMultithreaded.py @@ -1,4 +1,4 @@ -"""Test the lldb public C++ api breakpoint callbacks. """ +"""Test the lldb public C++ api breakpoint callbacks.""" import os, re, StringIO import unittest2 @@ -10,41 +10,32 @@ mydir = TestBase.compute_mydir(__file__) -def setUp(self): -TestBase.setUp(self) -self.lib_dir = os.environ["LLDB_LIB_DIR"] -self.implib_dir = os.environ["LLDB_IMPLIB_DIR"] -self.inferior = 'inferior_program' -if self.getLldbArchitecture() == self.getArchitecture(): -self.buildProgram('inferior.cpp', self.inferior) -self.addTearDownHook(lambda: os.remove(self.inferior)) - @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_breakpoint_callback(self): """Test the that SBBreakpoint callback is invoked when a breakpoint is hit. """ self.build_and_test('driver.cpp test_breakpoint_callback.cpp', 'test_breakpoint_callback') @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_sb_api_listener_event_description(self): """ Test the description of an SBListener breakpoint event is valid.""" self.build_and_test('driver.cpp listener_test.cpp test_listener_event_description.cpp', 'test_listener_event_description') pass @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD @expectedFlakeyLinux # Driver occasionally returns '1' as exit status @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_sb_api_listener_event_process_state(self): """ Test that a registered SBListener receives events when a process changes state. @@ -56,9 +47,9 @@ @skipIfRemote @skipIfNoSBHeaders +@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.8"], archs=["x86_64"]) -@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_sb_api_listener_resume(self): """ Test that a process can be resumed from a non-main thread. """ self.build_and_test('driver.cpp listener_test.cpp test_listener_resume.cpp', @@ -75,6 +66,12 @@ if self.getLldbArchitecture() != self.getArchitecture(): self.skipTest("This test is only run if the target arch is the same as the lldb binary arch") +self.lib_dir = os.environ["LLDB_LIB_DIR"] +self.implib_dir = os.environ["LLDB_IMPLIB_DIR"] +self.inferior = 'inferior_program' +self.buildProgram('inferior.cpp', self.inferior) +self.addTearDownHook(lambda: os.remove(self.inferior)) + self.buildDriver(sources, test_name) self.addTearDownHook(lambda: os.remove(test_name)) Index: lldb/trunk/test/api/multithreaded/TestMultithreaded.py === --- lldb/trunk/test/api/multithreaded/TestMultithreaded.py +++ lldb/trunk/test/api/multithreaded/TestMultithreaded.py @@ -1,4 +1,4 @@ -"""Test the lldb public C++ api breakpoint callbacks. """ +"""Test the lldb public C++ api breakpoint callbacks.""" import os, re, StringIO import unittest2 @@ -10,41 +10,32 @@ mydir = TestBase.compute_mydir(__file__) -def setUp(self): -TestBase.setUp(self) -self.lib_dir = os.environ["LLDB_LIB_DIR"] -self.implib_dir = os.environ["
[Lldb-commits] [PATCH] D13947: [lldb-mi] Fix expansion of anonymous structures and unions
evgeny777 created this revision. evgeny777 added reviewers: ki.stfu, abidh. evgeny777 added subscribers: lldb-commits, KLapshin. Suppose we have the following type ``` struct S { union { inti1; unsigned u1; }; union { inti2; unsigned u2; }; }; ``` Current revision makes it impossible to evaluate it using MI, because MI assigns '??' as 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. http://reviews.llvm.org/D13947 Files: test/tools/lldb-mi/variable/TestMiVar.py test/tools/lldb-mi/variable/main.cpp tools/lldb-mi/MICmdCmdVar.cpp tools/lldb-mi/MICmnLLDBUtilSBValue.cpp Index: tools/lldb-mi/MICmnLLDBUtilSBValue.cpp === --- tools/lldb-mi/MICmnLLDBUtilSBValue.cpp +++ 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: tools/lldb-mi/MICmdCmdVar.cpp === --- tools/lldb-mi/MICmdCmdVar.cpp +++ 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: test/tools/lldb-mi/variable/main.cpp === --- test/tools/lldb-mi/variable/main.cpp +++ 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: test/tools/lldb-mi/variable/TestMiVar.py === --- test/tools/lldb-mi/variable/TestMiVar.py +++ test/tools/lldb-mi/variable/TestMiVar.py @@ -354,5 +354,46 @@ 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 t
[Lldb-commits] [PATCH] D13948: [AppleObjCRuntime] Don't bother looking for the runtime on non-apple targets
labath created this revision. labath added reviewers: clayborg, jingham. labath added a subscriber: lldb-commits. This short-circuits the GetObjCVersion function to avoid iterating through target modules on non-apple targets. This function is called on every Process::IsDynamicValue call, so this overhead is not negligible. http://reviews.llvm.org/D13948 Files: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp === --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -382,8 +382,11 @@ { if (!process) return ObjCRuntimeVersions::eObjC_VersionUnknown; - + Target &target = process->GetTarget(); +if (target.GetArchitecture().GetTriple().getVendor() != llvm::Triple::VendorType::Apple) +return ObjCRuntimeVersions::eObjC_VersionUnknown; + const ModuleList &target_modules = target.GetImages(); Mutex::Locker modules_locker(target_modules.GetMutex()); Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp === --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -382,8 +382,11 @@ { if (!process) return ObjCRuntimeVersions::eObjC_VersionUnknown; - + Target &target = process->GetTarget(); +if (target.GetArchitecture().GetTriple().getVendor() != llvm::Triple::VendorType::Apple) +return ObjCRuntimeVersions::eObjC_VersionUnknown; + const ModuleList &target_modules = target.GetImages(); Mutex::Locker modules_locker(target_modules.GetMutex()); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13942: Make SymbolFileDWARF::GetCachedSectionData thread safe
tberghammer updated this revision to Diff 38019. tberghammer added a comment. Use std::call_once instead of a std::atomic+std::mutex combination based on some offline discussion with Pavel http://reviews.llvm.org/D13942 Files: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h @@ -23,11 +23,6 @@ ~SymbolFileDWARFDwo() override = default; -const lldb_private::DWARFDataExtractor& -GetCachedSectionData(uint32_t got_flag, - lldb::SectionType sect_type, - lldb_private::DWARFDataExtractor &data) override; - lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit* dwarf_cu, uint32_t cu_idx) override; @@ -44,6 +39,9 @@ GetTypeSystemForLanguage(lldb::LanguageType language) override; protected: +void +LoadSectionData (lldb::SectionType sect_type, lldb_private::DWARFDataExtractor& data) override; + DIEToTypePtr& GetDIEToType() override; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp @@ -27,14 +27,9 @@ SetID(((lldb::user_id_t)dwarf_cu->GetOffset())<<32); } -const lldb_private::DWARFDataExtractor& -SymbolFileDWARFDwo::GetCachedSectionData(uint32_t got_flag, - lldb::SectionType sect_type, - lldb_private::DWARFDataExtractor &data) +void +SymbolFileDWARFDwo::LoadSectionData (lldb::SectionType sect_type, DWARFDataExtractor& data) { -if (!m_flags.IsClear (got_flag)) -return data; - const SectionList* section_list = m_obj_file->GetSectionList(false /* update_module_section_list */); if (section_list) { @@ -45,20 +40,17 @@ if (m_dwarf_data.GetByteSize()) { data.SetData(m_dwarf_data, section_sp->GetOffset(), section_sp->GetFileSize()); -m_flags.Set (got_flag); -return data; +return; } if (m_obj_file->ReadSectionData(section_sp.get(), data) != 0) -{ -m_flags.Set (got_flag); -return data; -} +return; data.Clear(); } } -return SymbolFileDWARF::GetCachedSectionData(got_flag, sect_type, data); + +SymbolFileDWARF::LoadSectionData(sect_type, data); } lldb::CompUnitSP Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h === --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -14,6 +14,7 @@ // C++ Includes #include #include +#include #include #include @@ -265,32 +266,16 @@ DWARFDebugRanges* DebugRanges(); + const DWARFDebugRanges* DebugRanges() const; -virtual const lldb_private::DWARFDataExtractor& -GetCachedSectionData (uint32_t got_flag, - lldb::SectionType sect_type, - lldb_private::DWARFDataExtractor &data); - static bool SupportedVersion(uint16_t version); DWARFDIE GetDeclContextDIEContainingDIE (const DWARFDIE &die); -lldb_private::Flags& -GetFlags () -{ -return m_flags; -} - -const lldb_private::Flags& -GetFlags () const -{ -return m_flags; -} - bool HasForwardDeclForClangType (const lldb_private::CompilerType &compiler_type); @@ -326,36 +311,27 @@ typedef llvm::DenseMap DIEToClangType; typedef llvm::DenseMap ClangTypeToDIE; -enum +struct DWARFDataSegment { -flagsGotDebugAbbrevData = (1 << 0), -flagsGotDebugAddrData = (1 << 1), -flagsGotDebugArangesData= (1 << 2), -flagsGotDebugFrameData = (1 << 3), -flagsGotDebugInfoData = (1 << 4), -flagsGotDebugLineData = (1 << 5), -flagsGotDebugLocData= (1 << 6), -flagsGotDebugMacInfoData= (1 << 7), -flagsGotDebugPubNamesData = (1 << 8), -flagsGotDebugPubTypesData = (1 << 9), -flagsGotDebugRangesData = (1 << 10), -flagsGotDebugStrData= (1 << 11), -flagsGotDebugStrOffsetsData = (1 << 12), -flagsGotAppleNamesData = (1 << 13), -flagsGotAppleTypesData = (1 << 14), -flagsGotAppleNamespacesData = (1 << 15), -flagsGotApp
Re: [Lldb-commits] [PATCH] D13941: Fix some race condition in ConstString around Mangled name handling
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks fine. Might want to make "h" const in places noted by inlined comments, but other than that it looks good. Comment at: source/Core/ConstString.cpp:39 @@ -38,2 +38,3 @@ { -const StringPoolEntryType&entry = GetStringMapEntryFromKeyData (ccstr); +uint8_t h = hash (llvm::StringRef(ccstr)); +llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); const uint8_t h? Comment at: source/Core/ConstString.cpp:52 @@ +51,3 @@ +{ +uint8_t h = hash (llvm::StringRef(ccstr)); +llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); const uint8_t h? Comment at: source/Core/ConstString.cpp:65 @@ +64,3 @@ +{ +uint8_t h = hash (llvm::StringRef(key_ccstr)); +llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); const uint8_t h? Comment at: source/Core/ConstString.cpp:70 @@ +69,3 @@ +{ +uint8_t h = hash (llvm::StringRef(value_ccstr)); +llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); const uint8_t h? Comment at: source/Core/ConstString.cpp:139 @@ +138,3 @@ +// mangled const string... +uint8_t h = hash (llvm::StringRef(mangled_ccstr)); +llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); const uint8_t h? http://reviews.llvm.org/D13941 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r250874 - Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.
Hi, Zachary! On Tue, Oct 20, 2015 at 8:25 PM, Zachary Turner wrote: > You can probably put this CL back in, just make sure you #include the > appropriate file from LLVM in the header file. Actually I only changed order of headers and forward declarations. Unfortunately I don't have access to MSVC, so somebody else help is needed to fix problem properly. Eugene. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer
clayborg requested changes to this revision. clayborg added a comment. This revision now requires changes to proceed. "thread_local" isn't well supported and has performance issues. See inlined comments. Comment at: include/lldb/Core/Timer.h:89 @@ +88,3 @@ + +static thread_local unsigned g_depth; + Not sure if all platforms support thread_local correctly. MacOSX might not. I also spoke with some compiler folks on using "thread_local" and they warned that the C++11 spec requires a bunch of other stuff gets initialized when _any_ thread_local variable gets used, so I was told that using the "__thread" instead of much better to do. So switch this from thread_local to __thread and it should work on most platforms. Not sure if windows will have a problem with this. So the best fix is probably to make a LLDB_THREAD_LOCAL #define in lldb-defines.h and define it to "__thread" by default. Windows can fix up as needed. Comment at: source/Core/Timer.cpp:27 @@ +26,3 @@ + +thread_local unsigned Timer::g_depth(0); + Use LLDB_THREAD_LOCAL instead of "thread_local". http://reviews.llvm.org/D13940 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer
zturner added a subscriber: zturner. Comment at: include/lldb/Core/Timer.h:89 @@ +88,3 @@ + +static thread_local unsigned g_depth; + clayborg wrote: > Not sure if all platforms support thread_local correctly. MacOSX might not. I > also spoke with some compiler folks on using "thread_local" and they warned > that the C++11 spec requires a bunch of other stuff gets initialized when > _any_ thread_local variable gets used, so I was told that using the > "__thread" instead of much better to do. So switch this from thread_local to > __thread and it should work on most platforms. Not sure if windows will have > a problem with this. > > So the best fix is probably to make a LLDB_THREAD_LOCAL #define in > lldb-defines.h and define it to "__thread" by default. Windows can fix up as > needed. Actually can you use llvm::ThreadLocal instead? `__thread` doesn't exist on Windows, and neither does `thread_local`. `ThreadLocal` in llvm is the only thing I know that works everywhere. Once I get the Python 3 stuff finished, we can move to MSVC 2015, which *does* support `thread_local`. Then we can use the `LLDB_THREAD_LOCAL` define as you suggest. Does that work for everyone? http://reviews.llvm.org/D13940 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250913 - Made the REPL choose a default language if only one REPL can be chosen.
Author: spyffe Date: Wed Oct 21 12:43:18 2015 New Revision: 250913 URL: http://llvm.org/viewvc/llvm-project?rev=250913&view=rev Log: Made the REPL choose a default language if only one REPL can be chosen. This requires REPLs to enumerate the languages they support. Modified: lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/PluginManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/include/lldb/Core/PluginManager.h (original) +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 12:43:18 2015 @@ -449,7 +449,8 @@ public: static bool RegisterPlugin (const ConstString &name, const char *description, -REPLCreateInstance create_callback); +REPLCreateInstance create_callback, +REPLEnumerateSupportedLanguages enumerate_languages_callback); static bool UnregisterPlugin (REPLCreateInstance create_callback); @@ -460,6 +461,12 @@ public: static REPLCreateInstance GetREPLCreateCallbackForPluginName (const ConstString &name); +static REPLEnumerateSupportedLanguages +GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); + +static REPLEnumerateSupportedLanguages +GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); + //-- // Some plug-ins might register a DebuggerInitializeCallback // callback when registering the plug-in. After a new Debugger Modified: lldb/trunk/include/lldb/Target/Language.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/include/lldb/Target/Language.h (original) +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 12:43:18 2015 @@ -149,6 +149,9 @@ public: static void GetLanguagesSupportingTypeSystems (std::set &languages, std::set &languages_for_expressions); + +static void +GetLanguagesSupportingREPLs (std::set &languages); protected: //-- Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 12:43:18 2015 @@ -51,6 +51,7 @@ namespace lldb_private typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); +typedef void (*REPLEnumerateSupportedLanguages) (std::set &languages); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 12:43:18 2015 @@ -1805,11 +1805,6 @@ Debugger::RunREPL (LanguageType language { Error err; FileSpec repl_executable; -if (language == eLanguageTypeUnknown) -{ -err.SetErrorString ("must specify a language for a REPL"); // TODO make it possible to specify a default language -return err; -} Target *const target = nullptr; // passing in an empty target means the REPL must create one Modified: lldb/trunk/source/Core/PluginManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/source/Core/PluginManager.cpp (original) +++ lldb/trunk/source/Core/PluginManager.cpp Wed Oct 21 12:
Re: [Lldb-commits] [PATCH] D13948: [AppleObjCRuntime] Don't bother looking for the runtime on non-apple targets
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. This is really the fault of AppleObjCRuntimeV1::CreateInstance() and AppleObjCRuntimeV2::CreateInstance() not checking the triple to begin with, but this is a simple solution that will effectively fix both places. Looks good. http://reviews.llvm.org/D13948 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13942: Make SymbolFileDWARF::GetCachedSectionData thread safe
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good. http://reviews.llvm.org/D13942 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer
clayborg added a comment. Yes, please use any llvm system utilities when possible. And scratch the need for LLDB_THREAD_LOCAL at any point in the future and just use llvm::ThreadLocal all the time as thread local variables have already been abstracted by llvm. http://reviews.llvm.org/D13940 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250915 - Use six to portably handle module renames in Python 2 and 3
Author: zturner Date: Wed Oct 21 12:48:52 2015 New Revision: 250915 URL: http://llvm.org/viewvc/llvm-project?rev=250915&view=rev Log: Use six to portably handle module renames in Python 2 and 3 Modified: lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py lldb/trunk/test/api/multithreaded/TestMultithreaded.py lldb/trunk/test/dosep.py lldb/trunk/test/dotest_channels.py lldb/trunk/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py lldb/trunk/test/functionalities/paths/TestPaths.py lldb/trunk/test/functionalities/rerun/TestRerun.py lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py lldb/trunk/test/lldbtest.py lldb/trunk/test/lldbutil.py lldb/trunk/test/python_api/frame/TestFrames.py lldb/trunk/test/test_results.py lldb/trunk/test/tools/lldb-server/lldbgdbserverutils.py lldb/trunk/test/tools/lldb-server/socket_packet_pump.py lldb/trunk/test/unittest2/result.py Modified: lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=250915&r1=250914&r2=250915&view=diff == --- lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py (original) +++ lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py Wed Oct 21 12:48:52 2015 @@ -3,7 +3,9 @@ There should be nothing unwanted there and a simpe main.cpp which includes SB*.h should compile and link with the LLDB framework.""" -import os, re, StringIO +import lldb_shared + +import os, re import unittest2 from lldbtest import * import lldbutil Modified: lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py?rev=250915&r1=250914&r2=250915&view=diff == --- lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py (original) +++ lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py Wed Oct 21 12:48:52 2015 @@ -1,6 +1,8 @@ """Test the lldb public C++ api when doing multiple debug sessions simultaneously.""" -import os, re, StringIO +import lldb_shared + +import os, re import unittest2 from lldbtest import * import lldbutil Modified: lldb/trunk/test/api/multithreaded/TestMultithreaded.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/multithreaded/TestMultithreaded.py?rev=250915&r1=250914&r2=250915&view=diff == --- lldb/trunk/test/api/multithreaded/TestMultithreaded.py (original) +++ lldb/trunk/test/api/multithreaded/TestMultithreaded.py Wed Oct 21 12:48:52 2015 @@ -1,6 +1,8 @@ """Test the lldb public C++ api breakpoint callbacks.""" -import os, re, StringIO +import lldb_shared + +import os, re import unittest2 from lldbtest import * import lldbutil Modified: lldb/trunk/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=250915&r1=250914&r2=250915&view=diff == --- lldb/trunk/test/dosep.py (original) +++ lldb/trunk/test/dosep.py Wed Oct 21 12:48:52 2015 @@ -34,6 +34,8 @@ echo core.%p | sudo tee /proc/sys/kernel from __future__ import print_function +import lldb_shared + # system packages and modules import asyncore import distutils.version @@ -42,12 +44,13 @@ import multiprocessing import multiprocessing.pool import os import platform -import Queue import re import signal import sys import threading +from six.moves import queue + # Add our local test_runner/lib dir to the python path. sys.path.append(os.path.join(os.path.dirname(__file__), "test_runner", "lib")) @@ -336,7 +339,7 @@ def process_dir_worker_multiprocessing( result = process_dir(job[0], job[1], job[2], job[3], inferior_pid_events) result_queue.put(result) -except Queue.Empty: +except queue.Empty: # Fine, we're done. pass @@ -359,7 +362,7 @@ def process_dir_worker_threading(job_que result = process_dir(job[0], job[1], job[2], job[3], inferior_pid_events) result_queue.put(result) -except Queue.Empty: +except queue.Empty: # Fine, we're done. pass @@ -641,7 +644,7 @@ def handle_ctrl_c(ctrl_c_count, job_queu try: # Just drain it to stop more work from being started. job_queue.get_nowait() -except Queue.Empty: +except queue.Empty: pass with output_lock: print("
Re: [Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer
zturner added a comment. Sad as it may seem, I actually think we may *need* this `LLDB_THREAD_LOCAL` at some point in the future. The reason is that there is at least one place in LLDB (I think it might even be in `Timer`, but it's been a while since I found this) that relies on thread local destructors. It is possible to make this work on Windows, but the code is absolutely crazy. You have to use pragmas to manually inject magic sections into the binary. Anyway, this actually works using the C++11 `thread_local` keyword under MSVC 2015, so the fact that we don't have those semantics on Windows is currently a bug, and the only way I know of to get them in a sane manner is to use `thread_local`. Anyway, TL;DR - If you need Thread Local destructors, you can't use `llvm::ThreadLocal` http://reviews.llvm.org/D13940 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D13951: [LLDB] Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.
Eugene.Zelenko created this revision. Eugene.Zelenko added reviewers: brucem, labath, clayborg. Eugene.Zelenko added a subscriber: lldb-commits. Eugene.Zelenko set the repository for this revision to rL LLVM. I checked this patch on my own build on RHEL 6. Repository: rL LLVM http://reviews.llvm.org/D13951 Files: source/Plugins/JITLoader/GDB/JITLoaderGDB.h source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp source/Plugins/OperatingSystem/Go/OperatingSystemGo.h source/Plugins/OperatingSystem/Python/OperatingSystemPython.h source/Plugins/Process/Utility/RegisterContextThreadMemory.h source/Plugins/Process/Utility/StopInfoMachException.h source/Plugins/Process/Utility/ThreadMemory.h source/Plugins/Process/Utility/UnwindLLDB.h source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h Index: source/Plugins/JITLoader/GDB/JITLoaderGDB.h === --- source/Plugins/JITLoader/GDB/JITLoaderGDB.h +++ source/Plugins/JITLoader/GDB/JITLoaderGDB.h @@ -13,15 +13,19 @@ // C Includes // C++ Includes #include -#include -#include +// Other libraries and framework includes +// Project includes #include "lldb/Target/JITLoader.h" #include "lldb/Target/Process.h" class JITLoaderGDB : public lldb_private::JITLoader { public: +JITLoaderGDB(lldb_private::Process *process); + +~JITLoaderGDB() override; + //-- // Static Functions //-- @@ -40,34 +44,29 @@ static lldb::JITLoaderSP CreateInstance (lldb_private::Process *process, bool force); -JITLoaderGDB (lldb_private::Process *process); - static void DebuggerInitialize(lldb_private::Debugger &debugger); -virtual -~JITLoaderGDB (); - //-- // PluginInterface protocol //-- -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; -virtual uint32_t -GetPluginVersion(); +uint32_t +GetPluginVersion() override; //-- // JITLoader interface //-- -virtual void -DidAttach (); +void +DidAttach() override; -virtual void -DidLaunch (); +void +DidLaunch() override; -virtual void -ModulesDidLoad (lldb_private::ModuleList &module_list); +void +ModulesDidLoad(lldb_private::ModuleList &module_list) override; private: lldb::addr_t @@ -108,4 +107,4 @@ }; -#endif +#endif // liblldb_JITLoaderGDB_h_ Index: source/Plugins/Process/Utility/UnwindLLDB.h === --- source/Plugins/Process/Utility/UnwindLLDB.h +++ source/Plugins/Process/Utility/UnwindLLDB.h @@ -10,8 +10,12 @@ #ifndef lldb_UnwindLLDB_h_ #define lldb_UnwindLLDB_h_ +// C Includes +// C++ Includes #include +// Other libraries and framework includes +// Project includes #include "lldb/lldb-public.h" #include "lldb/Core/ConstString.h" #include "lldb/Symbol/FuncUnwinders.h" @@ -27,10 +31,9 @@ { public: UnwindLLDB (lldb_private::Thread &thread); - -virtual -~UnwindLLDB() { } +~UnwindLLDB() override = default; + enum RegisterSearchResult { eRegisterFound = 0, @@ -62,23 +65,23 @@ }; void -DoClear() +DoClear() override { m_frames.clear(); m_candidate_frame.reset(); m_unwind_complete = false; } -virtual uint32_t -DoGetFrameCount(); +uint32_t +DoGetFrameCount() override; bool -DoGetFrameInfoAtIndex (uint32_t frame_idx, - lldb::addr_t& cfa, - lldb::addr_t& start_pc); +DoGetFrameInfoAtIndex(uint32_t frame_idx, + lldb::addr_t& cfa, + lldb::addr_t& start_pc) override; lldb::RegisterContextSP -DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame); +DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override; typedef std::shared_ptr RegisterContextLLDBSP; @@ -112,7 +115,6 @@ } private: - struct Cursor { lldb::addr_t start_pc; // The start address of the function/symbol for this frame - current pc if unknown @@ -149,6 +151,6 @@ DISALLOW_COPY_AND_ASSIGN (UnwindLLDB); }; -} // namespace lldb_private +} // namespace lldb_private -#endif // lldb_UnwindLLDB_h_ +#endif // lldb_U
Re: [Lldb-commits] [lldb] r250913 - Made the REPL choose a default language if only one REPL can be chosen.
This breaks the build because of two things: 1. The function GetLanguagesSupportingREPLs is declared static in Language.cpp, but Language.h has it declared as a static method. 2. There is a declaration for a static method GetREPLEnumerateSupportedLanguagesCallbackAtIndex in PluginManager, but no definition anywhere. On Wed, Oct 21, 2015 at 10:43 AM, Sean Callanan via lldb-commits wrote: > Author: spyffe > Date: Wed Oct 21 12:43:18 2015 > New Revision: 250913 > > URL: http://llvm.org/viewvc/llvm-project?rev=250913&view=rev > Log: > Made the REPL choose a default language if only one REPL can be chosen. > This requires REPLs to enumerate the languages they support. > > Modified: > lldb/trunk/include/lldb/Core/PluginManager.h > lldb/trunk/include/lldb/Target/Language.h > lldb/trunk/include/lldb/lldb-private-interfaces.h > lldb/trunk/source/Core/Debugger.cpp > lldb/trunk/source/Core/PluginManager.cpp > lldb/trunk/source/Target/Language.cpp > lldb/trunk/source/Target/Target.cpp > > Modified: lldb/trunk/include/lldb/Core/PluginManager.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250913&r1=250912&r2=250913&view=diff > == > --- lldb/trunk/include/lldb/Core/PluginManager.h (original) > +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 12:43:18 2015 > @@ -449,7 +449,8 @@ public: > static bool > RegisterPlugin (const ConstString &name, > const char *description, > -REPLCreateInstance create_callback); > +REPLCreateInstance create_callback, > +REPLEnumerateSupportedLanguages > enumerate_languages_callback); > > static bool > UnregisterPlugin (REPLCreateInstance create_callback); > @@ -460,6 +461,12 @@ public: > static REPLCreateInstance > GetREPLCreateCallbackForPluginName (const ConstString &name); > > +static REPLEnumerateSupportedLanguages > +GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); > + > +static REPLEnumerateSupportedLanguages > +GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const > ConstString &name); > + > //-- > // Some plug-ins might register a DebuggerInitializeCallback > // callback when registering the plug-in. After a new Debugger > > Modified: lldb/trunk/include/lldb/Target/Language.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250913&r1=250912&r2=250913&view=diff > == > --- lldb/trunk/include/lldb/Target/Language.h (original) > +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 12:43:18 2015 > @@ -149,6 +149,9 @@ public: > static void > GetLanguagesSupportingTypeSystems (std::set > &languages, > std::set > &languages_for_expressions); > + > +static void > +GetLanguagesSupportingREPLs (std::set &languages); > > protected: > //-- > > Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250913&r1=250912&r2=250913&view=diff > == > --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) > +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 12:43:18 2015 > @@ -51,6 +51,7 @@ namespace lldb_private > typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) > (lldb::LanguageType language, Module *module, Target *target); > typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, > lldb::LanguageType language, Debugger *debugger, Target *target, const char > *repl_options); > typedef void (*TypeSystemEnumerateSupportedLanguages) > (std::set &languages_for_types, > std::set &languages_for_expressions); > +typedef void (*REPLEnumerateSupportedLanguages) > (std::set &languages); > typedef int (*ComparisonFunction)(const void *, const void *); > typedef void (*DebuggerInitializeCallback)(Debugger &debugger); > > > Modified: lldb/trunk/source/Core/Debugger.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250913&r1=250912&r2=250913&view=diff > == > --- lldb/trunk/source/Core/Debugger.cpp (original) > +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 12:43:18 2015 > @@ -1805,11 +1805,6 @@ Debugger::RunREPL (LanguageType language > { > Error err; > FileSpec repl_executable; > -if (language == eLanguageTypeUnknown) > -{ > -err.SetErrorString ("must specify a language for a REPL");
[Lldb-commits] [lldb] r250925 - Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.
Author: eugenezelenko Date: Wed Oct 21 13:46:17 2015 New Revision: 250925 URL: http://llvm.org/viewvc/llvm-project?rev=250925&view=rev Log: Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13951 Modified: lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.h lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h lldb/trunk/source/Plugins/Process/Utility/RegisterContextThreadMemory.h lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h lldb/trunk/source/Plugins/Process/Utility/ThreadMemory.h lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h Modified: lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.h?rev=250925&r1=250924&r2=250925&view=diff == --- lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.h (original) +++ lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.h Wed Oct 21 13:46:17 2015 @@ -13,15 +13,19 @@ // C Includes // C++ Includes #include -#include -#include +// Other libraries and framework includes +// Project includes #include "lldb/Target/JITLoader.h" #include "lldb/Target/Process.h" class JITLoaderGDB : public lldb_private::JITLoader { public: +JITLoaderGDB(lldb_private::Process *process); + +~JITLoaderGDB() override; + //-- // Static Functions //-- @@ -40,34 +44,29 @@ public: static lldb::JITLoaderSP CreateInstance (lldb_private::Process *process, bool force); -JITLoaderGDB (lldb_private::Process *process); - static void DebuggerInitialize(lldb_private::Debugger &debugger); -virtual -~JITLoaderGDB (); - //-- // PluginInterface protocol //-- -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; -virtual uint32_t -GetPluginVersion(); +uint32_t +GetPluginVersion() override; //-- // JITLoader interface //-- -virtual void -DidAttach (); +void +DidAttach() override; -virtual void -DidLaunch (); +void +DidLaunch() override; -virtual void -ModulesDidLoad (lldb_private::ModuleList &module_list); +void +ModulesDidLoad(lldb_private::ModuleList &module_list) override; private: lldb::addr_t @@ -108,4 +107,4 @@ private: }; -#endif +#endif // liblldb_JITLoaderGDB_h_ Modified: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp?rev=250925&r1=250924&r2=250925&view=diff == --- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp (original) +++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp Wed Oct 21 13:46:17 2015 @@ -1,4 +1,4 @@ -//===-- OperatingSystemGo.cpp *- C++ -*-===// +//===-- OperatingSystemGo.cpp ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,13 +6,15 @@ // License. See LICENSE.TXT for details. // //===--===// -#include "OperatingSystemGo.h" // C Includes // C++ Includes #include // Other libraries and framework includes +// Project includes +#include "OperatingSystemGo.h" + #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" @@ -56,13 +58,7 @@ enum class PluginProperties : public Properties { - public: -static ConstString -GetSettingName() -{ -return OperatingSystemGo::GetPluginNameStatic(); -} - +public: PluginProperties() : Properties() { @@ -70,7 +66,13 @@ class PluginProperties : public Properti m_collection_sp->Initialize(g_properties); } -virtual ~Pl
Re: [Lldb-commits] [PATCH] D13951: [LLDB] Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.
This revision was automatically updated to reflect the committed changes. Closed by commit rL250925: Fix Clang-tidy modernize-use-override warnings in some files in… (authored by eugenezelenko). Changed prior to commit: http://reviews.llvm.org/D13951?vs=38031&id=38032#toc Repository: rL LLVM http://reviews.llvm.org/D13951 Files: lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.h lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h lldb/trunk/source/Plugins/Process/Utility/RegisterContextThreadMemory.h lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h lldb/trunk/source/Plugins/Process/Utility/ThreadMemory.h lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h Index: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h === --- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h +++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h @@ -1,24 +1,30 @@ -//===-- OperatingSystemGo.h --*- C++ -*-===// +//===-- OperatingSystemGo.h -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---===// +//===--===// #ifndef _liblldb_OperatingSystemGo_h_ #define _liblldb_OperatingSystemGo_h_ -#include - +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/Target/OperatingSystem.h" class DynamicRegisterInfo; class OperatingSystemGo : public lldb_private::OperatingSystem { - public: +public: +OperatingSystemGo(lldb_private::Process *process); + +~OperatingSystemGo() override = default; + //-- // Static Functions //-- @@ -35,38 +41,32 @@ static const char *GetPluginDescriptionStatic(); //-- -// Class Methods -//-- -OperatingSystemGo(lldb_private::Process *process); - -virtual ~OperatingSystemGo(); - -//-- // lldb_private::PluginInterface Methods //-- -virtual lldb_private::ConstString GetPluginName(); +lldb_private::ConstString GetPluginName() override; -virtual uint32_t GetPluginVersion(); +uint32_t GetPluginVersion() override; //-- // lldb_private::OperatingSystem Methods //-- -virtual bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &real_thread_list, - lldb_private::ThreadList &new_thread_list); +bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, + lldb_private::ThreadList &real_thread_list, + lldb_private::ThreadList &new_thread_list) override; -virtual void ThreadWasSelected(lldb_private::Thread *thread); +void ThreadWasSelected(lldb_private::Thread *thread) override; -virtual lldb::RegisterContextSP CreateRegisterContextForThread(lldb_private::Thread *thread, - lldb::addr_t reg_data_addr); +lldb::RegisterContextSP CreateRegisterContextForThread(lldb_private::Thread *thread, + lldb::addr_t reg_data_addr) override; -virtual lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread); +lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread) override; //-- // Method for lazy creation of threads on demand //-- -virtual lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context); +lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t cont
[Lldb-commits] [PATCH] D13952: Revert "Made the REPL choose a default language if only one REPL can be chosen."
sivachandra created this revision. sivachandra added a reviewer: spyffe. sivachandra added a subscriber: lldb-commits. This reverts commit babd6dd74e316b1fcd9d171d7d8c83845d51a487. http://reviews.llvm.org/D13952 Files: include/lldb/Core/PluginManager.h include/lldb/Target/Language.h include/lldb/lldb-private-interfaces.h source/Core/Debugger.cpp source/Core/PluginManager.cpp source/Target/Language.cpp source/Target/Target.cpp Index: source/Target/Target.cpp === --- source/Target/Target.cpp +++ source/Target/Target.cpp @@ -218,19 +218,7 @@ { if (language == eLanguageTypeUnknown) { -std::set repl_languages; - -Language::GetLanguagesSupportingREPLs(repl_languages); - -if (repl_languages.size() == 1) -{ -language = *repl_languages.begin(); -} -else -{ -err.SetErrorStringWithFormat("Multiple possible REPL languages. Please specify a language."); -return REPLSP(); // must provide a language -} +return REPLSP(); // must provide a language } REPLMap::iterator pos = m_repl_map.find(language); Index: source/Target/Language.cpp === --- source/Target/Language.cpp +++ source/Target/Language.cpp @@ -299,17 +299,6 @@ } } -static void -GetLanguagesSupportingREPLs (std::set &languages) -{ -uint32_t idx = 0; - -while (REPLEnumerateSupportedLanguages enumerate = PluginManager::GetREPLEnumerateSupportedLanguagesCallbackAtIndex(idx++)) -{ -(*enumerate)(languages); -} -} - std::unique_ptr Language::GetTypeScavenger () { Index: source/Core/PluginManager.cpp === --- source/Core/PluginManager.cpp +++ source/Core/PluginManager.cpp @@ -2662,7 +2662,6 @@ ConstString name; std::string description; REPLCreateInstance create_callback; -REPLEnumerateSupportedLanguages enumerate_languages_callback; }; typedef std::vector REPLInstances; @@ -2684,8 +2683,7 @@ bool PluginManager::RegisterPlugin (const ConstString &name, const char *description, - REPLCreateInstance create_callback, - REPLEnumerateSupportedLanguages enumerate_languages_callback) + REPLCreateInstance create_callback) { if (create_callback) { @@ -2695,7 +2693,6 @@ if (description && description[0]) instance.description = description; instance.create_callback = create_callback; -instance.enumerate_languages_callback = enumerate_languages_callback; Mutex::Locker locker (GetREPLMutex ()); GetREPLInstances ().push_back (instance); } Index: source/Core/Debugger.cpp === --- source/Core/Debugger.cpp +++ source/Core/Debugger.cpp @@ -1805,6 +1805,11 @@ { Error err; FileSpec repl_executable; +if (language == eLanguageTypeUnknown) +{ +err.SetErrorString ("must specify a language for a REPL"); // TODO make it possible to specify a default language +return err; +} Target *const target = nullptr; // passing in an empty target means the REPL must create one Index: include/lldb/lldb-private-interfaces.h === --- include/lldb/lldb-private-interfaces.h +++ include/lldb/lldb-private-interfaces.h @@ -51,7 +51,6 @@ typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); -typedef void (*REPLEnumerateSupportedLanguages) (std::set &languages); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Index: include/lldb/Target/Language.h === --- include/lldb/Target/Language.h +++ include/lldb/Target/Language.h @@ -149,9 +149,6 @@ static void GetLanguagesSupportingTypeSystems (std::set &languages, std::set &languages_for_expressions); - -static void -GetLanguagesSupportingREPLs (std::set &languages); protected: //-- Index: include/lldb/Core/PluginManager.h === --- include/lldb/Core/PluginManager.h +++ include/lldb/Core/PluginMana
[Lldb-commits] [lldb] r250927 - Revert "Made the REPL choose a default language if only one REPL can be chosen."
Author: sivachandra Date: Wed Oct 21 13:58:01 2015 New Revision: 250927 URL: http://llvm.org/viewvc/llvm-project?rev=250927&view=rev Log: Revert "Made the REPL choose a default language if only one REPL can be chosen." Summary: This reverts commit babd6dd74e316b1fcd9d171d7d8c83845d51a487. Reviewers: spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13952 Modified: lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/PluginManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250927&r1=250926&r2=250927&view=diff == --- lldb/trunk/include/lldb/Core/PluginManager.h (original) +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 13:58:01 2015 @@ -449,8 +449,7 @@ public: static bool RegisterPlugin (const ConstString &name, const char *description, -REPLCreateInstance create_callback, -REPLEnumerateSupportedLanguages enumerate_languages_callback); +REPLCreateInstance create_callback); static bool UnregisterPlugin (REPLCreateInstance create_callback); @@ -461,12 +460,6 @@ public: static REPLCreateInstance GetREPLCreateCallbackForPluginName (const ConstString &name); -static REPLEnumerateSupportedLanguages -GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); - -static REPLEnumerateSupportedLanguages -GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); - //-- // Some plug-ins might register a DebuggerInitializeCallback // callback when registering the plug-in. After a new Debugger Modified: lldb/trunk/include/lldb/Target/Language.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250927&r1=250926&r2=250927&view=diff == --- lldb/trunk/include/lldb/Target/Language.h (original) +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 13:58:01 2015 @@ -149,9 +149,6 @@ public: static void GetLanguagesSupportingTypeSystems (std::set &languages, std::set &languages_for_expressions); - -static void -GetLanguagesSupportingREPLs (std::set &languages); protected: //-- Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250927&r1=250926&r2=250927&view=diff == --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 13:58:01 2015 @@ -51,7 +51,6 @@ namespace lldb_private typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); -typedef void (*REPLEnumerateSupportedLanguages) (std::set &languages); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250927&r1=250926&r2=250927&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 13:58:01 2015 @@ -1805,6 +1805,11 @@ Debugger::RunREPL (LanguageType language { Error err; FileSpec repl_executable; +if (language == eLanguageTypeUnknown) +{ +err.SetErrorString ("must specify a language for a REPL"); // TODO make it possible to specify a default language +return err; +} Target *const target = nullptr; // passing in an empty target means the REPL must create one Modified: lldb/trunk/source/Core/PluginManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=250927&r1=250926&r2=250927&view=diff
Re: [Lldb-commits] [PATCH] D13952: Revert "Made the REPL choose a default language if only one REPL can be chosen."
sivachandra added a comment. I am going to put this in to fix the build. http://reviews.llvm.org/D13952 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13952: Revert "Made the REPL choose a default language if only one REPL can be chosen."
This revision was automatically updated to reflect the committed changes. Closed by commit rL250927: Revert "Made the REPL choose a default language if only one REPL can be chosen." (authored by sivachandra). Changed prior to commit: http://reviews.llvm.org/D13952?vs=38033&id=38034#toc Repository: rL LLVM http://reviews.llvm.org/D13952 Files: lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Target.cpp Index: lldb/trunk/include/lldb/lldb-private-interfaces.h === --- lldb/trunk/include/lldb/lldb-private-interfaces.h +++ lldb/trunk/include/lldb/lldb-private-interfaces.h @@ -51,7 +51,6 @@ typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); -typedef void (*REPLEnumerateSupportedLanguages) (std::set &languages); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Index: lldb/trunk/include/lldb/Core/PluginManager.h === --- lldb/trunk/include/lldb/Core/PluginManager.h +++ lldb/trunk/include/lldb/Core/PluginManager.h @@ -449,8 +449,7 @@ static bool RegisterPlugin (const ConstString &name, const char *description, -REPLCreateInstance create_callback, -REPLEnumerateSupportedLanguages enumerate_languages_callback); +REPLCreateInstance create_callback); static bool UnregisterPlugin (REPLCreateInstance create_callback); @@ -461,12 +460,6 @@ static REPLCreateInstance GetREPLCreateCallbackForPluginName (const ConstString &name); -static REPLEnumerateSupportedLanguages -GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); - -static REPLEnumerateSupportedLanguages -GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); - //-- // Some plug-ins might register a DebuggerInitializeCallback // callback when registering the plug-in. After a new Debugger Index: lldb/trunk/include/lldb/Target/Language.h === --- lldb/trunk/include/lldb/Target/Language.h +++ lldb/trunk/include/lldb/Target/Language.h @@ -149,9 +149,6 @@ static void GetLanguagesSupportingTypeSystems (std::set &languages, std::set &languages_for_expressions); - -static void -GetLanguagesSupportingREPLs (std::set &languages); protected: //-- Index: lldb/trunk/source/Target/Language.cpp === --- lldb/trunk/source/Target/Language.cpp +++ lldb/trunk/source/Target/Language.cpp @@ -299,17 +299,6 @@ } } -static void -GetLanguagesSupportingREPLs (std::set &languages) -{ -uint32_t idx = 0; - -while (REPLEnumerateSupportedLanguages enumerate = PluginManager::GetREPLEnumerateSupportedLanguagesCallbackAtIndex(idx++)) -{ -(*enumerate)(languages); -} -} - std::unique_ptr Language::GetTypeScavenger () { Index: lldb/trunk/source/Target/Target.cpp === --- lldb/trunk/source/Target/Target.cpp +++ lldb/trunk/source/Target/Target.cpp @@ -218,19 +218,7 @@ { if (language == eLanguageTypeUnknown) { -std::set repl_languages; - -Language::GetLanguagesSupportingREPLs(repl_languages); - -if (repl_languages.size() == 1) -{ -language = *repl_languages.begin(); -} -else -{ -err.SetErrorStringWithFormat("Multiple possible REPL languages. Please specify a language."); -return REPLSP(); // must provide a language -} +return REPLSP(); // must provide a language } REPLMap::iterator pos = m_repl_map.find(language); Index: lldb/trunk/source/Core/Debugger.cpp === --- lldb/trunk/source/Core/Debugger.cpp +++ lldb/trunk/source/Core/Debugger.cpp @@ -1805,6 +1805,11 @@ { Error err; FileSpec repl_executable; +if (language == eLanguageTypeUnknown) +{
Re: [Lldb-commits] [lldb] r250913 - Made the REPL choose a default language if only one REPL can be chosen.
Yeah, this was a really lousy commit. I’m sorry I committed without checking whether it linked. Thanks for reverting. I will fix this and re-commit. Sean > On Oct 21, 2015, at 11:43 AM, Siva Chandra wrote: > > This breaks the build because of two things: > > 1. The function GetLanguagesSupportingREPLs is declared static in > Language.cpp, but Language.h has it declared as a static method. > 2. There is a declaration for a static method > GetREPLEnumerateSupportedLanguagesCallbackAtIndex in PluginManager, > but no definition anywhere. > > On Wed, Oct 21, 2015 at 10:43 AM, Sean Callanan via lldb-commits > wrote: >> Author: spyffe >> Date: Wed Oct 21 12:43:18 2015 >> New Revision: 250913 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=250913&view=rev >> Log: >> Made the REPL choose a default language if only one REPL can be chosen. >> This requires REPLs to enumerate the languages they support. >> >> Modified: >>lldb/trunk/include/lldb/Core/PluginManager.h >>lldb/trunk/include/lldb/Target/Language.h >>lldb/trunk/include/lldb/lldb-private-interfaces.h >>lldb/trunk/source/Core/Debugger.cpp >>lldb/trunk/source/Core/PluginManager.cpp >>lldb/trunk/source/Target/Language.cpp >>lldb/trunk/source/Target/Target.cpp >> >> Modified: lldb/trunk/include/lldb/Core/PluginManager.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250913&r1=250912&r2=250913&view=diff >> == >> --- lldb/trunk/include/lldb/Core/PluginManager.h (original) >> +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 12:43:18 2015 >> @@ -449,7 +449,8 @@ public: >> static bool >> RegisterPlugin (const ConstString &name, >> const char *description, >> -REPLCreateInstance create_callback); >> +REPLCreateInstance create_callback, >> +REPLEnumerateSupportedLanguages >> enumerate_languages_callback); >> >> static bool >> UnregisterPlugin (REPLCreateInstance create_callback); >> @@ -460,6 +461,12 @@ public: >> static REPLCreateInstance >> GetREPLCreateCallbackForPluginName (const ConstString &name); >> >> +static REPLEnumerateSupportedLanguages >> +GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); >> + >> +static REPLEnumerateSupportedLanguages >> +GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const >> ConstString &name); >> + >> //-- >> // Some plug-ins might register a DebuggerInitializeCallback >> // callback when registering the plug-in. After a new Debugger >> >> Modified: lldb/trunk/include/lldb/Target/Language.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250913&r1=250912&r2=250913&view=diff >> == >> --- lldb/trunk/include/lldb/Target/Language.h (original) >> +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 12:43:18 2015 >> @@ -149,6 +149,9 @@ public: >> static void >> GetLanguagesSupportingTypeSystems (std::set >> &languages, >>std::set >> &languages_for_expressions); >> + >> +static void >> +GetLanguagesSupportingREPLs (std::set &languages); >> >> protected: >> //-- >> >> Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250913&r1=250912&r2=250913&view=diff >> == >> --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) >> +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 12:43:18 >> 2015 >> @@ -51,6 +51,7 @@ namespace lldb_private >> typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) >> (lldb::LanguageType language, Module *module, Target *target); >> typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, >> lldb::LanguageType language, Debugger *debugger, Target *target, const char >> *repl_options); >> typedef void (*TypeSystemEnumerateSupportedLanguages) >> (std::set &languages_for_types, >> std::set &languages_for_expressions); >> +typedef void (*REPLEnumerateSupportedLanguages) >> (std::set &languages); >> typedef int (*ComparisonFunction)(const void *, const void *); >> typedef void (*DebuggerInitializeCallback)(Debugger &debugger); >> >> >> Modified: lldb/trunk/source/Core/Debugger.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250913&r1=250912&r2=250913&view=diff >> == >> --- lldb/trunk/source/Core/Debugger.cpp (origi
[Lldb-commits] [lldb] r250928 - Fixed version of r250913, which actually implements all the static functions.
Author: spyffe Date: Wed Oct 21 14:14:33 2015 New Revision: 250928 URL: http://llvm.org/viewvc/llvm-project?rev=250928&view=rev Log: Fixed version of r250913, which actually implements all the static functions. Thanks to Siva Chandra and Oleksiy Vyalov for pouncing on this. Modified: lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/PluginManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/include/lldb/Core/PluginManager.h (original) +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 14:14:33 2015 @@ -449,7 +449,8 @@ public: static bool RegisterPlugin (const ConstString &name, const char *description, -REPLCreateInstance create_callback); +REPLCreateInstance create_callback, +REPLEnumerateSupportedLanguages enumerate_languages_callback); static bool UnregisterPlugin (REPLCreateInstance create_callback); @@ -460,6 +461,12 @@ public: static REPLCreateInstance GetREPLCreateCallbackForPluginName (const ConstString &name); +static REPLEnumerateSupportedLanguages +GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); + +static REPLEnumerateSupportedLanguages +GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); + //-- // Some plug-ins might register a DebuggerInitializeCallback // callback when registering the plug-in. After a new Debugger Modified: lldb/trunk/include/lldb/Target/Language.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/include/lldb/Target/Language.h (original) +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 14:14:33 2015 @@ -149,6 +149,9 @@ public: static void GetLanguagesSupportingTypeSystems (std::set &languages, std::set &languages_for_expressions); + +static void +GetLanguagesSupportingREPLs (std::set &languages); protected: //-- Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 14:14:33 2015 @@ -51,6 +51,7 @@ namespace lldb_private typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); +typedef void (*REPLEnumerateSupportedLanguages) (std::set &languages); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 14:14:33 2015 @@ -1805,11 +1805,6 @@ Debugger::RunREPL (LanguageType language { Error err; FileSpec repl_executable; -if (language == eLanguageTypeUnknown) -{ -err.SetErrorString ("must specify a language for a REPL"); // TODO make it possible to specify a default language -return err; -} Target *const target = nullptr; // passing in an empty target means the REPL must create one Modified: lldb/trunk/source/Core/PluginManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/source/Core/PluginManager.cpp (original) +++ lldb/trunk/source/Core/PluginManager.cpp Wed O
[Lldb-commits] [lldb] r250930 - [SBValue] Add a method GetNumChildren(uint32_t max)
Author: sivachandra Date: Wed Oct 21 14:28:08 2015 New Revision: 250930 URL: http://llvm.org/viewvc/llvm-project?rev=250930&view=rev Log: [SBValue] Add a method GetNumChildren(uint32_t max) Summary: Along with this, support for an optional argument to the "num_children" method of a Python synthetic child provider has also been added. These have been added with the following use case in mind: Synthetic child providers currently have a method "has_children" and "num_children". While the former is good enough to know if there are children, it does not give any insight into how many children there are. Though the latter serves this purpose, calculating the number for children of a data structure could be an O(N) operation if the data structure has N children. The new method added in this change provide a middle ground. One can call GetNumChildren(K) to know if a child exists at an index K which can be as large as the callers tolerance can be. If the caller wants to know about children beyond K, it can make an other call with 2K. If the synthetic child provider maintains state about it counting till K previosly, then the next call is only an O(K) operation. Infact, all calls made progressively with steps of K will be O(K) operations. Reviewers: vharron, clayborg, granata.enrico Subscribers: labath, lldb-commits Differential Revision: http://reviews.llvm.org/D13778 Modified: lldb/trunk/include/lldb/API/SBValue.h lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/include/lldb/Core/ValueObjectCast.h lldb/trunk/include/lldb/Core/ValueObjectChild.h lldb/trunk/include/lldb/Core/ValueObjectConstResult.h lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h lldb/trunk/include/lldb/Core/ValueObjectMemory.h lldb/trunk/include/lldb/Core/ValueObjectRegister.h lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h lldb/trunk/include/lldb/Core/ValueObjectVariable.h lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h lldb/trunk/scripts/Python/python-wrapper.swig lldb/trunk/scripts/interface/SBValue.i lldb/trunk/source/API/SBValue.cpp lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Core/ValueObjectCast.cpp lldb/trunk/source/Core/ValueObjectChild.cpp lldb/trunk/source/Core/ValueObjectConstResult.cpp lldb/trunk/source/Core/ValueObjectDynamicValue.cpp lldb/trunk/source/Core/ValueObjectMemory.cpp lldb/trunk/source/Core/ValueObjectRegister.cpp lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp lldb/trunk/source/Core/ValueObjectVariable.cpp lldb/trunk/source/DataFormatters/TypeSynthetic.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/main.cpp lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py Modified: lldb/trunk/include/lldb/API/SBValue.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBValue.h?rev=250930&r1=250929&r2=250930&view=diff == --- lldb/trunk/include/lldb/API/SBValue.h (original) +++ lldb/trunk/include/lldb/API/SBValue.h Wed Oct 21 14:28:08 2015 @@ -330,6 +330,9 @@ public: uint32_t GetNumChildren (); +uint32_t +GetNumChildren (uint32_t max); + void * GetOpaqueType(); Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=250930&r1=250929&r2=250930&view=diff == --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Wed Oct 21 14:28:08 2015 @@ -595,7 +595,7 @@ public: GetIndexOfChildWithName (const ConstString &name); size_t -GetNumChildren (); +GetNumChildren (uint32_t max=UINT32_MAX); const Value & GetValue() const; @@ -1204,7 +1204,7 @@ protected: // Should only be called by ValueObject::GetNumChildren() virtual size_t -CalculateNumChildren() = 0; +CalculateNumChildren(uint32_t max=UINT32_MAX) = 0; void SetNumChildren (size_t num_children); Modified: lldb/trunk/include/lldb/Core/ValueObjectCast.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectCast.h?rev=250930&r1=250929&r2=250930&view=diff == --- lldb/trunk/include/lldb/Core/ValueObjectCast.h (original) +++ lldb/trunk/include/lldb/Core/ValueObjectCast.h Wed Oct 21 14:28:08 2015 @@ -35
[Lldb-commits] [lldb] r250931 - Fix error handling when there are no REPLs installed.
Author: spyffe Date: Wed Oct 21 14:31:17 2015 New Revision: 250931 URL: http://llvm.org/viewvc/llvm-project?rev=250931&view=rev Log: Fix error handling when there are no REPLs installed. Before, in the absence of any configured REPLs, LLDB would act as if there were multiple possible REPL options, whereas actually no REPL language is supported. Now we make a better error. Modified: lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250931&r1=250930&r2=250931&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 14:31:17 2015 @@ -1806,6 +1806,28 @@ Debugger::RunREPL (LanguageType language Error err; FileSpec repl_executable; +if (language == eLanguageTypeUnknown) +{ +std::set repl_languages; + +Language::GetLanguagesSupportingREPLs(repl_languages); + +if (repl_languages.size() == 1) +{ +language = *repl_languages.begin(); +} +else if (repl_languages.size() == 0) +{ +err.SetErrorStringWithFormat("LLDB isn't configured with support support for any REPLs."); +return err; +} +else +{ +err.SetErrorStringWithFormat("Multiple possible REPL languages. Please specify a language."); +return err; +} +} + Target *const target = nullptr; // passing in an empty target means the REPL must create one REPLSP repl_sp(REPL::Create(err, language, this, target, repl_options)); Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250931&r1=250930&r2=250931&view=diff == --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Wed Oct 21 14:31:17 2015 @@ -226,10 +226,15 @@ Target::GetREPL (Error &err, lldb::Langu { language = *repl_languages.begin(); } +else if (repl_languages.size() == 0) +{ +err.SetErrorStringWithFormat("LLDB isn't configured with support support for any REPLs."); +return REPLSP(); +} else { err.SetErrorStringWithFormat("Multiple possible REPL languages. Please specify a language."); -return REPLSP(); // must provide a language +return REPLSP(); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250933 - Add domain socket support to gdb-remote protocol and lldb-server.
Author: ovyalov Date: Wed Oct 21 14:34:26 2015 New Revision: 250933 URL: http://llvm.org/viewvc/llvm-project?rev=250933&view=rev Log: Add domain socket support to gdb-remote protocol and lldb-server. http://reviews.llvm.org/D13881 Added: lldb/trunk/tools/lldb-server/Acceptor.cpp lldb/trunk/tools/lldb-server/Acceptor.h Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp lldb/trunk/source/Plugins/Platform/Android/AdbClient.h lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/tools/lldb-server/CMakeLists.txt lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp lldb/trunk/tools/lldb-server/lldb-platform.cpp Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=250933&r1=250932&r2=250933&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Oct 21 14:34:26 2015 @@ -103,6 +103,8 @@ 2579065C1BD0488100178368 /* TCPSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065A1BD0488100178368 /* TCPSocket.cpp */; }; 2579065D1BD0488100178368 /* UDPSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065B1BD0488100178368 /* UDPSocket.cpp */; }; 2579065F1BD0488D00178368 /* DomainSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065E1BD0488D00178368 /* DomainSocket.cpp */; }; + 257906641BD5AFD000178368 /* Acceptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 257906621BD5AFD000178368 /* Acceptor.cpp */; }; + 257906651BD5AFD000178368 /* Acceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 257906631BD5AFD000178368 /* Acceptor.h */; }; 257E47171AA56C2000A62F81 /* ModuleCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 257E47151AA56C2000A62F81 /* ModuleCache.cpp */; }; 25EF23781AC09B3700908DF0 /* AdbClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 25EF23751AC09AD800908DF0 /* AdbClient.cpp */; }; 260157C61885F51C00F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; }; @@ -1207,6 +1209,8 @@ 2579065A1BD0488100178368 /* TCPSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TCPSocket.cpp; sourceTree = ""; }; 2579065B1BD0488100178368 /* UDPSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UDPSocket.cpp; sourceTree = ""; }; 2579065E1BD0488D00178368 /* DomainSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DomainSocket.cpp; sourceTree = ""; }; + 257906621BD5AFD000178368 /* Acceptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Acceptor.cpp; path = "tools/lldb-server/Acceptor.cpp"; sourceTree = ""; }; + 257906631BD5AFD000178368 /* Acceptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Acceptor.h; path = "tools/lldb-server/Acceptor.h"; sourceTree = ""; }; 257E47151AA56C2000A62F81 /* ModuleCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleCache.cpp; path = source/Utility/ModuleCache.cpp; sourceTree = ""; }; 257E47161AA56C2000A62F81 /* ModuleCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleCache.h; path = source/Utility/ModuleCache.h; sourceTree = ""; }; 25EF23751AC09AD800908DF0 /* AdbClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AdbClient.cpp
Re: [Lldb-commits] [PATCH] D13881: Add domain socket support to gdb-remote protocol and lldb-server.
ovyalov closed this revision. ovyalov added a comment. Files: /lldb/trunk/lldb.xcodeproj/project.pbxproj /lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp /lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp /lldb/trunk/source/Plugins/Platform/Android/AdbClient.h /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h /lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp /lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp /lldb/trunk/tools/lldb-server/Acceptor.cpp /lldb/trunk/tools/lldb-server/Acceptor.h /lldb/trunk/tools/lldb-server/CMakeLists.txt /lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp /lldb/trunk/tools/lldb-server/lldb-platform.cpp Users: ovyalov (Author) http://reviews.llvm.org/rL250933 http://reviews.llvm.org/D13881 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250937 - Revert r250925 in source/Plugins/OperatingSystem/Go to fix MSVC builds failures.
Author: eugenezelenko Date: Wed Oct 21 15:03:58 2015 New Revision: 250937 URL: http://llvm.org/viewvc/llvm-project?rev=250937&view=rev Log: Revert r250925 in source/Plugins/OperatingSystem/Go to fix MSVC builds failures. Modified: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h Modified: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp?rev=250937&r1=250936&r2=250937&view=diff == --- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp (original) +++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp Wed Oct 21 15:03:58 2015 @@ -1,4 +1,4 @@ -//===-- OperatingSystemGo.cpp ---*- C++ -*-===// +//===-- OperatingSystemGo.cpp *- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,15 +6,13 @@ // License. See LICENSE.TXT for details. // //===--===// +#include "OperatingSystemGo.h" // C Includes // C++ Includes #include // Other libraries and framework includes -// Project includes -#include "OperatingSystemGo.h" - #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" @@ -58,7 +56,13 @@ enum class PluginProperties : public Properties { -public: + public: +static ConstString +GetSettingName() +{ +return OperatingSystemGo::GetPluginNameStatic(); +} + PluginProperties() : Properties() { @@ -66,13 +70,7 @@ public: m_collection_sp->Initialize(g_properties); } -~PluginProperties() override = default; - -static ConstString -GetSettingName() -{ -return OperatingSystemGo::GetPluginNameStatic(); -} +virtual ~PluginProperties() {} bool GetEnableGoroutines() @@ -102,7 +100,10 @@ GetGlobalPluginProperties() class RegisterContextGo : public RegisterContextMemory { -public: + public: +//-- +// Constructors and Destructors +//-- RegisterContextGo(lldb_private::Thread &thread, uint32_t concrete_frame_idx, DynamicRegisterInfo ®_info, lldb::addr_t reg_data_addr) : RegisterContextMemory(thread, concrete_frame_idx, reg_info, reg_data_addr) @@ -117,11 +118,10 @@ public: m_reg_data.SetData(reg_data_sp); } -~RegisterContextGo() override = default; +virtual ~RegisterContextGo() {} -bool -ReadRegister(const lldb_private::RegisterInfo *reg_info, - lldb_private::RegisterValue ®_value) override +virtual bool +ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue ®_value) { switch (reg_info->kinds[eRegisterKindGeneric]) { @@ -134,9 +134,8 @@ public: } } -bool -WriteRegister(const lldb_private::RegisterInfo *reg_info, - const lldb_private::RegisterValue ®_value) override +virtual bool +WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue ®_value) { switch (reg_info->kinds[eRegisterKindGeneric]) { @@ -148,11 +147,11 @@ public: } } -private: + private: DISALLOW_COPY_AND_ASSIGN(RegisterContextGo); }; -} // anonymous namespace +} // namespace struct OperatingSystemGo::Goroutine { @@ -220,12 +219,6 @@ OperatingSystemGo::CreateInstance(Proces return new OperatingSystemGo(process); } -OperatingSystemGo::OperatingSystemGo(lldb_private::Process *process) -: OperatingSystem(process) -, m_reginfo(new DynamicRegisterInfo) -{ -} - ConstString OperatingSystemGo::GetPluginNameStatic() { @@ -239,6 +232,16 @@ OperatingSystemGo::GetPluginDescriptionS return "Operating system plug-in that reads runtime data-structures for goroutines."; } +OperatingSystemGo::OperatingSystemGo(lldb_private::Process *process) +: OperatingSystem(process) +, m_reginfo(new DynamicRegisterInfo) +{ +} + +OperatingSystemGo::~OperatingSystemGo() +{ +} + bool OperatingSystemGo::Init(ThreadList &threads) { Modified: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h?rev=250937&r1=250936&r2=250937&view=diff == --- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h (original) +++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h Wed Oct 21 15:03:58 20
Re: [Lldb-commits] [PATCH] D13073: Add an expression parser for Go
On Tue, Oct 20, 2015 at 7:40 PM Jim Ingham via lldb-commits < lldb-commits@lists.llvm.org> wrote: > jingham added a comment. > > The generic parts of this change look fine to me, with a few inlined style > comments. > > I didn't read the Go specific parts of this in detail, I assume you're > going to get those right. I mentioned a couple of style things inline, > though I didn't mark everywhere that they occurred. Particularly, the > construct: > > Foo::Foo () : > > m_ivar1 > , m_ivar2 > > etc. looks very odd, and is not the way we do it anywhere else in lldb. > Please don't write it that way. > > Also, we try to always call shared pointers foo_sp and unique pointers > foo_up. The life cycle of these guys is enough different from pointers > that it is good to be able to see what they are in code without having to > trace them back to the definition. > > With those style changes this is okay by me. > > > > Comment at: source/Expression/LLVMUserExpression.cpp:43-60 > @@ +42,20 @@ > + > +LLVMUserExpression::LLVMUserExpression(ExecutionContextScope &exe_scope, > const char *expr, const char *expr_prefix, > + lldb::LanguageType language, > ResultType desired_type) > +: UserExpression(exe_scope, expr, expr_prefix, language, desired_type) > +, m_stack_frame_bottom(LLDB_INVALID_ADDRESS) > +, m_stack_frame_top(LLDB_INVALID_ADDRESS) > +, m_transformed_text() > +, m_execution_unit_sp() > +, m_materializer_ap() > +, m_jit_module_wp() > +, m_enforce_valid_object(true) > +, m_in_cplusplus_method(false) > +, m_in_objectivec_method(false) > +, m_in_static_method(false) > +, m_needs_object_ptr(false) > +, m_const_object(false) > +, m_target(NULL) > +, m_can_interpret(false) > +, m_materialized_address(LLDB_INVALID_ADDRESS) > +{ > > Don't write initializers with the commas in front like this. We don't do > it this way anywhere else in lldb, and it looks really weird... > Sorry, this is really clang-format's fault. Sigh, I really need to get off my you-know-what and get this fixed in clang-format because it's like one of the only things left in clang-format that doesn't do what LLDB needs. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250952 - Fix typo so that "./dotest.py --results-formatter=curses_results.Curses --results-file=/dev/stdout" works again.
Author: gclayton Date: Wed Oct 21 16:55:16 2015 New Revision: 250952 URL: http://llvm.org/viewvc/llvm-project?rev=250952&view=rev Log: Fix typo so that "./dotest.py --results-formatter=curses_results.Curses --results-file=/dev/stdout" works again. Modified: lldb/trunk/test/lldbcurses.py Modified: lldb/trunk/test/lldbcurses.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbcurses.py?rev=250952&r1=250951&r2=250952&view=diff == --- lldb/trunk/test/lldbcurses.py (original) +++ lldb/trunk/test/lldbcurses.py Wed Oct 21 16:55:16 2015 @@ -430,7 +430,7 @@ class Window(object): n is the number of times to go through the event loop before exiting''' done = False while not done and n > 0: -c = self.get_key(timeoue_msec) +c = self.get_key(timeout_msec) if c != -1: try: self.handle_key(c) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250953 - Fix lldb-server - write null terminating symbol along with port number.
Author: ovyalov Date: Wed Oct 21 16:58:22 2015 New Revision: 250953 URL: http://llvm.org/viewvc/llvm-project?rev=250953&view=rev Log: Fix lldb-server - write null terminating symbol along with port number. Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=250953&r1=250952&r2=250953&view=diff == --- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original) +++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Wed Oct 21 16:58:22 2015 @@ -257,7 +257,7 @@ writeSocketIdToPipe(Pipe &port_pipe, con { size_t bytes_written = 0; // Write the port number as a C string with the NULL terminator. -return port_pipe.Write(socket_id.c_str(), socket_id.size(), bytes_written); +return port_pipe.Write(socket_id.c_str(), socket_id.size() + 1, bytes_written); } Error ___ 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 added a comment. This ncurses header is now the blocker for buildslave. [2817/3214] Building CXX object tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o FAILED: /usr/bin/g++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated-register -Wno-vla-extension -fno-exceptions -fno-rtti -fPIC -fPIC -DNDEBUG -Itools/lldb/source/Core -I/home/motus/build/build/llvm/tools/lldb/source/Core -I/home/motus/build/build/llvm/tools/lldb/include -Itools/lldb/include -Iinclude -I/home/motus/build/build/llvm/include -I/usr/pkg/include/python2.7 -I/home/motus/build/build/llvm/tools/lldb/../clang/include -Itools/lldb/../clang/include -I/home/motus/build/build/llvm/tools/lldb/source/. -fno-exceptions -fno-rtti -MMD -MT tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o -MF tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o.d -o tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o -c /home/motus/build/build/llvm/tools/lldb/source/Core/IOHandler.cpp /home/motus/build/build/llvm/tools/lldb/source/Core/IOHandler.cpp:32:21: fatal error: ncurses.h: No such file or directory #include ^ compilation terminated. ninja: build stopped: subcommand failed. program finished with exit code 1 elapsedTime=2238.962841 http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/139/steps/ninja%20build%20local/logs/stdio 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] D13964: Fix libstdc++ data formatters on Ubuntu 15.10 x86_64
tfiala created this revision. tfiala added a reviewer: granata.enrico. tfiala added a subscriber: lldb-commits. This change fixes data formatters for libstdc++ 6.0.21: * Adds std::string data formatter support in C++ (rather than Python) for 6.0.21+. * Uses std::list count field support when present. * Fixes std container and std::string failing tests on Ubuntu 15.10 x86_64. * Fixes what looks like a broken compilation on TOT which assumes libc++ is used but doesn't guarantee it, then uses libc++ details, which breaks when compiling with libstdc++. (The test would later figure it out, but only after the failing build step). Modified the using of libc++ to define a LLDB_USING_LIBCPP flag when we're really compiling with it, and conditionally compile the libc++-specific code so it doesn't break when built with libstdc++. Anybody on the Linux/BSD side, feel free to review. This has been tested on Ubuntu 14.04 x86_64 (with libstdc++ 6.0.20) and Ubuntu 15.10 x86_64 (with libstdc++ 6.0.21). Both built using clang-3.6 and using clang-3.6 inferiors. http://reviews.llvm.org/D13964 Files: examples/synthetic/gnu_libstdcpp.py source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp source/Plugins/Language/CPlusPlus/LibStdcpp.cpp source/Plugins/Language/CPlusPlus/LibStdcpp.h test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py test/make/Makefile.rules Index: test/make/Makefile.rules === --- test/make/Makefile.rules +++ test/make/Makefile.rules @@ -296,12 +296,12 @@ ifeq "$(OS)" "Linux" # This is the default install location on Ubuntu 14.04 ifneq ($(wildcard /usr/include/c++/v1/.),) -CXXFLAGS += -stdlib=libc++ +CXXFLAGS += -stdlib=libc++ -DLLDB_USING_LIBCPP LDFLAGS += -stdlib=libc++ CXXFLAGS += -I/usr/include/c++/v1 endif else - CXXFLAGS += -stdlib=libc++ + CXXFLAGS += -stdlib=libc++ -DLLDB_USING_LIBCPP LDFLAGS += -stdlib=libc++ endif endif Index: test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py === --- test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py +++ test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py @@ -47,21 +47,21 @@ # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) -self.expect("frame variable", -substrs = ['(std::wstring) s = L"hello world! מזל טוב!"', -'(std::wstring) S = L""', -'(const wchar_t *) mazeltov = 0x','L"מזל טוב"', -'(std::string) q = "hello world"', -'(std::string) Q = "quite a long std::strin with lots of info inside it"']) +var_s = self.frame().FindVariable('s') +var_S = self.frame().FindVariable('S') +var_mazeltov = self.frame().FindVariable('mazeltov') +var_q = self.frame().FindVariable('q') +var_Q = self.frame().FindVariable('Q') -self.runCmd("n") +self.assertTrue(var_s.GetSummary() == 'L"hello world! מזל טוב!"', "s summary wrong") +self.assertTrue(var_S.GetSummary() == 'L""', "S summary wrong") +self.assertTrue(var_mazeltov.GetSummary() == 'L"מזל טוב"', "mazeltov summary wrong") +self.assertTrue(var_q.GetSummary() == '"hello world"', "q summary wrong") +self.assertTrue(var_Q.GetSummary() == '"quite a long std::strin with lots of info inside it"', "Q summary wrong") -self.expect("frame variable", -substrs = ['(std::wstring) s = L"hello world! מזל טוב!"', -'(std::wstring) S = L"!"', -'(const wchar_t *) mazeltov = 0x','L"מזל טוב"', -'(std::string) q = "hello world"', -'(std::string) Q = "quite a long std::strin with lots of info inside it"']) +self.runCmd("next") + +self.assertTrue(var_S.GetSummary() == 'L"!"', "new S summary wrong") if __name__ == '__main__': import atexit Index: test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp === --- test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp +++ test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp @@ -15,13 +15,15 @@ int main() { +#ifdef LLDB_USING_LIBCPP int_list *numbers_list = new int_list{1,2,3,4,5,6,7,8,9,10}; auto *third_elem = numbers_list->__end_.__next_->__next_->__next_; // Set break point at this line. assert(third_elem->__value_ == 3); auto *fifth_elem = third_elem->__next_
Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.
dawn added a subscriber: lldb-commits. Users: sas (Author) http://reviews.llvm.org/rL250335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13964: Fix libstdc++ data formatters on Ubuntu 15.10 x86_64
granata.enrico accepted this revision. granata.enrico added a comment. This revision is now accepted and ready to land. Looks good to me http://reviews.llvm.org/D13964 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.
dawn added a subscriber: dawn. dawn raised a concern with this commit. dawn added a comment. First, sorry for my delay in reviewing your patch, but I've been on vacation and now am at the C++ ANSI meeting in Kona for this week. But... This broke the build of cmake on OSX. We get: [...] [2632/2743] Linking CXX executable bin/debugserver FAILED: : && /usr/bin/c++ -std=c++11 -stdlib=libc++ [...] -o bin/debugserver lib/liblldbDebugserverCommon.a lib/liblldbUtility.a lib/liblldbDebugserverMacOSX_I386.a lib/liblldbDebugserverMacOSX_X86_64.a -framework Cocoa -Wl,-rpath,@executable_path/../lib && cd /Users/testuser/build/workspace/LLVM-Clang-LLDB_master_release_OSX/llvm/build_ninja/bin && /usr/local/Cellar/cmake/3.0.2/bin/cmake -E env CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate codesign --force --sign lldb_codesign debugserver CMake Error: cmake version 3.0.2 Usage: /usr/local/Cellar/cmake/3.0.2/bin/cmake -E [command] [arguments ...] Available commands: chdir dir cmd [args]... - run command in a given directory [...] lldb is built on OSX as: mkdir "$BUILDDIR" && cd "$BUILDDIR" cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_BUILD_TYPE=Release security unlock-keychain -p testuser /Users/testuser/Library/Keychains/login.keychain ninja Does the new "-E env" option require a new version of cmake? Is there a way to change the patch to only add the -E option if cmake supports it? Thanks in advance, -Dawn Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL250335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D13966: [LLDB] Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins/LanguageRuntime; other minor fixes.
Eugene.Zelenko created this revision. Eugene.Zelenko added reviewers: brucem, labath, clayborg. Eugene.Zelenko added a subscriber: lldb-commits. Eugene.Zelenko set the repository for this revision to rL LLVM. I checked this patch on my own build on RHEL 6. Repository: rL LLVM http://reviews.llvm.org/D13966 Files: source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.h source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h === --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h @@ -12,15 +12,13 @@ // C Includes // C++ Includes - // Other libraries and framework includes +#include "clang/AST/ASTContext.h" // Project includes #include "lldb/lldb-private.h" #include "lldb/Target/ObjCLanguageRuntime.h" -#include "clang/AST/ASTContext.h" - namespace lldb_utility { class StringLexer; } @@ -31,9 +29,10 @@ { public: AppleObjCTypeEncodingParser (ObjCLanguageRuntime& runtime); -virtual CompilerType RealizeType (clang::ASTContext &ast_ctx, const char* name, bool for_expression); -virtual ~AppleObjCTypeEncodingParser() {} +~AppleObjCTypeEncodingParser() override = default; +CompilerType RealizeType(clang::ASTContext &ast_ctx, const char* name, bool for_expression) override; + private: struct StructElement { std::string name; @@ -79,4 +78,4 @@ } // namespace lldb_private -#endif // liblldb_AppleObjCTypeEncodingParser_h_ +#endif // liblldb_AppleObjCTypeEncodingParser_h_ Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h === --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h @@ -1,4 +1,4 @@ -//===-- AppleObjCRuntimeV2.h *- C++ -*-===// +//===-- AppleObjCRuntimeV2.h *- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,7 +12,6 @@ // C Includes // C++ Includes - #include #include @@ -30,31 +29,8 @@ public AppleObjCRuntime { public: -static bool classof(const ObjCLanguageRuntime* runtime) -{ -switch (runtime->GetRuntimeVersion()) -{ -case ObjCRuntimeVersions::eAppleObjC_V2: -return true; -default: -return false; -} -} +~AppleObjCRuntimeV2() override = default; -virtual ~AppleObjCRuntimeV2(); - -// These are generic runtime functions: -virtual bool -GetDynamicTypeAndAddress (ValueObject &in_value, - lldb::DynamicValueType use_dynamic, - TypeAndOrName &class_type_or_name, - Address &address, - Value::ValueType &value_type); - -virtual UtilityFunction * -CreateObjectChecker (const char *); - - //-- // Static Functions //-- @@ -69,28 +45,74 @@ static lldb_private::ConstString GetPluginNameStatic(); + +static bool classof(const ObjCLanguageRuntime* runtime) +{ +switch (runtime->GetRuntimeVersion()) +{ +case ObjCRuntimeVersions::eAppleObjC_V2: +return true; +default: +return false; +} +} + +// These are generic runtime functions: +bool +GetDynamicTypeAndAddress(ValueObject &in_value, + lldb::DynamicValueType use_dynamic, + TypeAndOrName &class_type_or_name, + Address &address, + Value::ValueType &value_type) override; +UtilityFunction * +CreateObjectChecker(const char *) override; + //--
[Lldb-commits] [lldb] r250965 - Fix libstdc++ data formatters on Ubuntu 15.10 x86_64
Author: tfiala Date: Wed Oct 21 19:23:38 2015 New Revision: 250965 URL: http://llvm.org/viewvc/llvm-project?rev=250965&view=rev Log: Fix libstdc++ data formatters on Ubuntu 15.10 x86_64 See http://reviews.llvm.org/D13964 for details. Modified: lldb/trunk/examples/synthetic/gnu_libstdcpp.py lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.h lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py lldb/trunk/test/make/Makefile.rules Modified: lldb/trunk/examples/synthetic/gnu_libstdcpp.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/synthetic/gnu_libstdcpp.py?rev=250965&r1=250964&r2=250965&view=diff == --- lldb/trunk/examples/synthetic/gnu_libstdcpp.py (original) +++ lldb/trunk/examples/synthetic/gnu_libstdcpp.py Wed Oct 21 19:23:38 2015 @@ -13,7 +13,7 @@ class StdListSynthProvider: logger = lldb.formatters.Logger.Logger() self.valobj = valobj self.count = None - logger >> "Providing synthetic children for a map named " + str(valobj.GetName()) + logger >> "Providing synthetic children for a list named " + str(valobj.GetName()) def next_node(self,node): logger = lldb.formatters.Logger.Logger() @@ -21,11 +21,20 @@ class StdListSynthProvider: def is_valid(self,node): logger = lldb.formatters.Logger.Logger() - return self.value(self.next_node(node)) != self.node_address + valid = self.value(self.next_node(node)) != self.node_address +if valid: +logger >> "%s is valid" % str(self.valobj.GetName()) +else: +logger >> "synthetic value is not valid" +return valid def value(self,node): logger = lldb.formatters.Logger.Logger() - return node.GetValueAsUnsigned() +value = node.GetValueAsUnsigned() +logger >> "synthetic value for {}: {}".format( +str(self.valobj.GetName()), +value) +return value # Floyd's cycle-finding algorithm # try to detect if this list has a loop @@ -49,7 +58,12 @@ class StdListSynthProvider: def num_children(self): logger = lldb.formatters.Logger.Logger() - if self.count == None: + if self.count is None: +# libstdc++ 6.0.21 added dedicated count field. +count_child = self.node.GetChildMemberWithName('_M_data') +if count_child and count_child.IsValid(): +self.count = count_child.GetValueAsUnsigned(0) +if self.count is None: self.count = self.num_children_impl() return self.count @@ -117,10 +131,10 @@ class StdListSynthProvider: self.count = None try: impl = self.valobj.GetChildMemberWithName('_M_impl') - node = impl.GetChildMemberWithName('_M_node') + self.node = impl.GetChildMemberWithName('_M_node') self.node_address = self.valobj.AddressOf().GetValueAsUnsigned(0) - self.next = node.GetChildMemberWithName('_M_next') - self.prev = node.GetChildMemberWithName('_M_prev') + self.next = self.node.GetChildMemberWithName('_M_next') + self.prev = self.node.GetChildMemberWithName('_M_prev') self.data_type = self.extract_type() self.data_size = self.data_type.GetByteSize() except: Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=250965&r1=250964&r2=250965&view=diff == --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (original) +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Wed Oct 21 19:23:38 2015 @@ -545,7 +545,14 @@ LoadLibStdcppFormatters(lldb::TypeCatego lldb::TypeSummaryImplSP std_string_summary_sp(new StringSummaryFormat(stl_summary_flags, "${var._M_dataplus._M_p}")); - + +lldb::TypeSummaryImplSP cxx11_string_summary_sp(new CXXFunctionSummaryFormat(stl_summary_fl
[Lldb-commits] [lldb] r250966 - Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins/LanguageRuntime; other minor fixes.
Author: eugenezelenko Date: Wed Oct 21 19:45:41 2015 New Revision: 250966 URL: http://llvm.org/viewvc/llvm-project?rev=250966&view=rev Log: Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins/LanguageRuntime; other minor fixes. Differential Revision: http://reviews.llvm.org/D13966 Modified: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h Modified: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h?rev=250966&r1=250965&r2=250966&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h Wed Oct 21 19:45:41 2015 @@ -1,4 +1,4 @@ -//===-- ItaniumABILanguageRuntime.h *- C++ -*-===// +//===-- ItaniumABILanguageRuntime.h -*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,6 +12,8 @@ // C Includes // C++ Includes +#include + // Other libraries and framework includes // Project includes #include "lldb/lldb-private.h" @@ -20,33 +22,13 @@ #include "lldb/Target/CPPLanguageRuntime.h" #include "lldb/Core/Value.h" -#include -#include - namespace lldb_private { class ItaniumABILanguageRuntime : public lldb_private::CPPLanguageRuntime { public: -~ItaniumABILanguageRuntime() { } - -virtual bool -IsVTableName (const char *name); - -virtual bool -GetDynamicTypeAndAddress (ValueObject &in_value, - lldb::DynamicValueType use_dynamic, - TypeAndOrName &class_type_or_name, - Address &address, - Value::ValueType &value_type); - -virtual TypeAndOrName -FixUpDynamicType (const TypeAndOrName& type_and_or_name, - ValueObject& static_value); - -virtual bool -CouldHaveDynamicValue (ValueObject &in_value); +~ItaniumABILanguageRuntime() override = default; //-- // Static Functions @@ -63,38 +45,54 @@ namespace lldb_private { static lldb_private::ConstString GetPluginNameStatic(); -//-- -// PluginInterface protocol -//-- -virtual lldb_private::ConstString -GetPluginName(); - -virtual uint32_t -GetPluginVersion(); +bool +IsVTableName(const char *name) override; -virtual void -SetExceptionBreakpoints (); +bool +GetDynamicTypeAndAddress(ValueObject &in_value, + lldb::DynamicValueType use_dynamic, + TypeAndOrName &class_type_or_name, + Address &address, + Value::ValueType &value_type) override; + +TypeAndOrName +FixUpDynamicType(const TypeAndOrName& type_and_or_name, + ValueObject& static_value) override; + +bool +CouldHaveDynamicValue(ValueObject &in_value) override; + +void +SetExceptionBreakpoints() override; -virtual void -ClearExceptionBreakpoints (); +void +ClearExceptionBreakpoints() override; -virtual bool -ExceptionBreakpointsAreSet (); +bool +ExceptionBreakpointsAreSet() override; -virtual bool -ExceptionBreakpointsExplainStop (lldb::StopInfoSP sto
Re: [Lldb-commits] [PATCH] D13966: [LLDB] Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins/LanguageRuntime; other minor fixes.
This revision was automatically updated to reflect the committed changes. Closed by commit rL250966: Fix Clang-tidy modernize-use-override warnings in some files in… (authored by eugenezelenko). Changed prior to commit: http://reviews.llvm.org/D13966?vs=38065&id=38067#toc Repository: rL LLVM http://reviews.llvm.org/D13966 Files: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h === --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h @@ -12,15 +12,13 @@ // C Includes // C++ Includes - // Other libraries and framework includes +#include "clang/AST/ASTContext.h" // Project includes #include "lldb/lldb-private.h" #include "lldb/Target/ObjCLanguageRuntime.h" -#include "clang/AST/ASTContext.h" - namespace lldb_utility { class StringLexer; } @@ -31,9 +29,10 @@ { public: AppleObjCTypeEncodingParser (ObjCLanguageRuntime& runtime); -virtual CompilerType RealizeType (clang::ASTContext &ast_ctx, const char* name, bool for_expression); -virtual ~AppleObjCTypeEncodingParser() {} +~AppleObjCTypeEncodingParser() override = default; +CompilerType RealizeType(clang::ASTContext &ast_ctx, const char* name, bool for_expression) override; + private: struct StructElement { std::string name; @@ -79,4 +78,4 @@ } // namespace lldb_private -#endif // liblldb_AppleObjCTypeEncodingParser_h_ +#endif // liblldb_AppleObjCTypeEncodingParser_h_ Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h === --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h @@ -1,4 +1,4 @@ -//===-- AppleObjCRuntimeV2.h *- C++ -*-===// +//===-- AppleObjCRuntimeV2.h *- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,7 +12,6 @@ // C Includes // C++ Includes - #include #include @@ -30,30 +29,7 @@ public AppleObjCRuntime { public: -static bool classof(const ObjCLanguageRuntime* runtime) -{ -switch (runtime->GetRuntimeVersion()) -{ -case ObjCRuntimeVersions::eAppleObjC_V2: -return true; -default: -return false; -} -} - -virtual ~AppleObjCRuntimeV2(); - -// These are generic runtime functions: -virtual bool -GetDynamicTypeAndAddress (ValueObject &in_value, - lldb::DynamicValueType use_dynamic, - TypeAndOrName &class_type_or_name, - Address &address, - Value::ValueType &value_type); - -virtual UtilityFunction * -CreateObjectChecker (const char *); - +~AppleObjCRuntimeV2() override = default; //-- // Static Functions @@ -69,27 +45,73 @@ static lldb_private::ConstString GetPluginNameStatic(); + +static bool classof(const ObjCLanguageRuntime* runtime) +{ +switch (runtime->GetRuntimeVersion()) +{ +case ObjCRuntimeVersions::eAppleObjC_V2: +return true; +default: +return false; +} +} + +// These are generic runtime functions: +bool +GetDynamicTypeAndAddress(ValueObject &in_value, + lldb::DynamicValueType use_dynamic, + TypeAndOrName &class_type_or_name, + Address &address, + Value::ValueType &value_type) overr
[Lldb-commits] [PATCH] D13968: [LLDB] Attempt to fix MSVC builds after rL250966
Eugene.Zelenko created this revision. Eugene.Zelenko added reviewers: brucem, labath, clayborg. Eugene.Zelenko added a subscriber: lldb-commits. Eugene.Zelenko set the repository for this revision to rL LLVM. Looks like MSVC build failure didn't relate to my changes, since I didn't remove lldb/Expression/UtilityFunction.h from any of files changed in rL250966. May be source/Plugins/LanguageRuntime was not properly rebuilt after other change? Repository: rL LLVM http://reviews.llvm.org/D13968 Files: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h === --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h @@ -14,18 +14,18 @@ // C++ Includes #include #include + // Other libraries and framework includes // Project includes #include "lldb/lldb-public.h" #include "lldb/Host/Mutex.h" +#include "lldb/Expression/UtilityFunction.h" - namespace lldb_private { class AppleObjCTrampolineHandler { public: - AppleObjCTrampolineHandler (const lldb::ProcessSP &process_sp, const lldb::ModuleSP &objc_module_sp); @@ -44,7 +44,6 @@ return (addr == m_msg_forward_addr || addr == m_msg_forward_stret_addr); } - struct DispatchFunction { public: typedef enum @@ -92,7 +91,6 @@ lldb::addr_t code_start; }; - class VTableRegion { public: @@ -189,7 +187,6 @@ lldb::break_id_t m_trampolines_changed_bp_id; region_collection m_regions; lldb::ModuleSP m_objc_module_sp; - }; static const DispatchFunction g_dispatch_functions[]; @@ -205,10 +202,8 @@ lldb::addr_t m_msg_forward_addr; lldb::addr_t m_msg_forward_stret_addr; std::unique_ptr m_vtables_ap; - - }; -} // using namespace lldb_private +} // namespace lldb_private -#endif // lldb_AppleObjCTrampolineHandler_h_ +#endif // lldb_AppleObjCTrampolineHandler_h_ Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h === --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h @@ -14,18 +14,18 @@ // C++ Includes #include #include + // Other libraries and framework includes // Project includes #include "lldb/lldb-public.h" #include "lldb/Host/Mutex.h" +#include "lldb/Expression/UtilityFunction.h" - namespace lldb_private { class AppleObjCTrampolineHandler { public: - AppleObjCTrampolineHandler (const lldb::ProcessSP &process_sp, const lldb::ModuleSP &objc_module_sp); @@ -44,7 +44,6 @@ return (addr == m_msg_forward_addr || addr == m_msg_forward_stret_addr); } - struct DispatchFunction { public: typedef enum @@ -92,7 +91,6 @@ lldb::addr_t code_start; }; - class VTableRegion { public: @@ -189,7 +187,6 @@ lldb::break_id_t m_trampolines_changed_bp_id; region_collection m_regions; lldb::ModuleSP m_objc_module_sp; - }; static const DispatchFunction g_dispatch_functions[]; @@ -205,10 +202,8 @@ lldb::addr_t m_msg_forward_addr; lldb::addr_t m_msg_forward_stret_addr; std::unique_ptr m_vtables_ap; - - }; -} // using namespace lldb_private +} // namespace lldb_private -#endif // lldb_AppleObjCTrampolineHandler_h_ +#endif // lldb_AppleObjCTrampolineHandler_h_ ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13968: [LLDB] Attempt to fix MSVC builds after rL250966
zturner accepted this revision. zturner added a comment. This revision is now accepted and ready to land. lgtm. In the future you don't need to ask for a review to unbreak a build. Repository: rL LLVM http://reviews.llvm.org/D13968 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.
brucem added a subscriber: brucem. brucem added a comment. You are correct: ``-E env`` is new after 3.0. (Not in 3.0, but it is in 3.2.) I think the minimum supported cmake is actually older then 3.0 (2.8.something) ... Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL250335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.
krytarowski added a subscriber: krytarowski. krytarowski added a comment. cmake_minimum_required(VERSION 2.8) in CMakeLists.txt Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL250335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.
enlight added a subscriber: enlight. enlight added a comment. I believe LLVM requires CMake 2.8.12 or later (at least that was the case when I looked three weeks ago). Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL250335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250978 - Add some verbose lldb host logging so lldb will show what SDK
Author: jmolenda Date: Wed Oct 21 22:44:51 2015 New Revision: 250978 URL: http://llvm.org/viewvc/llvm-project?rev=250978&view=rev Log: Add some verbose lldb host logging so lldb will show what SDK directories it is searching for files. Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=250978&r1=250977&r2=250978&view=diff == --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Wed Oct 21 22:44:51 2015 @@ -237,7 +237,7 @@ PlatformRemoteiOS::ResolveExecutable (co NULL, NULL, NULL); - + if (exe_module_sp && exe_module_sp->GetObjectFile()) return error; exe_module_sp.reset(); @@ -567,6 +567,7 @@ uint32_t PlatformRemoteiOS::FindFileInAllSDKs (const char *platform_file_path, FileSpecList &file_list) { +Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST | LIBLLDB_LOG_VERBOSE); if (platform_file_path && platform_file_path[0] && UpdateSDKDirectoryInfosIfNeeded()) { const uint32_t num_sdk_infos = m_sdk_directory_infos.size(); @@ -574,6 +575,10 @@ PlatformRemoteiOS::FindFileInAllSDKs (co // First try for an exact match of major, minor and update for (uint32_t sdk_idx=0; sdk_idxPrintf ("Searching for %s in sdk path %s", platform_file_path, m_sdk_directory_infos[sdk_idx].directory.GetPath().c_str()); +} if (GetFileInSDK (platform_file_path, sdk_idx, local_file)) @@ -764,6 +769,7 @@ PlatformRemoteiOS::GetSharedModule (cons // then we attempt to get a shared module for the right architecture // with the right UUID. const FileSpec &platform_file = module_spec.GetFileSpec(); +Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST | LIBLLDB_LOG_VERBOSE); Error error; char platform_file_path[PATH_MAX]; @@ -781,6 +787,10 @@ PlatformRemoteiOS::GetSharedModule (cons const uint32_t connected_sdk_idx = GetConnectedSDKIndex (); if (connected_sdk_idx < num_sdk_infos) { +if (log) +{ +log->Printf ("Searching for %s in sdk path %s", platform_file_path, m_sdk_directory_infos[connected_sdk_idx].directory.GetPath().c_str()); +} if (GetFileInSDK (platform_file_path, connected_sdk_idx, platform_module_spec.GetFileSpec())) { module_sp.reset(); @@ -800,6 +810,10 @@ PlatformRemoteiOS::GetSharedModule (cons // will tend to be valid in that same SDK. if (m_last_module_sdk_idx < num_sdk_infos) { +if (log) +{ +log->Printf ("Searching for %s in sdk path %s", platform_file_path, m_sdk_directory_infos[m_last_module_sdk_idx].directory.GetPath().c_str()); +} if (GetFileInSDK (platform_file_path, m_last_module_sdk_idx, platform_module_spec.GetFileSpec())) { module_sp.reset(); @@ -820,6 +834,10 @@ PlatformRemoteiOS::GetSharedModule (cons const uint32_t current_sdk_idx = GetSDKIndexBySDKDirectoryInfo(current_sdk_info); if (current_sdk_idx < num_sdk_infos && current_sdk_idx != m_last_module_sdk_idx) { +if (log) +{ +log->Printf ("Searching for %s in sdk path %s", platform_file_path, m_sdk_directory_infos[current_sdk_idx].directory.GetPath().c_str()); +} if (GetFileInSDK (platform_file_path, current_sdk_idx, platform_module_spec.GetFileSpec())) { module_sp.reset(); @@ -844,6 +862,10 @@ PlatformRemoteiOS::GetSharedModule (cons // it above continue; } +if (log) +{ +log->Printf ("Searching for %s in sdk path %s", platform_file_path, m_sdk_directory_infos[sdk_idx].directory.GetPath().c_str()); +} if (GetFileInSDK (platform_file_path, sdk_idx, platform_module_spec.GetFileSpec())) { //printf ("sdk[%u]: '%s'\n", sdk_idx, local_file.GetPath().c_str()); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250979 - Change ModuleList::GetSharedModule so that it will reject "stub
Author: jmolenda Date: Wed Oct 21 22:50:28 2015 New Revision: 250979 URL: http://llvm.org/viewvc/llvm-project?rev=250979&view=rev Log: Change ModuleList::GetSharedModule so that it will reject "stub libraries" altogether. On Mac/iOS, these are libraries which have a UUID and nlist records but no text or data. If one of these gets into the global module list, every time we try to search for a given filename/arch/UUID, we'll get this stub library back. We need to prevent them from getting added to the module list altogether. I thought about doing this down in ObjectFileMachO -- just rejecting the file as a valid binary file altogether -- but Greg didn't want to take that hard line approach at this point, he wanted to keep the ability for lldb to read one of these if someone wanted to in the future. Modified: lldb/trunk/source/Core/ModuleList.cpp Modified: lldb/trunk/source/Core/ModuleList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=250979&r1=250978&r2=250979&view=diff == --- lldb/trunk/source/Core/ModuleList.cpp (original) +++ lldb/trunk/source/Core/ModuleList.cpp Wed Oct 21 22:50:28 2015 @@ -989,18 +989,31 @@ ModuleList::GetSharedModule // If we get in here we got the correct arch, now we just need // to verify the UUID if one was given if (uuid_ptr && *uuid_ptr != module_sp->GetUUID()) +{ module_sp.reset(); +} else { -if (did_create_ptr) -*did_create_ptr = true; +if (module_sp->GetObjectFile() && module_sp->GetObjectFile()->GetType() == ObjectFile::eTypeStubLibrary) +{ +module_sp.reset(); +} +else +{ +if (did_create_ptr) +{ +*did_create_ptr = true; +} -shared_module_list.ReplaceEquivalent(module_sp); -return error; +shared_module_list.ReplaceEquivalent(module_sp); +return error; +} } } else +{ module_sp.reset(); +} if (module_search_paths_ptr) { @@ -1024,18 +1037,29 @@ ModuleList::GetSharedModule // If we get in here we got the correct arch, now we just need // to verify the UUID if one was given if (uuid_ptr && *uuid_ptr != module_sp->GetUUID()) +{ module_sp.reset(); +} else { -if (did_create_ptr) -*did_create_ptr = true; - -shared_module_list.ReplaceEquivalent(module_sp); -return Error(); +if (module_sp->GetObjectFile()->GetType() == ObjectFile::eTypeStubLibrary) +{ +module_sp.reset(); +} +else +{ +if (did_create_ptr) +*did_create_ptr = true; + +shared_module_list.ReplaceEquivalent(module_sp); +return Error(); +} } } else +{ module_sp.reset(); +} } } @@ -1119,10 +1143,17 @@ ModuleList::GetSharedModule // By getting the object file we can guarantee that the architecture matches if (module_sp && module_sp->GetObjectFile()) { -if (did_create_ptr) -*did_create_ptr = true; +if (module_sp->GetObjectFile()->GetType() == ObjectFile::eTypeStubLibrary) +{ +module_sp.reset(); +} +else +{ +if (did_create_ptr) +*did_create_ptr = true; -shared_module_list.ReplaceEquivalent(module_sp); +shared_module_list.ReplaceEquivalent(module_sp); +} } else { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D13970: Add support for abstract domain sockets.
ovyalov created this revision. ovyalov added reviewers: clayborg, labath. ovyalov added a subscriber: lldb-commits. Abstract domain sockets are supported only by Linux (at least, as documentation says) so I'm putting new socket class into linux subfolder. Since there is a possibility that abstract namespace might be provided by other posix platforms it might be useful to link it with linux-independent URL scheme - i.e. "unix-abstract-connect". http://reviews.llvm.org/D13970 Files: include/lldb/Host/Socket.h include/lldb/Host/linux/AbstractSocket.h include/lldb/Host/posix/ConnectionFileDescriptorPosix.h include/lldb/Host/posix/DomainSocket.h source/Host/CMakeLists.txt source/Host/common/Socket.cpp source/Host/linux/AbstractSocket.cpp source/Host/posix/ConnectionFileDescriptorPosix.cpp source/Host/posix/DomainSocket.cpp Index: source/Host/posix/DomainSocket.cpp === --- source/Host/posix/DomainSocket.cpp +++ source/Host/posix/DomainSocket.cpp @@ -29,14 +29,19 @@ const int kDomain = AF_UNIX; const int kType = SOCK_STREAM; -void SetSockAddr(llvm::StringRef name, sockaddr_un* saddr_un) +bool SetSockAddr(llvm::StringRef name, const size_t name_offset, sockaddr_un* saddr_un) { +if (name.size() + name_offset > sizeof(saddr_un->sun_path)) +return false; + saddr_un->sun_family = kDomain; -::strncpy(saddr_un->sun_path, name.data(), sizeof(saddr_un->sun_path) - 1); -saddr_un->sun_path[sizeof(saddr_un->sun_path) - 1] = '\0'; +memset(saddr_un->sun_path, 0, sizeof(saddr_un->sun_path)); + +strncpy(&saddr_un->sun_path[name_offset], name.data(), name.size()); #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) saddr_un->sun_len = SUN_LEN (saddr_un); #endif +return true; } } @@ -51,14 +56,20 @@ { } +DomainSocket::DomainSocket(SocketProtocol protocol, bool child_processes_inherit, Error &error) +: Socket(CreateSocket(kDomain, kType, 0, child_processes_inherit, error), protocol, true) +{ +} + Error DomainSocket::Connect(llvm::StringRef name) { sockaddr_un saddr_un; -SetSockAddr(name, &saddr_un); +if (!SetSockAddr(name, GetNameOffset(), &saddr_un)) +return Error("Failed to set socket address"); Error error; -if (::connect(GetNativeSocket(), (struct sockaddr *)&saddr_un, SUN_LEN (&saddr_un)) < 0) +if (::connect(GetNativeSocket(), (struct sockaddr *)&saddr_un, sizeof(saddr_un)) < 0) SetLastError (error); return error; @@ -68,12 +79,13 @@ DomainSocket::Listen(llvm::StringRef name, int backlog) { sockaddr_un saddr_un; -SetSockAddr(name, &saddr_un); +if (!SetSockAddr(name, GetNameOffset(), &saddr_un)) +return Error("Failed to set socket address"); -FileSystem::Unlink(FileSpec{name, true}); +DeleteSocketFile(name); Error error; -if (::bind(GetNativeSocket(), (struct sockaddr *)&saddr_un, SUN_LEN (&saddr_un)) == 0) +if (::bind(GetNativeSocket(), (struct sockaddr *)&saddr_un, sizeof(saddr_un)) == 0) if (::listen(GetNativeSocket(), backlog) == 0) return error; @@ -91,3 +103,15 @@ return error; } + +size_t +DomainSocket::GetNameOffset() const +{ +return 0; +} + +void +DomainSocket::DeleteSocketFile(llvm::StringRef name) +{ +FileSystem::Unlink(FileSpec{name, true}); +} Index: source/Host/posix/ConnectionFileDescriptorPosix.cpp === --- source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -186,6 +186,11 @@ // unix-connect://SOCKNAME return NamedSocketConnect(s + strlen("unix-connect://"), error_ptr); } +else if (strstr(s, "unix-abstract-connect://") == s) +{ +// unix-abstract-connect://SOCKNAME +return UnixAbstractSocketConnect(s + strlen("unix-abstract-connect://"), error_ptr); +} #ifndef LLDB_DISABLE_POSIX else if (strstr(s, "fd://") == s) { @@ -763,6 +768,23 @@ return eConnectionStatusSuccess; } +lldb::ConnectionStatus +ConnectionFileDescriptor::UnixAbstractSocketConnect(const char *socket_name, Error *error_ptr) +{ +Socket *socket = nullptr; +Error error = Socket::UnixAbstractConnect(socket_name, m_child_processes_inherit, socket); +if (error_ptr) +*error_ptr = error; +m_write_sp.reset(socket); +m_read_sp = m_write_sp; +if (error.Fail()) +{ +return eConnectionStatusError; +} +m_uri.assign(socket_name); +return eConnectionStatusSuccess; +} + ConnectionStatus ConnectionFileDescriptor::SocketListenAndAccept(const char *s, Error *error_ptr) { Index: source/Host/linux/AbstractSocket.cpp === --- /dev/null +++ source/Host/linux/AbstractSocket.cpp @@ -0,0 +1,31 @@ +//===-- AbstractSocket.cp
[Lldb-commits] [lldb] r250981 - Move the launch-as-root xpc service from lldb to xcode, to
Author: jmolenda Date: Wed Oct 21 23:17:26 2015 New Revision: 250981 URL: http://llvm.org/viewvc/llvm-project?rev=250981&view=rev Log: Move the launch-as-root xpc service from lldb to xcode, to make it easier to run hand-built lldb roots and retain those entitlements. This is currently only used by Xcode; command line lldb doesn't expose the SBLaunchInfo::SetUserID() launch option. Removed: lldb/trunk/source/Host/macosx/launcherXPCService/ Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Host/macosx/Host.mm Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=250981&r1=250980&r2=250981&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Oct 21 23:17:26 2015 @@ -38,11 +38,8 @@ buildConfigurationList = 26CEF3B214FD592B007286B2 /* Build configuration list for PBXAggregateTarget "desktop" */; buildPhases = ( AF90106415AB7D2900FF120D /* CopyFiles */, - AF030DA31A9C20A2466A /* CopyFiles */, ); dependencies = ( - 26CEF3B914FD5952007286B2 /* PBXTargetDependency */, - 26CEF3B714FD594E007286B2 /* PBXTargetDependency */, 26CEF3BB14FD595B007286B2 /* PBXTargetDependency */, 26B391EF1A6DCCAF00456239 /* PBXTargetDependency */, 2687EACB1508115000DD8C2E /* PBXTargetDependency */, @@ -860,8 +857,6 @@ AF2BA6EC1A707E3400C5248A /* UriParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33064C991A5C7A330033D415 /* UriParser.cpp */; }; AF2BCA6C18C7EFDE005B4526 /* JITLoaderGDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */; }; AF37E10A17C861F20061E18E /* ProcessRunLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF37E10917C861F20061E18E /* ProcessRunLock.cpp */; }; - AF455D571A9C231700D6C4F7 /* com.apple.lldb.launcherXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; fileRef = EDC6D49914E5C19B001B75F8 /* com.apple.lldb.launcherXPCService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - AF455D581A9C231700D6C4F7 /* com.apple.lldb.launcherRootXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; fileRef = EDE274EC14EDCE1F005B0F75 /* com.apple.lldb.launcherRootXPCService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; AF45FDE518A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF45FDE318A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp */; }; AF77E08F1A033C700096C0EA /* ABISysV_ppc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E08D1A033C700096C0EA /* ABISysV_ppc.cpp */; }; AF77E0931A033C7F0096C0EA /* ABISysV_ppc64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E0911A033C7F0096C0EA /* ABISysV_ppc64.cpp */; }; @@ -900,11 +895,6 @@ E778E9A21B062D1700247609 /* EmulateInstructionMIPS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E778E99F1B062D1700247609 /* EmulateInstructionMIPS.cpp */; }; E7E94ABC1B54961F00D0AE30 /* GDBRemoteSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E73A15A41B548EC500786197 /* GDBRemoteSignals.cpp */; }; EB8375E71B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB8375E61B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp */; }; - ED88244E15114A9200BC98B9 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; }; - ED88245015114CA200BC98B9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; }; - ED88245115114CA200BC98B9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; }; - ED88245315114CFC00BC98B9 /* LauncherRootXPCService.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED88245215114CFC00BC98B9 /* LauncherRootXPCService.mm */; }; - EDC6D4AA14E5C49E001B75F8 /* LauncherXPCService.mm in Sources */ = {isa = PBXBuildFile; fileRef = EDC6D49414E5C15C001B75F8 /* LauncherXPCService.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -999,20 +989,6 @@ remoteGlobalIDString = 26F5C26910F3D9A4009D5894; remoteInfo = "lldb-tool"; }; - 26CEF3B614FD594E007286B2 /* PBXConta