diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-17 12:15:36 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-17 12:24:00 -0600 |
commit | 2ec4daeeff60b3a727f48b2c99abb002a2dd7a14 (patch) | |
tree | 169f83e308068716799455594d1275db22a88eb0 /gdb-helpers | |
parent | 29ad1efc7c6de44a965db9f181165b72a9ef8ff1 (diff) |
gdb-helpers: libcr.py: Begone with the CrCoroutine.id alias
Diffstat (limited to 'gdb-helpers')
-rw-r--r-- | gdb-helpers/libcr.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gdb-helpers/libcr.py b/gdb-helpers/libcr.py index fcfd86e..658ddf6 100644 --- a/gdb-helpers/libcr.py +++ b/gdb-helpers/libcr.py @@ -131,7 +131,7 @@ class CrGlobals: if gdb_bug_32428: print("Must return to running coroutine before continuing.") print("Hit ^C twice then run:") - print(f" cr select {self.coroutine_running.id}") + print(f" cr select {self.coroutine_running.cid}") while True: time.sleep(1) assert self.coroutine_running.cont_env @@ -256,10 +256,6 @@ class CrCoroutine: self.cont_env = None @property - def id(self) -> int: - return self.cid - - @property def state(self) -> gdb.Value: return gdb.parse_and_eval(f"coroutine_table[{self.cid-1}].state") @@ -272,8 +268,8 @@ class CrCoroutine: def is_selected(self) -> bool: sp = int(gdb.parse_and_eval("$sp")) - lo = int(gdb.parse_and_eval(f"coroutine_table[{self.id-1}].stack")) - hi = lo + int(gdb.parse_and_eval(f"coroutine_table[{self.id-1}].stack_size")) + lo = int(gdb.parse_and_eval(f"coroutine_table[{self.cid-1}].stack")) + hi = lo + int(gdb.parse_and_eval(f"coroutine_table[{self.cid-1}].stack_size")) return lo <= sp < hi def select(self, level: int = -1) -> None: @@ -289,7 +285,7 @@ class CrCoroutine: elif self.state == self.cr_globals.CR_RUNNING: env = self.cr_globals.readjmp("&coroutine_add_env") else: - env = self.cr_globals.readjmp(f"&coroutine_table[{self.id-1}].env") + env = self.cr_globals.readjmp(f"&coroutine_table[{self.cid-1}].env") gdb_longjmp(env) cr_select_top_frame() @@ -353,7 +349,7 @@ class CrListCommand(gdb.Command): "G" if cr.is_selected() else " ", ] ), - str(cr.id), + str(cr.cid), repr(cr.name), str(cr.state), self._pretty_frame(cr, from_tty), |