bulbazord created this revision. bulbazord added reviewers: JDevlieghere, teemperor, mib, jingham, clayborg. Herald added a project: All. bulbazord requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D153900 Files: lldb/include/lldb/API/SBHostOS.h lldb/tools/driver/Driver.cpp Index: lldb/tools/driver/Driver.cpp =================================================================== --- lldb/tools/driver/Driver.cpp +++ lldb/tools/driver/Driver.cpp @@ -795,8 +795,6 @@ // 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); Index: lldb/include/lldb/API/SBHostOS.h =================================================================== --- lldb/include/lldb/API/SBHostOS.h +++ lldb/include/lldb/API/SBHostOS.h @@ -24,15 +24,36 @@ static lldb::SBFileSpec GetUserHomeDirectory(); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static void ThreadCreated(const char *name); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") 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 " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static bool ThreadCancel(lldb::thread_t thread, lldb::SBError *err); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static bool ThreadDetach(lldb::thread_t thread, lldb::SBError *err); + + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static bool ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result, lldb::SBError *err);
Index: lldb/tools/driver/Driver.cpp =================================================================== --- lldb/tools/driver/Driver.cpp +++ lldb/tools/driver/Driver.cpp @@ -795,8 +795,6 @@ // 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); Index: lldb/include/lldb/API/SBHostOS.h =================================================================== --- lldb/include/lldb/API/SBHostOS.h +++ lldb/include/lldb/API/SBHostOS.h @@ -24,15 +24,36 @@ static lldb::SBFileSpec GetUserHomeDirectory(); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static void ThreadCreated(const char *name); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") 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 " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static bool ThreadCancel(lldb::thread_t thread, lldb::SBError *err); + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static bool ThreadDetach(lldb::thread_t thread, lldb::SBError *err); + + LLDB_DEPRECATED("Threading functionality in SBHostOS is not well supported " + "and not portable. It is difficult to use from Python. Do " + "not introduce new uses of this method.", + "") static bool ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result, lldb::SBError *err);
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits