DebugThread represents a thread in the target. It has the following fields: * ``tid``: the ID of the thread. On different systems, this may be either the system thread ID, or a sequential\ index starting from zero. * ``rip``: the current address (instruction pointer) of the thr
| 60 | |
| 61 | |
| 62 | class DebugThread: |
| 63 | """ |
| 64 | DebugThread represents a thread in the target. It has the following fields: |
| 65 | |
| 66 | * ``tid``: the ID of the thread. On different systems, this may be either the system thread ID, or a sequential\ |
| 67 | index starting from zero. |
| 68 | * ``rip``: the current address (instruction pointer) of the thread |
| 69 | |
| 70 | In the future, we should provide both the internal thread ID and the system thread ID. |
| 71 | |
| 72 | """ |
| 73 | def __init__(self, tid, rip): |
| 74 | self.tid = tid |
| 75 | self.rip = rip |
| 76 | |
| 77 | def __eq__(self, other): |
| 78 | if not isinstance(other, self.__class__): |
| 79 | return NotImplemented |
| 80 | return self.tid == other.tid and self.rip == other.rip |
| 81 | |
| 82 | def __ne__(self, other): |
| 83 | if not isinstance(other, self.__class__): |
| 84 | return NotImplemented |
| 85 | return not (self == other) |
| 86 | |
| 87 | def __hash__(self): |
| 88 | return hash((self.tid, self.rip)) |
| 89 | |
| 90 | def __setattr__(self, name, value): |
| 91 | try: |
| 92 | object.__setattr__(self, name, value) |
| 93 | except AttributeError: |
| 94 | raise AttributeError(f"attribute '{name}' is read only") |
| 95 | |
| 96 | def __repr__(self): |
| 97 | return f"<DebugThread: {self.tid:#x} @ {self.rip:#x}>" |
| 98 | |
| 99 | |
| 100 | class DebugModule: |
no outgoing calls
no test coverage detected