def mfinish_func(self, args): frame = m_frame.get_newest_frame() if not frame: return silent_finish() m_util.gdb_exec("msi") m_util.gdb_exec("mlist") m_datastore.mgdb_rdata.update_frame_change_counter()
def mfinish_func(self, args): frame = m_frame.get_newest_frame() if not frame: return silent_finish() frame = m_frame.get_selected_frame() if m_debug.Debug: m_debug.dbg_print("frame.name()=", frame.name()) m_util.gdb_exec("msi") m_util.gdb_exec("mlist") m_datastore.mgdb_rdata.update_frame_change_counter()
def mni_common(): #start_level_num = get_current_stack_level() prev_frame = m_frame.get_newest_frame() m_util.gdb_exec('msi -internal') new_frame = m_frame.get_newest_frame() #end_level_num = get_current_stack_level() if not new_frame: return if new_frame != prev_frame and prev_frame.is_valid(): #assert start_level_num < end_level_num m_stepi.silent_finish() m_util.gdb_exec('msi -internal') #else: # assert start_level_num >= end_level_num # a trigger point to update m_datastore caches if m_inf.is_inferior_running(): m_datastore.mgdb_rdata.update_gdb_runtime_data() m_datastore.mgdb_rdata.update_frame_change_counter()
def mdown_func(self, args, from_tty): steps = 1 s = str(args).split() if len(s) is 1: try: steps = int(s[0]) except: pass elif len(s) > 1: self.usage() return selected_frame = m_frame.get_selected_frame() newest_frame = m_frame.get_newest_frame() if not selected_frame or not newest_frame: gdb_print('Unable to locate Maple frame') return # walk through from innermost frame to selected frame # to get the level number from newest frame to selected frame. index = 0 frame = newest_frame while frame != selected_frame and frame: frame = m_frame.get_next_older_frame(frame) index += 1 if not frame: gdb_print('No valid frames found') return prev_maple_frame = frame prev_maple_frame_index = index while frame and steps > 0: frame = m_frame.get_next_newer_frame(frame) if frame: m_util.gdb_exec_to_null('down-silently') index -= 1 else: frame = prev_maple_frame m_util.gdb_exec_to_null('up-silently ' + str(index - prev_maple_frame_index)) index = prev_maple_frame_index break if m_frame.is_maple_frame(frame): prev_maple_frame = frame prev_maple_frame_index = index steps -= 1 print_maple_frame(frame, index, MBT_FORMAT_SRC) m_datastore.mgdb_rdata.update_frame_change_counter()
def mbt_func(self, args, from_tty): s = str(args) mbt_format = MBT_FORMAT_SRC full = False if s == "-full" or s == "full": full = True elif s == "-asm": mbt_format = MBT_FORMAT_ASM elif s == "-mir": mbt_format = MBT_FORMAT_MIR selected_frame = m_frame.get_selected_frame() newest_frame = m_frame.get_newest_frame() if not selected_frame or not newest_frame: gdb_print('Unable to locate Maple frame') return # walk through from innermost frame to selected frame index = 0 frame = newest_frame while frame != selected_frame and frame: frame = m_frame.get_next_older_frame(frame) index += 1 if not frame: gdb_print('No valid frames found') return start_level = index gdb_print('Maple Traceback (most recent call first):') while frame: if m_frame.is_maple_frame(frame): print_maple_frame(frame, index, mbt_format) elif full: print_gdb_frame(frame, index) index += 1 frame = m_frame.get_next_older_frame(frame) if frame: m_util.gdb_exec_to_null('up-silently') # move frame back to the original stack level m_util.gdb_exec_to_null('down-silently ' + str(index - start_level - 1))