MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / print_mge_frame

Function print_mge_frame

scripts/gdb/commands.py:100–119  ·  view source on GitHub ↗
(frame)

Source from the content-addressed store, hash-verified

98
99
100def print_mge_frame(frame):
101 function = frame.function()
102 op = eval_on_val(
103 dynamic_cast(frame.read_var("op")), ".to_string().c_str()"
104 ).string()
105 inputs = str(frame.read_var("inputs"))
106 matcher = mge_apply_transform_pattern.match(function.name)
107 if matcher:
108 name = matcher.group(1)
109 else:
110 name = mge_op_fallback_pattern.match(function.name).group(1)
111 # TODO: span
112 sal = frame.find_sal()
113 filename = sal.symtab.filename
114 line = sal.line
115 print(
116 "#{} {} apply {} on {}, file: {}:{}".format(
117 count_frame_level(frame), name, op, inputs, filename, line
118 )
119 )
120
121
122class MegengineBacktrace(gdb.Command):

Callers 3

invokeMethod · 0.85
invokeMethod · 0.85
invokeMethod · 0.85

Calls 8

strFunction · 0.85
printFunction · 0.85
count_frame_levelFunction · 0.85
functionMethod · 0.80
eval_on_valFunction · 0.70
dynamic_castFunction · 0.70
matchMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected