Author: Alex Langford Date: 2023-07-05T08:46:48-07:00 New Revision: 1c7c9970379e1949a0b338eba2746dbf84b0bda4
URL: https://github.com/llvm/llvm-project/commit/1c7c9970379e1949a0b338eba2746dbf84b0bda4 DIFF: https://github.com/llvm/llvm-project/commit/1c7c9970379e1949a0b338eba2746dbf84b0bda4.diff LOG: [lldb] Deprecate SBHostOS threading functionality For some context, Raphael tried to this before: https://reviews.llvm.org/D104231 These methods are not tested at all, and in some cases, are not even fully implemented (e.g. SBHostOS::ThreadCreated). I'm not convinced it's possible to use these correctly from Python, and I'm not aware of any users of these methods. It's difficult to remove these methods wholesale, but we can start with deprecating them. A possible follow-up to this change (which may require an RFC to get more buy in from the community) is to gut these functions entirely. That is, remove the implementations and replace them either with nothing or have them dump out a message to stderr saying not to use these. Differential Revision: https://reviews.llvm.org/D153900 Added: Modified: lldb/include/lldb/API/SBHostOS.h lldb/tools/driver/Driver.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/API/SBHostOS.h b/lldb/include/lldb/API/SBHostOS.h index b170f8d6581038..ad57a9ec409f61 100644 --- a/lldb/include/lldb/API/SBHostOS.h +++ b/lldb/include/lldb/API/SBHostOS.h @@ -24,15 +24,26 @@ class LLDB_API SBHostOS { static lldb::SBFileSpec GetUserHomeDirectory(); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported, " + "not portable, and is diff icult to use from Python.") static void ThreadCreated(const char *name); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported, " + "not portable, and is diff icult to use from Python.") static lldb::thread_t ThreadCreate(const char *name, lldb::thread_func_t thread_function, void *thread_arg, lldb::SBError *err); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported, " + "not portable, and is diff icult to use from Python.") static bool ThreadCancel(lldb::thread_t thread, lldb::SBError *err); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported, " + "not portable, and is diff icult to use from Python.") static bool ThreadDetach(lldb::thread_t thread, lldb::SBError *err); + + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported, " + "not portable, and is diff icult to use from Python.") static bool ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result, lldb::SBError *err); diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index d463267aeef353..b14d15602aba31 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -795,8 +795,6 @@ int main(int argc, char const *argv[]) { // Setup LLDB signal handlers once the debugger has been initialized. SBDebugger::PrintDiagnosticsOnError(); - SBHostOS::ThreadCreated("<lldb.driver.main-thread>"); - signal(SIGINT, sigint_handler); #if !defined(_WIN32) signal(SIGPIPE, SIG_IGN); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits