This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Deprecate the threading functionality in SBHostOS
AbandonedPublic

Authored by bulbazord on Jun 14 2021, 8:14 AM.

Details

Reviewers
teemperor
Group Reviewers
Restricted Project
Summary

SBHostOS implements a threading framework that allows creating and manipulating
OS threads in the current process.

We usually don't deprecate SB APIs, but in this case I think it makes sense because:

  • The framework is not implemented on all platforms (i.e. Windows and *BSD support seems to be incomplete)
  • ThreadCreated is completely unimplemented..
  • It hasn't been touched since the original check-in of the source code.
  • I don't think it can even be used via the Python bindings as ThreadCreate seems impossible to call (it takes a function pointer and returns a OS specific struct).
  • It's not tested.
  • It's to my knowledge not used by Xcode or anyone that has their source code indexed by Google.
  • It's the only reason why we (partially) implement a bunch of internal threading utilities in LLDB (which I'll remove in a follow-up patch).

I would propose deprecating it with the upcoming LLDB 13 release (which will be branched in about a month).

Diff Detail

Event Timeline

teemperor requested review of this revision.Jun 14 2021, 8:14 AM
teemperor created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2021, 8:14 AM
teemperor updated this revision to Diff 351882.Jun 14 2021, 8:16 AM
  • Remove the deprecation attribute that got inserted by accident.

Not sure what else we should do to properly deprecate an API. LLVM's approach would be to put [[deprecated("bla")]] the C++ APIs (which would mean you need a C++14 compiler to use the SB API) and there is also the lldb-versioning.h header (which seems to be reserved for actual API breakages).

labath added a subscriber: labath.Sep 6 2021, 6:18 AM

Not sure what else we should do to properly deprecate an API. LLVM's approach would be to put [[deprecated("bla")]] the C++ APIs (which would mean you need a C++14 compiler to use the SB API)

You can always put the attribute inside an #ifdef c++14.

Another option is to put something like #ifdef LLDB_USE_DEPRECATED_DECLARATIONS around these functions, forcing to user to explicitly request their usage.

Neither of these options will help the usages from python, so it's not a fully general solution, but it sounds like we don't need to worry about that right now...

and there is also the lldb-versioning.h header (which seems to be reserved for actual API breakages).

wow

bulbazord commandeered this revision.Jul 5 2023, 8:49 AM
bulbazord added a reviewer: teemperor.
bulbazord added a subscriber: bulbazord.

Commandeering this change in order to close it. I've effectively done this already with D153900.

Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2023, 8:49 AM
bulbazord abandoned this revision.Jul 5 2023, 8:49 AM