This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Deprecate SBHostOS threading functionality
ClosedPublic

Authored by bulbazord on Jun 27 2023, 11:01 AM.

Details

Summary

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.

Diff Detail

Event Timeline

bulbazord created this revision.Jun 27 2023, 11:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 11:01 AM
bulbazord requested review of this revision.Jun 27 2023, 11:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 11:01 AM
This revision is now accepted and ready to land.Jun 27 2023, 11:09 AM

I think the SBHostOS::ThreadCreated() function used to just set the thread name for the current thread, but looks like that hasn't been hooked up for a while. Don't know who was using this before, but LGTM.

JDevlieghere added inline comments.Jun 27 2023, 2:27 PM
lldb/include/lldb/API/SBHostOS.h
28–29

On second thought, I think we should omit the "Do not introduce new uses of this method." This is implied by the fact that it's deprecated.

bulbazord updated this revision to Diff 536864.Jul 3 2023, 12:14 PM

Reword deprecation message

mib accepted this revision.Jul 3 2023, 1:42 PM
mib added a comment.Jul 3 2023, 2:03 PM

LGTM! @bulbazord when you land this, make sure to close @teemperor's diff (D104231). Thanks!

This revision was automatically updated to reflect the committed changes.

LGTM! @bulbazord when you land this, make sure to close @teemperor's diff (D104231). Thanks!

👍