(frame)
| 98 | |
| 99 | |
| 100 | def 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 | |
| 122 | class MegengineBacktrace(gdb.Command): |
no test coverage detected