| 58 | } |
| 59 | |
| 60 | class 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 | |
| 76 | def cast_addr2long_pointer(addr): |
| 77 | return gdb.Value(addr).cast(types.long_pointer) |
no outgoing calls
no test coverage detected