[all-commits] [llvm/llvm-project] 65ad02: [lldb][NFC] Break ThreadMemory into smaller abstra...
Felipe de Azevedo Piovezan via All-commits
all-commits at lists.llvm.org
Tue Mar 25 02:51:14 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 65ad02b882ba545dafbfc195a78e204c218e93ed
https://github.com/llvm/llvm-project/commit/65ad02b882ba545dafbfc195a78e204c218e93ed
Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: 2025-03-25 (Tue, 25 Mar 2025)
Changed paths:
M lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
M lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
M lldb/source/Plugins/Process/Utility/ThreadMemory.h
Log Message:
-----------
[lldb][NFC] Break ThreadMemory into smaller abstractions (#132905)
ThreadMemory attempts to be a class abstracting the notion of a "fake"
Thread that is backed by a "real" thread. According to its
documentation, it is meant to be a class forwarding most methods to the
backing thread, but it does so only for a handful of methods.
Along the way, it also tries to represent a Thread that may or may not
have a different name, and may or may not have a different queue from
the backing thread. This can be problematic for a couple of reasons:
1. It forces all users into this optional behavior.
2. The forwarding behavior is incomplete: not all methods are currently
being forwarded properly. Some of them involve queues and seem to have
been intentionally left unimplemented.
This commit creates the following separation:
ThreadMemory <- ThreadMemoryProvidingName <-
ThreadMemoryProvidingNameAndQueue
ThreadMemory captures the notion of a backed thread that _really_
forwards all methods to the backing thread. (Missing methods should be
implemented in a later commit, and allowing them to be implemented
without changing behavior of other derived classes is the main purpose
of this refactor).
ThreadMemoryProvidingNameAndQueue is a ThreadMemory that allows users to
override the thread name. If a name is present, it is used; otherwise
the forwarding behavior is used.
ThreadMemoryProvidingNameAndQueue is a ThreadMemoryProvidingName that
allows users to override queue information. If queue information is
present, it is used; otherwise, the forwarding behavior is used.
With this separation, we can more explicitly implement missing methods
of the base class and override them, if needed, in
ThreadMemoryProvidingNameAndQueue. But this commit really is NFC, no new
methods are implemented and no method implementation is changed.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list