Follow-up chores from @plafosse's review of #1125 (approved contingent only on the std::pair<bool,…> → std::optional fix, which has been done). These are the remaining "holistic / light mechanical refactor" items. They aren't specific to the register-write code — most apply to the surrounding TTD query APIs generally — so tracking them here rather than blocking that PR.
C++
Python (api/python/debuggercontroller.py)
Review comments: #1125 (review)
Follow-up chores from @plafosse's review of #1125 (approved contingent only on the
std::pair<bool,…>→std::optionalfix, which has been done). These are the remaining "holistic / light mechanical refactor" items. They aren't specific to the register-write code — most apply to the surrounding TTD query APIs generally — so tracking them here rather than blocking that PR.C++
std::pair<bool, T>→std::optional<T>everywhere. Done for the register-write methods in Add TTD go to previous/next register write (#1123) #1125; the pre-existing TTD memory-access methods (GetTTDNext/PrevMemoryAccess) still returnstd::pair<bool, TTDMemoryEvent>and should be migrated for consistency.const std::string&→std::string_view. Applies to the TTD query methods that take a register name (api/debuggerapi.h, controller, adapter).ParseSingleTTDRegisterWriteObject: takeexpressionby value (std::string) andstd::moveit intowExpressionrather thanconst std::string&+ copy (core/adapters/dbgengttdadapter.cpp).Log*without a logger, and prefer theLog*Fvariants (faster, more readable, more featureful). The new TTD code uses bareLogInfo/LogError/LogWarnwith printf-style args — this pattern is repo-wide in the debugger, so worth a broader sweep.Python (
api/python/debuggercontroller.py)@dataclasses instead of hand-rolled classes with manual__eq__/__hash__/__setattr__(TTDRegisterWriteEvent, and the siblingTTDMemoryEvent/ related event classes).str. Mirror architecture.py'sRegisterName = NewType('RegisterName', str)for register-name parameters.Review comments: #1125 (review)