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

Class StacklessCoroutineFrameDecorator

dbg/LazyStack.py:95–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 self.other_fields = self.continuation_addr + types.continuation_size
94
95class StacklessCoroutineFrameDecorator(FrameDecorator):
96 def __init__(self, frame, coro_frame):
97 super(StacklessCoroutineFrameDecorator, self).__init__(frame)
98 self.coro_frame = coro_frame
99
100 self.resume_func = dereference(self.coro_frame.resume_addr)
101 self.resume_func_block = gdb.block_for_pc(self.resume_func)
102 if self.resume_func_block == None:
103 raise Exception('Not stackless coroutine.')
104 self.line_info = gdb.find_pc_line(self.resume_func)
105
106 def address(self):
107 return self.resume_func
108
109 def filename(self):
110 return self.line_info.symtab.filename
111
112 def frame_args(self):
113 return [SymValueWrapper("frame_addr", self.coro_frame.frame_addr_pointer),
114 SymValueWrapper("promise_addr", self.coro_frame.promise_base_addr_pointer),
115 SymValueWrapper("continuation_addr", self.coro_frame.continuation_addr_pointer),
116 SymValueWrapper("others_addr", self.coro_frame.other_fields_pointer)
117 ]
118
119 def function(self):
120 return self.resume_func_block.function.print_name
121
122 def func_linkage_name(self):
123 return self.resume_func_block.function.linkage_name
124
125 def line(self):
126 return self.line_info.line
127
128class StripDecorator(FrameDecorator):
129 def __init__(self, frame):

Callers 2

invokeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected