TTD API cleanup chores (follow-up from PR #1125 review)

Ouverte
#1,131 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Calme
Stack technique
cpp, python

Piste de recherche

Start with the TTD declarations in api/debuggerapi.h, the controller and adapter, especially core/adapters/dbgengttdadapter.cpp and ParseSingleTTDRegisterWriteObject. Then inspect api/python/debuggercontroller.py and architecture.py's RegisterName definition. Done means the listed C++ return types and parameter conventions, logging patterns, and Python event classes and register-name types are updated consistently across the TTD APIs.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

DbgEng Adapter python api TTD

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++
  • std::pair<bool, T> → std::optional<T> everywhere. Done for the register-write methods in #1125; the pre-existing TTD memory-access methods (GetTTDNext/PrevMemoryAccess) still return std::pair<bool, TTDMemoryEvent> and should be migrated for consistency.
  • Register-name parameters: const std::string& → std::string_view. Applies to the TTD query methods that take a register name (api/debuggerapi.h, controller, adapter).
  • ParseSingleTTDRegisterWriteObject: take expression by value (std::string) and std::move it into wExpression rather than const std::string& + copy (core/adapters/dbgengttdadapter.cpp).
  • Logging: avoid Log* without a logger, and prefer the Log*F variants (faster, more readable, more featureful). The new TTD code uses bare LogInfo/LogError/LogWarn with printf-style args — this pattern is repo-wide in the debugger, so worth a broader sweep.
Python (api/python/debuggercontroller.py)
  • Make the event classes frozen @dataclasses instead of hand-rolled classes with manual __eq__/__hash__/__setattr__ (TTDRegisterWriteEvent, and the sibling TTDMemoryEvent / related event classes).
  • Use a typedef'd register-name type instead of native str. Mirror architecture.py's RegisterName = NewType('RegisterName', str) for register-name parameters.

Review comments: https://github.com/Vector35/debugger/pull/1125#pullrequestreview

Langage dominant
C++
Étoiles
342
Forks
34
Merge moyen
7 j 21 h
PR mergées (30 j)
1

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Vector35/debugger

Toutes les issues de Vector35/debugger

Issues similaires

Plus d'issues C++

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.