[Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67
labath requested changes to this revision. labath added a comment. This revision now requires changes to proceed. This makes all sorts of tests fail. Regardless of your platform you should at least be able to reproduce the following failures: FAIL: test_FPR_SSE (functionalities/postmortem/elf-core/TestLinuxCore.py) FAIL: test_image_list_shows_multiple_architectures (functionalities/object-file/TestImageListMultiArchitecture.py) FAIL: test_local_variables_in_minidump (functionalities/postmortem/minidump-new/TestMiniDumpNew.py) ERROR: test_deeper_stack_in_minidump (functionalities/postmortem/minidump-new/TestMiniDumpNew.py) ERROR: test_deeper_stack_in_minidump_with_same_pid_running (functionalities/postmortem/minidump-new/TestMiniDumpNew.py) ERROR: test_two_cores_same_pid (functionalities/postmortem/minidump-new/TestMiniDumpNew.py) Let me know if you have problems reproducing these, and I can then take a look. Repository: rL LLVM https://reviews.llvm.org/D31825 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31823: Update LLDB Host to support IPv6 over TCP
labath added a comment. When I created the `MainLoop` class, i was hoping it would become the central place for all select-like functionality. Currently it uses pselect, but i don't see a reason we couldn't switch it to ppoll (but we actually don't have to, as the current implementation should work just fine for your use case). We also can-but-don't-have-to provide a specialized kevent-based implementation for mac&freebsd (afaict, kevent also supports listening for signals, but i would be fine with leaving that out even, as we don't need that functionality on these platforms). So all that needs to be added is a WSAPoll-based MainLoopWindows. Then your `Listen` implementation would boil down to: for (auto socket: sockets) handles.emplace_back(loop.RegisterReadObject(socket, [&] { accepted = accept(socket, ...); loop.RequestTermination(); }); loop.Run(); I'm not married to the current MainLoop interface in any way, so we can change it if you find the current one cumbersome, but I would like to cut down the number of selecting pieces of code. What do you think about that? Comment at: source/Host/common/TCPSocket.cpp:284 +#if defined(_WIN32) +int retval = WSAPoll(sock_set.data(), sock_set.size(), 1000); +#else Why not simply use infinite timeout if that's the behaviour you desire? https://reviews.llvm.org/D31823 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r299933 - Remove Plugins/Process/POSIX from include_directories
Author: labath Date: Tue Apr 11 07:26:25 2017 New Revision: 299933 URL: http://llvm.org/viewvc/llvm-project?rev=299933&view=rev Log: Remove Plugins/Process/POSIX from include_directories Summary: The files there can always be referred to using their full path, which is what most of the code has been doing already, so this makes the situation more consistent. Also fix the the code in the FreeBSD plugin to use the new paths. Reviewers: eugene, emaste Subscribers: lldb-commits, kettenis, mgorny, krytarowski Differential Revision: https://reviews.llvm.org/D31877 Modified: lldb/trunk/source/CMakeLists.txt lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=299933&r1=299932&r2=299933&view=diff == --- lldb/trunk/source/CMakeLists.txt (original) +++ lldb/trunk/source/CMakeLists.txt Tue Apr 11 07:26:25 2017 @@ -1,31 +1,5 @@ include_directories(.) -if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) -include_directories( - Plugins/Process/Linux - Plugins/Process/POSIX - ) -endif () - -if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ) -include_directories( - Plugins/Process/FreeBSD - Plugins/Process/POSIX - ) -endif () - -if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) -include_directories( - Plugins/Process/POSIX - ) -endif () - -if ( CMAKE_SYSTEM_NAME MATCHES "OpenBSD" ) -include_directories( - Plugins/Process/POSIX - ) -endif () - set(lldbBase_SOURCES lldb.cpp ) Modified: lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp?rev=299933&r1=299932&r2=299933&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Tue Apr 11 07:26:25 2017 @@ -24,6 +24,7 @@ // Project includes #include "FreeBSDThread.h" #include "POSIXStopInfo.h" +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h" #include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h" #include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h" @@ -33,7 +34,6 @@ #include "Plugins/Process/Utility/UnwindLLDB.h" #include "ProcessFreeBSD.h" #include "ProcessMonitor.h" -#include "ProcessPOSIXLog.h" #include "RegisterContextPOSIXProcessMonitor_arm.h" #include "RegisterContextPOSIXProcessMonitor_arm64.h" #include "RegisterContextPOSIXProcessMonitor_mips64.h" Modified: lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h?rev=299933&r1=299932&r2=299933&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h Tue Apr 11 07:26:25 2017 @@ -10,15 +10,9 @@ #ifndef liblldb_POSIXStopInfo_H_ #define liblldb_POSIXStopInfo_H_ -// C Includes -// C++ Includes -// Other libraries and framework includes -// Project includes -#include "lldb/Target/StopInfo.h" - -#include "CrashReason.h" #include "FreeBSDThread.h" - +#include "Plugins/Process/POSIX/CrashReason.h" +#include "lldb/Target/StopInfo.h" #include //===--===// Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp?rev=299933&r1=299932&r2=299933&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Tue Apr 11 07:26:25 2017 @@ -32,11 +32,11 @@ #include "lldb/Target/Target.h" #include "FreeBSDThread.h" +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "Plugins/Process/Utility/FreeBSDSignals.h" #include "Plugins/Process/Utility/InferiorCallPOSIX.h" #include "ProcessFreeBSD.h" #include "ProcessMonitor.h" -#include "ProcessPOSIXLog.h" // Other libraries and framework includes #include "lldb/Breakpoint/BreakpointLocation.h" Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h?rev=299933&r1=299932&r2=299933&view=diff ==
[Lldb-commits] [lldb] r299934 - Add missing annotation to TestDataFormatterUnordered
Author: labath Date: Tue Apr 11 07:26:33 2017 New Revision: 299934 URL: http://llvm.org/viewvc/llvm-project?rev=299934&view=rev Log: Add missing annotation to TestDataFormatterUnordered Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py?rev=299934&r1=299933&r2=299934&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py Tue Apr 11 07:26:33 2017 @@ -22,6 +22,7 @@ class LibcxxUnorderedDataFormatterTestCa ns = 'ndk' if lldbplatformutil.target_is_android() else '' self.namespace = 'std::__' + ns + '1' +@add_test_categories(["libc++"]) def test_with_run_command(self): self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31877: Remove Plugins/Process/POSIX from include_directories
This revision was automatically updated to reflect the committed changes. Closed by commit rL299933: Remove Plugins/Process/POSIX from include_directories (authored by labath). Changed prior to commit: https://reviews.llvm.org/D31877?vs=94656&id=94805#toc Repository: rL LLVM https://reviews.llvm.org/D31877 Files: lldb/trunk/source/CMakeLists.txt lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Index: lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h === --- lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h +++ lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h @@ -10,15 +10,9 @@ #ifndef liblldb_POSIXStopInfo_H_ #define liblldb_POSIXStopInfo_H_ -// C Includes -// C++ Includes -// Other libraries and framework includes -// Project includes -#include "lldb/Target/StopInfo.h" - -#include "CrashReason.h" #include "FreeBSDThread.h" - +#include "Plugins/Process/POSIX/CrashReason.h" +#include "lldb/Target/StopInfo.h" #include //===--===// Index: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp === --- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -33,9 +33,9 @@ #include "FreeBSDThread.h" #include "Plugins/Process/POSIX/CrashReason.h" +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "ProcessFreeBSD.h" #include "ProcessMonitor.h" -#include "ProcessPOSIXLog.h" extern "C" { extern char **environ; Index: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h === --- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h +++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h @@ -11,19 +11,13 @@ #ifndef liblldb_ProcessFreeBSD_H_ #define liblldb_ProcessFreeBSD_H_ -// C Includes - -// C++ Includes +#include "Plugins/Process/POSIX/ProcessMessage.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/ThreadList.h" #include #include #include -// Other libraries and framework includes -#include "ProcessFreeBSD.h" -#include "ProcessMessage.h" -#include "lldb/Target/Process.h" -#include "lldb/Target/ThreadList.h" - class ProcessMonitor; class FreeBSDThread; Index: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp === --- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -32,11 +32,11 @@ #include "lldb/Target/Target.h" #include "FreeBSDThread.h" +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "Plugins/Process/Utility/FreeBSDSignals.h" #include "Plugins/Process/Utility/InferiorCallPOSIX.h" #include "ProcessFreeBSD.h" #include "ProcessMonitor.h" -#include "ProcessPOSIXLog.h" // Other libraries and framework includes #include "lldb/Breakpoint/BreakpointLocation.h" Index: lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp === --- lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp +++ lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp @@ -24,6 +24,7 @@ // Project includes #include "FreeBSDThread.h" #include "POSIXStopInfo.h" +#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h" #include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h" #include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h" @@ -33,7 +34,6 @@ #include "Plugins/Process/Utility/UnwindLLDB.h" #include "ProcessFreeBSD.h" #include "ProcessMonitor.h" -#include "ProcessPOSIXLog.h" #include "RegisterContextPOSIXProcessMonitor_arm.h" #include "RegisterContextPOSIXProcessMonitor_arm64.h" #include "RegisterContextPOSIXProcessMonitor_mips64.h" Index: lldb/trunk/source/CMakeLists.txt === --- lldb/trunk/source/CMakeLists.txt +++ lldb/trunk/source/CMakeLists.txt @@ -1,31 +1,5 @@ include_directories(.) -if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) -include_directories( - Plugins/Process/Linux - Plugins/Process/POSIX - ) -endif () - -if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ) -include_directories( - Plugins/Process/FreeBSD - Plugins/Process/POSIX - ) -endif () - -if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) -include_directories( - Plugins/Process/POSIX - ) -endif () - -if ( CMAKE_SYSTEM_NAME MATCHES "OpenBSD" ) -include_directories( - Plugins/Process/POSI
[Lldb-commits] [PATCH] D31357: Support Unit Testing debugserver
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. This is fine, as far as i am concerned. Comment at: tools/debugserver/source/CMakeLists.txt:117 +POST_BUILD +# Note: --entitlements option removed (see comment above). +COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} The comment does not make sense anymore. https://reviews.llvm.org/D31357 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31880: Fix libc++ vector data formatter (bug #32553)
labath marked 3 inline comments as done. labath added inline comments. Comment at: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp:301-304 + TypeImpl type = valobj_sp->GetTypeImpl(); + if (!type.IsValid()) +return nullptr; + CompilerType compiler_type = type.GetCompilerType(false); tberghammer wrote: > Is there a reason you are not using ValueObject::GetCompilerType()? Because I did not know it exists. :) https://reviews.llvm.org/D31880 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31880: Fix libc++ vector data formatter (bug #32553)
labath updated this revision to Diff 94807. labath added a comment. Address review comments. https://reviews.llvm.org/D31880 Files: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp source/Plugins/Language/CPlusPlus/LibCxx.cpp source/Plugins/Language/CPlusPlus/LibCxx.h source/Plugins/Language/CPlusPlus/LibCxxVector.cpp Index: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp === --- source/Plugins/Language/CPlusPlus/LibCxxVector.cpp +++ source/Plugins/Language/CPlusPlus/LibCxxVector.cpp @@ -45,6 +45,29 @@ CompilerType m_element_type; uint32_t m_element_size; }; + +class LibcxxVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd { +public: + LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); + + size_t CalculateNumChildren() override; + + lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; + + bool Update() override; + + bool MightHaveChildren() override { return true; } + + size_t GetIndexOfChildWithName(const ConstString &name) override; + +private: + CompilerType m_bool_type; + ExecutionContextRef m_exe_ctx_ref; + uint64_t m_count; + lldb::addr_t m_base_data_address; + std::map m_children; +}; + } // namespace formatters } // namespace lldb_private @@ -133,9 +156,126 @@ return ExtractIndexFromString(name.GetCString()); } +lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd:: +LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp) +: SyntheticChildrenFrontEnd(*valobj_sp), m_bool_type(), m_exe_ctx_ref(), + m_count(0), m_base_data_address(0), m_children() { + if (valobj_sp) { +Update(); +m_bool_type = +valobj_sp->GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeBool); + } +} + +size_t lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd:: +CalculateNumChildren() { + return m_count; +} + +lldb::ValueObjectSP +lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::GetChildAtIndex( +size_t idx) { + auto iter = m_children.find(idx), end = m_children.end(); + if (iter != end) +return iter->second; + if (idx >= m_count) +return ValueObjectSP(); + if (m_base_data_address == 0 || m_count == 0) +return ValueObjectSP(); + if (!m_bool_type) +return ValueObjectSP(); + size_t byte_idx = (idx >> 3); // divide by 8 to get byte index + size_t bit_index = (idx & 7); // efficient idx % 8 for bit index + lldb::addr_t byte_location = m_base_data_address + byte_idx; + ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP()); + if (!process_sp) +return ValueObjectSP(); + uint8_t byte = 0; + uint8_t mask = 0; + Error err; + size_t bytes_read = process_sp->ReadMemory(byte_location, &byte, 1, err); + if (err.Fail() || bytes_read == 0) +return ValueObjectSP(); + mask = 1 << bit_index; + bool bit_set = ((byte & mask) != 0); + DataBufferSP buffer_sp( + new DataBufferHeap(m_bool_type.GetByteSize(nullptr), 0)); + if (bit_set && buffer_sp && buffer_sp->GetBytes()) { +// regardless of endianness, anything non-zero is true +*(buffer_sp->GetBytes()) = 1; + } + StreamString name; + name.Printf("[%" PRIu64 "]", (uint64_t)idx); + ValueObjectSP retval_sp(CreateValueObjectFromData( + name.GetString(), + DataExtractor(buffer_sp, process_sp->GetByteOrder(), +process_sp->GetAddressByteSize()), + m_exe_ctx_ref, m_bool_type)); + if (retval_sp) +m_children[idx] = retval_sp; + return retval_sp; +} + +/*(std::__1::vector >) vBool = { + __begin_ = 0x0001001000e0 + __size_ = 56 + __cap_alloc_ = { + std::__1::__libcpp_compressed_pair_imp > = { + __first_ = 1 + } + } + }*/ + +bool lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::Update() { + m_children.clear(); + ValueObjectSP valobj_sp = m_backend.GetSP(); + if (!valobj_sp) +return false; + m_exe_ctx_ref = valobj_sp->GetExecutionContextRef(); + ValueObjectSP size_sp( + valobj_sp->GetChildMemberWithName(ConstString("__size_"), true)); + if (!size_sp) +return false; + m_count = size_sp->GetValueAsUnsigned(0); + if (!m_count) +return true; + ValueObjectSP begin_sp( + valobj_sp->GetChildMemberWithName(ConstString("__begin_"), true)); + if (!begin_sp) { +m_count = 0; +return false; + } + m_base_data_address = begin_sp->GetValueAsUnsigned(0); + if (!m_base_data_address) { +m_count = 0; +return false; + } + return false; +} + +size_t lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd:: +GetIndexOfChildWithName(const ConstString &name) { + if (!m_count || !m_base_data_address) +return UINT32_MAX; + const char *item_name = name.GetCString(); + uint32_t idx = ExtractIndexFromString(item_name); + if (idx < UINT32_MAX && idx >= CalculateNumChildren()) +return UINT32_MAX; + return idx; +} +
[Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67
krytarowski added a comment. I might need some guidance to address the asserts appropriately in finite time. In general we set osabi to generic unix (value 0), and NetBSD core(5) files are distinguished only (or mostly) with "NetBSD-CORE*" notes. Repository: rL LLVM https://reviews.llvm.org/D31825 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67
Just to be clear, this patch was only intended to be a starting point. I didn't run the test suite or do anything other than verify that the core loaded. ArchSpec is a pretty core class so touching it in this manner is likely to have many side effects that you'll need to work out. Most likely so many tests fail on NetBSD that it masks the regressions, but you should at least be able to diff your test results before/after On Tue, Apr 11, 2017 at 6:12 AM Kamil Rytarowski via Phabricator < revi...@reviews.llvm.org> wrote: > krytarowski added a comment. > > I might need some guidance to address the asserts appropriately in finite > time. > > In general we set osabi to generic unix (value 0), and NetBSD core(5) > files are distinguished only (or mostly) with "NetBSD-CORE*" notes. > > > Repository: > rL LLVM > > https://reviews.llvm.org/D31825 > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31823: Update LLDB Host to support IPv6 over TCP
zturner added a comment. Networking isn't my area of domain expertise, so these are mostly just general comments. Comment at: include/lldb/Host/common/TCPSocket.h:55 + + std::map m_listen_sockets; }; Any particular reason you're using a `std::map` instead of a `DenseMap` or other similar LLVM structure? I was under the impression that the number of times where you should actually use `std::map` are pretty small. Comment at: source/Host/common/Socket.cpp:86 case ProtocolTcp: -socket_up.reset(new TCPSocket(child_processes_inherit, error)); +socket_up.reset(new TCPSocket(true, child_processes_inherit)); break; Is this ever set to `false` anywhere? If not, just delete the parameter. Also, since you're in this code anyway, maybe you could use `llvm::make_unique`. Comment at: source/Host/common/Socket.cpp:150 std::unique_ptr listen_socket( - new TCPSocket(child_processes_inherit, error)); + new TCPSocket(child_processes_inherit, true)); if (error.Fail()) The parameters look reversed here. Comment at: source/Host/common/Socket.cpp:260 + if (host_str.front() == '[' && host_str.back() == ']') +host_str = host_str.substr(1, host_str.size() - 2); bool ok = false; Makes me wish we had `StringRef::shrink(int N)`. Oh well, this is fine. Comment at: source/Host/common/TCPSocket.cpp:29 +#include +#elif defined(_WIN32) +#include Can you use `LLVM_ON_WIN32`? Comment at: source/Host/common/TCPSocket.cpp:60 +bool TCPSocket::IsValid() const { + return m_socket != kInvalidSocketValue || m_listen_sockets.size() != 0; +} `!m_listen_sockets.empty()` Comment at: source/Host/common/TCPSocket.cpp:116 + Error error; + if (IsValid()) +error = Close(); Should we perhaps assert here? Seems like creating 2 sockets back to back without cleaning up after yourself is not intended behavior. The owner of a socket should probably close it before they try to create a new one, and an `assert(!IsValid())` would catch that. Comment at: source/Host/common/TCPSocket.cpp:194 +if (-1 == err) { +#if defined(_WIN32) + closesocket(fd); `LLVM_ON_WIN32`. Also can you raise this up into something like this: ``` #if defined(LLVM_ON_WIN32) #define CLOSE_SOCKET ::closesocket #else #define CLOSE_SOCKET ::close #endif ``` Then just write `CLOSE_SOCKET(fd);` Comment at: source/Host/common/TCPSocket.cpp:217 + for (auto socket : m_listen_sockets) +#if defined(_WIN32) +closesocket(socket.first); Use `CLOSE_SOCKET` macro from earlier. Comment at: source/Host/common/TCPSocket.cpp:250 +#else + std::vector sock_set; + Can you add `sock_set.reserve(m_listen_sockets.size())`? Comment at: source/Host/common/TCPSocket.cpp:284 +#if defined(_WIN32) +int retval = WSAPoll(sock_set.data(), sock_set.size(), 1000); +#else labath wrote: > Why not simply use infinite timeout if that's the behaviour you desire? Similar to before, you could add a `#define POLL_SOCKET ...` Comment at: source/Host/common/TCPSocket.cpp:318 +if (!AddrIn.IsAnyAddr() && AccptAddr != AddrIn) { +#if defined(_WIN32) + closesocket(sock); `CLOSE_SOCKET(fd)` Comment at: source/Host/common/TCPSocket.cpp:323-326 + ::fprintf( + stderr, + "error: rejecting incoming connection from %s (expecting %s)\n", + AccptAddr.GetIPAddress().c_str(), AddrIn.GetIPAddress().c_str()); `llvm::errs() << formatv("error: rejecting incoming connection from {0} (expecting {1})", AcceptAddr.GetIPAddress(), AddrIn.GetIPAddress());` Comment at: source/Host/common/TCPSocket.cpp:330 +accept_connection = true; +accepted_socket.reset(new TCPSocket(sock, *this)); } `make_unique` Comment at: source/Host/common/UDPSocket.cpp:125 +Error UDPSocket::Listen(llvm::StringRef name, int backlog) { + return Error("%s", g_not_supported_error); +} This seems odd. Does `return Error(g_not_supported_error)` not work? Comment at: source/Host/common/UDPSocket.cpp:145-146 + Socket *&socket) { + std::unique_ptr final_socket( + new UDPSocket(true, child_processes_inherit)); + Error error = final_socket->Connect(name); `make_unique` again. https://reviews.llvm.org/D31823 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31822: [NFC] Adding a new wrapper for getaddrinfo
zturner accepted this revision. zturner added inline comments. This revision is now accepted and ready to land. Comment at: include/lldb/Host/SocketAddress.h:44-45 + // + static std::vector GetAddressInfo(const char *hostname, + const char *servname); + What about using `Twine` here instead of `const char *` literals? Comment at: source/Host/common/SocketAddress.cpp:260 + service_ptr = service_ptr->ai_next) { + addr_list.push_back(SocketAddress(service_ptr)); +} How about `emplace_back(service_ptr)` https://reviews.llvm.org/D31822 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67
Right, This patch happened to does not fully work for me (NetBSD-CORE@ switches were skipped), I will be back to it once I will get my current efforts done on watchpoints and fpr. Thank you for the initial scratch! On 11.04.2017 17:14, Zachary Turner wrote: > Just to be clear, this patch was only intended to be a starting point. I > didn't run the test suite or do anything other than verify that the core > loaded. ArchSpec is a pretty core class so touching it in this manner is > likely to have many side effects that you'll need to work out. > > Most likely so many tests fail on NetBSD that it masks the regressions, > but you should at least be able to diff your test results before/after > On Tue, Apr 11, 2017 at 6:12 AM Kamil Rytarowski via Phabricator > mailto:revi...@reviews.llvm.org>> wrote: > > krytarowski added a comment. > > I might need some guidance to address the asserts appropriately in > finite time. > > In general we set osabi to generic unix (value 0), and NetBSD > core(5) files are distinguished only (or mostly) with "NetBSD-CORE*" > notes. > > > Repository: > rL LLVM > > https://reviews.llvm.org/D31825 > > > signature.asc Description: OpenPGP digital signature ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31823: Update LLDB Host to support IPv6 over TCP
beanz added a comment. @labath, I could adapt this into the `MainLoop` class, but I would actually want to change how that class hierarchy is implemented. Regardless of the event handling/polling model you use much of the code is identical between the classes. I'd rather get rid of `MainLoopPosix` and `MainLoopBase` and instead just implement a portable `MainLoop` class. In particular the difference between Windows `WSAPoll` and posix `poll(2)` is the name of two functions, which makes the idea of having separate Windows and Posix implementations just seem overly complicated to me, although neither Darwin nor Windows have `ppoll` because it isn't POSIX, and Windows doesn't have `pselect`, so there isn't a remotely portable way to wait on file descriptors and signals... This is why we can't have nice things. I'm going to dig into the `MainLoop` code. At first glance I do think that is a better way to fit this all together, but I'm going to need to think on it and experiment a bit. https://reviews.llvm.org/D31823 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31823: Update LLDB Host to support IPv6 over TCP
jasonmolenda added a comment. Looks good. I'd recommend adding clayborg as a reviewer and giving him a couple days to comment on this if he has time. He wrote all of this code originally. Comment at: include/lldb/Host/common/TCPSocket.h:55 + + std::map m_listen_sockets; }; zturner wrote: > Any particular reason you're using a `std::map` instead of a `DenseMap` or > other similar LLVM structure? I was under the impression that the number of > times where you should actually use `std::map` are pretty small. llvm docs say, "Also, because DenseMap allocates space for a large number of key/value pairs (it starts with 64 by default), it will waste a lot of space if your keys or values are large." I think std::map is the right choice. When it's a tossup between an llvm container class and an STL container class, my opinion is always to go with the standard container class that everyone is familiar with already. If there's a distinct benefit to a given llvm container class for a specific scenario, that's fine, but it just increases the barrier to entry for people outside the llvm community to use these classes pervasively. Comment at: source/Host/common/Socket.cpp:258 regex_match.GetMatchAtIndex(host_and_port.data(), 2, port_str)) { + // IPv6 addresses are wrapped in [] when specified with ports + if (host_str.front() == '[' && host_str.back() == ']') Ah, I'd originally said I thought we should just tack the :portnum on to the end of the string, search backwards to find it (because the [] characters are metacharacters in unix shells). but I see that RFC8986 says this is how things like this are specified, like http://[2001:db8:1f70::999:de8:7648:6e8]:100/ so cool with that. https://reviews.llvm.org/D31823 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300012 - Teach SBFrame how to guess its language.
Author: jingham Date: Tue Apr 11 19:19:54 2017 New Revision: 300012 URL: http://llvm.org/viewvc/llvm-project?rev=300012&view=rev Log: Teach SBFrame how to guess its language. Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/other-2.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/other.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/other.h lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/somefunc.c Modified: lldb/trunk/include/lldb/API/SBFrame.h lldb/trunk/scripts/interface/SBFrame.i lldb/trunk/source/API/SBFrame.cpp lldb/trunk/source/Core/Mangled.cpp lldb/trunk/source/Target/StackFrame.cpp Modified: lldb/trunk/include/lldb/API/SBFrame.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFrame.h?rev=300012&r1=300011&r2=300012&view=diff == --- lldb/trunk/include/lldb/API/SBFrame.h (original) +++ lldb/trunk/include/lldb/API/SBFrame.h Tue Apr 11 19:19:54 2017 @@ -78,6 +78,10 @@ public: const char *GetDisplayFunctionName(); const char *GetFunctionName() const; + + // Return the frame function's language. If there isn't a function, then + // guess the language type from the mangled name. + lldb::LanguageType GuessLanguage() const; /// Return true if this frame represents an inlined function. /// Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile?rev=300012&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile Tue Apr 11 19:19:54 2017 @@ -0,0 +1,12 @@ +LEVEL = ../../make + +CXX_SOURCES := main.cpp other.cpp other-2.cpp +C_SOURCES := somefunc.c + +include $(LEVEL)/Makefile.rules + +other-2.o: other-2.cpp + $(CXX) $(CFLAGS_NO_DEBUG) -c other-2.cpp + +somefunc.o: somefunc.c + $(CC) $(CFLAGS) -std=c99 -c somefunc.c \ No newline at end of file Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py?rev=300012&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py Tue Apr 11 19:19:54 2017 @@ -0,0 +1,81 @@ +""" +Test the SB API SBFrame::GuessLanguage. +""" + +from __future__ import print_function + + +import os +import time +import re +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + + +class TestFrameGuessLanguage(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +# If your test case doesn't stress debug info, the +# set this to true. That way it won't be run once for +# each debug info format. +NO_DEBUG_INFO_TESTCASE = True + +def test_guess_language(self): +"""Test GuessLanguage for C and C++.""" +self.build() +self.do_test() + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) + +def check_language(self, thread, frame_no, test_lang): +frame = thread.frames[frame_no] +self.assertTrue(frame.IsValid(), "Frame %d was not valid."%(frame_no)) +lang = frame.GuessLanguage() +self.assertEqual(lang, test_lang) + +def do_test(self): +"""Test GuessLanguage for C & C++.""" +exe = os.path.join(os.getcwd(), "a.out") + +# Create a target by the debugger. +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +# Now create a breakpoint in main.c at the source matching +# "Set a breakpoint here" +breakpoint = target.BreakpointCreateBySourceRegex( +"Set breakpoint here", lldb.SBFileSpec("somefunc.c")) +self.assertTrue(breakpoint and +breakpoint.GetNumLocations() >= 1, +VALID_BREAKPOINT) + +error = lldb.SBError() +# This is the launch info. If you want to launch with arg
Re: [Lldb-commits] [lldb] r297585 - Make file / directory completion work properly on Windows.
I noticed that the llvm.org sources crash when you do filename completion with a file in the current working directory: % build/Debug/lldb (lldb) file aaa[TAB]Assertion failed: (!SearchDir.empty()), function DiskFilesOrDirectories, file /Volumes/newwork/svn/lldb/source/Commands/CommandCompletions.cpp, line 179. Abort Or through the SB API: % build/Debug/lldb (lldb) scri >>> print lldb.debugger.GetCommandInterpreter().HandleCompletion("file >>> /tmp/ll", 11, 0, -1, lldb.SBStringList()) 0 >>> print lldb.debugger.GetCommandInterpreter().HandleCompletion("file ll", 7, >>> 0, -1, lldb.SBStringList()) Assertion failed: (!SearchDir.empty()), function DiskFilesOrDirectories, file /Volumes/newwork/svn/lldb/source/Commands/CommandCompletions.cpp, line 179. Abort maybe it's related from r297585? There have been a few overlapping changes to CommandCompletions.cpp by you and Pavel recently, not sure exactly which it might be. If this can't be tested through the unit test framework, it would be easy to add an SB API test case, see above. Thanks > On Mar 12, 2017, at 11:18 AM, Zachary Turner via lldb-commits > wrote: > > Author: zturner > Date: Sun Mar 12 13:18:50 2017 > New Revision: 297585 > > URL: http://llvm.org/viewvc/llvm-project?rev=297585&view=rev > Log: > Make file / directory completion work properly on Windows. > > There were a couple of problems with this function on Windows. Different > separators and differences in how tilde expressions are resolved for > starters, but in addition there was no clear indication of what the > function's inputs or outputs were supposed to be, and there were no tests > to demonstrate its use. > > To more easily paper over the differences between Windows paths, > non-Windows paths, and tilde expressions, I've ported this function to use > LLVM-based directory iteration (in fact, I would like to eliminate all of > LLDB's directory iteration code entirely since LLVM's is cleaner / more > efficient (i.e. it invokes fewer stat calls)). and llvm's portable path > manipulation library. > > Since file and directory completion assumes you are referring to files and > directories on your local machine, it's safe to assume the path syntax > properties of the host in doing so, so LLVM's APIs are perfect for this. > > I've also added a fairly robust set of unit tests. Since you can't really > predict what users will be on your machine, or what their home directories > will be, I added an interface called TildeExpressionResolver, and in the > unit test I've mocked up a fake implementation that acts like a unix > password database. This allows us to configure some fake users and home > directories in the test, so we can exercise all of those hard-to-test > codepaths that normally otherwise depend on the host. > > Differential Revision: https://reviews.llvm.org/D30789 > > Added: >lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h >lldb/trunk/source/Utility/TildeExpressionResolver.cpp >lldb/trunk/unittests/Interpreter/TestCompletion.cpp > Modified: >lldb/trunk/include/lldb/Interpreter/CommandCompletions.h >lldb/trunk/source/Commands/CommandCompletions.cpp >lldb/trunk/source/Utility/CMakeLists.txt >lldb/trunk/unittests/Interpreter/CMakeLists.txt > > Modified: lldb/trunk/include/lldb/Interpreter/CommandCompletions.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandCompletions.h?rev=297585&r1=297584&r2=297585&view=diff > == > --- lldb/trunk/include/lldb/Interpreter/CommandCompletions.h (original) > +++ lldb/trunk/include/lldb/Interpreter/CommandCompletions.h Sun Mar 12 > 13:18:50 2017 > @@ -21,7 +21,10 @@ > #include "lldb/Utility/RegularExpression.h" > #include "lldb/lldb-private.h" > > +#include "llvm/ADT/Twine.h" > + > namespace lldb_private { > +struct TildeExpressionResolver; > class CommandCompletions { > public: > //-- > @@ -76,12 +79,19 @@ public: >int max_return_elements, SearchFilter *searcher, >bool &word_complete, StringList &matches); > > + static int DiskFiles(const llvm::Twine &partial_file_name, > + StringList &matches, TildeExpressionResolver > &Resolver); > + > static int DiskDirectories(CommandInterpreter &interpreter, > llvm::StringRef partial_file_name, > int match_start_point, int max_return_elements, > SearchFilter *searcher, bool &word_complete, > StringList &matches); > > + static int DiskDirectories(const llvm::Twine &partial_file_name, > + StringList &matches, > + TildeExpressionResolver &Resolver); > + > static int SourceFiles(CommandInterpreter &interpreter, >
Re: [Lldb-commits] [lldb] r297585 - Make file / directory completion work properly on Windows.
Thanks for the heads up, I'll try to look at this tomorrow. On Tue, Apr 11, 2017 at 5:55 PM Jason Molenda wrote: > I noticed that the llvm.org sources crash when you do filename completion > with a file in the current working directory: > > % build/Debug/lldb > (lldb) file aaa[TAB]Assertion failed: (!SearchDir.empty()), function > DiskFilesOrDirectories, file > /Volumes/newwork/svn/lldb/source/Commands/CommandCompletions.cpp, line 179. > Abort > > > Or through the SB API: > > % build/Debug/lldb > (lldb) scri > >>> print lldb.debugger.GetCommandInterpreter().HandleCompletion("file > /tmp/ll", 11, 0, -1, lldb.SBStringList()) > 0 > >>> print lldb.debugger.GetCommandInterpreter().HandleCompletion("file > ll", 7, 0, -1, lldb.SBStringList()) > Assertion failed: (!SearchDir.empty()), function DiskFilesOrDirectories, > file /Volumes/newwork/svn/lldb/source/Commands/CommandCompletions.cpp, line > 179. > Abort > > > maybe it's related from r297585? There have been a few overlapping > changes to CommandCompletions.cpp by you and Pavel recently, not sure > exactly which it might be. > > If this can't be tested through the unit test framework, it would be easy > to add an SB API test case, see above. > > Thanks > > > > > On Mar 12, 2017, at 11:18 AM, Zachary Turner via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > > > > Author: zturner > > Date: Sun Mar 12 13:18:50 2017 > > New Revision: 297585 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=297585&view=rev > > Log: > > Make file / directory completion work properly on Windows. > > > > There were a couple of problems with this function on Windows. Different > > separators and differences in how tilde expressions are resolved for > > starters, but in addition there was no clear indication of what the > > function's inputs or outputs were supposed to be, and there were no tests > > to demonstrate its use. > > > > To more easily paper over the differences between Windows paths, > > non-Windows paths, and tilde expressions, I've ported this function to > use > > LLVM-based directory iteration (in fact, I would like to eliminate all of > > LLDB's directory iteration code entirely since LLVM's is cleaner / more > > efficient (i.e. it invokes fewer stat calls)). and llvm's portable path > > manipulation library. > > > > Since file and directory completion assumes you are referring to files > and > > directories on your local machine, it's safe to assume the path syntax > > properties of the host in doing so, so LLVM's APIs are perfect for this. > > > > I've also added a fairly robust set of unit tests. Since you can't really > > predict what users will be on your machine, or what their home > directories > > will be, I added an interface called TildeExpressionResolver, and in the > > unit test I've mocked up a fake implementation that acts like a unix > > password database. This allows us to configure some fake users and home > > directories in the test, so we can exercise all of those hard-to-test > > codepaths that normally otherwise depend on the host. > > > > Differential Revision: https://reviews.llvm.org/D30789 > > > > Added: > >lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h > >lldb/trunk/source/Utility/TildeExpressionResolver.cpp > >lldb/trunk/unittests/Interpreter/TestCompletion.cpp > > Modified: > >lldb/trunk/include/lldb/Interpreter/CommandCompletions.h > >lldb/trunk/source/Commands/CommandCompletions.cpp > >lldb/trunk/source/Utility/CMakeLists.txt > >lldb/trunk/unittests/Interpreter/CMakeLists.txt > > > > Modified: lldb/trunk/include/lldb/Interpreter/CommandCompletions.h > > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandCompletions.h?rev=297585&r1=297584&r2=297585&view=diff > > > == > > --- lldb/trunk/include/lldb/Interpreter/CommandCompletions.h (original) > > +++ lldb/trunk/include/lldb/Interpreter/CommandCompletions.h Sun Mar 12 > 13:18:50 2017 > > @@ -21,7 +21,10 @@ > > #include "lldb/Utility/RegularExpression.h" > > #include "lldb/lldb-private.h" > > > > +#include "llvm/ADT/Twine.h" > > + > > namespace lldb_private { > > +struct TildeExpressionResolver; > > class CommandCompletions { > > public: > > > //-- > > @@ -76,12 +79,19 @@ public: > >int max_return_elements, SearchFilter *searcher, > >bool &word_complete, StringList &matches); > > > > + static int DiskFiles(const llvm::Twine &partial_file_name, > > + StringList &matches, TildeExpressionResolver > &Resolver); > > + > > static int DiskDirectories(CommandInterpreter &interpreter, > > llvm::StringRef partial_file_name, > > int match_start_point, int > max_return_elements, > > SearchFilter *searcher, boo
[Lldb-commits] [PATCH] D31969: [CMake] Support generating Config.h
beanz created this revision. Herald added subscribers: mgorny, srhines, emaste. This patch removes the hand maintained config files in favor of auto-generating the config file. We will still need to maintain the defines for the Xcode builds on Mac, but all CMake builds use the generated header instead. This will enable finer grained platform support tests and enable supporting LLDB on more platforms with less manual maintenance. I have only tested this patch on Darwin, and any help testing it out on other platforms would be greatly appreciated. I've probably messed something up somewhere. https://reviews.llvm.org/D31969 Files: cmake/modules/LLDBConfig.cmake include/lldb/Host/Config.h include/lldb/Host/Config.h.cmake include/lldb/Host/android/Config.h include/lldb/Host/freebsd/Config.h include/lldb/Host/linux/Config.h include/lldb/Host/macosx/Config.h include/lldb/Host/mingw/Config.h include/lldb/Host/msvc/Config.h include/lldb/Host/netbsd/Config.h include/lldb/Host/openbsd/Config.h Index: include/lldb/Host/openbsd/Config.h === --- include/lldb/Host/openbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/netbsd/Config.h === --- include/lldb/Host/netbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/msvc/Config.h === --- include/lldb/Host/msvc/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_host_msvc_Config_h_ -#define liblldb_host_msvc_Config_h_ - -#define LLDB_DISABLE_POSIX - -//#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -//#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/mingw/Config.h === --- include/lldb/Host/mingw/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h --
[Lldb-commits] [PATCH] D31969: [CMake] Support generating Config.h
krytarowski added inline comments. Comment at: cmake/modules/LLDBConfig.cmake:433 +set(LLDB_CONFIG_TERMIOS_SUPPORTED ${HAVE_TERMIOS_H}) +set(LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED ${HAVE_FCNTL_H}) +if(NOT UNIX) Can we just use `#ifdef F_GETPATH` in the source code? No need to define another symbol wrapping `F_GETPATH`. https://reviews.llvm.org/D31969 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31969: [CMake] Support generating Config.h
krytarowski added a comment. While there there are candidates like `pipe2`(2) in `source/Host/posix/PipePosix.cpp`. https://reviews.llvm.org/D31969 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31969: [CMake] Support generating Config.h
beanz updated this revision to Diff 94924. beanz added a comment. - Fixing installation to make sure CMake always installs the generated Config.h - Removing LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED becasue we really don't need it https://reviews.llvm.org/D31969 Files: cmake/modules/LLDBConfig.cmake include/lldb/Host/Config.h include/lldb/Host/Config.h.cmake include/lldb/Host/android/Config.h include/lldb/Host/freebsd/Config.h include/lldb/Host/linux/Config.h include/lldb/Host/macosx/Config.h include/lldb/Host/mingw/Config.h include/lldb/Host/msvc/Config.h include/lldb/Host/netbsd/Config.h include/lldb/Host/openbsd/Config.h Index: include/lldb/Host/openbsd/Config.h === --- include/lldb/Host/openbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/netbsd/Config.h === --- include/lldb/Host/netbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/msvc/Config.h === --- include/lldb/Host/msvc/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_host_msvc_Config_h_ -#define liblldb_host_msvc_Config_h_ - -#define LLDB_DISABLE_POSIX - -//#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -//#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/mingw/Config.h === --- include/lldb/Host/mingw/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-
[Lldb-commits] [PATCH] D31969: [CMake] Support generating Config.h
beanz updated this revision to Diff 94925. beanz added a comment. Actually uploading the updates this time... https://reviews.llvm.org/D31969 Files: cmake/modules/LLDBConfig.cmake include/lldb/Host/Config.h include/lldb/Host/Config.h.cmake include/lldb/Host/android/Config.h include/lldb/Host/freebsd/Config.h include/lldb/Host/linux/Config.h include/lldb/Host/macosx/Config.h include/lldb/Host/mingw/Config.h include/lldb/Host/msvc/Config.h include/lldb/Host/netbsd/Config.h include/lldb/Host/openbsd/Config.h source/Host/common/File.cpp Index: source/Host/common/File.cpp === --- source/Host/common/File.cpp +++ source/Host/common/File.cpp @@ -307,7 +307,7 @@ Error File::GetFileSpec(FileSpec &file_spec) const { Error error; -#ifdef LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED +#ifdef F_GETPATH if (IsValid()) { char path[PATH_MAX]; if (::fcntl(GetDescriptor(), F_GETPATH, path) == -1) Index: include/lldb/Host/openbsd/Config.h === --- include/lldb/Host/openbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/netbsd/Config.h === --- include/lldb/Host/netbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/msvc/Config.h === --- include/lldb/Host/msvc/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_host_msvc_Config_h_ -#define liblldb_host_msvc_Config_h_ - -#define LLDB_DISABLE_POSIX - -//#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -//#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/mingw/Config.h === --- include/lldb/Host/mingw/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h
[Lldb-commits] [PATCH] D31969: [CMake] Support generating Config.h
beanz updated this revision to Diff 94928. beanz added a comment. Updating the hard coded Config.h https://reviews.llvm.org/D31969 Files: cmake/modules/LLDBConfig.cmake include/lldb/Host/Config.h include/lldb/Host/Config.h.cmake include/lldb/Host/android/Config.h include/lldb/Host/freebsd/Config.h include/lldb/Host/linux/Config.h include/lldb/Host/macosx/Config.h include/lldb/Host/mingw/Config.h include/lldb/Host/msvc/Config.h include/lldb/Host/netbsd/Config.h include/lldb/Host/openbsd/Config.h source/Host/common/File.cpp Index: source/Host/common/File.cpp === --- source/Host/common/File.cpp +++ source/Host/common/File.cpp @@ -307,7 +307,7 @@ Error File::GetFileSpec(FileSpec &file_spec) const { Error error; -#ifdef LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED +#ifdef F_GETPATH if (IsValid()) { char path[PATH_MAX]; if (::fcntl(GetDescriptor(), F_GETPATH, path) == -1) Index: include/lldb/Host/openbsd/Config.h === --- include/lldb/Host/openbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/netbsd/Config.h === --- include/lldb/Host/netbsd/Config.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_Platform_Config_h_ -#define liblldb_Platform_Config_h_ - -#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/msvc/Config.h === --- include/lldb/Host/msvc/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -//-- -// LLDB currently doesn't have a dynamic configuration mechanism, so we -// are going to hardcode things for now. Eventually these files will -// be auto generated by some configuration script that can detect -// platform functionality availability. -//-- - -#ifndef liblldb_host_msvc_Config_h_ -#define liblldb_host_msvc_Config_h_ - -#define LLDB_DISABLE_POSIX - -//#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 - -//#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 - -//#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 - -//#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 - -#endif // #ifndef liblldb_Platform_Config_h_ Index: include/lldb/Host/mingw/Config.h === --- include/lldb/Host/mingw/Config.h +++ /dev/null @@ -1,30 +0,0 @@ -//===-- Config.h ---*- C
[Lldb-commits] [PATCH] D31969: [CMake] Support generating Config.h
zturner added a comment. How much would it complicate things to move the hand maintained files out of tree? If the Xcode build isn't really a thing we're officially supporting, perhaps we can take that aggressive approach in-tree as well? Comment at: cmake/modules/LLDBConfig.cmake:287-293 + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ +COMPONENT lldb_headers +DESTINATION include +FILES_MATCHING +PATTERN "*.h" +PATTERN ".svn" EXCLUDE +PATTERN ".cmake" EXCLUDE Is this necessary? Comment at: include/lldb/Host/Config.h.cmake:10-11 + +#ifndef liblldb_Config_h_ +#define liblldb_Config_h_ + Since we're in here anyway, can you use a fully qualified include guard here? Like `#ifndef LLDB_HOST_CONFIG_H`? https://reviews.llvm.org/D31969 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31880: Fix libc++ vector data formatter (bug #32553)
jasonmolenda added a comment. This all looks good to me, thanks for doing this Pavel. Tamas asked in an earlier comment, "The previous version of the data formatter was triggering for std::vector> as well. Jason, do you know why was it the case? Do we need that functionality because of a broken compiler version or can it be removed?" I have no idea why that was there. I could dig around in the svn commit history to try to figure it out, but it may have been unnecessary to begin with. If in doubt, we can drop it and put it back in if we hear of any problems. https://reviews.llvm.org/D31880 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31823: Update LLDB Host to support IPv6 over TCP
zturner added inline comments. Comment at: include/lldb/Host/common/TCPSocket.h:55 + + std::map m_listen_sockets; }; jasonmolenda wrote: > zturner wrote: > > Any particular reason you're using a `std::map` instead of a `DenseMap` or > > other similar LLVM structure? I was under the impression that the number > > of times where you should actually use `std::map` are pretty small. > llvm docs say, "Also, because DenseMap allocates space for a large number of > key/value pairs (it starts with 64 by default), it will waste a lot of space > if your keys or values are large." I think std::map is the right choice. > When it's a tossup between an llvm container class and an STL container > class, my opinion is always to go with the standard container class that > everyone is familiar with already. If there's a distinct benefit to a given > llvm container class for a specific scenario, that's fine, but it just > increases the barrier to entry for people outside the llvm community to use > these classes pervasively. I was under the impression `SocketAddress` was fairly small, but I checked and it turns out it's not. That said, I *still* don't think `std::map` is the right choice, because there is `std::unordered_map` which is more efficient when iterating over keys in sorted order is not a requirement. In fact, I'm not even sure any kind of map is needed. Isn't the point of this just to allow listening on an IPv4 interface and an IPv6 interface at the same time? If so, the most common use case is either going to be 1 item in the map or 2 items in the map, in which case perhaps a `SmallVector, 2>` is better. https://reviews.llvm.org/D31823 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits