[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From 35d7391ec513b2b27082eafaf15693a4a3f5f158 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the named pipe is passed by name and a transient ofstream is constructed at each I/O request. This assumes, - Blocking semantics: FIFO I/O waits for the other side to connect. - Buffered semantics: Closing one side does not discard existing data. The former can be replaced by WaitNamedPipe/ConnectNamedPipe on Win32, but the second cannot be easily worked around. It is also impossible to have another "keep-alive" pipe server instance, as server-client pairs are fixed on connection on Win32 and the client may get connected to it instead of the real one. Refactor FifoFile[IO] to use an open file handles rather than file name. --- lldb/tools/lldb-dap/FifoFiles.cpp | 110 +- lldb/tools/lldb-dap/FifoFiles.h | 31 lldb/tools/lldb-dap/RunInTerminal.cpp | 27 +-- lldb/tools/lldb-dap/RunInTerminal.h | 4 +- lldb/tools/lldb-dap/lldb-dap.cpp | 13 ++- 5 files changed, 138 insertions(+), 47 deletions(-) diff --git a/lldb/tools/lldb-dap/FifoFiles.cpp b/lldb/tools/lldb-dap/FifoFiles.cpp index 1f1bba80bd3b11..f2544cfe974a54 100644 --- a/lldb/tools/lldb-dap/FifoFiles.cpp +++ b/lldb/tools/lldb-dap/FifoFiles.cpp @@ -9,7 +9,13 @@ #include "FifoFiles.h" #include "JSONUtils.h" -#if !defined(_WIN32) +#include "llvm/Support/FileSystem.h" + +#if defined(_WIN32) +#include +#include +#include +#else #include #include #include @@ -24,26 +30,65 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::error_code(errno, std::generic_category()); +llvm::errs() << "Failed to open fifo file: " << path << EC.message() + << "\n"; +return; + } + if (setvbuf(m_file, NULL, _IONBF, 0)) +llvm::errs() << "Error setting unbuffered mode on C FILE\n"; +} +FifoFile::FifoFile(StringRef path, FILE *f) : m_path(path), m_file(f) {} FifoFile::~FifoFile() { + fclose(m_file); #if !defined(_WIN32) unlink(m_path.c_str()); #endif + // Unreferenced named pipes are deleted automatically on Win32 } -Expected> CreateFifoFile(StringRef path) { -#if defined(_WIN32) - return createStringError(inconvertibleErrorCode(), "Unimplemented"); +// This probably belongs to llvm::sys::fs as another FSEntity type +std::error_code createNamedPipe(const Twine &Prefix, StringRef Suffix, +int &ResultFd, +SmallVectorImpl &ResultPath) { + const char *Middle = Suffix.empty() ? "-%%" : "-%%."; + auto EC = sys::fs::getPotentiallyUniqueFileName( +#ifdef _WIN32 + ".\\pipe\\LOCAL\\" +#else + "/tmp/" +#endif + + Prefix + Middle + Suffix, + ResultPath); + if (EC) +return EC; + ResultPath.push_back(0); + const char *path = ResultPath.data(); +#ifdef _WIN32 + HANDLE h = ::CreateNamedPipeA( + path, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 1024, 1024, 0, NULL); + if (h == INVALID_HANDLE_VALUE) +return std::error_code(::GetLastError(), std::system_category()); + ResultFd = _open_osfhandle((intptr_t)h, _O_TEXT | _O_RDWR); + if (ResultFd == -1) +return std::error_code(::GetLastError(), std::system_category()); #else - if (int err = mkfifo(path.data(), 0600)) -return createStringError(std::error_code(err, std::generic_category()), - "Couldn't create fifo file: %s", path.data()); - return std::make_shared(path); + if (mkfifo(path, 0600) == -1) +return std::error_code(errno, std::generic_category()); + EC = openFileForWrite(ResultPath, ResultFd, sys::fs::CD_OpenExisting, sys::fs::OF_None, 0600); + if (EC) +return EC; #endif + return std::error_code(); } -FifoFileIO::FifoFileIO(StringRef fifo_file, StringRef other_endpoint_name) +FifoFileIO::FifoFileIO(FifoFile fifo_file, StringRef other_endpoint_name) : m_fifo_file(fifo_file), m_other_endpoint_name(other_endpoint_name) {} Expected FifoFileIO::ReadJSON(std::chrono::milliseconds timeout) { @@ -52,13 +97,20 @@ Expected FifoFileIO::ReadJSON(std::chrono::milliseconds timeout) { std::optional line; std::future *future = new std::future(std::async(std::launch::async, [&]() { -std::ifstream reader(m_fifo_file, std::ifstream::in); -std::string buffer; -std::getline(reader, buffer); -if (!buffer.empty()) - line = buffer; +rewind(m_fifo_file.m_file); +constexpr size_t buffer_size = 2048; +char buffer[buffer_size]; +cha
[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From b475e34ef1522b2919fc881d88bfa817bb719aa4 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the named pipe is passed by name and a transient ofstream is constructed at each I/O request. This assumes, - Blocking semantics: FIFO I/O waits for the other side to connect. - Buffered semantics: Closing one side does not discard existing data. The former can be replaced by WaitNamedPipe/ConnectNamedPipe on Win32, but the second cannot be easily worked around. It is also impossible to have another "keep-alive" pipe server instance, as server-client pairs are fixed on connection on Win32 and the client may get connected to it instead of the real one. Refactor FifoFile[IO] to use an open file handles rather than file name. --- lldb/tools/lldb-dap/FifoFiles.cpp | 110 +- lldb/tools/lldb-dap/FifoFiles.h | 31 lldb/tools/lldb-dap/RunInTerminal.cpp | 27 +-- lldb/tools/lldb-dap/RunInTerminal.h | 4 +- lldb/tools/lldb-dap/lldb-dap.cpp | 13 ++- 5 files changed, 138 insertions(+), 47 deletions(-) diff --git a/lldb/tools/lldb-dap/FifoFiles.cpp b/lldb/tools/lldb-dap/FifoFiles.cpp index 1f1bba80bd3b11..f2544cfe974a54 100644 --- a/lldb/tools/lldb-dap/FifoFiles.cpp +++ b/lldb/tools/lldb-dap/FifoFiles.cpp @@ -9,7 +9,13 @@ #include "FifoFiles.h" #include "JSONUtils.h" -#if !defined(_WIN32) +#include "llvm/Support/FileSystem.h" + +#if defined(_WIN32) +#include +#include +#include +#else #include #include #include @@ -24,26 +30,65 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::error_code(errno, std::generic_category()); +llvm::errs() << "Failed to open fifo file: " << path << EC.message() + << "\n"; +return; + } + if (setvbuf(m_file, NULL, _IONBF, 0)) +llvm::errs() << "Error setting unbuffered mode on C FILE\n"; +} +FifoFile::FifoFile(StringRef path, FILE *f) : m_path(path), m_file(f) {} FifoFile::~FifoFile() { + fclose(m_file); #if !defined(_WIN32) unlink(m_path.c_str()); #endif + // Unreferenced named pipes are deleted automatically on Win32 } -Expected> CreateFifoFile(StringRef path) { -#if defined(_WIN32) - return createStringError(inconvertibleErrorCode(), "Unimplemented"); +// This probably belongs to llvm::sys::fs as another FSEntity type +std::error_code createNamedPipe(const Twine &Prefix, StringRef Suffix, +int &ResultFd, +SmallVectorImpl &ResultPath) { + const char *Middle = Suffix.empty() ? "-%%" : "-%%."; + auto EC = sys::fs::getPotentiallyUniqueFileName( +#ifdef _WIN32 + ".\\pipe\\LOCAL\\" +#else + "/tmp/" +#endif + + Prefix + Middle + Suffix, + ResultPath); + if (EC) +return EC; + ResultPath.push_back(0); + const char *path = ResultPath.data(); +#ifdef _WIN32 + HANDLE h = ::CreateNamedPipeA( + path, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 1024, 1024, 0, NULL); + if (h == INVALID_HANDLE_VALUE) +return std::error_code(::GetLastError(), std::system_category()); + ResultFd = _open_osfhandle((intptr_t)h, _O_TEXT | _O_RDWR); + if (ResultFd == -1) +return std::error_code(::GetLastError(), std::system_category()); #else - if (int err = mkfifo(path.data(), 0600)) -return createStringError(std::error_code(err, std::generic_category()), - "Couldn't create fifo file: %s", path.data()); - return std::make_shared(path); + if (mkfifo(path, 0600) == -1) +return std::error_code(errno, std::generic_category()); + EC = openFileForWrite(ResultPath, ResultFd, sys::fs::CD_OpenExisting, sys::fs::OF_None, 0600); + if (EC) +return EC; #endif + return std::error_code(); } -FifoFileIO::FifoFileIO(StringRef fifo_file, StringRef other_endpoint_name) +FifoFileIO::FifoFileIO(FifoFile fifo_file, StringRef other_endpoint_name) : m_fifo_file(fifo_file), m_other_endpoint_name(other_endpoint_name) {} Expected FifoFileIO::ReadJSON(std::chrono::milliseconds timeout) { @@ -52,13 +97,20 @@ Expected FifoFileIO::ReadJSON(std::chrono::milliseconds timeout) { std::optional line; std::future *future = new std::future(std::async(std::launch::async, [&]() { -std::ifstream reader(m_fifo_file, std::ifstream::in); -std::string buffer; -std::getline(reader, buffer); -if (!buffer.empty()) - line = buffer; +rewind(m_fifo_file.m_file); +constexpr size_t buffer_size = 2048; +char buffer[buffer_size]; +cha
[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)
SuibianP wrote: Ping https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NetBSD] Remove unused include in FileSystemPosix.cpp (PR #121920)
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/121920 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 7edeeab - [lldb][NetBSD] Remove unused include in FileSystemPosix.cpp (#121920)
Author: David Spickett Date: 2025-01-07T14:07:38Z New Revision: 7edeeab5e0023dabd6003d6f113575a5b5b6c83b URL: https://github.com/llvm/llvm-project/commit/7edeeab5e0023dabd6003d6f113575a5b5b6c83b DIFF: https://github.com/llvm/llvm-project/commit/7edeeab5e0023dabd6003d6f113575a5b5b6c83b.diff LOG: [lldb][NetBSD] Remove unused include in FileSystemPosix.cpp (#121920) Added: Modified: lldb/source/Host/posix/FileSystemPosix.cpp Removed: diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index d2e5b52917ac26..4c326a29812f77 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -11,9 +11,6 @@ // C includes #include #include -#if defined(__NetBSD__) -#include -#endif // lldb Includes #include "lldb/Host/Host.h" ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 0d9cf26 - [lldb-dap] Ensure the IO forwarding threads are managed by the DAP object lifecycle. (#120457)
Author: John Harrison Date: 2025-01-07T09:01:34-08:00 New Revision: 0d9cf2671e06c9124a0b5fc753330c39c8b4a791 URL: https://github.com/llvm/llvm-project/commit/0d9cf2671e06c9124a0b5fc753330c39c8b4a791 DIFF: https://github.com/llvm/llvm-project/commit/0d9cf2671e06c9124a0b5fc753330c39c8b4a791.diff LOG: [lldb-dap] Ensure the IO forwarding threads are managed by the DAP object lifecycle. (#120457) This moves the ownership of the threads that forward stdout/stderr to the DAP object itself to ensure that the threads are joined and that the forwarding is cleaned up when the DAP connection is disconnected. This is part of a larger refactor to allow lldb-dap to run in a listening mode and accept multiple connections. - Co-authored-by: Pavel Labath Added: Modified: lldb/tools/lldb-dap/CMakeLists.txt lldb/tools/lldb-dap/DAP.cpp lldb/tools/lldb-dap/DAP.h lldb/tools/lldb-dap/IOStream.h lldb/tools/lldb-dap/OutputRedirector.cpp lldb/tools/lldb-dap/OutputRedirector.h lldb/tools/lldb-dap/lldb-dap.cpp Removed: diff --git a/lldb/tools/lldb-dap/CMakeLists.txt b/lldb/tools/lldb-dap/CMakeLists.txt index d68098bf7b3266..43fc18873feb33 100644 --- a/lldb/tools/lldb-dap/CMakeLists.txt +++ b/lldb/tools/lldb-dap/CMakeLists.txt @@ -1,7 +1,3 @@ -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) - list(APPEND extra_libs lldbHost) -endif () - if (HAVE_LIBPTHREAD) list(APPEND extra_libs pthread) endif () @@ -26,9 +22,11 @@ add_lldb_tool(lldb-dap lldb-dap.cpp Breakpoint.cpp BreakpointBase.cpp + DAP.cpp ExceptionBreakpoint.cpp FifoFiles.cpp FunctionBreakpoint.cpp + InstructionBreakpoint.cpp IOStream.cpp JSONUtils.cpp LLDBUtils.cpp @@ -36,12 +34,11 @@ add_lldb_tool(lldb-dap ProgressEvent.cpp RunInTerminal.cpp SourceBreakpoint.cpp - DAP.cpp Watchpoint.cpp - InstructionBreakpoint.cpp LINK_LIBS liblldb +lldbHost ${extra_libs} LINK_COMPONENTS diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp index 35250d9eef608a..a67abe582abd40 100644 --- a/lldb/tools/lldb-dap/DAP.cpp +++ b/lldb/tools/lldb-dap/DAP.cpp @@ -6,34 +6,62 @@ // //===--===// -#include -#include -#include -#include - #include "DAP.h" #include "JSONUtils.h" #include "LLDBUtils.h" +#include "OutputRedirector.h" +#include "lldb/API/SBBreakpoint.h" #include "lldb/API/SBCommandInterpreter.h" +#include "lldb/API/SBCommandReturnObject.h" #include "lldb/API/SBLanguageRuntime.h" #include "lldb/API/SBListener.h" +#include "lldb/API/SBProcess.h" #include "lldb/API/SBStream.h" +#include "lldb/Host/FileSystem.h" +#include "lldb/Utility/Status.h" +#include "lldb/lldb-defines.h" +#include "lldb/lldb-enumerations.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/Error.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormatVariadic.h" +#include "llvm/Support/raw_ostream.h" +#include +#include +#include +#include +#include +#include +#include +#include #if defined(_WIN32) #define NOMINMAX #include #include #include +#else +#include #endif using namespace lldb_dap; +namespace { +#ifdef _WIN32 +const char DEV_NULL[] = "nul"; +#else +const char DEV_NULL[] = "/dev/null"; +#endif +} // namespace + namespace lldb_dap { -DAP::DAP(llvm::StringRef path, ReplMode repl_mode) -: debug_adaptor_path(path), broadcaster("lldb-dap"), +DAP::DAP(llvm::StringRef path, std::ofstream *log, ReplMode repl_mode, + StreamDescriptor input, StreamDescriptor output) +: debug_adaptor_path(path), log(log), input(std::move(input)), + output(std::move(output)), broadcaster("lldb-dap"), exception_breakpoints(), focus_tid(LLDB_INVALID_THREAD_ID), stop_at_entry(false), is_attach(false), enable_auto_variable_summaries(false), @@ -43,21 +71,7 @@ DAP::DAP(llvm::StringRef path, ReplMode repl_mode) configuration_done_sent(false), waiting_for_run_in_terminal(false), progress_event_reporter( [&](const ProgressEvent &event) { SendJSON(event.ToJSON()); }), - reverse_request_seq(0), repl_mode(repl_mode) { - const char *log_file_path = getenv("LLDBDAP_LOG"); -#if defined(_WIN32) - // Windows opens stdout and stdin in text mode which converts \n to 13,10 - // while the value is just 10 on Darwin/Linux. Setting the file mode to binary - // fixes this. - int result = _setmode(fileno(stdout), _O_BINARY); - assert(result); - result = _setmode(fileno(stdin), _O_BINARY); - UNUSED_IF_ASSERT_DISABLED(result); - assert(result); -#endif - if (log_file_path) -log.reset(new std::ofstream(log_file_path)); -} + reverse_request_seq(0), repl_mode(repl_mode) {} DAP::~DAP() = default; @@ -173,6 +187,45 @
[Lldb-commits] [lldb] [lldb-dap] Ensure the IO forwarding threads are managed by the DAP object lifecycle. (PR #120457)
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/120457 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NetBSD] Remove unused include in FileSystemPosix.cpp (PR #121920)
https://github.com/brad0 approved this pull request. https://github.com/llvm/llvm-project/pull/121920 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] a15fedc - [lldb] Correct address calculation for reading segment data (#120655)
Author: GeorgeHuyubo Date: 2025-01-07T10:31:18-08:00 New Revision: a15fedc399d5d1aa07c14531e5cd8d3efc583600 URL: https://github.com/llvm/llvm-project/commit/a15fedc399d5d1aa07c14531e5cd8d3efc583600 DIFF: https://github.com/llvm/llvm-project/commit/a15fedc399d5d1aa07c14531e5cd8d3efc583600.diff LOG: [lldb] Correct address calculation for reading segment data (#120655) This commit addresses a bug introduced in commit bcf654c, which prevented LLDB from parsing the GNU build ID for the main executable from a core file. The fix finds the `p_vaddr` of the first `PT_LOAD` segment as the `base_addr` and subtract this `base_addr` from the virtual address being read. Co-authored-by: George Hu Added: Modified: lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp Removed: diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index b3916cc913f7db..5f85f99ce7bddc 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -1031,6 +1031,8 @@ UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) { std::vector ph_bytes; ph_bytes.resize(elf_header.e_phentsize); + lldb::addr_t base_addr = 0; + bool found_first_load_segment = false; for (unsigned int i = 0; i < elf_header.e_phnum; ++i) { byte_read = ReadMemory(ph_addr + i * elf_header.e_phentsize, ph_bytes.data(), elf_header.e_phentsize, error); @@ -1041,6 +1043,11 @@ UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) { offset = 0; elf::ELFProgramHeader program_header; program_header.Parse(program_header_data, &offset); +if (program_header.p_type == llvm::ELF::PT_LOAD && +!found_first_load_segment) { + base_addr = program_header.p_vaddr; + found_first_load_segment = true; +} if (program_header.p_type != llvm::ELF::PT_NOTE) continue; @@ -1049,7 +1056,7 @@ UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) { // We need to slide the address of the p_vaddr as these values don't get // relocated in memory. -const lldb::addr_t vaddr = program_header.p_vaddr + address; +const lldb::addr_t vaddr = program_header.p_vaddr + address - base_addr; byte_read = ReadMemory(vaddr, note_bytes.data(), program_header.p_memsz, error); if (byte_read != program_header.p_memsz) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct address calculation for reading segment data (PR #120655)
https://github.com/GeorgeHuyubo closed https://github.com/llvm/llvm-project/pull/120655 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct address calculation for reading segment data (PR #120655)
https://github.com/GeorgeHuyubo edited https://github.com/llvm/llvm-project/pull/120655 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fixing FindUnusedPort method tcp_socket object creation with proper constructor parameter (PR #121879)
SiamAbdullah wrote: > Thanks for the fix. Should I press the "merge" button for you? yes please. I don't see the merge option. Thank You https://github.com/llvm/llvm-project/pull/121879 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] Ensure the IO forwarding threads are managed by the DAP object lifecycle. (PR #120457)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-windows` running on `linaro-armv8-windows-msvc-05` while building `lldb` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/5258 Here is the relevant piece of the build log for the reference ``` Step 6 (test) failure: build (failure) ... UNSUPPORTED: lldb-api :: tools/lldb-dap/stackTrace/TestDAP_stackTrace.py (1157 of 2058) UNSUPPORTED: lldb-api :: tools/lldb-dap/stackTrace/subtleFrames/TestDAP_subtleFrames.py (1158 of 2058) UNSUPPORTED: lldb-api :: tools/lldb-dap/stackTraceMissingFunctionName/TestDAP_stackTraceMissingFunctionName.py (1159 of 2058) PASS: lldb-api :: tools/lldb-dap/send-event/TestDAP_sendEvent.py (1160 of 2058) UNSUPPORTED: lldb-api :: tools/lldb-dap/step/TestDAP_step.py (1161 of 2058) PASS: lldb-api :: tools/lldb-dap/startDebugging/TestDAP_startDebugging.py (1162 of 2058) UNSUPPORTED: lldb-api :: tools/lldb-dap/stepInTargets/TestDAP_stepInTargets.py (1163 of 2058) UNSUPPORTED: lldb-api :: tools/lldb-dap/terminated-event/TestDAP_terminatedEvent.py (1164 of 2058) UNSUPPORTED: lldb-api :: tools/lldb-dap/threads/TestDAP_threads.py (1165 of 2058) PASS: lldb-api :: tools/lldb-dap/stop-hooks/TestDAP_stop_hooks.py (1166 of 2058) FAIL: lldb-api :: tools/lldb-dap/variables/children/TestDAP_variables_children.py (1167 of 2058) TEST 'lldb-api :: tools/lldb-dap/variables/children/TestDAP_variables_children.py' FAILED Script: -- C:/Users/tcwg/scoop/apps/python/current/python.exe C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/llvm-project/lldb\test\API\dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --env LLVM_INCLUDE_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/include --env LLVM_TOOLS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --arch aarch64 --build-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex --lldb-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-lldb\lldb-api --clang-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-clang\lldb-api --executable C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/lldb.exe --compiler C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/clang.exe --dsymutil C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/dsymutil.exe --make C:/Users/tcwg/scoop/shims/make.exe --llvm-tools-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --lldb-obj-root C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/tools/lldb --lldb-libs-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --skip-category=watchpoint C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\tools\lldb-dap\variables\children -p TestDAP_variables_children.py -- Exit Code: 1 Command Output (stdout): -- lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 0d9cf2671e06c9124a0b5fc753330c39c8b4a791) clang revision 0d9cf2671e06c9124a0b5fc753330c39c8b4a791 llvm revision 0d9cf2671e06c9124a0b5fc753330c39c8b4a791 Skipping the following test categories: ['watchpoint', 'libc++', 'libstdcxx', 'dwo', 'dsym', 'gmodules', 'debugserver', 'objc', 'fork', 'pexpect'] [{'$__lldb_extensions': {'declaration': {'line': 5, 'path': 'C:\\Users\\tcwg\\llvm-worker\\lldb-aarch64-windows\\llvm-project\\lldb\\test\\API\\tools\\lldb-dap\\variables\\children\\main.cpp'}}, 'declarationLocationReference': 8, 'evaluateName': 'indexed', 'id': 4, 'indexedVariables': 1, 'memoryReference': '0xD70638FC7B', 'name': 'indexed', 'type': 'Indexed', 'value': 'Indexed @ 0xd70638fc7b', 'variablesReference': 4}, {'$__lldb_extensions': {'declaration': {'line': 6, 'path': 'C:\\Users\\tcwg\\llvm-worker\\lldb-aarch64-windows\\llvm-project\\lldb\\test\\API\\tools\\lldb-dap\\variables\\children\\main.cpp'}}, 'declarationLocationReference': 10, 'evaluateName': 'not_indexed', 'id': 5, 'memoryReference': '0xD70638FC7A', 'name': 'not_indexed', 'type': 'NotIndexed', 'value': 'NotIndexed @ 0xd70638fc7a', 'variablesReference': 5}] = DEBUG ADAPTER PROTOCOL LOGS = 1736281236.409484386 --> Content-Length: 344 { "arguments": { "adapterID": "lldb-native", "clientID": "vscode", "columnsStartAt1": true, ``` https://github.com/llvm/llvm-project/pull/120457 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct address calculation for reading segment data (PR #120655)
https://github.com/GeorgeHuyubo edited https://github.com/llvm/llvm-project/pull/120655 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; Jlalond wrote: @clayborg Got it, from the context of the conversation I thought you wanted that structure data embedded in the Corefile. I think that makes sense instead of using this Flag stream. https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; Jlalond wrote: @labath I agree, I think it would be ideal to agree with Breakpad/Crashpad on a section about what program generated it, including version of that software. From Memory I know there is some brakepad relevant data, but a unified section would be great. https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 56936ec - Fixing FindUnusedPort method tcp_socket object creation with proper constructor parameter (#121879)
Author: Sad Al Abdullah Date: 2025-01-07T12:59:09-08:00 New Revision: 56936ec63dcc03f64c129ee45716431e56e5d3d1 URL: https://github.com/llvm/llvm-project/commit/56936ec63dcc03f64c129ee45716431e56e5d3d1 DIFF: https://github.com/llvm/llvm-project/commit/56936ec63dcc03f64c129ee45716431e56e5d3d1.diff LOG: Fixing FindUnusedPort method tcp_socket object creation with proper constructor parameter (#121879) ### Issue: Currently lldb `platform connect unix-connect://localhost:43045/` is failing and showing "Failed to connect port" error message.  ### Cause: TCPSocket(bool should_close, bool child_processes_inherit) constructor was removed in commit [c1dff71](https://github.com/llvm/llvm-project/commit/c1dff7152592f1beee9059ee8e2cb3cc68baea4d#diff-91817651b505a466ea94ddc44eca856f62073e03b05d0d0d2f4a55dcfea0002eL20). However, the tcp_socket object creation still passes the deleted constructor parameters, which causes the invocation of the wrong constructor. As a result, the `FindUnusedPort` method is unable to resolve the local port and always returns 0. Added: Modified: lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp Removed: diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp index d18b718d4a56cf..0cf64807ec0d64 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -64,7 +64,7 @@ static Status DeleteForwardPortWithAdb(uint16_t local_port, static Status FindUnusedPort(uint16_t &port) { Status error; - std::unique_ptr tcp_socket(new TCPSocket(true, false)); + std::unique_ptr tcp_socket(new TCPSocket(true)); if (error.Fail()) return error; ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fixing FindUnusedPort method tcp_socket object creation with proper constructor parameter (PR #121879)
github-actions[bot] wrote: @SiamAbdullah Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail [here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr). If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of [LLVM development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy). You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! https://github.com/llvm/llvm-project/pull/121879 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fixing FindUnusedPort method tcp_socket object creation with proper constructor parameter (PR #121879)
https://github.com/JDevlieghere closed https://github.com/llvm/llvm-project/pull/121879 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; clayborg wrote: We should change all dynamic loaders to always check with the process via: ``` lldb_private::StructuredData::ObjectSP Process::GetLoadedDynamicLibrariesInfos() ``` This allows processes to tell the dynamic loaders where things are loaded in case they know, like in the case of minidumps. So we can probably make the POSIX dynamic loader a bit smarter when it comes to dealing with core files. https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; clayborg wrote: If nothing comes back from this call, then the dynamic loader will use its normal means to locate things, else, it should use the list that the process provides. https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; Jlalond wrote: @clayborg Just so I follow, you're recommending we embed a structured data (really just Json) into a section? If so, I really like the proposal, because it allows us to have a fairly loose schema across Brakepad, Crashpad and LLDB. https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; clayborg wrote: No, we should implement the `lldb_private::StructuredData::ObjectSP Process::GetLoadedDynamicLibrariesInfos()` virtual method in ProcessMinidump and return a structured data that describes where everything is loaded. Then have the POSIX dynamic loader call this method on the process object and see if it returns anything. If it does, then we use this as the truth, else we discover the shared libraries using the existing code in the POSIX dynamic loader. https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; clayborg wrote: (since ProcessMinidump has the shared library load list embedded in a directory). https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 4ecd9bd - [lldb][Posix] Remove unused includes in file system (#121913)
Author: David Spickett Date: 2025-01-07T11:23:17Z New Revision: 4ecd9bd03b8b0e2ceba5c6c8525227be8d8ab215 URL: https://github.com/llvm/llvm-project/commit/4ecd9bd03b8b0e2ceba5c6c8525227be8d8ab215 DIFF: https://github.com/llvm/llvm-project/commit/4ecd9bd03b8b0e2ceba5c6c8525227be8d8ab215.diff LOG: [lldb][Posix] Remove unused includes in file system (#121913) You could remove unistd.h and it will still build, but only because something else included it. So I've left it in in the spirit of "include what you use". Tested on Linux and FreeBSD. Added: Modified: lldb/source/Host/posix/FileSystemPosix.cpp Removed: diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 945e2affc83715..d2e5b52917ac26 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -9,12 +9,7 @@ #include "lldb/Host/FileSystem.h" // C includes -#include #include -#include -#include -#include -#include #include #if defined(__NetBSD__) #include ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/121913 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)
https://github.com/DhruvSrivastavaX commented: Tested with AIX too. Thanks! https://github.com/llvm/llvm-project/pull/121913 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)
brad0 wrote: @DavidSpickett The NetBSD statvfs header can be removed as the relevant code was removed quite some time ago.. https://github.com/llvm/llvm-project/commit/bfe8bcbc43ccd45d4d32d0c5b6acc22d43ff330d https://github.com/llvm/llvm-project/pull/121913 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)
@@ -89,8 +89,11 @@ Status MinidumpFileBuilder::AddHeaderAndCalculateDirectories() { "Failed to fill in header and directory " "sections. Written / Expected (%" PRIx64 " / %" PRIx64 ")", new_offset, m_saved_data_size); - return error; + if (error.Fail()) +return error; labath wrote: Ultimately I think this patch is a workaround for the fact that the dynamic loader (posix) and process (minidump) classes can't agree on how to load the modules. The dynamic loader expect that it will be completely in charge of module loading, and this works fine in case of a live process, as it always contains enough information to determine the set of loaded modules. A minidump does not (always) contains this information, but (maybe for that same reason) it contains a explicit list of loaded modules (which is handled by the process class). When we start to use both sources, things get messy. I'm not sure what's the best way to handle this situation, but I think this patch approximates the desired behavior relatively well, and I think it is useful to be able to tell who generated a minidump. https://github.com/llvm/llvm-project/pull/120166 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/121913 You could remove unistd.h and it builds, but only because something else included it. So I've left it in in the spirit of "include what you use". Tested on Linux and FreeBSD. >From 770bad587e02f5aa2851b2c650b1012f4b756188 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Tue, 7 Jan 2025 10:44:58 + Subject: [PATCH] [lldb][Posix] Remove unused includes in file system You could remove unistd.h and it builds, but only because something else included it. So I've left it in in the spirit of "include what you use". --- lldb/source/Host/posix/FileSystemPosix.cpp | 5 - 1 file changed, 5 deletions(-) diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 945e2affc83715..d2e5b52917ac26 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -9,12 +9,7 @@ #include "lldb/Host/FileSystem.h" // C includes -#include #include -#include -#include -#include -#include #include #if defined(__NetBSD__) #include ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) Changes You could remove unistd.h and it builds, but only because something else included it. So I've left it in in the spirit of "include what you use". Tested on Linux and FreeBSD. --- Full diff: https://github.com/llvm/llvm-project/pull/121913.diff 1 Files Affected: - (modified) lldb/source/Host/posix/FileSystemPosix.cpp (-5) ``diff diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 945e2affc83715..d2e5b52917ac26 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -9,12 +9,7 @@ #include "lldb/Host/FileSystem.h" // C includes -#include #include -#include -#include -#include -#include #include #if defined(__NetBSD__) #include `` https://github.com/llvm/llvm-project/pull/121913 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/121913 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -11,7 +11,9 @@ // C includes #include #include +#ifndef _AIX #include DavidSpickett wrote: https://github.com/llvm/llvm-project/pull/121913 https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NetBSD] Remove unused include in FileSystemPosix.cpp (PR #121920)
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/121920 None >From 0b4048f40300d00659a7b6067e183bb1fcc9efe5 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Tue, 7 Jan 2025 11:46:02 + Subject: [PATCH] [lldb][NetBSD] Remove unused include in FileSystemPosix.cpp --- lldb/source/Host/posix/FileSystemPosix.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index d2e5b52917ac26..4c326a29812f77 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -11,9 +11,6 @@ // C includes #include #include -#if defined(__NetBSD__) -#include -#endif // lldb Includes #include "lldb/Host/Host.h" ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NetBSD] Remove unused include in FileSystemPosix.cpp (PR #121920)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/121920.diff 1 Files Affected: - (modified) lldb/source/Host/posix/FileSystemPosix.cpp (-3) ``diff diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index d2e5b52917ac26..4c326a29812f77 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -11,9 +11,6 @@ // C includes #include #include -#if defined(__NetBSD__) -#include -#endif // lldb Includes #include "lldb/Host/Host.h" `` https://github.com/llvm/llvm-project/pull/121920 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [compiler-rt] [flang] [libc] [libclc] [libcxx] [lldb] [llvm] [mlir] [polly] Make AMDGPUCombinerHelper methods const (PR #121740)
Alejandro =?utf-8?q?Álvarez_Ayllón?=,Matthias Springer =?utf-8?q?,?=Mats Petersson ,Benjamin Maxwell ,Nikolas Klauser ,Luke Lau ,Dhruv Srivastava ,staz ,Arseniy Zaostrovnykh ,Kerry McLaughlin ,Maksim Levental ,Vikash Gupta ,Maksim Levental ,Simon Pilgrim ,Yihe Li ,Nico Weber ,David Sherwood ,JoelWee <32009741+joel...@users.noreply.github.com>,Phoebe Wang ,Simon Pilgrim ,Nikita Popov ,Yingwei Zheng ,cor3ntin ,Joseph Huber ,Vlad Serebrennikov ,Nikita Popov ,Vlad Serebrennikov ,arthurqiu ,Joseph Huber ,Paul Bowen-Huggett Message-ID: In-Reply-To: https://github.com/paulhuggett closed https://github.com/llvm/llvm-project/pull/121740 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [compiler-rt] [flang] [libc] [libclc] [libcxx] [lldb] [llvm] [mlir] [polly] Make AMDGPUCombinerHelper methods const (PR #121740)
Alejandro =?utf-8?q?Álvarez_Ayllón?=,Matthias Springer =?utf-8?q?,?=Mats Petersson ,Benjamin Maxwell ,Nikolas Klauser ,Luke Lau ,Dhruv Srivastava ,staz ,Arseniy Zaostrovnykh ,Kerry McLaughlin ,Maksim Levental ,Vikash Gupta ,Maksim Levental ,Simon Pilgrim ,Yihe Li ,Nico Weber ,David Sherwood ,JoelWee <32009741+joel...@users.noreply.github.com>,Phoebe Wang ,Simon Pilgrim ,Nikita Popov ,Yingwei Zheng ,cor3ntin ,Joseph Huber ,Vlad Serebrennikov ,Nikita Popov ,Vlad Serebrennikov ,arthurqiu ,Joseph Huber ,Paul Bowen-Huggett Message-ID: In-Reply-To: paulhuggett wrote: Sorry, I screwed up resolving conflicts. I'm going to abandon this PR and try again. https://github.com/llvm/llvm-project/pull/121740 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)
https://github.com/labath approved this pull request. https://github.com/llvm/llvm-project/pull/121913 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Added PlatformAIX plugin (PR #121273)
@@ -0,0 +1,370 @@ +//===-- PlatformAIX.cpp -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// + +#include "PlatformAIX.h" +#include "lldb/Host/Config.h" +#include +#if LLDB_ENABLE_POSIX +#include +#endif +#include "Utility/ARM64_DWARF_Registers.h" +#include "lldb/Core/Debugger.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Host/HostInfo.h" +#include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/Target.h" +#include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/LLDBLog.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/State.h" +#include "lldb/Utility/Status.h" +#include "lldb/Utility/StreamString.h" + +// Use defined constants from AIX mman.h for use when targeting remote aix +// systems even when host has different values. + +#if defined(_AIX) +#include +#endif + +using namespace lldb; +using namespace lldb_private; +using namespace lldb_private::platform_aix; + +LLDB_PLUGIN_DEFINE(PlatformAIX) + +static uint32_t g_initialize_count = 0; + +PlatformSP PlatformAIX::CreateInstance(bool force, const ArchSpec *arch) { + Log *log = GetLog(LLDBLog::Platform); + LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force, + arch ? arch->GetArchitectureName() : "", + arch ? arch->GetTriple().getTriple() : ""); + + bool create = force; + if (!create && arch && arch->IsValid()) { +const llvm::Triple &triple = arch->GetTriple(); +switch (triple.getOS()) { +case llvm::Triple::AIX: + create = true; + break; + +default: + break; +} + } + + LLDB_LOG(log, "create = {0}", create); + if (create) { +return PlatformSP(new PlatformAIX(false)); + } + return PlatformSP(); +} + +llvm::StringRef PlatformAIX::GetPluginDescriptionStatic(bool is_host) { + if (is_host) +return "Local AIX user platform plug-in."; + return "Remote AIX user platform plug-in."; +} + +void PlatformAIX::Initialize() { + PlatformPOSIX::Initialize(); + + if (g_initialize_count++ == 0) { +#ifdef _AIX +PlatformSP default_platform_sp(new PlatformAIX(true)); +default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture()); +Platform::SetHostPlatform(default_platform_sp); +#endif +PluginManager::RegisterPlugin( +PlatformAIX::GetPluginNameStatic(false), +PlatformAIX::GetPluginDescriptionStatic(false), +PlatformAIX::CreateInstance, nullptr); + } +} + +void PlatformAIX::Terminate() { + if (g_initialize_count > 0) { +if (--g_initialize_count == 0) { + PluginManager::UnregisterPlugin(PlatformAIX::CreateInstance); +} + } + + PlatformPOSIX::Terminate(); +} + +/// Default Constructor +PlatformAIX::PlatformAIX(bool is_host) +: PlatformPOSIX(is_host) // This is the local host platform +{ + if (is_host) { +ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault); +m_supported_architectures.push_back(hostArch); +if (hostArch.GetTriple().isArch64Bit()) { + m_supported_architectures.push_back( + HostInfo::GetArchitecture(HostInfo::eArchKind32)); +} + } else { +m_supported_architectures = +CreateArchList({llvm::Triple::ppc64}, llvm::Triple::AIX); + } +} + +std::vector +PlatformAIX::GetSupportedArchitectures(const ArchSpec &process_host_arch) { + if (m_remote_platform_sp) +return m_remote_platform_sp->GetSupportedArchitectures(process_host_arch); + return m_supported_architectures; +} + +void PlatformAIX::GetStatus(Stream &strm) { + Platform::GetStatus(strm); + +#if LLDB_ENABLE_POSIX + // Display local kernel information only when we are running in host mode. + // Otherwise, we would end up printing non-AIX information (when running on + // Mac OS for example). + if (IsHost()) { +struct utsname un; + +if (uname(&un)) + return; + +strm.Printf("Kernel: %s\n", un.sysname); +strm.Printf(" Release: %s\n", un.release); +strm.Printf(" Version: %s\n", un.version); + } +#endif +} + +uint32_t +PlatformAIX::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) { + uint32_t resume_count = 0; + + // Always resume past the initial stop when we use eLaunchFlagDebug + if (launch_info.GetFlags().Test(eLaunchFlagDebug)) { +// Resume past the stop for the final exec into the true inferior. +++resume_count; + } + + // If we're not launching a shell, we're done. + const FileSpec &shell = launch_info.GetShell(); + if (!shell) +return resume_count; + + std::string shell_string = shell.GetPath(); + // We're in a shell, so for sure we have to resume past the shell exec. + ++resume_count; + + // Figure out what shell we're planning on using. + const char *shell_name
[Lldb-commits] [lldb] [lldb][AIX] Added PlatformAIX plugin (PR #121273)
@@ -0,0 +1,370 @@ +//===-- PlatformAIX.cpp -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// + +#include "PlatformAIX.h" +#include "lldb/Host/Config.h" +#include +#if LLDB_ENABLE_POSIX +#include +#endif +#include "Utility/ARM64_DWARF_Registers.h" +#include "lldb/Core/Debugger.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Host/HostInfo.h" +#include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/Target.h" +#include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/LLDBLog.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/State.h" +#include "lldb/Utility/Status.h" +#include "lldb/Utility/StreamString.h" + +// Use defined constants from AIX mman.h for use when targeting remote aix +// systems even when host has different values. + +#if defined(_AIX) +#include +#endif + +using namespace lldb; +using namespace lldb_private; +using namespace lldb_private::platform_aix; + +LLDB_PLUGIN_DEFINE(PlatformAIX) + +static uint32_t g_initialize_count = 0; + +PlatformSP PlatformAIX::CreateInstance(bool force, const ArchSpec *arch) { + Log *log = GetLog(LLDBLog::Platform); + LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force, + arch ? arch->GetArchitectureName() : "", + arch ? arch->GetTriple().getTriple() : ""); + + bool create = force; + if (!create && arch && arch->IsValid()) { +const llvm::Triple &triple = arch->GetTriple(); +switch (triple.getOS()) { +case llvm::Triple::AIX: + create = true; + break; + +default: + break; +} + } + + LLDB_LOG(log, "create = {0}", create); + if (create) { +return PlatformSP(new PlatformAIX(false)); + } + return PlatformSP(); +} + +llvm::StringRef PlatformAIX::GetPluginDescriptionStatic(bool is_host) { + if (is_host) +return "Local AIX user platform plug-in."; + return "Remote AIX user platform plug-in."; +} + +void PlatformAIX::Initialize() { + PlatformPOSIX::Initialize(); + + if (g_initialize_count++ == 0) { +#ifdef _AIX +PlatformSP default_platform_sp(new PlatformAIX(true)); +default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture()); +Platform::SetHostPlatform(default_platform_sp); +#endif +PluginManager::RegisterPlugin( +PlatformAIX::GetPluginNameStatic(false), +PlatformAIX::GetPluginDescriptionStatic(false), +PlatformAIX::CreateInstance, nullptr); + } +} + +void PlatformAIX::Terminate() { + if (g_initialize_count > 0) { +if (--g_initialize_count == 0) { + PluginManager::UnregisterPlugin(PlatformAIX::CreateInstance); +} + } + + PlatformPOSIX::Terminate(); +} + +/// Default Constructor +PlatformAIX::PlatformAIX(bool is_host) +: PlatformPOSIX(is_host) // This is the local host platform +{ + if (is_host) { +ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault); +m_supported_architectures.push_back(hostArch); +if (hostArch.GetTriple().isArch64Bit()) { + m_supported_architectures.push_back( + HostInfo::GetArchitecture(HostInfo::eArchKind32)); +} + } else { +m_supported_architectures = +CreateArchList({llvm::Triple::ppc64}, llvm::Triple::AIX); + } +} + +std::vector +PlatformAIX::GetSupportedArchitectures(const ArchSpec &process_host_arch) { + if (m_remote_platform_sp) +return m_remote_platform_sp->GetSupportedArchitectures(process_host_arch); + return m_supported_architectures; +} + +void PlatformAIX::GetStatus(Stream &strm) { + Platform::GetStatus(strm); + +#if LLDB_ENABLE_POSIX + // Display local kernel information only when we are running in host mode. + // Otherwise, we would end up printing non-AIX information (when running on + // Mac OS for example). + if (IsHost()) { +struct utsname un; + +if (uname(&un)) + return; + +strm.Printf("Kernel: %s\n", un.sysname); +strm.Printf(" Release: %s\n", un.release); +strm.Printf(" Version: %s\n", un.version); + } +#endif +} + +uint32_t +PlatformAIX::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) { + uint32_t resume_count = 0; + + // Always resume past the initial stop when we use eLaunchFlagDebug + if (launch_info.GetFlags().Test(eLaunchFlagDebug)) { +// Resume past the stop for the final exec into the true inferior. +++resume_count; + } + + // If we're not launching a shell, we're done. + const FileSpec &shell = launch_info.GetShell(); + if (!shell) +return resume_count; + + std::string shell_string = shell.GetPath(); + // We're in a shell, so for sure we have to resume past the shell exec. + ++resume_count; + + // Figure out what shell we're planning on using. + const char *shell_name
[Lldb-commits] [lldb] [lldb][AIX] Added PlatformAIX plugin (PR #121273)
@@ -0,0 +1,370 @@ +//===-- PlatformAIX.cpp -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// + +#include "PlatformAIX.h" +#include "lldb/Host/Config.h" +#include +#if LLDB_ENABLE_POSIX +#include +#endif +#include "Utility/ARM64_DWARF_Registers.h" +#include "lldb/Core/Debugger.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Host/HostInfo.h" +#include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/Target.h" +#include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/LLDBLog.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/State.h" +#include "lldb/Utility/Status.h" +#include "lldb/Utility/StreamString.h" + +// Use defined constants from AIX mman.h for use when targeting remote aix +// systems even when host has different values. + +#if defined(_AIX) +#include +#endif + +using namespace lldb; +using namespace lldb_private; +using namespace lldb_private::platform_aix; + +LLDB_PLUGIN_DEFINE(PlatformAIX) + +static uint32_t g_initialize_count = 0; + +PlatformSP PlatformAIX::CreateInstance(bool force, const ArchSpec *arch) { + Log *log = GetLog(LLDBLog::Platform); + LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force, + arch ? arch->GetArchitectureName() : "", + arch ? arch->GetTriple().getTriple() : ""); + + bool create = force; + if (!create && arch && arch->IsValid()) { +const llvm::Triple &triple = arch->GetTriple(); +switch (triple.getOS()) { +case llvm::Triple::AIX: + create = true; + break; + +default: + break; +} + } + + LLDB_LOG(log, "create = {0}", create); + if (create) { +return PlatformSP(new PlatformAIX(false)); + } + return PlatformSP(); +} + +llvm::StringRef PlatformAIX::GetPluginDescriptionStatic(bool is_host) { + if (is_host) +return "Local AIX user platform plug-in."; + return "Remote AIX user platform plug-in."; +} + +void PlatformAIX::Initialize() { + PlatformPOSIX::Initialize(); + + if (g_initialize_count++ == 0) { +#ifdef _AIX +PlatformSP default_platform_sp(new PlatformAIX(true)); +default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture()); +Platform::SetHostPlatform(default_platform_sp); +#endif +PluginManager::RegisterPlugin( +PlatformAIX::GetPluginNameStatic(false), +PlatformAIX::GetPluginDescriptionStatic(false), +PlatformAIX::CreateInstance, nullptr); + } +} + +void PlatformAIX::Terminate() { + if (g_initialize_count > 0) { +if (--g_initialize_count == 0) { + PluginManager::UnregisterPlugin(PlatformAIX::CreateInstance); +} + } + + PlatformPOSIX::Terminate(); +} + +/// Default Constructor +PlatformAIX::PlatformAIX(bool is_host) +: PlatformPOSIX(is_host) // This is the local host platform +{ + if (is_host) { +ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault); +m_supported_architectures.push_back(hostArch); +if (hostArch.GetTriple().isArch64Bit()) { + m_supported_architectures.push_back( + HostInfo::GetArchitecture(HostInfo::eArchKind32)); +} + } else { +m_supported_architectures = +CreateArchList({llvm::Triple::ppc64}, llvm::Triple::AIX); + } +} + +std::vector +PlatformAIX::GetSupportedArchitectures(const ArchSpec &process_host_arch) { + if (m_remote_platform_sp) +return m_remote_platform_sp->GetSupportedArchitectures(process_host_arch); + return m_supported_architectures; +} + +void PlatformAIX::GetStatus(Stream &strm) { + Platform::GetStatus(strm); + +#if LLDB_ENABLE_POSIX + // Display local kernel information only when we are running in host mode. + // Otherwise, we would end up printing non-AIX information (when running on + // Mac OS for example). + if (IsHost()) { +struct utsname un; + +if (uname(&un)) + return; + +strm.Printf("Kernel: %s\n", un.sysname); +strm.Printf(" Release: %s\n", un.release); +strm.Printf(" Version: %s\n", un.version); + } +#endif +} + +uint32_t +PlatformAIX::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) { + uint32_t resume_count = 0; + + // Always resume past the initial stop when we use eLaunchFlagDebug + if (launch_info.GetFlags().Test(eLaunchFlagDebug)) { +// Resume past the stop for the final exec into the true inferior. +++resume_count; + } + + // If we're not launching a shell, we're done. + const FileSpec &shell = launch_info.GetShell(); + if (!shell) +return resume_count; + + std::string shell_string = shell.GetPath(); + // We're in a shell, so for sure we have to resume past the shell exec. + ++resume_count; + + // Figure out what shell we're planning on using. + const char *shell_name
[Lldb-commits] [lldb] [lldb][AIX] Added PlatformAIX plugin (PR #121273)
@@ -0,0 +1,370 @@ +//===-- PlatformAIX.cpp -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// + +#include "PlatformAIX.h" +#include "lldb/Host/Config.h" +#include +#if LLDB_ENABLE_POSIX +#include +#endif +#include "Utility/ARM64_DWARF_Registers.h" +#include "lldb/Core/Debugger.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Host/HostInfo.h" +#include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/Target.h" +#include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/LLDBLog.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/State.h" +#include "lldb/Utility/Status.h" +#include "lldb/Utility/StreamString.h" + +// Use defined constants from AIX mman.h for use when targeting remote aix +// systems even when host has different values. + +#if defined(_AIX) +#include +#endif + +using namespace lldb; +using namespace lldb_private; +using namespace lldb_private::platform_aix; + +LLDB_PLUGIN_DEFINE(PlatformAIX) + +static uint32_t g_initialize_count = 0; + +PlatformSP PlatformAIX::CreateInstance(bool force, const ArchSpec *arch) { + Log *log = GetLog(LLDBLog::Platform); + LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force, + arch ? arch->GetArchitectureName() : "", + arch ? arch->GetTriple().getTriple() : ""); + + bool create = force; + if (!create && arch && arch->IsValid()) { +const llvm::Triple &triple = arch->GetTriple(); +switch (triple.getOS()) { +case llvm::Triple::AIX: + create = true; + break; + +default: + break; +} + } + + LLDB_LOG(log, "create = {0}", create); + if (create) { +return PlatformSP(new PlatformAIX(false)); + } + return PlatformSP(); +} + +llvm::StringRef PlatformAIX::GetPluginDescriptionStatic(bool is_host) { + if (is_host) +return "Local AIX user platform plug-in."; + return "Remote AIX user platform plug-in."; +} + +void PlatformAIX::Initialize() { + PlatformPOSIX::Initialize(); + + if (g_initialize_count++ == 0) { +#ifdef _AIX +PlatformSP default_platform_sp(new PlatformAIX(true)); +default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture()); +Platform::SetHostPlatform(default_platform_sp); +#endif +PluginManager::RegisterPlugin( +PlatformAIX::GetPluginNameStatic(false), +PlatformAIX::GetPluginDescriptionStatic(false), +PlatformAIX::CreateInstance, nullptr); + } +} + +void PlatformAIX::Terminate() { + if (g_initialize_count > 0) { +if (--g_initialize_count == 0) { + PluginManager::UnregisterPlugin(PlatformAIX::CreateInstance); +} + } + + PlatformPOSIX::Terminate(); +} + +/// Default Constructor +PlatformAIX::PlatformAIX(bool is_host) +: PlatformPOSIX(is_host) // This is the local host platform +{ + if (is_host) { +ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault); +m_supported_architectures.push_back(hostArch); +if (hostArch.GetTriple().isArch64Bit()) { + m_supported_architectures.push_back( + HostInfo::GetArchitecture(HostInfo::eArchKind32)); +} + } else { +m_supported_architectures = +CreateArchList({llvm::Triple::ppc64}, llvm::Triple::AIX); + } +} + +std::vector +PlatformAIX::GetSupportedArchitectures(const ArchSpec &process_host_arch) { + if (m_remote_platform_sp) +return m_remote_platform_sp->GetSupportedArchitectures(process_host_arch); + return m_supported_architectures; +} + +void PlatformAIX::GetStatus(Stream &strm) { + Platform::GetStatus(strm); + +#if LLDB_ENABLE_POSIX + // Display local kernel information only when we are running in host mode. + // Otherwise, we would end up printing non-AIX information (when running on + // Mac OS for example). + if (IsHost()) { +struct utsname un; + +if (uname(&un)) + return; + +strm.Printf("Kernel: %s\n", un.sysname); +strm.Printf(" Release: %s\n", un.release); +strm.Printf(" Version: %s\n", un.version); + } +#endif +} + +uint32_t +PlatformAIX::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) { labath wrote: This is a candidate for moving into ProcessPOSIX. I doubt the shell exec behavior depends on the OS. (But I think you could also just delete this function, and everything'd be fine. I'm not sure if anything actually depends on this. In the worst case, we find out that something does depend on it, and *then* we move it to ProcessPOSIX) https://github.com/llvm/llvm-project/pull/121273 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fix address to read segment data (PR #120655)
https://github.com/labath approved this pull request. Yes, that looks about right, though it's unfortunate that this does not have any test case. I would really recommend you figure out a testing strategy for this -- for your benefit (less chance of other changes breaking this use case) if nothing else. Be sure to update the commit message before committing this. https://github.com/llvm/llvm-project/pull/120655 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
https://github.com/DhruvSrivastavaX edited https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -715,7 +715,7 @@ ConnectionFileDescriptor::ConnectFD(llvm::StringRef s, ConnectionStatus ConnectionFileDescriptor::ConnectFile( llvm::StringRef s, socket_id_callback_type socket_id_callback, Status *error_ptr) { -#if LLDB_ENABLE_POSIX +#if LLDB_ENABLE_POSIX && !defined(_AIX) DhruvSrivastavaX wrote: Right, so user can implement their own platform's value as required when they encounter the error. Sure https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fixing FindUnusedPort method tcp_socket object creation with proper constructor parameter (PR #121879)
https://github.com/labath approved this pull request. Thanks for the fix. Should I press the "merge" button for you? https://github.com/llvm/llvm-project/pull/121879 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -11,7 +11,9 @@ // C includes #include #include +#ifndef _AIX #include labath wrote: FWICS, this file isn't used even on linux. I'd try deleting it instead. https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -715,7 +715,7 @@ ConnectionFileDescriptor::ConnectFD(llvm::StringRef s, ConnectionStatus ConnectionFileDescriptor::ConnectFile( llvm::StringRef s, socket_id_callback_type socket_id_callback, Status *error_ptr) { -#if LLDB_ENABLE_POSIX +#if LLDB_ENABLE_POSIX && !defined(_AIX) labath wrote: Yes, and instead of `ifdef AIX` I'd use `#ifdef B115200`. (Linux manpage contains this sentence: "Due to differences between architectures, portable applications should check if a particular Bnnn constant is defined prior to using it.") https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -16,6 +16,9 @@ #include #include #include +#ifdef _AIX +#include labath wrote: (I see you've already done that, so no point in backing it out, but I'll note that some people like to do a wholesale `s/memset(0)/bzero` because the second one is supposedly faster. I think it would be fine to include strings.h unconditionally. Even linux documents it to be included in strings.h (and it work without probably because it ends up being included transitively) https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -11,7 +11,9 @@ // C includes #include #include +#ifndef _AIX #include DavidSpickett wrote: A lot of them aren't used, I'll see how many I can remove on Linux and FreeBSD. https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -715,7 +715,7 @@ ConnectionFileDescriptor::ConnectFD(llvm::StringRef s, ConnectionStatus ConnectionFileDescriptor::ConnectFile( llvm::StringRef s, socket_id_callback_type socket_id_callback, Status *error_ptr) { -#if LLDB_ENABLE_POSIX +#if LLDB_ENABLE_POSIX && !defined(_AIX) DhruvSrivastavaX wrote: For AIX the max we have is `B38400` which can be and `#elif` but there should be a default case speed too, what should that be? https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -11,7 +11,9 @@ // C includes #include #include +#ifndef _AIX #include DhruvSrivastavaX wrote: I'll remove sys/mount.h as part of this PR atleast. https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
@@ -715,7 +715,7 @@ ConnectionFileDescriptor::ConnectFD(llvm::StringRef s, ConnectionStatus ConnectionFileDescriptor::ConnectFile( llvm::StringRef s, socket_id_callback_type socket_id_callback, Status *error_ptr) { -#if LLDB_ENABLE_POSIX +#if LLDB_ENABLE_POSIX && !defined(_AIX) DavidSpickett wrote: https://www.man7.org/linux/man-pages/man3/termios.3.html This would be a build error, so I think `#error Max baud rate unknown.` would be fine here. This forces the developer to check what their platform supports. You could write it so that it tries the 3 in order B115200, B38400, B57600, then falls into the else and errors. https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][OpenBSD] Make use of Environment class (PR #122040)
https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/122040 None >From 881a7767c1397951bf5275682a13037cd93dfcd5 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 7 Jan 2025 21:16:56 -0500 Subject: [PATCH] [lldb][OpenBSD] Make use of Environment class --- lldb/source/Host/openbsd/Host.cpp | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lldb/source/Host/openbsd/Host.cpp b/lldb/source/Host/openbsd/Host.cpp index a4dc3918acfd08..e7ad18e03e19b3 100644 --- a/lldb/source/Host/openbsd/Host.cpp +++ b/lldb/source/Host/openbsd/Host.cpp @@ -41,18 +41,7 @@ namespace lldb_private { class ProcessLaunchInfo; } -Environment Host::GetEnvironment() { - Environment env; - char *v; - char **var = environ; - for (; var != NULL && *var != NULL; ++var) { -v = strchr(*var, (int)'-'); -if (v == NULL) - continue; -env.insert(v); - } - return env; -} +Environment Host::GetEnvironment() { return Environment(environ); } static bool GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr, ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][OpenBSD] Make use of Environment class (PR #122040)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Brad Smith (brad0) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/122040.diff 1 Files Affected: - (modified) lldb/source/Host/openbsd/Host.cpp (+1-12) ``diff diff --git a/lldb/source/Host/openbsd/Host.cpp b/lldb/source/Host/openbsd/Host.cpp index a4dc3918acfd08..e7ad18e03e19b3 100644 --- a/lldb/source/Host/openbsd/Host.cpp +++ b/lldb/source/Host/openbsd/Host.cpp @@ -41,18 +41,7 @@ namespace lldb_private { class ProcessLaunchInfo; } -Environment Host::GetEnvironment() { - Environment env; - char *v; - char **var = environ; - for (; var != NULL && *var != NULL; ++var) { -v = strchr(*var, (int)'-'); -if (v == NULL) - continue; -env.insert(v); - } - return env; -} +Environment Host::GetEnvironment() { return Environment(environ); } static bool GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr, `` https://github.com/llvm/llvm-project/pull/122040 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][OpenBSD][NFC] Replace tab with spaces (PR #122041)
https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/122041 None >From 248e768f220e30a2f926ef93a856a1c5ee26dce3 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 7 Jan 2025 21:25:34 -0500 Subject: [PATCH] [lldb][OpenBSD][NFC] Replace tab with spaces --- lldb/source/Host/openbsd/Host.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Host/openbsd/Host.cpp b/lldb/source/Host/openbsd/Host.cpp index a4dc3918acfd08..76d8c4faa3863c 100644 --- a/lldb/source/Host/openbsd/Host.cpp +++ b/lldb/source/Host/openbsd/Host.cpp @@ -127,7 +127,7 @@ static bool GetOpenBSDProcessUserAndGroup(ProcessInstanceInfo &process_info) { process_info.SetUserID(proc_kinfo.p_ruid); process_info.SetGroupID(proc_kinfo.p_rgid); process_info.SetEffectiveUserID(proc_kinfo.p_uid); - process_info.SetEffectiveGroupID(proc_kinfo.p_gid); +process_info.SetEffectiveGroupID(proc_kinfo.p_gid); return true; } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][OpenBSD][NFC] Replace tab with spaces (PR #122041)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Brad Smith (brad0) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/122041.diff 1 Files Affected: - (modified) lldb/source/Host/openbsd/Host.cpp (+1-1) ``diff diff --git a/lldb/source/Host/openbsd/Host.cpp b/lldb/source/Host/openbsd/Host.cpp index a4dc3918acfd08..76d8c4faa3863c 100644 --- a/lldb/source/Host/openbsd/Host.cpp +++ b/lldb/source/Host/openbsd/Host.cpp @@ -127,7 +127,7 @@ static bool GetOpenBSDProcessUserAndGroup(ProcessInstanceInfo &process_info) { process_info.SetUserID(proc_kinfo.p_ruid); process_info.SetGroupID(proc_kinfo.p_rgid); process_info.SetEffectiveUserID(proc_kinfo.p_uid); - process_info.SetEffectiveGroupID(proc_kinfo.p_gid); +process_info.SetEffectiveGroupID(proc_kinfo.p_gid); return true; } } `` https://github.com/llvm/llvm-project/pull/122041 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
https://github.com/DhruvSrivastavaX updated https://github.com/llvm/llvm-project/pull/120979 >From c8887adb58fc0042c99a66fbc436bc95361e9086 Mon Sep 17 00:00:00 2001 From: Dhruv-Srivastava Date: Mon, 23 Dec 2024 10:22:40 -0600 Subject: [PATCH 1/3] Some base #if _AIX changes --- .../Host/posix/ConnectionFileDescriptorPosix.cpp | 7 +++ lldb/source/Host/posix/DomainSocket.cpp | 6 +- lldb/source/Host/posix/FileSystemPosix.cpp| 2 ++ lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 15 +++ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp index 6bdc33f8923281..e3d1300cf76eda 100644 --- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -119,8 +119,7 @@ bool ConnectionFileDescriptor::IsConnected() const { ConnectionStatus ConnectionFileDescriptor::Connect(llvm::StringRef path, Status *error_ptr) { - return Connect( - path, [](llvm::StringRef) {}, error_ptr); + return Connect(path, [](llvm::StringRef) {}, error_ptr); } ConnectionStatus @@ -716,7 +715,7 @@ ConnectionFileDescriptor::ConnectFD(llvm::StringRef s, ConnectionStatus ConnectionFileDescriptor::ConnectFile( llvm::StringRef s, socket_id_callback_type socket_id_callback, Status *error_ptr) { -#if LLDB_ENABLE_POSIX +#if LLDB_ENABLE_POSIX && !defined(_AIX) std::string addr_str = s.str(); // file:///PATH int fd = FileSystem::Instance().Open(addr_str.c_str(), O_RDWR); @@ -747,7 +746,7 @@ ConnectionStatus ConnectionFileDescriptor::ConnectFile( m_io_sp = std::make_shared(fd, File::eOpenOptionReadWrite, true); return eConnectionStatusSuccess; -#endif // LLDB_ENABLE_POSIX +#endif // LLDB_ENABLE_POSIX && !defined(_AIX) llvm_unreachable("this function should be only called w/ LLDB_ENABLE_POSIX"); } diff --git a/lldb/source/Host/posix/DomainSocket.cpp b/lldb/source/Host/posix/DomainSocket.cpp index 9a0b385d998bfc..9f4f12bb481bd0 100644 --- a/lldb/source/Host/posix/DomainSocket.cpp +++ b/lldb/source/Host/posix/DomainSocket.cpp @@ -16,6 +16,9 @@ #include #include #include +#ifdef _AIX +#include +#endif using namespace lldb; using namespace lldb_private; @@ -86,7 +89,8 @@ Status DomainSocket::Connect(llvm::StringRef name) { if (error.Fail()) return error; if (llvm::sys::RetryAfterSignal(-1, ::connect, GetNativeSocket(), -(struct sockaddr *)&saddr_un, saddr_un_len) < 0) + (struct sockaddr *)&saddr_un, + saddr_un_len) < 0) SetLastError(error); return error; diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 945e2affc83715..1a84f550662d75 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -11,7 +11,9 @@ // C includes #include #include +#ifndef _AIX #include +#endif #include #include #include diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp index bbe5d4c611f870..1d79edbede5d67 100644 --- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -31,7 +31,6 @@ #include "llvm/ADT/APInt.h" #include "llvm/ADT/bit.h" - using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; @@ -267,21 +266,21 @@ bool lldb_private::formatters::NSIndexSetSummaryProvider( if (class_name == "NSIndexSet" || class_name == "NSMutableIndexSet") { // Foundation version 2000 added a bitmask if the index set fit in 64 bits // and a Tagged Pointer version if the bitmask is small enough to fit in - // the tagged pointer payload. + // the tagged pointer payload. // It also changed the layout (but not the size) of the set descriptor. // First check whether this is a tagged pointer. The bitmask will be in // the payload of the tagged pointer. uint64_t payload; - if (runtime->GetFoundationVersion() >= 2000 - && descriptor->GetTaggedPointerInfo(nullptr, nullptr, &payload)) { + if (runtime->GetFoundationVersion() >= 2000 && + descriptor->GetTaggedPointerInfo(nullptr, nullptr, &payload)) { count = llvm::popcount(payload); break; } // The first 32 bits describe the index set in all cases: Status error; uint32_t mode = process_sp->ReadUnsignedIntegerFromMemory( -valobj_addr + ptr_size, 4, 0, error); + valobj_addr + ptr_size, 4, 0, error); if (error.Fail()) return false; // Now check if the index is held in a bitmask in the object: @@ -292,7 +291,7 @@ bool lldb_private::formatters::NSIndexSetSummaryProvider( if (
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
https://github.com/DhruvSrivastavaX updated https://github.com/llvm/llvm-project/pull/120979 >From c8887adb58fc0042c99a66fbc436bc95361e9086 Mon Sep 17 00:00:00 2001 From: Dhruv-Srivastava Date: Mon, 23 Dec 2024 10:22:40 -0600 Subject: [PATCH 1/4] Some base #if _AIX changes --- .../Host/posix/ConnectionFileDescriptorPosix.cpp | 7 +++ lldb/source/Host/posix/DomainSocket.cpp | 6 +- lldb/source/Host/posix/FileSystemPosix.cpp| 2 ++ lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 15 +++ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp index 6bdc33f8923281..e3d1300cf76eda 100644 --- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -119,8 +119,7 @@ bool ConnectionFileDescriptor::IsConnected() const { ConnectionStatus ConnectionFileDescriptor::Connect(llvm::StringRef path, Status *error_ptr) { - return Connect( - path, [](llvm::StringRef) {}, error_ptr); + return Connect(path, [](llvm::StringRef) {}, error_ptr); } ConnectionStatus @@ -716,7 +715,7 @@ ConnectionFileDescriptor::ConnectFD(llvm::StringRef s, ConnectionStatus ConnectionFileDescriptor::ConnectFile( llvm::StringRef s, socket_id_callback_type socket_id_callback, Status *error_ptr) { -#if LLDB_ENABLE_POSIX +#if LLDB_ENABLE_POSIX && !defined(_AIX) std::string addr_str = s.str(); // file:///PATH int fd = FileSystem::Instance().Open(addr_str.c_str(), O_RDWR); @@ -747,7 +746,7 @@ ConnectionStatus ConnectionFileDescriptor::ConnectFile( m_io_sp = std::make_shared(fd, File::eOpenOptionReadWrite, true); return eConnectionStatusSuccess; -#endif // LLDB_ENABLE_POSIX +#endif // LLDB_ENABLE_POSIX && !defined(_AIX) llvm_unreachable("this function should be only called w/ LLDB_ENABLE_POSIX"); } diff --git a/lldb/source/Host/posix/DomainSocket.cpp b/lldb/source/Host/posix/DomainSocket.cpp index 9a0b385d998bfc..9f4f12bb481bd0 100644 --- a/lldb/source/Host/posix/DomainSocket.cpp +++ b/lldb/source/Host/posix/DomainSocket.cpp @@ -16,6 +16,9 @@ #include #include #include +#ifdef _AIX +#include +#endif using namespace lldb; using namespace lldb_private; @@ -86,7 +89,8 @@ Status DomainSocket::Connect(llvm::StringRef name) { if (error.Fail()) return error; if (llvm::sys::RetryAfterSignal(-1, ::connect, GetNativeSocket(), -(struct sockaddr *)&saddr_un, saddr_un_len) < 0) + (struct sockaddr *)&saddr_un, + saddr_un_len) < 0) SetLastError(error); return error; diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 945e2affc83715..1a84f550662d75 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -11,7 +11,9 @@ // C includes #include #include +#ifndef _AIX #include +#endif #include #include #include diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp index bbe5d4c611f870..1d79edbede5d67 100644 --- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -31,7 +31,6 @@ #include "llvm/ADT/APInt.h" #include "llvm/ADT/bit.h" - using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; @@ -267,21 +266,21 @@ bool lldb_private::formatters::NSIndexSetSummaryProvider( if (class_name == "NSIndexSet" || class_name == "NSMutableIndexSet") { // Foundation version 2000 added a bitmask if the index set fit in 64 bits // and a Tagged Pointer version if the bitmask is small enough to fit in - // the tagged pointer payload. + // the tagged pointer payload. // It also changed the layout (but not the size) of the set descriptor. // First check whether this is a tagged pointer. The bitmask will be in // the payload of the tagged pointer. uint64_t payload; - if (runtime->GetFoundationVersion() >= 2000 - && descriptor->GetTaggedPointerInfo(nullptr, nullptr, &payload)) { + if (runtime->GetFoundationVersion() >= 2000 && + descriptor->GetTaggedPointerInfo(nullptr, nullptr, &payload)) { count = llvm::popcount(payload); break; } // The first 32 bits describe the index set in all cases: Status error; uint32_t mode = process_sp->ReadUnsignedIntegerFromMemory( -valobj_addr + ptr_size, 4, 0, error); + valobj_addr + ptr_size, 4, 0, error); if (error.Fail()) return false; // Now check if the index is held in a bitmask in the object: @@ -292,7 +291,7 @@ bool lldb_private::formatters::NSIndexSetSummaryProvider( if (
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
https://github.com/DhruvSrivastavaX updated https://github.com/llvm/llvm-project/pull/120979 >From c8887adb58fc0042c99a66fbc436bc95361e9086 Mon Sep 17 00:00:00 2001 From: Dhruv-Srivastava Date: Mon, 23 Dec 2024 10:22:40 -0600 Subject: [PATCH 1/3] Some base #if _AIX changes --- .../Host/posix/ConnectionFileDescriptorPosix.cpp | 7 +++ lldb/source/Host/posix/DomainSocket.cpp | 6 +- lldb/source/Host/posix/FileSystemPosix.cpp| 2 ++ lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 15 +++ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp index 6bdc33f8923281..e3d1300cf76eda 100644 --- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -119,8 +119,7 @@ bool ConnectionFileDescriptor::IsConnected() const { ConnectionStatus ConnectionFileDescriptor::Connect(llvm::StringRef path, Status *error_ptr) { - return Connect( - path, [](llvm::StringRef) {}, error_ptr); + return Connect(path, [](llvm::StringRef) {}, error_ptr); } ConnectionStatus @@ -716,7 +715,7 @@ ConnectionFileDescriptor::ConnectFD(llvm::StringRef s, ConnectionStatus ConnectionFileDescriptor::ConnectFile( llvm::StringRef s, socket_id_callback_type socket_id_callback, Status *error_ptr) { -#if LLDB_ENABLE_POSIX +#if LLDB_ENABLE_POSIX && !defined(_AIX) std::string addr_str = s.str(); // file:///PATH int fd = FileSystem::Instance().Open(addr_str.c_str(), O_RDWR); @@ -747,7 +746,7 @@ ConnectionStatus ConnectionFileDescriptor::ConnectFile( m_io_sp = std::make_shared(fd, File::eOpenOptionReadWrite, true); return eConnectionStatusSuccess; -#endif // LLDB_ENABLE_POSIX +#endif // LLDB_ENABLE_POSIX && !defined(_AIX) llvm_unreachable("this function should be only called w/ LLDB_ENABLE_POSIX"); } diff --git a/lldb/source/Host/posix/DomainSocket.cpp b/lldb/source/Host/posix/DomainSocket.cpp index 9a0b385d998bfc..9f4f12bb481bd0 100644 --- a/lldb/source/Host/posix/DomainSocket.cpp +++ b/lldb/source/Host/posix/DomainSocket.cpp @@ -16,6 +16,9 @@ #include #include #include +#ifdef _AIX +#include +#endif using namespace lldb; using namespace lldb_private; @@ -86,7 +89,8 @@ Status DomainSocket::Connect(llvm::StringRef name) { if (error.Fail()) return error; if (llvm::sys::RetryAfterSignal(-1, ::connect, GetNativeSocket(), -(struct sockaddr *)&saddr_un, saddr_un_len) < 0) + (struct sockaddr *)&saddr_un, + saddr_un_len) < 0) SetLastError(error); return error; diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 945e2affc83715..1a84f550662d75 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -11,7 +11,9 @@ // C includes #include #include +#ifndef _AIX #include +#endif #include #include #include diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp index bbe5d4c611f870..1d79edbede5d67 100644 --- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -31,7 +31,6 @@ #include "llvm/ADT/APInt.h" #include "llvm/ADT/bit.h" - using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; @@ -267,21 +266,21 @@ bool lldb_private::formatters::NSIndexSetSummaryProvider( if (class_name == "NSIndexSet" || class_name == "NSMutableIndexSet") { // Foundation version 2000 added a bitmask if the index set fit in 64 bits // and a Tagged Pointer version if the bitmask is small enough to fit in - // the tagged pointer payload. + // the tagged pointer payload. // It also changed the layout (but not the size) of the set descriptor. // First check whether this is a tagged pointer. The bitmask will be in // the payload of the tagged pointer. uint64_t payload; - if (runtime->GetFoundationVersion() >= 2000 - && descriptor->GetTaggedPointerInfo(nullptr, nullptr, &payload)) { + if (runtime->GetFoundationVersion() >= 2000 && + descriptor->GetTaggedPointerInfo(nullptr, nullptr, &payload)) { count = llvm::popcount(payload); break; } // The first 32 bits describe the index set in all cases: Status error; uint32_t mode = process_sp->ReadUnsignedIntegerFromMemory( -valobj_addr + ptr_size, 4, 0, error); + valobj_addr + ptr_size, 4, 0, error); if (error.Fail()) return false; // Now check if the index is held in a bitmask in the object: @@ -292,7 +291,7 @@ bool lldb_private::formatters::NSIndexSetSummaryProvider( if (
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 61b806f43b2d6b3673a8f91393a28c98521472a8 ce3629f80ab7eca189261269fdd0fee1acafa3ba --extensions cpp -- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp lldb/source/Host/posix/DomainSocket.cpp lldb/source/Plugins/Language/ObjC/Cocoa.cpp lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp `` View the diff from clang-format here. ``diff diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp index cb24fc460e..fae7ddb864 100644 --- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -732,8 +732,8 @@ ConnectionStatus ConnectionFileDescriptor::ConnectFile( // Set port speed to the available maximum #ifdef B115200 - ::cfsetospeed(&options, B115200); - ::cfsetispeed(&options, B115200); +::cfsetospeed(&options, B115200); +::cfsetispeed(&options, B115200); #elif B57600 ::cfsetospeed(&options, B57600); ::cfsetispeed(&options, B57600); diff --git a/lldb/source/Host/posix/DomainSocket.cpp b/lldb/source/Host/posix/DomainSocket.cpp index fc073ab371..9b0e330d1a 100644 --- a/lldb/source/Host/posix/DomainSocket.cpp +++ b/lldb/source/Host/posix/DomainSocket.cpp @@ -14,9 +14,9 @@ #include #include +#include #include #include -#include using namespace lldb; using namespace lldb_private; `` https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)
DhruvSrivastavaX wrote: Updated the branch https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] Debuginfod cache use index cache settings and include real file name. (PR #120814)
https://github.com/GeorgeHuyubo updated https://github.com/llvm/llvm-project/pull/120814 >From 6923737d728191816567e7874a01c5dfce68bfde Mon Sep 17 00:00:00 2001 From: George Hu Date: Fri, 20 Dec 2024 15:20:00 -0800 Subject: [PATCH 1/2] [lldb] Change debuginfod cache file name to include origin file name --- .../Debuginfod/SymbolLocatorDebuginfod.cpp| 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp index 2cd7244902..c103c98d20ac27 100644 --- a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp +++ b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp @@ -141,6 +141,25 @@ SymbolLocator *SymbolLocatorDebuginfod::CreateInstance() { return new SymbolLocatorDebuginfod(); } +static llvm::StringRef getFileName(const ModuleSpec &module_spec, + std::string url_path) { + // Check if the URL path requests an executable file or a symbol file + bool is_executable = url_path.find("debuginfo") == std::string::npos; + if (is_executable) { +return module_spec.GetFileSpec().GetFilename().GetStringRef(); + } + llvm::StringRef symbol_file = + module_spec.GetSymbolFileSpec().GetFilename().GetStringRef(); + // Remove llvmcache- prefix and hash, keep origin file name + if (symbol_file.starts_with("llvmcache-")) { +size_t pos = symbol_file.rfind('-'); +if (pos != llvm::StringRef::npos) { + symbol_file = symbol_file.substr(pos + 1); +} + } + return symbol_file; +} + static std::optional GetFileForModule(const ModuleSpec &module_spec, std::function UrlBuilder) { @@ -166,9 +185,13 @@ GetFileForModule(const ModuleSpec &module_spec, // We're ready to ask the Debuginfod library to find our file. llvm::object::BuildID build_id(module_uuid.GetBytes()); std::string url_path = UrlBuilder(build_id); - std::string cache_key = llvm::getDebuginfodCacheKey(url_path); + llvm::StringRef file_name = getFileName(module_spec, url_path); + std::string cache_file_name = llvm::toHex(build_id, true); + if (!file_name.empty()) { +cache_file_name += "-" + file_name.str(); + } llvm::Expected result = llvm::getCachedOrDownloadArtifact( - cache_key, url_path, cache_path, debuginfod_urls, timeout); + cache_file_name, url_path, cache_path, debuginfod_urls, timeout); if (result) return FileSpec(*result); >From 7b808e73aa0193c8a42eae8f2420a803f424bee1 Mon Sep 17 00:00:00 2001 From: George Hu Date: Fri, 20 Dec 2024 16:37:50 -0800 Subject: [PATCH 2/2] [lldb] Switch debuginfod cache to use lldb index cache settings --- .../Debuginfod/SymbolLocatorDebuginfod.cpp| 17 +++ llvm/include/llvm/Debuginfod/Debuginfod.h | 4 ++- llvm/lib/Debuginfod/Debuginfod.cpp| 29 +-- llvm/unittests/Debuginfod/DebuginfodTests.cpp | 3 +- 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp index c103c98d20ac27..00b4c9a45b5a76 100644 --- a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp +++ b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp @@ -8,6 +8,7 @@ #include "SymbolLocatorDebuginfod.h" +#include "lldb/Core/DataFileCache.h" #include "lldb/Core/PluginManager.h" #include "lldb/Interpreter/OptionValueString.h" #include "lldb/Utility/Args.h" @@ -173,11 +174,14 @@ GetFileForModule(const ModuleSpec &module_spec, // Grab LLDB's Debuginfod overrides from the // plugin.symbol-locator.debuginfod.* settings. PluginProperties &plugin_props = GetGlobalPluginProperties(); - llvm::Expected cache_path_or_err = plugin_props.GetCachePath(); - // A cache location is *required*. - if (!cache_path_or_err) -return {}; - std::string cache_path = *cache_path_or_err; + // Grab the lldb index cache settings from the global module list properties. + ModuleListProperties &properties = + ModuleList::GetGlobalModuleListProperties(); + std::string cache_path = properties.GetLLDBIndexCachePath().GetPath(); + + llvm::CachePruningPolicy pruning_policy = + DataFileCache::GetLLDBIndexCachePolicy(); + llvm::SmallVector debuginfod_urls = llvm::getDefaultDebuginfodUrls(); std::chrono::milliseconds timeout = plugin_props.GetTimeout(); @@ -191,7 +195,8 @@ GetFileForModule(const ModuleSpec &module_spec, cache_file_name += "-" + file_name.str(); } llvm::Expected result = llvm::getCachedOrDownloadArtifact( - cache_file_name, url_path, cache_path, debuginfod_urls, timeout); + cache_file_name, url_path, cache_path, debuginfod_urls, timeout, + pruning_policy); if (result) return FileSpec(*result); diff --git