MCPcopy Create free account
hub / github.com/Vector35/debugger / DebugThread

Class DebugThread

api/python/debuggercontroller.py:62–97  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

60
61
62class 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
100class DebugModule:

Callers 2

threadsMethod · 0.70
active_threadMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected