MCPcopy Create free account
hub / github.com/alibaba/async_simple / CoroutineFrame

Class CoroutineFrame

dbg/LazyStack.py:60–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60class CoroutineFrame(object):
61 def __init__(self, task_addr):
62 self.promise_base_addr = task_addr + types.long_pointer_size * 2
63 # In async_simple, the continuation address should be equal to promise_address
64 self.continuation_addr = self.promise_base_addr
65
66 def next_task_addr(self):
67 return dereference(self.continuation_addr)
68
69 def __getattr__(self, name):
70 if name.endswith("_pointer"):
71 name = name[:-len("_pointer")]
72 return cast_addr2long_pointer(object.__getattribute__(self, name))
73 print "Search: ", name
74 return object.__getattribute__(self, name)
75
76def cast_addr2long_pointer(addr):
77 return gdb.Value(addr).cast(types.long_pointer)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected