'Do a single step or step-over. Returns the result of the last gdb
command that made execution stop.
This implementation, for stepping, sets (conditional) breakpoints for
all functions that are deemed relevant. It then does a step over until
either something halts execution, or until the next line is reached.
If, however, stepover_command is given, it should be a string gdb
command that continues execution in some way. The idea is that the
caller has set a (conditional) breakpoint or watchpoint that can work
more efficiently than the step-over loop. For Python this means setting
a watchpoint for f->f_lasti, which means we can then subsequently
"finish" frames.
We want f->f_lasti instead of f->f_lineno, because the latter only
works properly with local trace functions, see
PyFrameObjectPtr.current_line_num and PyFrameObjectPtr.addr2line.'

def step(self, stepinto, stepover_command='next'):

    if stepinto:
        breakpoint_list = list(self.install_breakpoints())
    beginframe = gdb.selected_frame()
    if self.lang_info.is_relevant_function(beginframe):
        beginline = self.lang_info.lineno(beginframe)
        if (not stepinto):
            depth = stackdepth(beginframe)
    newframe = beginframe
    while True:
        if self.lang_info.is_relevant_function(newframe):
            result = gdb.execute(stepover_command, to_string=True)
        else:
            result = self._finish_frame()
        if self.stopped():
            break
        newframe = gdb.selected_frame()
        is_relevant_function = self.lang_info.is_relevant_function(newframe)
        try:
            framename = newframe.name()
        except RuntimeError:
            framename = None
        m = re.search('Breakpoint    (\\d+)', result)
        if m:
            if (is_relevant_function and (m.group(1) in breakpoint_list)):
                break
        if (newframe != beginframe):
            if (not stepinto):
                newdepth = stackdepth(newframe)
                is_relevant_function = ((newdepth < depth) and is_relevant_function)
            if is_relevant_function:
                break
        else:
            lineno = self.lang_info.lineno(newframe)
            if (lineno and (lineno != beginline)):
                break
    if stepinto:
        self.delete_breakpoints(breakpoint_list)
    self.finish_executing(result)
